makeWrapper,makeBinaryWrapper: introduce explicitly named functions
Because both versions might end up in a derivation's build inputs, it might be useful to be able to explicitly select which function to use.
This commit is contained in:
parent
0d6bcb513b
commit
62245943aa
|
@ -24,7 +24,8 @@ stdenv.mkDerivation rec {
|
|||
libxshmfence
|
||||
mesa
|
||||
nss
|
||||
(wrapGAppsHook.override { makeBinaryWrapper = makeWrapper; })
|
||||
wrapGAppsHook
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
dontWrapGApps = true;
|
||||
|
@ -78,7 +79,7 @@ stdenv.mkDerivation rec {
|
|||
patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
|
||||
$out/opt/${binaryName}/${binaryName}
|
||||
|
||||
wrapProgram $out/opt/${binaryName}/${binaryName} \
|
||||
wrapProgramShell $out/opt/${binaryName}/${binaryName} \
|
||||
"''${gappsWrapperArgs[@]}" \
|
||||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" \
|
||||
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
||||
|
|
|
@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
|
|||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
(wrapGAppsHook.override { makeBinaryWrapper = makeWrapper; })
|
||||
wrapGAppsHook
|
||||
];
|
||||
|
||||
dontWrapGApps = true;
|
||||
|
@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
|
|||
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
||||
"$(find "$out/toolbox" -name jspawnhelper)"
|
||||
|
||||
makeWrapper $out/toolbox/toolbox $out/bin/tla-toolbox \
|
||||
makeShellWrapper $out/toolbox/toolbox $out/bin/tla-toolbox \
|
||||
--chdir "$out/toolbox" \
|
||||
--add-flags "-data ~/.tla-toolbox" \
|
||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ gtk3 libXtst glib zlib ]}" \
|
||||
|
|
|
@ -32,7 +32,8 @@ assertExecutable() {
|
|||
|
||||
# To troubleshoot a binary wrapper after you compiled it,
|
||||
# use the `strings` command or open the binary file in a text editor.
|
||||
makeWrapper() {
|
||||
makeWrapper() { makeBinaryWrapper "$@"; }
|
||||
makeBinaryWrapper() {
|
||||
local NIX_CFLAGS_COMPILE= NIX_CFLAGS_LINK=
|
||||
local original="$1"
|
||||
local wrapper="$2"
|
||||
|
@ -52,7 +53,8 @@ makeWrapper() {
|
|||
}
|
||||
|
||||
# Syntax: wrapProgram <PROGRAM> <MAKE-WRAPPER FLAGS...>
|
||||
wrapProgram() {
|
||||
wrapProgram() { wrapProgramBinary "$@"; }
|
||||
wrapProgramBinary() {
|
||||
local prog="$1"
|
||||
local hidden
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@ assertExecutable() {
|
|||
# --prefix-contents ENV SEP FILES : like --suffix-each, but contents of FILES
|
||||
# are read first and used as VALS
|
||||
# --suffix-contents
|
||||
makeWrapper() {
|
||||
makeWrapper() { makeShellWrapper "$@"; }
|
||||
makeShellWrapper() {
|
||||
local original="$1"
|
||||
local wrapper="$2"
|
||||
local params varName value command separator n fileNames
|
||||
|
@ -193,7 +194,8 @@ filterExisting() {
|
|||
}
|
||||
|
||||
# Syntax: wrapProgram <PROGRAM> <MAKE-WRAPPER FLAGS...>
|
||||
wrapProgram() {
|
||||
wrapProgram() { wrapProgramShell "$@"; }
|
||||
wrapProgramShell() {
|
||||
local prog="$1"
|
||||
local hidden
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ in stdenv.mkDerivation rec {
|
|||
rm $out/share/cryptomator/libs/jff*.jar
|
||||
cp -f ${jffi}/share/java/jffi-complete.jar $out/share/cryptomator/libs/
|
||||
|
||||
makeWrapper ${jre}/bin/java $out/bin/cryptomator \
|
||||
makeShellWrapper ${jre}/bin/java $out/bin/cryptomator \
|
||||
--add-flags "--class-path '$out/share/cryptomator/libs/*'" \
|
||||
--add-flags "--module-path '$out/share/cryptomator/mods'" \
|
||||
--add-flags "-Dcryptomator.logDir='~/.local/share/Cryptomator/logs'" \
|
||||
|
@ -102,7 +102,7 @@ in stdenv.mkDerivation rec {
|
|||
autoPatchelfHook
|
||||
maven
|
||||
makeWrapper
|
||||
(wrapGAppsHook.override { makeBinaryWrapper = makeWrapper; })
|
||||
wrapGAppsHook
|
||||
jdk
|
||||
];
|
||||
buildInputs = [ fuse jre glib jffi ];
|
||||
|
|
Loading…
Reference in a new issue