From f3125d2f71b8ee8f79d8ed214be1f0abbcbaf67a Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 15:54:24 +0200 Subject: [PATCH 1/4] sile: remove now unneeded darwin inputs https://discourse.nixos.org/t/the-darwin-sdks-have-been-updated/55295 --- pkgs/by-name/si/sile/package.nix | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/si/sile/package.nix b/pkgs/by-name/si/sile/package.nix index d5ba7ee42103..5f830c0614a2 100644 --- a/pkgs/by-name/si/sile/package.nix +++ b/pkgs/by-name/si/sile/package.nix @@ -19,7 +19,6 @@ libiconv, stylua, typos, - darwin, # FONTCONFIG_FILE makeFontsConf, gentium, @@ -54,19 +53,15 @@ stdenv.mkDerivation (finalAttrs: { rustPlatform.cargoSetupHook ]; - buildInputs = - [ - finalAttrs.finalPackage.passthru.luaEnv - harfbuzz - icu - fontconfig - libiconv - stylua - typos - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.apple_sdk.frameworks.AppKit - ]; + buildInputs = [ + finalAttrs.finalPackage.passthru.luaEnv + harfbuzz + icu + fontconfig + libiconv + stylua + typos + ]; configureFlags = [ From 9a687953146dcb7749e7d283ddc9741bfff5b5c2 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 16:15:46 +0200 Subject: [PATCH 2/4] sile: 0.15.6 -> 0.15.7 Diff: https://github.com/sile-typesetter/sile/compare/None...v0.15.7 Changelog: https://github.com/sile-typesetter/sile/raw/v0.15.7/CHANGELOG.md --- pkgs/by-name/si/sile/package.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/si/sile/package.nix b/pkgs/by-name/si/sile/package.nix index 5f830c0614a2..20a14a34bda3 100644 --- a/pkgs/by-name/si/sile/package.nix +++ b/pkgs/by-name/si/sile/package.nix @@ -10,6 +10,7 @@ cargo, rustc, rustPlatform, + luarocks, # buildInputs lua, @@ -30,18 +31,18 @@ stdenv.mkDerivation (finalAttrs: { pname = "sile"; - version = "0.15.6"; + version = "0.15.7"; src = fetchurl { url = "https://github.com/sile-typesetter/sile/releases/download/v${finalAttrs.version}/sile-${finalAttrs.version}.tar.zst"; - sha256 = "sha256-CtPvxbpq2/qwuANPp9XDJQHlxIbFiaNZJvYZeUx/wyE="; + sha256 = "sha256-PjU6Qfn+FTL3vt66mkIAn/uXWMPPlH8iK6B264ekIis="; }; cargoDeps = rustPlatform.fetchCargoTarball { inherit (finalAttrs) src; nativeBuildInputs = [ zstd ]; dontConfigure = true; - hash = "sha256-5SheeabI4SqJZ3edAvX2rUEGTdCXHoBTa+rnX7lv9Cg="; + hash = "sha256-m21SyGtHwVCz+77pYq48Gjnrf/TLCLCf/IQ7AnZk+fo="; }; nativeBuildInputs = [ @@ -51,7 +52,10 @@ stdenv.mkDerivation (finalAttrs: { cargo rustc rustPlatform.cargoSetupHook + luarocks ]; + # luarocks propagates cmake, but it shouldn't be used as a build system. + dontUseCmakeConfigure = true; buildInputs = [ finalAttrs.finalPackage.passthru.luaEnv From 7edacad9b7f5fe13eff162dcbcdc35138bab7ffe Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 19:18:08 +0200 Subject: [PATCH 3/4] sile: make it easier to setup a modified luaEnv when writing documents --- pkgs/by-name/si/sile/package.nix | 61 ++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/pkgs/by-name/si/sile/package.nix b/pkgs/by-name/si/sile/package.nix index 20a14a34bda3..1a64d5981d20 100644 --- a/pkgs/by-name/si/sile/package.nix +++ b/pkgs/by-name/si/sile/package.nix @@ -110,41 +110,48 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; passthru = { - luaEnv = lua.withPackages ( - ps: - with ps; + # Use this passthru variable to add packages to your lua environment. Use + # something like this in your development environment: + # + # myLuaEnv = lua.withPackages ( + # ps: lib.attrVals (sile.passthru.luaPackages ++ [ + # "lua-cjson" + # "lua-resty-http" + # ]) ps + # ) + luaPackages = [ - cassowary - cldr - fluent - linenoise - loadkit - lpeg - lua-zlib - lua_cliargs - luaepnf - luaexpat - luafilesystem - luarepl - luasec - luasocket - luautf8 - penlight - vstruct + "cassowary" + "cldr" + "fluent" + "linenoise" + "loadkit" + "lpeg" + "lua-zlib" + "lua_cliargs" + "luaepnf" + "luaexpat" + "luafilesystem" + "luarepl" + "luasec" + "luasocket" + "luautf8" + "penlight" + "vstruct" # lua packages needed for testing - busted - luacheck + "busted" + "luacheck" # packages needed for building api docs - ldoc + "ldoc" # NOTE: Add lua packages here, to change the luaEnv also read by `flake.nix` ] ++ lib.optionals (lib.versionOlder lua.luaversion "5.2") [ - bit32 + "bit32" ] ++ lib.optionals (lib.versionOlder lua.luaversion "5.3") [ - compat53 - ] - ); + "compat53" + ]; + luaEnv = lua.withPackages (ps: lib.attrVals finalAttrs.finalPackage.passthru.luaPackages ps); # Copied from Makefile.am tests.test = lib.optionalAttrs (!(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) ( From 0ed2ac3ee5fa3748297d8f478d6d35fcbe7b1de5 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 28 Nov 2024 19:37:17 +0200 Subject: [PATCH 4/4] sile: build with luajit by default --- pkgs/top-level/all-packages.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d5cf9339704a..a64a1ee607c1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -744,6 +744,10 @@ with pkgs; propagatedBuildInputs = [ dieHook ]; } ../build-support/setup-hooks/shorten-perl-shebang.sh; + sile = callPackage ../by-name/si/sile/package.nix { + lua = luajit; + }; + singularity-tools = callPackage ../build-support/singularity-tools { }; srcOnly = callPackage ../build-support/src-only { };