From 48b434ab52ba4c343066f5179ca0eebb8b79aa5d Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sun, 16 Oct 2022 02:14:41 -0300 Subject: [PATCH] arcanPackages.arcan: cosmetical rewrite --- pkgs/desktops/arcan/arcan/default.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/desktops/arcan/arcan/default.nix b/pkgs/desktops/arcan/arcan/default.nix index 0cd7e4e0db64..bfb29e2d869d 100644 --- a/pkgs/desktops/arcan/arcan/default.nix +++ b/pkgs/desktops/arcan/arcan/default.nix @@ -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" ];