arcanPackages.arcan: cosmetical rewrite

This commit is contained in:
AndersonTorres 2022-10-16 02:14:41 -03:00 committed by ehmry
parent db5c049e00
commit 48b434ab52

View file

@ -52,6 +52,10 @@
, useStaticSqlite ? false , useStaticSqlite ? false
}: }:
let
cmakeFeatureFlag = feature: flag:
"-D${feature}=${if flag then "on" else "off"}";
in
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "arcan" + lib.optionalString useStaticOpenAL "-static-openal"; pname = "arcan" + lib.optionalString useStaticOpenAL "-static-openal";
version = "0.6.2"; version = "0.6.2";
@ -156,8 +160,8 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace ./src/CMakeLists.txt --replace "SETUID" "# SETUID" substituteInPlace ./src/CMakeLists.txt --replace "SETUID" "# SETUID"
''; '';
# INFO: Arcan build scripts require the manpages to be generated # INFO: Arcan build scripts require the manpages to be generated before the
# before the configure phase # `configure` phase
preConfigure = lib.optionalString buildManPages '' preConfigure = lib.optionalString buildManPages ''
pushd doc pushd doc
ruby docgen.rb mangen ruby docgen.rb mangen
@ -169,13 +173,13 @@ stdenv.mkDerivation (finalAttrs: {
# The upstream project recommends tagging the distribution # The upstream project recommends tagging the distribution
"-DDISTR_TAG=Nixpkgs" "-DDISTR_TAG=Nixpkgs"
"-DENGINE_BUILDTAG=${finalAttrs.version}" "-DENGINE_BUILDTAG=${finalAttrs.version}"
"-DHYBRID_SDL=on" (cmakeFeatureFlag "HYBRID_SDL" true)
"-DBUILTIN_LUA=${if useBuiltinLua then "on" else "off"}" (cmakeFeatureFlag "BUILTIN_LUA" useBuiltinLua)
"-DDISABLE_JIT=${if useBuiltinLua then "on" else "off"}" (cmakeFeatureFlag "DISABLE_JIT" useBuiltinLua)
"-DSTATIC_FREETYPE=${if useStaticFreetype then "on" else "off"}" (cmakeFeatureFlag "STATIC_FREETYPE" useStaticFreetype)
"-DSTATIC_LIBUVC=${if useStaticLibuvc then "on" else "off"}" (cmakeFeatureFlag "STATIC_LIBUVC" useStaticLibuvc)
"-DSTATIC_OPENAL=${if useStaticOpenAL then "on" else "off"}" (cmakeFeatureFlag "STATIC_OPENAL" useStaticOpenAL)
"-DSTATIC_SQLite3=${if useStaticSqlite then "on" else "off"}" (cmakeFeatureFlag "STATIC_SQLite3" useStaticSqlite)
"../src" "../src"
]; ];