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