diff options
author | Naïm Favier <n@monade.li> | 2022-03-14 19:06:00 +0100 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2022-03-19 09:46:31 +0100 |
commit | 9160044f5f05d0a4ac46f1260beb8604c15ed4fa (patch) | |
tree | baed08f4b9da8509af8f1e126c054d13a0d69ef8 | |
parent | 10479e4f51ff182651ccff4a71b2a94ab93816c0 (diff) |
treewide/makeWrapper: replace `--run cd` with `--chdir`
Lay the groundwork for switching to binary wrappers by reducing uses
of `--run` (which is not supported by `makeBinaryWrapper`).
57 files changed, 71 insertions, 70 deletions
diff --git a/nixos/modules/services/misc/etebase-server.nix b/nixos/modules/services/misc/etebase-server.nix index dd84ac37b0d5..cb99364aa1a6 100644 --- a/nixos/modules/services/misc/etebase-server.nix +++ b/nixos/modules/services/misc/etebase-server.nix @@ -166,7 +166,7 @@ in } '' makeWrapper ${pythonEnv}/bin/etebase-server \ $out/bin/etebase-server \ - --run "cd ${cfg.dataDir}" \ + --chdir ${escapeShellArg cfg.dataDir} \ --prefix ETEBASE_EASY_CONFIG_PATH : "${configIni}" '') ]; diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix index e48444f71612..c3b23f4d3482 100644 --- a/nixos/modules/services/misc/gitlab.nix +++ b/nixos/modules/services/misc/gitlab.nix @@ -179,7 +179,7 @@ let ${concatStrings (mapAttrsToList (name: value: "--set ${name} '${value}' ") gitlabEnv)} \ --set PATH '${lib.makeBinPath [ pkgs.nodejs pkgs.gzip pkgs.git pkgs.gnutar postgresqlPackage pkgs.coreutils pkgs.procps ]}:$PATH' \ --set RAKEOPT '-f ${cfg.packages.gitlab}/share/gitlab/Rakefile' \ - --run 'cd ${cfg.packages.gitlab}/share/gitlab' + --chdir '${cfg.packages.gitlab}/share/gitlab' ''; }; @@ -193,7 +193,7 @@ let makeWrapper ${cfg.packages.gitlab.rubyEnv}/bin/rails $out/bin/gitlab-rails \ ${concatStrings (mapAttrsToList (name: value: "--set ${name} '${value}' ") gitlabEnv)} \ --set PATH '${lib.makeBinPath [ pkgs.nodejs pkgs.gzip pkgs.git pkgs.gnutar postgresqlPackage pkgs.coreutils pkgs.procps ]}:$PATH' \ - --run 'cd ${cfg.packages.gitlab}/share/gitlab' + --chdir '${cfg.packages.gitlab}/share/gitlab' ''; }; diff --git a/pkgs/applications/audio/hivelytracker/default.nix b/pkgs/applications/audio/hivelytracker/default.nix index 4cf20e3c8985..8f9e3809fd2d 100644 --- a/pkgs/applications/audio/hivelytracker/default.nix +++ b/pkgs/applications/audio/hivelytracker/default.nix @@ -60,7 +60,7 @@ stdenv.mkDerivation rec { # files passed as arguments anyway, so this works well enough until the # issue is fixed. wrapProgram $out/bin/hivelytracker \ - --run "cd $out/share/hivelytracker" + --chdir "$out/share/hivelytracker" # Also install the hvl2wav tool install -Dm755 hvl2wav/hvl2wav $out/bin/hvl2wav diff --git a/pkgs/applications/audio/lyrebird/default.nix b/pkgs/applications/audio/lyrebird/default.nix index 81c792d95e2d..055662ce743f 100644 --- a/pkgs/applications/audio/lyrebird/default.nix +++ b/pkgs/applications/audio/lyrebird/default.nix @@ -42,7 +42,7 @@ python3Packages.buildPythonApplication rec { makeWrapperArgs = [ "--prefix 'PATH' ':' '${lib.makeBinPath [ sox pulseaudio ]}'" "--prefix 'PYTHONPATH' ':' '${placeholder "out"}/share/lyrebird'" - "--run 'cd ${placeholder "out"}/share/lyrebird'" + "--chdir '${placeholder "out"}/share/lyrebird'" ''"''${gappsWrapperArgs[@]}"'' ]; diff --git a/pkgs/applications/blockchains/wasabibackend/default.nix b/pkgs/applications/blockchains/wasabibackend/default.nix index c7f594e31b49..784b01192f70 100644 --- a/pkgs/applications/blockchains/wasabibackend/default.nix +++ b/pkgs/applications/blockchains/wasabibackend/default.nix @@ -32,7 +32,7 @@ buildDotnetModule rec { preConfigure = '' makeWrapperArgs+=( - --run "cd $out/lib/${pname}" + --chdir "$out/lib/${pname}" ) ''; diff --git a/pkgs/applications/graphics/awesomebump/default.nix b/pkgs/applications/graphics/awesomebump/default.nix index 4d79f10a9e10..e7bc474e17d3 100644 --- a/pkgs/applications/graphics/awesomebump/default.nix +++ b/pkgs/applications/graphics/awesomebump/default.nix @@ -46,7 +46,7 @@ in mkDerivation { # AwesomeBump expects to find Core and Configs in its current directory. makeQtWrapper $d/AwesomeBump $out/bin/AwesomeBump \ - --run "cd $d" + --chdir "$d" ''; # $ cd Sources; qmake; make ../workdir/linux-g++-dgb-gl4/obj/glwidget.o diff --git a/pkgs/applications/graphics/foxotron/default.nix b/pkgs/applications/graphics/foxotron/default.nix index 39fb78b317f1..f60ea4ea90c8 100644 --- a/pkgs/applications/graphics/foxotron/default.nix +++ b/pkgs/applications/graphics/foxotron/default.nix @@ -48,7 +48,7 @@ stdenv.mkDerivation rec { cp -R ${lib.optionalString stdenv.hostPlatform.isDarwin "Foxotron.app/Contents/MacOS/"}Foxotron \ ../{config.json,Shaders,Skyboxes} $out/lib/foxotron/ wrapProgram $out/lib/foxotron/Foxotron \ - --run "cd $out/lib/foxotron" + --chdir "$out/lib/foxotron" ln -s $out/{lib/foxotron,bin}/Foxotron runHook postInstall diff --git a/pkgs/applications/graphics/unigine-valley/default.nix b/pkgs/applications/graphics/unigine-valley/default.nix index 3187f573de70..81ed98f9ad44 100644 --- a/pkgs/applications/graphics/unigine-valley/default.nix +++ b/pkgs/applications/graphics/unigine-valley/default.nix @@ -97,7 +97,7 @@ in mkdir -p $out/bin install -m 0755 valley $out/bin/valley wrapProgram $out/bin/valley \ - --run "cd $instdir" \ + --chdir "$instdir" \ --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$instdir/bin:$libPath runHook postInstall diff --git a/pkgs/applications/misc/multibootusb/default.nix b/pkgs/applications/misc/multibootusb/default.nix index 3890246a63d6..403df853343c 100644 --- a/pkgs/applications/misc/multibootusb/default.nix +++ b/pkgs/applications/misc/multibootusb/default.nix @@ -101,7 +101,7 @@ python3Packages.buildPythonApplication rec { --prefix "PATH" ":" "${lib.makeBinPath runTimeDeps}" # Finally, move to directory that contains data - --run "cd $out/share/${pname}" + --chdir "$out/share/${pname}" ) ''; diff --git a/pkgs/applications/misc/tvbrowser/bin.nix b/pkgs/applications/misc/tvbrowser/bin.nix index bd8fdf5e48c5..887a979219db 100644 --- a/pkgs/applications/misc/tvbrowser/bin.nix +++ b/pkgs/applications/misc/tvbrowser/bin.nix @@ -41,7 +41,7 @@ in stdenv.mkDerivation rec { mkdir -p $out/bin makeWrapper ${jre}/bin/java $out/bin/${pname} \ --add-flags "-jar $out/share/java/${pname}/${pname}.jar" \ - --run "cd $out/share/java/${pname}" + --chdir "$out/share/java/${pname}" ''; meta = with lib; { diff --git a/pkgs/applications/misc/xteddy/default.nix b/pkgs/applications/misc/xteddy/default.nix index 717ba66feb86..481255393472 100644 --- a/pkgs/applications/misc/xteddy/default.nix +++ b/pkgs/applications/misc/xteddy/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { postFixup = '' # this is needed, because xteddy expects images to reside # in the current working directory - wrapProgram $out/bin/xteddy --run "cd $out/share/images/" + wrapProgram $out/bin/xteddy --chdir "$out/share/images/" ''; meta = with lib; { diff --git a/pkgs/applications/networking/instant-messengers/ripcord/default.nix b/pkgs/applications/networking/instant-messengers/ripcord/default.nix index 76f93d9d2173..7379d769288b 100644 --- a/pkgs/applications/networking/instant-messengers/ripcord/default.nix +++ b/pkgs/applications/networking/instant-messengers/ripcord/default.nix @@ -48,7 +48,7 @@ mkDerivation rec { install -Dm755 ${src}/Ripcord $out/Ripcord patchelf --replace-needed libsodium.so.18 libsodium.so $out/Ripcord makeQtWrapper $out/Ripcord $out/bin/ripcord \ - --run "cd $out" \ + --chdir "$out" \ --set FONTCONFIG_FILE "${fontsConf}" \ --prefix LD_LIBRARY_PATH ":" "${xorg.libXcursor}/lib" \ --prefix QT_XKB_CONFIG_ROOT ":" "${xorg.xkeyboardconfig}/share/X11/xkb" \ diff --git a/pkgs/applications/networking/instant-messengers/torchat/default.nix b/pkgs/applications/networking/instant-messengers/torchat/default.nix index 3278d68cd0b5..224a70ce9f72 100644 --- a/pkgs/applications/networking/instant-messengers/torchat/default.nix +++ b/pkgs/applications/networking/instant-messengers/torchat/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { cp -rf * $out/lib/torchat makeWrapper ${python2}/bin/python $out/bin/torchat \ --set PYTHONPATH $out/lib/torchat:$program_PYTHONPATH \ - --run "cd $out/lib/torchat" \ + --chdir "$out/lib/torchat" \ --add-flags "-O $out/lib/torchat/torchat.py" ''; diff --git a/pkgs/applications/networking/instant-messengers/zoom-us/default.nix b/pkgs/applications/networking/instant-messengers/zoom-us/default.nix index 4aa9dbc9b10c..b55eb6e36ede 100644 --- a/pkgs/applications/networking/instant-messengers/zoom-us/default.nix +++ b/pkgs/applications/networking/instant-messengers/zoom-us/default.nix @@ -104,7 +104,7 @@ stdenv.mkDerivation rec { # Clear Qt paths to prevent tripping over "foreign" Qt resources. # Clear Qt screen scaling settings to prevent over-scaling. makeWrapper $out/opt/zoom/ZoomLauncher $out/bin/zoom \ - --run "cd $out/opt/zoom" \ + --chdir "$out/opt/zoom" \ --unset QML2_IMPORT_PATH \ --unset QT_PLUGIN_PATH \ --unset QT_SCREEN_SCALE_FACTORS \ diff --git a/pkgs/applications/networking/p2p/tribler/default.nix b/pkgs/applications/networking/p2p/tribler/default.nix index d1df2fea444c..e74db03b5332 100644 --- a/pkgs/applications/networking/p2p/tribler/default.nix +++ b/pkgs/applications/networking/p2p/tribler/default.nix @@ -74,10 +74,10 @@ stdenv.mkDerivation rec { makeWrapper ${python3.pkgs.python}/bin/python $out/bin/tribler \ --set QT_QPA_PLATFORM_PLUGIN_PATH ${qt5.qtbase.bin}/lib/qt-*/plugins/platforms \ --set QT_PLUGIN_PATH "${qt5.qtsvg.bin}/${qt5.qtbase.qtPluginPrefix}" \ - --set _TRIBLERPATH $out/src \ + --set _TRIBLERPATH "$out/src" \ --set PYTHONPATH $out/src/tribler-core:$out/src/tribler-common:$out/src/tribler-gui:$program_PYTHONPATH \ --set NO_AT_BRIDGE 1 \ - --run 'cd $_TRIBLERPATH' \ + --chdir "$out/src" \ --add-flags "-O $out/src/run_tribler.py" mkdir -p $out/share/applications $out/share/icons diff --git a/pkgs/applications/networking/remote/rustdesk/default.nix b/pkgs/applications/networking/remote/rustdesk/default.nix index 677629dbcfba..2850995bd13c 100644 --- a/pkgs/applications/networking/remote/rustdesk/default.nix +++ b/pkgs/applications/networking/remote/rustdesk/default.nix @@ -86,7 +86,7 @@ rustPlatform.buildRustPackage rec { ln -s ${libsciter}/lib/libsciter-gtk.so $out/lib/rustdesk makeWrapper $out/lib/rustdesk/rustdesk $out/bin/rustdesk \ - --run "cd $out/share" + --chdir "$out/share" cp -a $src/src/ui $out/share/src diff --git a/pkgs/applications/office/jameica/default.nix b/pkgs/applications/office/jameica/default.nix index 767a4202ae86..197f035101f6 100644 --- a/pkgs/applications/office/jameica/default.nix +++ b/pkgs/applications/office/jameica/default.nix @@ -59,7 +59,7 @@ stdenv.mkDerivation rec { lib.optionalString stdenv.isDarwin ''-Xdock:name="Jameica" -XstartOnFirstThread'' } de.willuhn.jameica.Main" \ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath buildInputs} \ - --run "cd $out/share/java/" + --chdir "$out/share/java/" ''; meta = with lib; { diff --git a/pkgs/applications/science/astronomy/openspace/default.nix b/pkgs/applications/science/astronomy/openspace/default.nix index 17c721ac8693..b6e5275d8b05 100644 --- a/pkgs/applications/science/astronomy/openspace/default.nix +++ b/pkgs/applications/science/astronomy/openspace/default.nix @@ -69,7 +69,7 @@ stdenv.mkDerivation rec { patchelf --set-rpath $rpath:${bundle}/lib $bin name=$(basename $bin) - makeWrapper $bin $out/bin/$name --run "cd ${bundle}" + makeWrapper $bin $out/bin/$name --chdir "${bundle}" done ''; diff --git a/pkgs/applications/science/logic/tlaplus/toolbox.nix b/pkgs/applications/science/logic/tlaplus/toolbox.nix index 7b1ee4384c9e..e13fd578927d 100644 --- a/pkgs/applications/science/logic/tlaplus/toolbox.nix +++ b/pkgs/applications/science/logic/tlaplus/toolbox.nix @@ -62,7 +62,7 @@ stdenv.mkDerivation rec { "$(find "$out/toolbox" -name jspawnhelper)" makeWrapper $out/toolbox/toolbox $out/bin/tla-toolbox \ - --run "set -x; cd $out/toolbox" \ + --chdir "$out/toolbox" \ --add-flags "-data ~/.tla-toolbox" \ --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ gtk3 libXtst glib zlib ]}" \ "''${gappsWrapperArgs[@]}" diff --git a/pkgs/applications/science/misc/netlogo/default.nix b/pkgs/applications/science/misc/netlogo/default.nix index ed92dfb90dab..d32f4312047a 100644 --- a/pkgs/applications/science/misc/netlogo/default.nix +++ b/pkgs/applications/science/misc/netlogo/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { # launcher with `cd` is required b/c otherwise the model library isn't usable makeWrapper "${jre}/bin/java" "$out/bin/netlogo" \ - --run "cd $out/share/netlogo/app" \ + --chdir "$out/share/netlogo/app" \ --add-flags "-jar netlogo-${version}.jar" cp $src1 $out/share/icons/hicolor/256x256/apps/netlogo.png diff --git a/pkgs/applications/science/robotics/sumorobot-manager/default.nix b/pkgs/applications/science/robotics/sumorobot-manager/default.nix index c0f619b9592c..343f9fad105b 100644 --- a/pkgs/applications/science/robotics/sumorobot-manager/default.nix +++ b/pkgs/applications/science/robotics/sumorobot-manager/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { mkdir $out/bin dos2unix $out/opt/sumorobot-manager/main.py makeQtWrapper $out/opt/sumorobot-manager/main.py $out/bin/sumorobot-manager \ - --run "cd $out/opt/sumorobot-manager" + --chdir "$out/opt/sumorobot-manager" ''; preFixup = '' diff --git a/pkgs/applications/video/epgstation/default.nix b/pkgs/applications/video/epgstation/default.nix index 77510ae153de..a8ec353d788a 100644 --- a/pkgs/applications/video/epgstation/default.nix +++ b/pkgs/applications/video/epgstation/default.nix @@ -115,7 +115,7 @@ let ln -sfT /var/lib/epgstation/thumbnail thumbnail makeWrapper ${nodejs}/bin/npm $out/bin/epgstation \ - --run "cd $out/lib/node_modules/epgstation" \ + --chdir "$out/lib/node_modules/epgstation" \ --prefix PATH : ${lib.makeBinPath runtimeDeps} \ --set APP_ROOT_PATH "$out/lib/node_modules/epgstation" diff --git a/pkgs/applications/video/mirakurun/default.nix b/pkgs/applications/video/mirakurun/default.nix index 3987e1252844..53f1467ee8eb 100644 --- a/pkgs/applications/video/mirakurun/default.nix +++ b/pkgs/applications/video/mirakurun/default.nix @@ -61,7 +61,7 @@ stdenvNoCC.mkDerivation rec { mkdir -p $out/bin makeWrapper ${mirakurun}/bin/mirakurun-epgdump $out/bin/mirakurun-epgdump \ - --run "cd ${mirakurun}/libexec/mirakurun/node_modules/mirakurun" \ + --chdir "${mirakurun}/libexec/mirakurun/node_modules/mirakurun" \ --prefix PATH : ${lib.makeBinPath runtimeDeps} # XXX: The original mirakurun command uses PM2 to manage the Mirakurun @@ -70,7 +70,7 @@ stdenvNoCC.mkDerivation rec { # unique to PM2 is currently being used. makeWrapper ${yarn}/bin/yarn $out/bin/mirakurun-start \ --add-flags "start" \ - --run "cd ${mirakurun}/libexec/mirakurun/node_modules/mirakurun" \ + --chdir "${mirakurun}/libexec/mirakurun/node_modules/mirakurun" \ --prefix PATH : ${lib.makeBinPath runtimeDeps} ''; diff --git a/pkgs/development/ruby-modules/bundler-app/default.nix b/pkgs/development/ruby-modules/bundler-app/default.nix index 03bf7275cc71..e3c430cc923b 100644 --- a/pkgs/development/ruby-modules/bundler-app/default.nix +++ b/pkgs/development/ruby-modules/bundler-app/default.nix @@ -57,7 +57,7 @@ in "--set BUNDLE_FROZEN 1 "+ "--set GEM_HOME ${basicEnv}/${ruby.gemPath} "+ "--set GEM_PATH ${basicEnv}/${ruby.gemPath} "+ - "--run \"cd $srcdir\";\n") scripts)} + "--chdir \"$srcdir\";\n") scripts)} ${lib.optionalString installManpages '' for section in {1..9}; do diff --git a/pkgs/development/tools/database/sqldeveloper/default.nix b/pkgs/development/tools/database/sqldeveloper/default.nix index da43a4daf7d1..655156c176c6 100644 --- a/pkgs/development/tools/database/sqldeveloper/default.nix +++ b/pkgs/development/tools/database/sqldeveloper/default.nix @@ -62,7 +62,7 @@ in makeWrapper $out/libexec/sqldeveloper/bin/sqldeveloper $out/bin/sqldeveloper \ --set JAVA_HOME ${jdk.home} \ - --run "cd $out/libexec/sqldeveloper/bin" + --chdir "$out/libexec/sqldeveloper/bin" ''; meta = with lib; { diff --git a/pkgs/games/airstrike/default.nix b/pkgs/games/airstrike/default.nix index 12b485764a5b..8441ac7a2fee 100644 --- a/pkgs/games/airstrike/default.nix +++ b/pkgs/games/airstrike/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { cp -r data airstrikerc $out/share wrapProgram $out/bin/airstrike \ - --run "cd $out/share" + --chdir "$out/share" ''; meta = with lib; { diff --git a/pkgs/games/assaultcube/default.nix b/pkgs/games/assaultcube/default.nix index 1013be2694e9..4a0951d0964c 100644 --- a/pkgs/games/assaultcube/default.nix +++ b/pkgs/games/assaultcube/default.nix @@ -52,13 +52,13 @@ stdenv.mkDerivation rec { install -Dpm644 packages/misc/icon.png $out/share/pixmaps/assaultcube.png makeWrapper $out/bin/ac_client $out/bin/${pname} \ - --run "cd $out/$gamedatadir" --add-flags "--home=\$HOME/.assaultcube/v1.2next --init" + --chdir "$out/$gamedatadir" --add-flags "--home=\$HOME/.assaultcube/v1.2next --init" fi if (test -e source/src/ac_server) then cp source/src/ac_server $bindir makeWrapper $out/bin/ac_server $out/bin/${pname}-server \ - --run "cd $out/$gamedatadir" --add-flags "-Cconfig/servercmdline.txt" + --chdir "$out/$gamedatadir" --add-flags "-Cconfig/servercmdline.txt" fi ''; diff --git a/pkgs/games/domination/default.nix b/pkgs/games/domination/default.nix index b7eae5e5acd6..8ef45b850198 100644 --- a/pkgs/games/domination/default.nix +++ b/pkgs/games/domination/default.nix @@ -63,10 +63,10 @@ in stdenv. |