NixOS Package
Posted: Sun Sep 08, 2024 1:30 am
Hello! I've been trying to make a package for Drag[en]gine on NixOS. I'm currently using 5 patches for this but still run into a non-obvious to me compilation error. First I'll go through the patches I had to make.
This one lets me add to CPPPATH and LIBPATH:
This one allows the use of system openal. Are you able to clarify what the "annoying limitations" are that disable this by default?
Next one allows for using the system openvr:
Same for openxr:
Finally, there's a patch to fix the libLinkName for sndio:
The compilation error I get is:
This one lets me add to CPPPATH and LIBPATH:
Code: Select all
diff --git a/SConstruct b/SConstruct
index d4080e9c3..4f67cfd11 100644
--- a/SConstruct
+++ b/SConstruct
@@ -154,6 +154,9 @@ if not (parent_env['OSPosix'] or parent_env['OSWindows'] or parent_env['OSBeOS']
#params = Variables(['parameters.cache', 'custom.py'])
params = Variables(['custom.py'])
+params.Add(PathVariable('append_cpppath', 'Additional paths to search for include files', None))
+params.Add(PathVariable('append_libpath', 'Additional paths to search for libraries', None))
+
params.Add(EnumVariable('platform_android', 'Build for Android platform', 'no', ['no', 'armv7', 'armv8', 'x86']))
params.Add(BoolVariable('with_tests', 'Build engine tests', False))
params.Add(BoolVariable('with_debug', 'Build with debug symbols for GDB usage', False))
@@ -535,6 +538,11 @@ else:
params.Update(parent_env)
#print(parent_env.Dump())
+if parent_env['append_cpppath']:
+ parent_env.Append(CPPPATH = Split(parent_env['append_cpppath']))
+if parent_env['append_libpath']:
+ parent_env.Append(LIBPATH = Split(parent_env['append_libpath']))
+
# determine sanitize flags to use
parent_env.Replace(SANITIZE_FLAGS = [])
parent_env.Replace(SANITIZE_LINK_FLAGS = [])
Code: Select all
diff --git a/extern/openal/SConscript b/extern/openal/SConscript
index fd6727c26..355fd7ee7 100644
--- a/extern/openal/SConscript
+++ b/extern/openal/SConscript
@@ -34,7 +34,7 @@ else:
staticFileName = envLibrary.subst('lib/${LIBPREFIX}openal${LIBSUFFIX}')
# check if system openal is present
-hasSystemOpenAL = False
+hasSystemOpenAL = True
""" force false due to annoying limitations
conf = envLibrary.Configure()
if envLibrary['with_system_openal'] != TernaryVariableNo:
Code: Select all
diff --git a/extern/openvr/SConscript b/extern/openvr/SConscript
index f507cad0f..e6bc74e5c 100644
--- a/extern/openvr/SConscript
+++ b/extern/openvr/SConscript
@@ -36,6 +36,16 @@ else:
libLinkName = 'openvr_api'
libpath = [envLibrary.Dir('lib')]
+parent_targets['lib_openvr'] = {
+ 'name' : 'Internal OpenVR library',
+ 'cpppath' : [],
+ 'cppflags' : [],
+ 'libpath' : [],
+ 'libs' : ['openvr_api'],
+ 'runtimelibs' : [],
+ 'depends' : [] }
+Return()
+
def openvrBuild(target, source, env):
buildDir = target[0].get_dir().up()
Code: Select all
diff --git a/extern/openxr/SConscript b/extern/openxr/SConscript
index fa2acc0ad..f3b7fa51b 100644
--- a/extern/openxr/SConscript
+++ b/extern/openxr/SConscript
@@ -36,6 +36,16 @@ else:
libLinkName = 'libopenxr_loader'
libpath = [envLibrary.Dir('lib')]
+parent_targets['lib_openxr'] = {
+ 'name' : 'Internal openxr librar',
+ 'cpppath' : [],
+ 'cppflags' : [],
+ 'libpath' : [],
+ 'libs' : [libLinkName],
+ 'runtimelibs' : [],
+ 'depends' : [] }
+Return()
+
def openxrBuild(target, source, env):
buildDir = target[0].get_dir().up()
Code: Select all
diff --git a/extern/sndio/SConscript b/extern/sndio/SConscript
index 61abce950..982c508f9 100644
--- a/extern/sndio/SConscript
+++ b/extern/sndio/SConscript
@@ -16,7 +16,7 @@ buildStaticLinking = True
srcdir = 'sndio-1.6.0'
libLinkVersion = '0'
-libLinkName = 'ogg'
+libLinkName = 'sndio'
if envLibrary[ 'OSWindows' ]:
libFileName = 'bin/lib{}-{}.dll'.format( libLinkName, libLinkVersion )
Code: Select all
Compiling src/launcher/gui/src/gui/games/properties/deglDialogGameProperties.cpp
src/launcher/gui/src/gui/games/properties/deglDialogGameProperties.cpp: In static member function 'static FX::FXint deglDialogGameProperties::fSortCache(const FX::FXIconItem*, const FX::FXIconItem*)':
src/launcher/gui/src/gui/games/properties/deglDialogGameProperties.cpp:1270:32: error: 'compare' was not declared in this scope
1270 | return compare( cache1.name, cache2.name );
| ^~~~~~~
scons: *** [src/launcher/gui/build/src/gui/games/properties/deglDialogGameProperties.o] Error 1
scons: building terminated because of errors.