Skip to content

Commit

Permalink
Fix sile wrapper issues on darwin.
Browse files Browse the repository at this point in the history
Darwin execve has issues with shebang lines that point to other scripts
with shebang lines. A new makeBinaryWrapper hook was added to workaround
the issue on darwin. See NixOS#171473 and NixOS#23018 for more information. This
uses that binary wrapper to fix packages like sile.

I'm not sure this can be considered complete but it appears to work for
sile at least.
  • Loading branch information
zaphar committed May 12, 2022
1 parent 90bd7d7 commit 02bf421
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkgs/development/interpreters/lua-5/interpreter.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib, stdenv, fetchurl, readline
, compat ? false
, callPackage
, makeWrapper
, makeBinaryWrapper
, packageOverrides ? (final: prev: {})
, sourceVersion
, hash
Expand Down Expand Up @@ -40,7 +40,7 @@ self = stdenv.mkDerivation rec {
LuaCPathSearchPaths = luaPackages.lib.luaCPathList;
setupHook = luaPackages.lua-setup-hook LuaPathSearchPaths LuaCPathSearchPaths;

nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ makeBinaryWrapper ];
buildInputs = [ readline ];

inherit patches;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/interpreters/lua-5/wrapper.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, lua, buildEnv, makeWrapper
{ lib, stdenv, lua, buildEnv, makeBinaryWrapper
, extraLibs ? []
, extraOutputsToInstall ? []
, postBuild ? ""
Expand All @@ -19,7 +19,7 @@ let
extraOutputsToInstall = [ "out" ] ++ extraOutputsToInstall;

nativeBuildInputs = [
makeWrapper
makeBinaryWrapper
(lua.pkgs.lua-setup-hook lua.LuaPathSearchPaths lua.LuaCPathSearchPaths)
];

Expand Down
1 change: 0 additions & 1 deletion pkgs/tools/typesetting/sile/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ stdenv.mkDerivation rec {
homepage = "https://sile-typesetter.org";
changelog = "https://github.com/sile-typesetter/sile/raw/v${version}/CHANGELOG.md";
platforms = platforms.unix;
broken = stdenv.isDarwin; # https://github.com/NixOS/nixpkgs/issues/23018
maintainers = with maintainers; [ doronbehar alerque ];
license = licenses.mit;
};
Expand Down

0 comments on commit 02bf421

Please sign in to comment.