diff --git a/doc/doc-support/lib-function-docs.nix b/doc/doc-support/lib-function-docs.nix index 8c9673d887bf2..89210c782215f 100644 --- a/doc/doc-support/lib-function-docs.nix +++ b/doc/doc-support/lib-function-docs.nix @@ -101,6 +101,8 @@ stdenvNoCC.mkDerivation { ]; installPhase = '' + runHook preInstall + export NIX_STATE_DIR=$(mktemp -d) nix-instantiate --eval --strict --json ${./lib-function-locations.nix} \ --arg nixpkgsPath "./." \ @@ -139,5 +141,7 @@ stdenvNoCC.mkDerivation { ) libsets} echo '```' >> "$out/index.md" + + runHook postInstall ''; } diff --git a/doc/doc-support/package.nix b/doc/doc-support/package.nix index ca4694f3d11c8..e8c0fc11ee25b 100644 --- a/doc/doc-support/package.nix +++ b/doc/doc-support/package.nix @@ -74,6 +74,8 @@ stdenvNoCC.mkDerivation ( ''; installPhase = '' + runHook preInstall + dest="$out/share/doc/nixpkgs" mkdir -p "$(dirname "$dest")" mv out "$dest" @@ -84,6 +86,8 @@ stdenvNoCC.mkDerivation ( mkdir -p $out/nix-support/ echo "doc manual $dest manual.html" >> $out/nix-support/hydra-build-products echo "doc manual $dest nixpkgs-manual.epub" >> $out/nix-support/hydra-build-products + + runHook postInstall ''; passthru = { diff --git a/doc/languages-frameworks/bower.section.md b/doc/languages-frameworks/bower.section.md index 20c142dad5b91..2a14f193ab54e 100644 --- a/doc/languages-frameworks/bower.section.md +++ b/doc/languages-frameworks/bower.section.md @@ -102,7 +102,7 @@ pkgs.stdenv.mkDerivation { ${pkgs.nodePackages.gulp}/bin/gulp build # note 4 ''; - installPhase = "mv gulpdist $out"; + installPhase = "runHook preInstall; mv gulpdist $out; runHook postInstall"; } ``` diff --git a/doc/languages-frameworks/emscripten.section.md b/doc/languages-frameworks/emscripten.section.md index 9ce48db2c2ded..baf4d8585bdea 100644 --- a/doc/languages-frameworks/emscripten.section.md +++ b/doc/languages-frameworks/emscripten.section.md @@ -61,7 +61,11 @@ One advantage is that when `pkgs.zlib` is updated, it will automatically update emmake make ''; installPhase = '' + runHook preInstall + emmake make install + + runHook postInstall ''; checkPhase = '' echo "================= testing zlib using node =================" @@ -132,6 +136,8 @@ pkgs.buildEmscriptenPackage rec { outputs = [ "out" "doc" ]; installPhase = '' + runHook preInstall + mkdir -p $out/share mkdir -p $doc/share/${name} @@ -145,6 +151,8 @@ pkgs.buildEmscriptenPackage rec { cp *.json $out/share cp *.rng $out/share cp README.md $doc/share/${name} + + runHook postInstall ''; checkPhase = '' diff --git a/doc/languages-frameworks/gradle.section.md b/doc/languages-frameworks/gradle.section.md index b2058ef87491b..7ba859829744a 100644 --- a/doc/languages-frameworks/gradle.section.md +++ b/doc/languages-frameworks/gradle.section.md @@ -41,6 +41,8 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/pdftk} cp build/libs/pdftk-all.jar $out/share/pdftk @@ -48,6 +50,8 @@ stdenv.mkDerivation (finalAttrs: { --add-flags "-jar $out/share/pdftk/pdftk-all.jar" cp ${finalAttrs.src}/pdftk.1 $out/share/man/man1 + + runHook postInstall ''; meta.sourceProvenance = with lib.sourceTypes; [ diff --git a/doc/languages-frameworks/maven.section.md b/doc/languages-frameworks/maven.section.md index e56beb1025703..8fbc8300be328 100644 --- a/doc/languages-frameworks/maven.section.md +++ b/doc/languages-frameworks/maven.section.md @@ -27,11 +27,15 @@ maven.buildMavenPackage rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/jd-cli install -Dm644 jd-cli/target/jd-cli.jar $out/share/jd-cli makeWrapper ${jre}/bin/java $out/bin/jd-cli \ --add-flags "-jar $out/share/jd-cli/jd-cli.jar" + + runHook postInstall ''; meta = { @@ -210,11 +214,15 @@ stdenv.mkDerivation { # keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside installPhase = '' + runHook preInstall + find $out -type f \ -name \*.lastUpdated -or \ -name resolver-status.properties -or \ -name _remote.repositories \ -delete + + runHook postInstall ''; # don't do any fixup @@ -269,7 +277,11 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm644 target/${pname}-${version}.jar $out/share/java + + runHook postInstall ''; } ``` @@ -327,6 +339,8 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin classpath=$(find ${repository} -name "*.jar" -printf ':%h/%f'); @@ -336,6 +350,8 @@ in stdenv.mkDerivation rec { makeWrapper ${jre}/bin/java $out/bin/${pname} \ --add-flags "-classpath $out/share/java/${pname}-${version}.jar:''${classpath#:}" \ --add-flags "Main" + + runHook postInstall ''; } ``` @@ -405,6 +421,8 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin # create a symbolic link for the repository directory @@ -415,6 +433,8 @@ in stdenv.mkDerivation rec { # this should be the paths from the dependency derivation makeWrapper ${jre}/bin/java $out/bin/${pname} \ --add-flags "-jar $out/share/java/${pname}-${version}.jar" + + runHook postInstall ''; } ``` diff --git a/doc/languages-frameworks/swift.section.md b/doc/languages-frameworks/swift.section.md index 88d98deeb2dd3..fdbeaf0c72b3d 100644 --- a/doc/languages-frameworks/swift.section.md +++ b/doc/languages-frameworks/swift.section.md @@ -97,12 +97,16 @@ stdenv.mkDerivation rec { configurePhase = generated.configure; installPhase = '' + runHook preInstall + # This is a special function that invokes swiftpm to find the location # of the binaries it produced. binPath="$(swiftpmBinPath)" # Now perform any installation steps. mkdir -p $out/bin cp $binPath/myproject $out/bin/ + + runHook postInstall ''; } ``` diff --git a/doc/packages/weechat.section.md b/doc/packages/weechat.section.md index 295397f476b04..b056decee3e8f 100644 --- a/doc/packages/weechat.section.md +++ b/doc/packages/weechat.section.md @@ -77,9 +77,13 @@ stdenv.mkDerivation { }; passthru.scripts = [ "foo.py" "bar.lua" ]; installPhase = '' + runHook preInstall + mkdir $out/share cp foo.py $out/share cp bar.lua $out/share + + runHook postInstall ''; } ``` diff --git a/maintainers/scripts/nix-generate-from-cpan.nix b/maintainers/scripts/nix-generate-from-cpan.nix index a8135f4b304a8..bf12c06d94a57 100644 --- a/maintainers/scripts/nix-generate-from-cpan.nix +++ b/maintainers/scripts/nix-generate-from-cpan.nix @@ -12,10 +12,14 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${./nix-generate-from-cpan.pl} $out/bin/nix-generate-from-cpan patchShebangs $out/bin/nix-generate-from-cpan wrapProgram $out/bin/nix-generate-from-cpan --set PERL5LIB $PERL5LIB + + runHook postInstall ''; meta = { diff --git a/maintainers/scripts/nixpkgs-lint.nix b/maintainers/scripts/nixpkgs-lint.nix index 979ec286d8090..fc7c97cd642ea 100644 --- a/maintainers/scripts/nixpkgs-lint.nix +++ b/maintainers/scripts/nixpkgs-lint.nix @@ -12,12 +12,16 @@ stdenv.mkDerivation { installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${./nixpkgs-lint.pl} $out/bin/nixpkgs-lint # make the built version hermetic substituteInPlace $out/bin/nixpkgs-lint \ --replace-fail "#! /usr/bin/env nix-shell" "#! ${lib.getExe perl}" wrapProgram $out/bin/nixpkgs-lint --set PERL5LIB $PERL5LIB + + runHook postInstall ''; meta = with lib; { diff --git a/nixos/modules/hardware/raid/hpsa.nix b/nixos/modules/hardware/raid/hpsa.nix index 873a2db380919..991ad42eccaeb 100644 --- a/nixos/modules/hardware/raid/hpsa.nix +++ b/nixos/modules/hardware/raid/hpsa.nix @@ -20,6 +20,8 @@ let unpackPhase = "dpkg -x $src ./"; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/doc $out/share/man mv opt/hp/hpssacli/bld/{hpssascripting,hprmstr,hpssacli} $out/bin/ mv opt/hp/hpssacli/bld/*.{license,txt} $out/share/doc/ @@ -31,6 +33,8 @@ let --set-rpath ${lib.makeLibraryPath [ pkgs.stdenv.cc.cc ]} \ $file done + + runHook postInstall ''; dontStrip = true; diff --git a/nixos/modules/programs/fish.nix b/nixos/modules/programs/fish.nix index ef31a404bcb80..35440e0feec01 100644 --- a/nixos/modules/programs/fish.nix +++ b/nixos/modules/programs/fish.nix @@ -252,8 +252,12 @@ in patches = [ ./fish_completion-generator.patch ]; # to prevent collisions of identical completion files dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out cp * $out/ + + runHook postInstall ''; preferLocalBuild = true; allowSubstitutes = false; diff --git a/nixos/modules/programs/zsh/oh-my-zsh.md b/nixos/modules/programs/zsh/oh-my-zsh.md index 7e4a41641eeaa..7a6be24c825c9 100644 --- a/nixos/modules/programs/zsh/oh-my-zsh.md +++ b/nixos/modules/programs/zsh/oh-my-zsh.md @@ -101,9 +101,13 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/zsh/site-functions cp {themes,plugins} $out/share/zsh cp completions $out/share/zsh/site-functions + + runHook postInstall ''; } ``` diff --git a/nixos/modules/security/wrappers/default.nix b/nixos/modules/security/wrappers/default.nix index b5dae96d79c6b..48473de0bfbc0 100644 --- a/nixos/modules/security/wrappers/default.nix +++ b/nixos/modules/security/wrappers/default.nix @@ -24,8 +24,12 @@ let ({ name, ... }: { name = "${name}-unsecvars"; installPhase = '' + runHook preInstall + mkdir $out cp sysdeps/generic/unsecvars.h $out + + runHook postInstall ''; }); }; diff --git a/nixos/modules/security/wrappers/wrapper.nix b/nixos/modules/security/wrappers/wrapper.nix index ca4b27bff1801..7b253e575b6fd 100644 --- a/nixos/modules/security/wrappers/wrapper.nix +++ b/nixos/modules/security/wrappers/wrapper.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation { ]); dontStrip = debug; installPhase = '' + runHook preInstall + mkdir -p $out/bin $CC $CFLAGS ${./wrapper.c} -I${unsecvars} -o $out/bin/security-wrapper + + runHook postInstall ''; } diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix index 9fd6014f2c71c..5d2bf3971b5b6 100644 --- a/nixos/modules/services/misc/gitlab.nix +++ b/nixos/modules/services/misc/gitlab.nix @@ -202,13 +202,17 @@ let dontBuild = true; dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin makeWrapper ${cfg.packages.gitlab.rubyEnv}/bin/rake $out/bin/gitlab-rake \ ${concatStrings (mapAttrsToList (name: value: "--set ${name} '${value}' ") gitlabEnv)} \ --set PATH '${lib.makeBinPath runtimeDeps}:$PATH' \ --set RAKEOPT '-f ${cfg.packages.gitlab}/share/gitlab/Rakefile' \ --chdir '${cfg.packages.gitlab}/share/gitlab' - ''; + + runHook postInstall + ''; }; gitlab-rails = pkgs.stdenv.mkDerivation { @@ -217,12 +221,16 @@ let dontBuild = true; dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin makeWrapper ${cfg.packages.gitlab.rubyEnv}/bin/rails $out/bin/gitlab-rails \ ${concatStrings (mapAttrsToList (name: value: "--set ${name} '${value}' ") gitlabEnv)} \ --set PATH '${lib.makeBinPath runtimeDeps}:$PATH' \ --chdir '${cfg.packages.gitlab}/share/gitlab' - ''; + + runHook postInstall + ''; }; extraGitlabRb = pkgs.writeText "extra-gitlab.rb" cfg.extraGitlabRb; diff --git a/nixos/modules/services/monitoring/zabbix-agent.nix b/nixos/modules/services/monitoring/zabbix-agent.nix index b3850baa738b3..2a2bd63d054c8 100644 --- a/nixos/modules/services/monitoring/zabbix-agent.nix +++ b/nixos/modules/services/monitoring/zabbix-agent.nix @@ -56,8 +56,12 @@ in buildInputs = [ cfg.package ]; sourceRoot = "zabbix-''${cfg.package.version}/src/modules/dummy"; installPhase = ''' + runHook preInstall + mkdir -p $out/lib cp dummy.so $out/lib/ + + runHook postInstall '''; }; } diff --git a/nixos/modules/services/monitoring/zabbix-proxy.nix b/nixos/modules/services/monitoring/zabbix-proxy.nix index dec403df85ea8..1fd2aaf28a0a4 100644 --- a/nixos/modules/services/monitoring/zabbix-proxy.nix +++ b/nixos/modules/services/monitoring/zabbix-proxy.nix @@ -79,8 +79,12 @@ in buildInputs = [ cfg.package ]; sourceRoot = "zabbix-''${cfg.package.version}/src/modules/dummy"; installPhase = ''' + runHook preInstall + mkdir -p $out/lib cp dummy.so $out/lib/ + + runHook postInstall '''; }; } diff --git a/nixos/modules/services/monitoring/zabbix-server.nix b/nixos/modules/services/monitoring/zabbix-server.nix index 3c6f60b9d722e..4224bf0f12369 100644 --- a/nixos/modules/services/monitoring/zabbix-server.nix +++ b/nixos/modules/services/monitoring/zabbix-server.nix @@ -71,8 +71,12 @@ in buildInputs = [ cfg.package ]; sourceRoot = "zabbix-''${cfg.package.version}/src/modules/dummy"; installPhase = ''' + runHook preInstall + mkdir -p $out/lib cp dummy.so $out/lib/ + + runHook postInstall '''; }; } diff --git a/nixos/modules/services/networking/pptpd.nix b/nixos/modules/services/networking/pptpd.nix index b28015800f3cf..d28a5948c8345 100644 --- a/nixos/modules/services/networking/pptpd.nix +++ b/nixos/modules/services/networking/pptpd.nix @@ -84,10 +84,14 @@ with lib; phases = [ "installPhase" ]; nativeBuildInputs = with pkgs; [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin makeWrapper ${pkgs.ppp}/bin/pppd $out/bin/pppd \ --set LD_PRELOAD "${pkgs.libredirect}/lib/libredirect.so" \ --set NIX_REDIRECTS "/etc/ppp=/etc/ppp-pptpd" + + runHook postInstall ''; }; in { diff --git a/nixos/modules/services/networking/xl2tpd.nix b/nixos/modules/services/networking/xl2tpd.nix index 8d192be6c2fa8..2218c513211f4 100644 --- a/nixos/modules/services/networking/xl2tpd.nix +++ b/nixos/modules/services/networking/xl2tpd.nix @@ -86,6 +86,8 @@ with lib; phases = [ "installPhase" ]; nativeBuildInputs = with pkgs; [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin makeWrapper ${pkgs.ppp}/sbin/pppd $out/bin/pppd \ @@ -95,6 +97,8 @@ with lib; makeWrapper ${pkgs.xl2tpd}/bin/xl2tpd $out/bin/xl2tpd \ --set LD_PRELOAD "${pkgs.libredirect}/lib/libredirect.so" \ --set NIX_REDIRECTS "${pkgs.ppp}/sbin/pppd=$out/bin/pppd" + + runHook postInstall ''; }; in { diff --git a/nixos/modules/services/web-apps/akkoma.nix b/nixos/modules/services/web-apps/akkoma.nix index 17c221778d89a..8a69e4077eb3d 100644 --- a/nixos/modules/services/web-apps/akkoma.nix +++ b/nixos/modules/services/web-apps/akkoma.nix @@ -526,7 +526,11 @@ in { dontUnpack = true; installPhase = ''' + runHook preInstall + rsvg-convert -o $out -w 96 -h 96 $src + + runHook postInstall '''; }; } diff --git a/nixos/modules/services/web-apps/anuko-time-tracker.nix b/nixos/modules/services/web-apps/anuko-time-tracker.nix index 75f3d66b2f99e..b28c6940c5421 100644 --- a/nixos/modules/services/web-apps/anuko-time-tracker.nix +++ b/nixos/modules/services/web-apps/anuko-time-tracker.nix @@ -39,6 +39,8 @@ let inherit (src) version; src = cfg.package; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out/ @@ -51,6 +53,8 @@ let # Remove unsafe dbinstall.php rm -f $out/dbinstall.php + + runHook postInstall ''; }; in diff --git a/nixos/modules/services/web-apps/cloudlog.nix b/nixos/modules/services/web-apps/cloudlog.nix index 6550d112d5373..1017cee8fea2c 100644 --- a/nixos/modules/services/web-apps/cloudlog.nix +++ b/nixos/modules/services/web-apps/cloudlog.nix @@ -47,6 +47,8 @@ let version = src.version; src = pkgs.cloudlog; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out/ @@ -64,6 +66,8 @@ let rm -rf $out/assets/json/$asset.txt ln -s ${cfg.dataDir}/assets/json/$asset.txt $out/assets/json/$asset.txt done + + runHook postInstall ''; }; in diff --git a/nixos/modules/services/web-apps/dokuwiki.nix b/nixos/modules/services/web-apps/dokuwiki.nix index c5ea809c8d592..efcac4c5f33c6 100644 --- a/nixos/modules/services/web-apps/dokuwiki.nix +++ b/nixos/modules/services/web-apps/dokuwiki.nix @@ -225,7 +225,7 @@ let url = "https://github.com/real-or-random/dokuwiki-plugin-icalevents/releases/download/''${version}/dokuwiki-plugin-icalevents-''${version}.zip"; hash = "sha256-IPs4+qgEfe8AAWevbcCM9PnyI0uoyamtWeg4rEb+9Wc="; }; - installPhase = "mkdir -p $out; cp -R * $out/"; + installPhase = "runHook preInstall; mkdir -p $out; cp -R * $out/; runHook postInstall"; }; # And then pass this theme to the plugin list like this: in [ plugin-icalevents ] @@ -253,7 +253,7 @@ let rev = "v''${version}"; hash = "sha256-B3Yd4lxdwqfCnfmZdp+i/Mzwn/aEuZ0ovagDxuR6lxo="; }; - installPhase = "mkdir -p $out; cp -R * $out/"; + installPhase = "runHook preInstall; mkdir -p $out; cp -R * $out/; runHook postInstall"; }; # And then pass this theme to the template list like this: in [ template-bootstrap3 ] diff --git a/nixos/modules/services/web-apps/invoiceplane.nix b/nixos/modules/services/web-apps/invoiceplane.nix index 9a9f180b21021..8e7e45db7e103 100644 --- a/nixos/modules/services/web-apps/invoiceplane.nix +++ b/nixos/modules/services/web-apps/invoiceplane.nix @@ -53,6 +53,8 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out/ @@ -70,6 +72,8 @@ let # symlink additional templates ${concatMapStringsSep "\n" (template: "cp -r ${template}/. $out/application/views/invoice_templates/pdf/") cfg.invoiceTemplates} + + runHook postInstall ''; }; diff --git a/nixos/modules/services/web-apps/mattermost.nix b/nixos/modules/services/web-apps/mattermost.nix index fee0ec2d641d2..6f77ae70a5d00 100644 --- a/nixos/modules/services/web-apps/mattermost.nix +++ b/nixos/modules/services/web-apps/mattermost.nix @@ -32,8 +32,12 @@ let map (plugin: stdenv.mkDerivation { name = "mattermost-plugin"; installPhase = '' + runHook preInstall + mkdir -p $out/share cp ${plugin} $out/share/plugin.tar.gz + + runHook postInstall ''; dontUnpack = true; dontPatch = true; @@ -53,6 +57,8 @@ let cfg.package ]; installPhase = '' + runHook preInstall + mkdir -p $out/data/plugins plugins=(${escapeShellArgs (map (plugin: "${plugin}/share/plugin.tar.gz") mattermostPluginDerivations)}) for plugin in "''${plugins[@]}"; do @@ -63,6 +69,8 @@ let GZIP_OPT=-9 tar -C "$hash" -cvzf "$out/data/plugins/$hash.tar.gz" . rm -rf "$hash" done + + runHook postInstall ''; dontUnpack = true; diff --git a/nixos/modules/services/web-apps/mediawiki.nix b/nixos/modules/services/web-apps/mediawiki.nix index 22e61ea3a6836..2eee90f4d6028 100644 --- a/nixos/modules/services/web-apps/mediawiki.nix +++ b/nixos/modules/services/web-apps/mediawiki.nix @@ -27,6 +27,8 @@ let src = cfg.package; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out/ @@ -40,6 +42,8 @@ let rm -rf $out/share/mediawiki/extensions/${k} ln -s ${if v != null then v else "$src/share/mediawiki/extensions/${k}"} $out/share/mediawiki/extensions/${k} '') cfg.extensions)} + + runHook postInstall ''; }; diff --git a/nixos/modules/services/web-apps/mobilizon.nix b/nixos/modules/services/web-apps/mobilizon.nix index b7fad7f3066e8..f0931906e7964 100644 --- a/nixos/modules/services/web-apps/mobilizon.nix +++ b/nixos/modules/services/web-apps/mobilizon.nix @@ -26,6 +26,8 @@ let dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin makeWrapper \ @@ -41,6 +43,8 @@ let --run '. ${secretEnvFile}' \ --set MOBILIZON_CONFIG_PATH "${configFile}" \ --set-default RELEASE_TMP "/tmp" + + runHook postInstall ''; }; diff --git a/nixos/modules/services/web-apps/wordpress.nix b/nixos/modules/services/web-apps/wordpress.nix index 37c39608edae1..a5fc5062d5afd 100644 --- a/nixos/modules/services/web-apps/wordpress.nix +++ b/nixos/modules/services/web-apps/wordpress.nix @@ -15,6 +15,8 @@ let src = cfg.package; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out/ @@ -35,6 +37,8 @@ let ${concatStringsSep "\n" (mapAttrsToList (name: theme: "cp -r ${theme} $out/share/wordpress/wp-content/themes/${name}") cfg.themes)} ${concatStringsSep "\n" (mapAttrsToList (name: plugin: "cp -r ${plugin} $out/share/wordpress/wp-content/plugins/${name}") cfg.plugins)} ${concatMapStringsSep "\n" (language: "cp -r ${language} $out/share/wordpress/wp-content/languages/") cfg.languages} + + runHook postInstall ''; }; @@ -187,7 +191,7 @@ let name = "wordpress-''${pkgs.wordpress.version}-language-de"; sha256 = "sha256-dlas0rXTSV4JAl8f/UyMbig57yURRYRhTMtJwF9g8h0="; }; - installPhase = "mkdir -p $out; cp -r ./wp-content/languages/* $out/"; + installPhase = "runHook preInstall; mkdir -p $out; cp -r ./wp-content/languages/* $out/; runHook postInstall"; }) ]; ''; diff --git a/nixos/modules/services/web-apps/writefreely.nix b/nixos/modules/services/web-apps/writefreely.nix index 4bb5d8a579fd2..14913d2150062 100644 --- a/nixos/modules/services/web-apps/writefreely.nix +++ b/nixos/modules/services/web-apps/writefreely.nix @@ -74,6 +74,8 @@ let ''; installPhase = '' + runHook preInstall + less_dir=$src/less css_dir=$out/static/css @@ -81,6 +83,8 @@ let lessc $less_dir/fonts.less $css_dir/fonts.css lessc $less_dir/icons.less $css_dir/icons.css lessc $less_dir/prose.less $css_dir/prose.css + + runHook postInstall ''; }; diff --git a/nixos/modules/services/web-servers/lighttpd/collectd.nix b/nixos/modules/services/web-servers/lighttpd/collectd.nix index 5e5c0adda1c26..d678304318e60 100644 --- a/nixos/modules/services/web-servers/lighttpd/collectd.nix +++ b/nixos/modules/services/web-servers/lighttpd/collectd.nix @@ -16,8 +16,12 @@ let dontConfigure = true; buildPhase = "true"; installPhase = '' + runHook preInstall + substituteInPlace contrib/collection.cgi --replace '"/etc/collection.conf"' '$ENV{COLLECTION_CONF}' cp contrib/collection.cgi $out + + runHook postInstall ''; }); in diff --git a/nixos/modules/services/x11/display-managers/account-service-util.nix b/nixos/modules/services/x11/display-managers/account-service-util.nix index 00ffd91cb2f6d..feb6b966e8bff 100644 --- a/nixos/modules/services/x11/display-managers/account-service-util.nix +++ b/nixos/modules/services/x11/display-managers/account-service-util.nix @@ -33,9 +33,13 @@ python3.pkgs.buildPythonApplication { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp $src $out/bin/set-session chmod +x $out/bin/set-session + + runHook postInstall ''; meta = with lib; { diff --git a/nixos/modules/system/activation/lib/test.nix b/nixos/modules/system/activation/lib/test.nix index 39886d305195a..ff71d1536cd66 100644 --- a/nixos/modules/system/activation/lib/test.nix +++ b/nixos/modules/system/activation/lib/test.nix @@ -22,7 +22,11 @@ let ./test.sh ''; installPhase = '' + runHook preInstall + touch $out + + runHook postInstall ''; }; diff --git a/nixos/modules/virtualisation/openvswitch.nix b/nixos/modules/virtualisation/openvswitch.nix index e0cedce091399..565bbed49febc 100644 --- a/nixos/modules/virtualisation/openvswitch.nix +++ b/nixos/modules/virtualisation/openvswitch.nix @@ -44,7 +44,7 @@ in { buildInputs = with pkgs; [ cfg.package ]; - installPhase = "mkdir -p $out"; + installPhase = "runHook preInstall; mkdir -p $out; runHook postInstall"; }; in { diff --git a/nixos/tests/common/acme/server/generate-certs.nix b/nixos/tests/common/acme/server/generate-certs.nix index 4f38ca309b05b..4b99150a284cd 100644 --- a/nixos/tests/common/acme/server/generate-certs.nix +++ b/nixos/tests/common/acme/server/generate-certs.nix @@ -25,9 +25,13 @@ in mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out mv ca.*.pem $out/ mv ${domain}/key.pem $out/${domain}.key.pem mv ${domain}/cert.pem $out/${domain}.cert.pem + + runHook postInstall ''; } diff --git a/nixos/tests/dokuwiki.nix b/nixos/tests/dokuwiki.nix index ce3102eec7801..4a4cc109879a9 100644 --- a/nixos/tests/dokuwiki.nix +++ b/nixos/tests/dokuwiki.nix @@ -10,7 +10,7 @@ let rev = "v${version}"; hash = "sha256-B3Yd4lxdwqfCnfmZdp+i/Mzwn/aEuZ0ovagDxuR6lxo="; }; - installPhase = "mkdir -p $out; cp -R * $out/"; + installPhase = "runHook preInstall; mkdir -p $out; cp -R * $out/; runHook postInstall"; }; @@ -22,7 +22,7 @@ let url = "https://github.com/real-or-random/dokuwiki-plugin-icalevents/releases/download/${version}/dokuwiki-plugin-icalevents-${version}.zip"; hash = "sha256-IPs4+qgEfe8AAWevbcCM9PnyI0uoyamtWeg4rEb+9Wc="; }; - installPhase = "mkdir -p $out; cp -R * $out/"; + installPhase = "runHook preInstall; mkdir -p $out; cp -R * $out/; runHook postInstall"; }; acronymsFile = pkgs.writeText "acronyms.local.conf" '' diff --git a/nixos/tests/hydra/common.nix b/nixos/tests/hydra/common.nix index f31518b1e2a20..25b59ac418094 100644 --- a/nixos/tests/hydra/common.nix +++ b/nixos/tests/hydra/common.nix @@ -17,7 +17,7 @@ name = "create-trivial-project"; dontUnpack = true; nativeBuildInputs = [ pkgs.makeWrapper ]; - installPhase = "install -m755 -D ${./create-trivial-project.sh} $out/bin/create-trivial-project.sh"; + installPhase = "runHook preInstall; install -m755 -D ${./create-trivial-project.sh} $out/bin/create-trivial-project.sh; runHook postInstall"; postFixup = '' wrapProgram "$out/bin/create-trivial-project.sh" --prefix PATH ":" ${pkgs.lib.makeBinPath [ pkgs.curl ]} --set EXPR_PATH ${trivialJob} ''; diff --git a/nixos/tests/restic-rest-server.nix b/nixos/tests/restic-rest-server.nix index 1d38ddbe513c9..b6b4daf9f1f23 100644 --- a/nixos/tests/restic-rest-server.nix +++ b/nixos/tests/restic-rest-server.nix @@ -18,11 +18,15 @@ import ./make-test-python.nix ( name = "test-files-to-backup"; unpackPhase = "true"; installPhase = '' + runHook preInstall + mkdir $out echo some_file > $out/some_file echo some_other_file > $out/some_other_file mkdir $out/a_dir echo a_file > $out/a_dir/a_file + + runHook postInstall ''; }; diff --git a/nixos/tests/restic.nix b/nixos/tests/restic.nix index 49631d27ca801..a59586e91829e 100644 --- a/nixos/tests/restic.nix +++ b/nixos/tests/restic.nix @@ -22,12 +22,16 @@ import ./make-test-python.nix ( name = "test-files-to-backup"; unpackPhase = "true"; installPhase = '' + runHook preInstall + mkdir $out echo some_file > $out/some_file echo some_other_file > $out/some_other_file mkdir $out/a_dir echo a_file > $out/a_dir/a_file echo a_file_2 > $out/a_dir/a_file_2 + + runHook postInstall ''; }; diff --git a/nixos/tests/web-servers/stargazer.nix b/nixos/tests/web-servers/stargazer.nix index 52bc93af17194..187cdb02ab194 100644 --- a/nixos/tests/web-servers/stargazer.nix +++ b/nixos/tests/web-servers/stargazer.nix @@ -7,8 +7,12 @@ let dontBuild = true; doCheck = false; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp scripts/gemini-diagnostics $out/bin/test + + runHook postInstall ''; }; test_env = pkgs.stdenv.mkDerivation { @@ -19,8 +23,12 @@ let ''; doCheck = false; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out/ + + runHook postInstall ''; }; scgi_server = pkgs.stdenv.mkDerivation { @@ -31,8 +39,12 @@ let dontBuild = true; doCheck = false; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp scripts/scgi-server $out/bin/scgi-server + + runHook postInstall ''; }; in diff --git a/nixos/tests/xxh.nix b/nixos/tests/xxh.nix index 3af8e53779e34..c85e55e0ed961 100644 --- a/nixos/tests/xxh.nix +++ b/nixos/tests/xxh.nix @@ -20,8 +20,12 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: ''; installPhase = '' + runHook preInstall + mkdir -p $out mv * $out/ + + runHook postInstall ''; }; diff --git a/pkgs/applications/audio/MMA/default.nix b/pkgs/applications/audio/MMA/default.nix index 8f54e6e297100..b7f4b4d415be5 100644 --- a/pkgs/applications/audio/MMA/default.nix +++ b/pkgs/applications/audio/MMA/default.nix @@ -24,6 +24,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/mma,share/man/man1,share/man/man8} mkdir -p $out/etc @@ -47,6 +49,8 @@ stdenv.mkDerivation rec { mv $out/share/mma/docs/man/mma-gb.1 $out/share/man/man1 rm -rf $out/share/mma/docs/man find $out -type f | xargs sed -i "s@/usr/share/mma@$out/share/mma@g" + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/applications/audio/aaxtomp3/default.nix b/pkgs/applications/audio/aaxtomp3/default.nix index 59bd228d4751a..ff6aeb14a83e6 100644 --- a/pkgs/applications/audio/aaxtomp3/default.nix +++ b/pkgs/applications/audio/aaxtomp3/default.nix @@ -36,8 +36,12 @@ resholve.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm 755 AAXtoMP3 $out/bin/aaxtomp3 install -Dm 755 interactiveAAXtoMP3 $out/bin/interactiveaaxtomp3 + + runHook postInstall ''; solutions.default = { diff --git a/pkgs/applications/audio/aether-lv2/default.nix b/pkgs/applications/audio/aether-lv2/default.nix index afec5763022d3..885fe86f956fc 100644 --- a/pkgs/applications/audio/aether-lv2/default.nix +++ b/pkgs/applications/audio/aether-lv2/default.nix @@ -25,8 +25,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/lv2 cp -r aether.lv2 $out/lib/lv2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/airwave/default.nix b/pkgs/applications/audio/airwave/default.nix index a57f43eea651a..7e0285e7984bd 100644 --- a/pkgs/applications/audio/airwave/default.nix +++ b/pkgs/applications/audio/airwave/default.nix @@ -31,7 +31,7 @@ let sha256 = "0r29fv6yhm2m5yznn8m4my7fq01w1lpphax4sshagy6b1dgjlv3w"; }; nativeBuildInputs = [ unzip ]; - installPhase = "cp -r . $out"; + installPhase = "runHook preInstall; cp -r . $out; runHook postInstall"; meta.license = lib.licenses.unfree; }; diff --git a/pkgs/applications/audio/baudline/default.nix b/pkgs/applications/audio/baudline/default.nix index 4856a0ed017a4..353c19cc0685f 100644 --- a/pkgs/applications/audio/baudline/default.nix +++ b/pkgs/applications/audio/baudline/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation rec { # LD_LIBRARY_PATH wrapper script instead. dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" mkdir -p "$out/libexec/baudline" @@ -44,6 +46,8 @@ stdenv.mkDerivation rec { for prog in "$out"/bin/*; do wrapProgram "$prog" --prefix LD_LIBRARY_PATH : ${rpath} done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/bespokesynth/default.nix b/pkgs/applications/audio/bespokesynth/default.nix index 83c5af0a53fce..f9255df7d6ec1 100644 --- a/pkgs/applications/audio/bespokesynth/default.nix +++ b/pkgs/applications/audio/bespokesynth/default.nix @@ -52,7 +52,11 @@ let sha256 = "0da16iwac590wphz2sm5afrfj42jrsnkr1bxcy93lj7a369ildkj"; }; installPhase = '' + runHook preInstall + cp -r . $out + + runHook postInstall ''; }; diff --git a/pkgs/applications/audio/castopod/default.nix b/pkgs/applications/audio/castopod/default.nix index 3f098c3653444..710f155d62cfd 100644 --- a/pkgs/applications/audio/castopod/default.nix +++ b/pkgs/applications/audio/castopod/default.nix @@ -39,8 +39,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/castopod cp -r . $out/share/castopod + + runHook postInstall ''; passthru.tests.castopod = nixosTests.castopod; diff --git a/pkgs/applications/audio/caudec/default.nix b/pkgs/applications/audio/caudec/default.nix index c1fd7acc90bd1..a915677f88a58 100644 --- a/pkgs/applications/audio/caudec/default.nix +++ b/pkgs/applications/audio/caudec/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + ./install.sh --prefix=$out/bin + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/audio/cheesecutter/default.nix b/pkgs/applications/audio/cheesecutter/default.nix index b1c44f2bebc8b..471e7f0342377 100644 --- a/pkgs/applications/audio/cheesecutter/default.nix +++ b/pkgs/applications/audio/cheesecutter/default.nix @@ -30,6 +30,8 @@ stdenv.mkDerivation rec { makefile = "Makefile.ldc"; installPhase = '' + runHook preInstall + for exe in {ccutter,ct2util}; do install -D $exe $out/bin/$exe done @@ -41,6 +43,8 @@ stdenv.mkDerivation rec { for res in $(ls icons | sed -e 's/cc//g' -e 's/.png//g'); do install -Dm444 icons/cc$res.png $out/share/icons/hicolor/''${res}x''${res}/apps/cheesecutter.png done + + runHook postInstall ''; postFixup = diff --git a/pkgs/applications/audio/crip/default.nix b/pkgs/applications/audio/crip/default.nix index 67ccc367be0e8..0b218db19ad17 100644 --- a/pkgs/applications/audio/crip/default.nix +++ b/pkgs/applications/audio/crip/default.nix @@ -42,6 +42,8 @@ stdenv.mkDerivation rec { scripts = [ "crip" "editcomment" "editfilenames" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin/ for script in ${lib.escapeShellArgs scripts}; do @@ -54,6 +56,8 @@ stdenv.mkDerivation rec { --set PERL5LIB "${perlPackages.makePerlPath [ perlPackages.CDDB_get ]}" \ --set PATH "${toolDeps}" done + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/csound/csound-manual/default.nix b/pkgs/applications/audio/csound/csound-manual/default.nix index bb4db74e22ab4..d521a724c37bb 100644 --- a/pkgs/applications/audio/csound/csound-manual/default.nix +++ b/pkgs/applications/audio/csound/csound-manual/default.nix @@ -31,8 +31,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc/csound cp -r ./html $out/share/doc/csound + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/delayarchitect/default.nix b/pkgs/applications/audio/delayarchitect/default.nix index c422549d6617b..f8254448d6626 100644 --- a/pkgs/applications/audio/delayarchitect/default.nix +++ b/pkgs/applications/audio/delayarchitect/default.nix @@ -25,9 +25,13 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/vst3 cd DelayArchitect_artefacts/Release cp -r VST3/Delay\ Architect.vst3 $out/lib/vst3 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/diopser/default.nix b/pkgs/applications/audio/diopser/default.nix index cba5d4615b385..8ea050fe12592 100644 --- a/pkgs/applications/audio/diopser/default.nix +++ b/pkgs/applications/audio/diopser/default.nix @@ -58,8 +58,12 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib/vst3 cp -r Diopser_artefacts/Release/VST3/Diopser.vst3 $out/lib/vst3 + + runHook postInstall ''; nativeBuildInputs = [ cmake pkg-config ]; diff --git a/pkgs/applications/audio/dolbybcsoftwaredecode/default.nix b/pkgs/applications/audio/dolbybcsoftwaredecode/default.nix index 1e54e25ec98aa..88c053d3f97f8 100644 --- a/pkgs/applications/audio/dolbybcsoftwaredecode/default.nix +++ b/pkgs/applications/audio/dolbybcsoftwaredecode/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { fpc DolbyBi64.PP ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp DolbyBi64 $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/espeak/edit.nix b/pkgs/applications/audio/espeak/edit.nix index 4be2f404f60f6..e416279f95038 100644 --- a/pkgs/applications/audio/espeak/edit.nix +++ b/pkgs/applications/audio/espeak/edit.nix @@ -49,8 +49,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp src/espeakedit "$out/bin" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/faustPhysicalModeling/default.nix b/pkgs/applications/audio/faustPhysicalModeling/default.nix index 8b00ca2252a69..3ab7644194407 100644 --- a/pkgs/applications/audio/faustPhysicalModeling/default.nix +++ b/pkgs/applications/audio/faustPhysicalModeling/default.nix @@ -24,11 +24,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib/lv2 $out/bin mv *.lv2/ $out/lib/lv2 for f in $(find . -executable -type f); do cp $f $out/bin/ done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/helio-workstation/default.nix b/pkgs/applications/audio/helio-workstation/default.nix index 45cf34588948d..936122799a7c3 100644 --- a/pkgs/applications/audio/helio-workstation/default.nix +++ b/pkgs/applications/audio/helio-workstation/default.nix @@ -29,6 +29,8 @@ stdenv.mkDerivation rec { buildFlags = [ "CONFIG=Release64" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -Dm755 build/helio $out/bin wrapProgram $out/bin/helio --prefix PATH ":" ${zenity}/bin @@ -37,6 +39,8 @@ stdenv.mkDerivation rec { cp -r ../Deployment/Linux/Debian/x64/usr/share/* $out/share substituteInPlace $out/share/applications/Helio.desktop \ --replace "/usr/bin/helio" "$out/bin/helio" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/in-formant/default.nix b/pkgs/applications/audio/in-formant/default.nix index 1f33323736cef..3843d41ce91e0 100644 --- a/pkgs/applications/audio/in-formant/default.nix +++ b/pkgs/applications/audio/in-formant/default.nix @@ -53,10 +53,14 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp in-formant $out/bin install -Dm444 $src/dist-res/in-formant.desktop -t $out/share/applications install -Dm444 $src/dist-res/in-formant.png -t $out/share/icons/hicolor/512x512/apps + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/ir.lv2/default.nix b/pkgs/applications/audio/ir.lv2/default.nix index d1984170e3acc..eda04f6134665 100644 --- a/pkgs/applications/audio/ir.lv2/default.nix +++ b/pkgs/applications/audio/ir.lv2/default.nix @@ -19,12 +19,16 @@ stdenv.mkDerivation rec { postBuild = "make convert4chan"; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" mkdir "$out/include" mkdir -p "$out/share/doc" make PREFIX="$out" INSTDIR="$out/lib/lv2" install install -Dm755 convert4chan "$out/bin/convert4chan" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/jack-autoconnect/default.nix b/pkgs/applications/audio/jack-autoconnect/default.nix index d4fd50ca4f6d3..db95f5cfa0be3 100644 --- a/pkgs/applications/audio/jack-autoconnect/default.nix +++ b/pkgs/applications/audio/jack-autoconnect/default.nix @@ -16,8 +16,12 @@ mkDerivation rec { nativeBuildInputs = [ pkg-config qmake ]; installPhase = '' + runHook preInstall + mkdir -p -- "$out/bin" cp -- jack_autoconnect "$out/bin" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/jack-capture/default.nix b/pkgs/applications/audio/jack-capture/default.nix index 6f5dd4ed0d3ce..86afa4e8b34f6 100644 --- a/pkgs/applications/audio/jack-capture/default.nix +++ b/pkgs/applications/audio/jack-capture/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { buildPhase = "PREFIX=$out make jack_capture"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp jack_capture $out/bin/ + + runHook postInstall ''; hardeningDisable = [ "format" ]; diff --git a/pkgs/applications/audio/jack-oscrolloscope/default.nix b/pkgs/applications/audio/jack-oscrolloscope/default.nix index d3dee233fcf26..99f9438768cae 100644 --- a/pkgs/applications/audio/jack-oscrolloscope/default.nix +++ b/pkgs/applications/audio/jack-oscrolloscope/default.nix @@ -13,8 +13,12 @@ stdenv.mkDerivation rec { buildInputs = [ SDL libjack2 libGLU libGL ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv jack_oscrolloscope $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/jackmix/default.nix b/pkgs/applications/audio/jackmix/default.nix index 86c8a91862e77..f77acaa54ab93 100644 --- a/pkgs/applications/audio/jackmix/default.nix +++ b/pkgs/applications/audio/jackmix/default.nix @@ -31,7 +31,11 @@ mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -D jackmix/jackmix $out/bin/jackmix + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/jmusicbot/default.nix b/pkgs/applications/audio/jmusicbot/default.nix index 1278bcc045235..ec759780e69a3 100644 --- a/pkgs/applications/audio/jmusicbot/default.nix +++ b/pkgs/applications/audio/jmusicbot/default.nix @@ -14,11 +14,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib cp $src $out/lib/JMusicBot makeWrapper ${jre_headless}/bin/java $out/bin/JMusicBot \ --add-flags "-Xmx1G -Dnogui=true -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -jar $out/lib/JMusicBot" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/klystrack/default.nix b/pkgs/applications/audio/klystrack/default.nix index 83c3410a88c16..0963d702757b0 100644 --- a/pkgs/applications/audio/klystrack/default.nix +++ b/pkgs/applications/audio/klystrack/default.nix @@ -36,6 +36,8 @@ stdenv.mkDerivation rec { buildFlags = [ "PREFIX=${placeholder "out"}" "CFG=release" ]; installPhase = '' + runHook preInstall + install -Dm755 bin.release/klystrack $out/bin/klystrack mkdir -p $out/lib/klystrack @@ -46,6 +48,8 @@ stdenv.mkDerivation rec { mkdir -p $out/share/applications substitute linux/klystrack.desktop $out/share/applications/klystrack.desktop \ --replace "klystrack %f" "$out/bin/klystrack %f" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/ladspa-sdk/ladspah.nix b/pkgs/applications/audio/ladspa-sdk/ladspah.nix index b497e91927b06..3e3a146bf6ccb 100644 --- a/pkgs/applications/audio/ladspa-sdk/ladspah.nix +++ b/pkgs/applications/audio/ladspa-sdk/ladspah.nix @@ -8,8 +8,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/include cp src/ladspa.h $out/include/ladspa.h + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/losslessaudiochecker/default.nix b/pkgs/applications/audio/losslessaudiochecker/default.nix index cdea7180a73ef..7d89a839ece02 100644 --- a/pkgs/applications/audio/losslessaudiochecker/default.nix +++ b/pkgs/applications/audio/losslessaudiochecker/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + install LAC -D -t $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/lv2bm/default.nix b/pkgs/applications/audio/lv2bm/default.nix index dd831f024c2a1..314c5a70cade5 100644 --- a/pkgs/applications/audio/lv2bm/default.nix +++ b/pkgs/applications/audio/lv2bm/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation rec { buildInputs = [ glib libsndfile lilv lv2 serd sord sratom ]; installPhase = '' + runHook preInstall + make install PREFIX=$out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/lyrebird/default.nix b/pkgs/applications/audio/lyrebird/default.nix index be12c55596509..ee857be51f6e2 100644 --- a/pkgs/applications/audio/lyrebird/default.nix +++ b/pkgs/applications/audio/lyrebird/default.nix @@ -47,10 +47,14 @@ python3Packages.buildPythonApplication rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/{applications,lyrebird}} cp -at $out/share/lyrebird/ app icon.png cp -at $out/share/applications/ ${desktopItem} install -Dm755 app.py $out/bin/lyrebird + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/magnetophonDSP/CharacterCompressor/default.nix b/pkgs/applications/audio/magnetophonDSP/CharacterCompressor/default.nix index 09e87abec0ea3..901ab432c0658 100644 --- a/pkgs/applications/audio/magnetophonDSP/CharacterCompressor/default.nix +++ b/pkgs/applications/audio/magnetophonDSP/CharacterCompressor/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin for f in $(find . -executable -type f); do cp $f $out/bin/ @@ -29,6 +31,8 @@ stdenv.mkDerivation rec { mkdir -p $out/lib/lv2 cp -r CharacterCompressor.lv2/ $out/lib/lv2 cp -r CharacterCompressorMono.lv2/ $out/lib/lv2 + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/magnetophonDSP/CompBus/default.nix b/pkgs/applications/audio/magnetophonDSP/CompBus/default.nix index ce90f0f5f1641..c3e6f9e6978af 100644 --- a/pkgs/applications/audio/magnetophonDSP/CompBus/default.nix +++ b/pkgs/applications/audio/magnetophonDSP/CompBus/default.nix @@ -27,12 +27,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib/lv2 mv *.lv2/ $out/lib/lv2 mkdir -p $out/bin for f in $(find . -executable -type f); do cp $f $out/bin/ done + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/magnetophonDSP/ConstantDetuneChorus/default.nix b/pkgs/applications/audio/magnetophonDSP/ConstantDetuneChorus/default.nix index 98fae67d71c52..40d059ffe4315 100644 --- a/pkgs/applications/audio/magnetophonDSP/ConstantDetuneChorus/default.nix +++ b/pkgs/applications/audio/magnetophonDSP/ConstantDetuneChorus/default.nix @@ -20,12 +20,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin for f in $(find . -executable -type f); do cp $f $out/bin/ done mkdir -p $out/lib/lv2 cp -r ConstantDetuneChorus.lv2/ $out/lib/lv2 + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/magnetophonDSP/LazyLimiter/default.nix b/pkgs/applications/audio/magnetophonDSP/LazyLimiter/default.nix index 66f66d2e24483..bc70b3e1b81a8 100644 --- a/pkgs/applications/audio/magnetophonDSP/LazyLimiter/default.nix +++ b/pkgs/applications/audio/magnetophonDSP/LazyLimiter/default.nix @@ -20,12 +20,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin for f in $(find . -executable -type f); do cp $f $out/bin/ done mkdir -p $out/lib/lv2 cp -r LazyLimiter.lv2/ $out/lib/lv2 + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/magnetophonDSP/MBdistortion/default.nix b/pkgs/applications/audio/magnetophonDSP/MBdistortion/default.nix index e8798424cc12f..a78aae7a79c12 100644 --- a/pkgs/applications/audio/magnetophonDSP/MBdistortion/default.nix +++ b/pkgs/applications/audio/magnetophonDSP/MBdistortion/default.nix @@ -27,12 +27,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin for f in $(find . -executable -type f); do cp $f $out/bin/ done mkdir -p $out/lib/lv2 cp -r MBdistortion.lv2/ $out/lib/lv2 + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/magnetophonDSP/RhythmDelay/default.nix b/pkgs/applications/audio/magnetophonDSP/RhythmDelay/default.nix index fb55af1dcebd7..50c256d3bf0e8 100644 --- a/pkgs/applications/audio/magnetophonDSP/RhythmDelay/default.nix +++ b/pkgs/applications/audio/magnetophonDSP/RhythmDelay/default.nix @@ -20,12 +20,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin for f in $(find . -executable -type f); do cp $f $out/bin/ done mkdir -p $out/lib/lv2 cp -r RhythmDelay.lv2/ $out/lib/lv2 + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/magnetophonDSP/faustCompressors/default.nix b/pkgs/applications/audio/magnetophonDSP/faustCompressors/default.nix index 0caba36177438..87a49eb7fe781 100644 --- a/pkgs/applications/audio/magnetophonDSP/faustCompressors/default.nix +++ b/pkgs/applications/audio/magnetophonDSP/faustCompressors/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib/lv2 mv *.lv2/ $out/lib/lv2 mkdir -p $out/bin @@ -38,6 +40,8 @@ stdenv.mkDerivation rec { for f in $(find . -executable -type f); do cp $f $out/bin/ done + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/magnetophonDSP/pluginUtils/default.nix b/pkgs/applications/audio/magnetophonDSP/pluginUtils/default.nix index 5230ed327e23a..c269927b01e4c 100644 --- a/pkgs/applications/audio/magnetophonDSP/pluginUtils/default.nix +++ b/pkgs/applications/audio/magnetophonDSP/pluginUtils/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + rm -f *.dsp rm -f *.lib mkdir -p $out/lib/lv2 @@ -33,7 +35,9 @@ stdenv.mkDerivation rec { for f in $(find . -executable -type f); do cp $f $out/bin/ done - ''; + + runHook postInstall + ''; meta = { description = "Some simple utility lv2 plugins"; diff --git a/pkgs/applications/audio/magnetophonDSP/shelfMultiBand/default.nix b/pkgs/applications/audio/magnetophonDSP/shelfMultiBand/default.nix index 42163d9879b8b..ceda9e2f16121 100644 --- a/pkgs/applications/audio/magnetophonDSP/shelfMultiBand/default.nix +++ b/pkgs/applications/audio/magnetophonDSP/shelfMultiBand/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin for f in $(find . -executable -type f); do cp $f $out/bin/ @@ -29,6 +31,8 @@ stdenv.mkDerivation rec { mkdir -p $out/lib/lv2 cp -r shelfMultiBand.lv2/ $out/lib/lv2 cp -r shelfMultiBandMono.lv2/ $out/lib/lv2 + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/mi2ly/default.nix b/pkgs/applications/audio/mi2ly/default.nix index 8b03f75b398d9..2ad1707d03a8b 100644 --- a/pkgs/applications/audio/mi2ly/default.nix +++ b/pkgs/applications/audio/mi2ly/default.nix @@ -17,9 +17,13 @@ stdenv.mkDerivation rec { buildPhase = "./cc"; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,share/doc/mi2ly} cp mi2ly "$out/bin" cp README Doc.txt COPYING Manual.txt "$out/share/doc/mi2ly" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/mid2key/default.nix b/pkgs/applications/audio/mid2key/default.nix index 95b48779459a2..e53174c3836e7 100644 --- a/pkgs/applications/audio/mid2key/default.nix +++ b/pkgs/applications/audio/mid2key/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildPhase = "make"; - installPhase = "mkdir -p $out/bin && mv mid2key $out/bin"; + installPhase = "runHook preInstall; mkdir -p $out/bin && mv mid2key $out/bin; runHook postInstall"; meta = with lib; { homepage = "http://code.google.com/p/mid2key/"; diff --git a/pkgs/applications/audio/midas/generic.nix b/pkgs/applications/audio/midas/generic.nix index fa5a7b5e46a3d..c36577cd9c2c7 100644 --- a/pkgs/applications/audio/midas/generic.nix +++ b/pkgs/applications/audio/midas/generic.nix @@ -13,8 +13,12 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${type}-Edit $out/bin/${pname} + + runHook postInstall ''; preFixup = let # we prepare our library path in the let clause to avoid it become part of the input of mkDerivation diff --git a/pkgs/applications/audio/midi-trigger/default.nix b/pkgs/applications/audio/midi-trigger/default.nix index 9fcf49e5ae667..20c9db79389dd 100644 --- a/pkgs/applications/audio/midi-trigger/default.nix +++ b/pkgs/applications/audio/midi-trigger/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p "$out/lib/lv2" mv midi-trigger.lv2 "$out/lib/lv2" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/midisheetmusic/default.nix b/pkgs/applications/audio/midisheetmusic/default.nix index 645c69a1c86b8..46291b1cdd63c 100644 --- a/pkgs/applications/audio/midisheetmusic/default.nix +++ b/pkgs/applications/audio/midisheetmusic/default.nix @@ -40,6 +40,8 @@ in stdenv.mkDerivation { doCheck = false; installPhase = '' + runHook preInstall + mkdir -p $out/share/applications $out/share/pixmaps $out/bin cp deb/midisheetmusic.desktop $out/share/applications @@ -50,6 +52,8 @@ in stdenv.mkDerivation { --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gtk2 cups ]} \ --prefix PATH : ${lib.makeBinPath [ timidity ]} \ --add-flags $out/bin/.MidiSheetMusic.exe + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/mooSpace/default.nix b/pkgs/applications/audio/mooSpace/default.nix index 6d67d83f9875c..42e7c6b0dad73 100644 --- a/pkgs/applications/audio/mooSpace/default.nix +++ b/pkgs/applications/audio/mooSpace/default.nix @@ -22,12 +22,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin for f in $(find . -executable -type f); do cp $f $out/bin/ done mkdir -p $out/lib/lv2 cp -r ${pname}.lv2 $out/lib/lv2 + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/mp3gain/default.nix b/pkgs/applications/audio/mp3gain/default.nix index a59f2e376db03..f6443a9720025 100644 --- a/pkgs/applications/audio/mp3gain/default.nix +++ b/pkgs/applications/audio/mp3gain/default.nix @@ -24,7 +24,11 @@ stdenv.mkDerivation rec { buildFlags = [ "OSTYPE=linux" ]; installPhase = '' + runHook preInstall + install -vD mp3gain "$out/bin/mp3gain" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/mp3val/default.nix b/pkgs/applications/audio/mp3val/default.nix index 506829ac3a000..2e71059b11b61 100644 --- a/pkgs/applications/audio/mp3val/default.nix +++ b/pkgs/applications/audio/mp3val/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation rec { makefile = "Makefile.linux"; installPhase = '' + runHook preInstall + install -Dv mp3val "$out/bin/mp3val" + + runHook postInstall ''; hardeningDisable = [ "fortify" ]; diff --git a/pkgs/applications/audio/ninjas2/default.nix b/pkgs/applications/audio/ninjas2/default.nix index 8a2cc317c1375..702d8f6d90723 100644 --- a/pkgs/applications/audio/ninjas2/default.nix +++ b/pkgs/applications/audio/ninjas2/default.nix @@ -22,9 +22,13 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -dD bin/ninjas2.lv2 $out/lib/lv2/ninjas2.lv2 install -D bin/ninjas2-vst.so $out/lib/vst/ninjas2-vst.so install -D bin/ninjas2 $out/bin/ninjas2 + + runHook postInstall ''; makeFlags = [ "PREFIX=$(out)" ]; diff --git a/pkgs/applications/audio/odin2/default.nix b/pkgs/applications/audio/odin2/default.nix index ae3a464f43b21..cb79a49206fe1 100644 --- a/pkgs/applications/audio/odin2/default.nix +++ b/pkgs/applications/audio/odin2/default.nix @@ -67,13 +67,17 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib/vst3 $out/lib/lv2 $out/lib/clap cd Odin2_artefacts/Release cp Standalone/Odin2 $out/bin cp -r VST3/Odin2.vst3 $out/lib/vst3 cp -r LV2/Odin2.lv2 $out/lib/lv2 cp -r CLAP/Odin2.clap $out/lib/clap -''; + + runHook postInstall + ''; meta = with lib; { diff --git a/pkgs/applications/audio/oxefmsynth/default.nix b/pkgs/applications/audio/oxefmsynth/default.nix index ef4482e8f1cc4..75ee3b95e23d6 100644 --- a/pkgs/applications/audio/oxefmsynth/default.nix +++ b/pkgs/applications/audio/oxefmsynth/default.nix @@ -8,7 +8,7 @@ let url = "https://web.archive.org/web/20181016150224if_/https://download.steinberg.net/sdk_downloads/${name}.zip"; sha256 = "0da16iwac590wphz2sm5afrfj42jrsnkr1bxcy93lj7a369ildkj"; }; - installPhase = "cp -r . $out"; + installPhase = "runHook preInstall; cp -r . $out; runHook postInstall"; }; in stdenv.mkDerivation rec { @@ -29,8 +29,12 @@ in stdenv.mkDerivation rec { buildInputs = [ libX11 ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/lxvst install -Dm644 oxevst64.so -t $out/lib/lxvst + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/paulstretch/default.nix b/pkgs/applications/audio/paulstretch/default.nix index c539521f11679..89c7ee3e57b73 100644 --- a/pkgs/applications/audio/paulstretch/default.nix +++ b/pkgs/applications/audio/paulstretch/default.nix @@ -42,7 +42,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -Dm555 ./paulstretch $out/bin/paulstretch + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/pd-plugins/helmholtz/default.nix b/pkgs/applications/audio/pd-plugins/helmholtz/default.nix index 50455328f3a40..8f666d3df6f81 100644 --- a/pkgs/applications/audio/pd-plugins/helmholtz/default.nix +++ b/pkgs/applications/audio/pd-plugins/helmholtz/default.nix @@ -34,7 +34,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + cp -r helmholtz~/ $out/ + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/pd-plugins/mrpeach/default.nix b/pkgs/applications/audio/pd-plugins/mrpeach/default.nix index e11c5cd00a186..c475903826e22 100644 --- a/pkgs/applications/audio/pd-plugins/mrpeach/default.nix +++ b/pkgs/applications/audio/pd-plugins/mrpeach/default.nix @@ -38,12 +38,16 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + for D in net osc do cd $D make install cd .. done + + runHook postInstall ''; fixupPhase = '' diff --git a/pkgs/applications/audio/pd-plugins/puremapping/default.nix b/pkgs/applications/audio/pd-plugins/puremapping/default.nix index 5aef92ab61fb0..b39511f8c878a 100644 --- a/pkgs/applications/audio/pd-plugins/puremapping/default.nix +++ b/pkgs/applications/audio/pd-plugins/puremapping/default.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/puremapping mv puremapping/ $out + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/pd-plugins/timbreid/default.nix b/pkgs/applications/audio/pd-plugins/timbreid/default.nix index f3da39f15b33d..0a721c7c47de3 100644 --- a/pkgs/applications/audio/pd-plugins/timbreid/default.nix +++ b/pkgs/applications/audio/pd-plugins/timbreid/default.nix @@ -23,12 +23,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/ cp -r *.pd $out/ cp -r *.pd_linux $out/ cp -r audio/ $out/ cp -r data/ $out/ cp -r doc/ $out/ + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/audio/picoloop/default.nix b/pkgs/applications/audio/picoloop/default.nix index cc9d0646d9879..5b7352f78ab6a 100644 --- a/pkgs/applications/audio/picoloop/default.nix +++ b/pkgs/applications/audio/picoloop/default.nix @@ -36,9 +36,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share} cp PatternPlayer_debian_RtAudio_sdl20 $out/bin/picoloop cp {font.*,LICENSE} $out/share + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/plugin-torture/default.nix b/pkgs/applications/audio/plugin-torture/default.nix index b3f671adc4b2a..6c8e5157fbef3 100644 --- a/pkgs/applications/audio/plugin-torture/default.nix +++ b/pkgs/applications/audio/plugin-torture/default.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation { buildInputs = [ boost ladspaH lilv lv2 serd sord sratom ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp plugin-torture $out/bin/ cp find-safe-plugins $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/renoise/default.nix b/pkgs/applications/audio/renoise/default.nix index 7e178728c2dd5..4db03c6833e4c 100644 --- a/pkgs/applications/audio/renoise/default.nix +++ b/pkgs/applications/audio/renoise/default.nix @@ -63,6 +63,8 @@ in stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + cp -r Resources $out mkdir -p $out/lib/ @@ -87,6 +89,8 @@ in stdenv.mkDerivation rec { cp Installer/renoise-48.png $out/share/icons/hicolor/48x48/apps/renoise.png cp Installer/renoise-64.png $out/share/icons/hicolor/64x64/apps/renoise.png cp Installer/renoise-128.png $out/share/icons/hicolor/128x128/apps/renoise.png + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/audio/rymcast/default.nix b/pkgs/applications/audio/rymcast/default.nix index 06e711941a637..6bb41924c1564 100644 --- a/pkgs/applications/audio/rymcast/default.nix +++ b/pkgs/applications/audio/rymcast/default.nix @@ -16,10 +16,14 @@ stdenv.mkDerivation rec { buildInputs = [ alsa-lib curl gtk3 stdenv.cc.cc.lib webkitgtk zenity ]; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp RYMCast "$out/bin/" wrapProgram "$out/bin/RYMCast" \ --set PATH "${lib.makeBinPath [ zenity ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/samplebrain/default.nix b/pkgs/applications/audio/samplebrain/default.nix index ae3549ff16d91..db9fa61f13b68 100644 --- a/pkgs/applications/audio/samplebrain/default.nix +++ b/pkgs/applications/audio/samplebrain/default.nix @@ -46,9 +46,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp samplebrain $out/bin install -m 444 -D desktop/samplebrain.svg $out/share/icons/hicolor/scalable/apps/samplebrain.svg + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/sndpeek/default.nix b/pkgs/applications/audio/sndpeek/default.nix index 7cf8636ad1074..c454c13e69206 100644 --- a/pkgs/applications/audio/sndpeek/default.nix +++ b/pkgs/applications/audio/sndpeek/default.nix @@ -29,8 +29,12 @@ stdenv.mkDerivation rec { buildFlags = [ "linux-alsa" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv sndpeek $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/sorcer/default.nix b/pkgs/applications/audio/sorcer/default.nix index 6c28d540458f5..0969759f3945b 100644 --- a/pkgs/applications/audio/sorcer/default.nix +++ b/pkgs/applications/audio/sorcer/default.nix @@ -21,8 +21,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + make install cp -a ../presets/* "$out/lib/lv2" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/soundwireserver/default.nix b/pkgs/applications/audio/soundwireserver/default.nix index b296ebdad602a..7d88c118131a5 100644 --- a/pkgs/applications/audio/soundwireserver/default.nix +++ b/pkgs/applications/audio/soundwireserver/default.nix @@ -25,9 +25,13 @@ qt5.mkDerivation { ]; installPhase = '' + runHook preInstall + install -D SoundWire-Server.desktop $out/share/applications/SoundWireServer.desktop install -D SoundWireServer $out/bin/SoundWireServer install -D sw-icon.xpm $out/share/icons/hicolor/256x256/apps/sw-icon.xpm + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/ssrc/default.nix b/pkgs/applications/audio/ssrc/default.nix index 73fd622fbeb23..21865ef6825a2 100644 --- a/pkgs/applications/audio/ssrc/default.nix +++ b/pkgs/applications/audio/ssrc/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ssrc ssrc_hp $out/bin - ''; + + runHook postInstall + ''; meta = with lib; { description = "High quality audio sampling rate converter"; diff --git a/pkgs/applications/audio/stochas/default.nix b/pkgs/applications/audio/stochas/default.nix index 33d9b050a1ff9..59299dca10642 100644 --- a/pkgs/applications/audio/stochas/default.nix +++ b/pkgs/applications/audio/stochas/default.nix @@ -24,8 +24,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/vst3 cp -r stochas_artefacts/Release/VST3/Stochas.vst3 $out/lib/vst3 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/surge/default.nix b/pkgs/applications/audio/surge/default.nix index f1d8600ed01bf..f2c46bdda9f07 100644 --- a/pkgs/applications/audio/surge/default.nix +++ b/pkgs/applications/audio/surge/default.nix @@ -80,8 +80,12 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + cd .. cmake --build build --config Release --target install-everything-global + + runHook postInstall ''; doInstallCheck = true; diff --git a/pkgs/applications/audio/swh-lv2/default.nix b/pkgs/applications/audio/swh-lv2/default.nix index 224ab749593dd..e56f325306345 100644 --- a/pkgs/applications/audio/swh-lv2/default.nix +++ b/pkgs/applications/audio/swh-lv2/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; buildInputs = [ fftwSinglePrec lv2 ]; - installPhase = "make install-system"; + installPhase = "runHook preInstall; make install-system; runHook postInstall"; meta = with lib; { homepage = "http://plugin.org.uk"; diff --git a/pkgs/applications/audio/talentedhack/default.nix b/pkgs/applications/audio/talentedhack/default.nix index 387fd4f5a0c61..c0dec0bc28a09 100644 --- a/pkgs/applications/audio/talentedhack/default.nix +++ b/pkgs/applications/audio/talentedhack/default.nix @@ -21,9 +21,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + d=$out/lib/lv2/talentedhack.lv2 mkdir -p $d cp *.so *.ttl $d + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/tambura/default.nix b/pkgs/applications/audio/tambura/default.nix index 9fcf9bb70ef93..8e5f6cdd64657 100644 --- a/pkgs/applications/audio/tambura/default.nix +++ b/pkgs/applications/audio/tambura/default.nix @@ -20,12 +20,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin for f in $(find . -executable -type f); do cp $f $out/bin/ done mkdir -p $out/lib/lv2 cp -r ${pname}.lv2/ $out/lib/lv2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/tauon/default.nix b/pkgs/applications/audio/tauon/default.nix index da77d6aeb5def..a388c5504b6aa 100644 --- a/pkgs/applications/audio/tauon/default.nix +++ b/pkgs/applications/audio/tauon/default.nix @@ -121,6 +121,8 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = '' + runHook preInstall + install -Dm755 tauon.py $out/bin/tauon mkdir -p $out/share/tauon cp -r lib $out @@ -132,6 +134,8 @@ stdenv.mkDerivation (finalAttrs: { install -Dm755 extra/tauonmb.desktop $out/share/applications/tauonmb.desktop mkdir -p $out/share/icons/hicolor/scalable/apps install -Dm644 extra/tauonmb{,-symbolic}.svg $out/share/icons/hicolor/scalable/apps + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/tonelib-gfx/default.nix b/pkgs/applications/audio/tonelib-gfx/default.nix index 826433128e7da..d101c8f3dba8c 100644 --- a/pkgs/applications/audio/tonelib-gfx/default.nix +++ b/pkgs/applications/audio/tonelib-gfx/default.nix @@ -44,9 +44,13 @@ stdenv.mkDerivation rec { unpackCmd = "dpkg -x $curSrc source"; installPhase = '' + runHook preInstall + mv usr $out substituteInPlace $out/share/applications/ToneLib-GFX.desktop --replace /usr/ $out/ - ''; + + runHook postInstall + ''; meta = with lib; { description = "Tonelib GFX is an amp and effects modeling software for electric guitar and bass"; diff --git a/pkgs/applications/audio/tonelib-jam/default.nix b/pkgs/applications/audio/tonelib-jam/default.nix index 289f8b92a189d..ad77ec4508f9b 100644 --- a/pkgs/applications/audio/tonelib-jam/default.nix +++ b/pkgs/applications/audio/tonelib-jam/default.nix @@ -47,8 +47,12 @@ stdenv.mkDerivation rec { unpackCmd = "dpkg -x $curSrc source"; installPhase = '' + runHook preInstall + mv usr $out substituteInPlace $out/share/applications/ToneLib-Jam.desktop --replace /usr/ $out/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/tonelib-metal/default.nix b/pkgs/applications/audio/tonelib-metal/default.nix index aee3c383ae68f..f4af0c856e25c 100644 --- a/pkgs/applications/audio/tonelib-metal/default.nix +++ b/pkgs/applications/audio/tonelib-metal/default.nix @@ -46,9 +46,13 @@ stdenv.mkDerivation rec { unpackCmd = "dpkg -x $curSrc source"; installPhase = '' + runHook preInstall + mv usr $out substituteInPlace $out/share/applications/ToneLib-Metal.desktop --replace /usr/ $out/ - ''; + + runHook postInstall + ''; meta = with lib; { description = "ToneLib Metal – Guitar amp simulator targeted at metal players"; diff --git a/pkgs/applications/audio/tonelib-noisereducer/default.nix b/pkgs/applications/audio/tonelib-noisereducer/default.nix index f2f01b9326bcf..68905ce351dca 100644 --- a/pkgs/applications/audio/tonelib-noisereducer/default.nix +++ b/pkgs/applications/audio/tonelib-noisereducer/default.nix @@ -46,8 +46,12 @@ stdenv.mkDerivation rec { unpackCmd = "dpkg -x $curSrc source"; installPhase = '' + runHook preInstall + mv usr $out - ''; + + runHook postInstall + ''; meta = with lib; { description = "ToneLib NoiseReducer – two-unit noise reduction rack effect plugin"; diff --git a/pkgs/applications/audio/tonelib-zoom/default.nix b/pkgs/applications/audio/tonelib-zoom/default.nix index e5adc356b6973..b3b5424b87203 100644 --- a/pkgs/applications/audio/tonelib-zoom/default.nix +++ b/pkgs/applications/audio/tonelib-zoom/default.nix @@ -49,8 +49,12 @@ stdenv.mkDerivation rec { unpackCmd = "dpkg -x $curSrc source"; installPhase = '' + runHook preInstall + mv usr $out substituteInPlace $out/share/applications/ToneLib-Zoom.desktop --replace /usr/ $out/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/transcribe/default.nix b/pkgs/applications/audio/transcribe/default.nix index 16f0082ec7901..16f15fcee7b16 100644 --- a/pkgs/applications/audio/transcribe/default.nix +++ b/pkgs/applications/audio/transcribe/default.nix @@ -68,6 +68,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/libexec $out/share/doc cp transcribe $out/libexec cp xschelp.htb readme_gtk.html $out/share/doc @@ -81,6 +83,8 @@ stdenv.mkDerivation rec { patchelf \ --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \ $out/libexec/transcribe + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/applications/audio/tree-from-tags/default.nix b/pkgs/applications/audio/tree-from-tags/default.nix index 9b81cc250c1b2..28285c34dc20c 100644 --- a/pkgs/applications/audio/tree-from-tags/default.nix +++ b/pkgs/applications/audio/tree-from-tags/default.nix @@ -17,6 +17,8 @@ in stdenv.mkDerivation { }; buildInputs = [ gems ruby ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share} cp tree-from-tags.rb $out/share/ bin=$out/bin/tree-from-tags @@ -26,6 +28,8 @@ in stdenv.mkDerivation { exec ${gems}/bin/bundle exec ${ruby}/bin/ruby "$out"/share/tree-from-tags.rb "\$@" EOF chmod +x $bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/tunefish/default.nix b/pkgs/applications/audio/tunefish/default.nix index df7564abcf02b..9b3dbbf972246 100644 --- a/pkgs/applications/audio/tunefish/default.nix +++ b/pkgs/applications/audio/tunefish/default.nix @@ -27,8 +27,12 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/lv2 cp -r src/tunefish4/Builds/LinuxMakefile/build/Tunefish4.lv2 $out/lib/lv2 + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/applications/audio/virtual-ans/default.nix b/pkgs/applications/audio/virtual-ans/default.nix index 4bec1952e03eb..8a7eae7ab4bb0 100644 --- a/pkgs/applications/audio/virtual-ans/default.nix +++ b/pkgs/applications/audio/virtual-ans/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out cp -R ./* $out/ @@ -41,6 +43,8 @@ stdenv.mkDerivation rec { # Start script performs relative search for resources, so it cannot be moved # to bin directory ln -s $out/${startScript} $out/bin/virtual-ans + + runHook postInstall ''; startScript = if stdenv.isx86_32 then "START_LINUX_X86" diff --git a/pkgs/applications/audio/waon/default.nix b/pkgs/applications/audio/waon/default.nix index b1f66798dd9c7..b0ed1866cc440 100644 --- a/pkgs/applications/audio/waon/default.nix +++ b/pkgs/applications/audio/waon/default.nix @@ -17,7 +17,11 @@ stdenv.mkDerivation rec { buildInputs = [ fftw gtk2 libao libsamplerate libsndfile ncurses ]; installPhase = '' + runHook preInstall + install -Dt $out/bin waon pv gwaon + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/wavegain/default.nix b/pkgs/applications/audio/wavegain/default.nix index 93dd7bf6fb235..aba6afb760a33 100644 --- a/pkgs/applications/audio/wavegain/default.nix +++ b/pkgs/applications/audio/wavegain/default.nix @@ -23,8 +23,12 @@ stdenv.mkDerivation { makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; installPhase = '' + runHook preInstall + strip -s wavegain install -vD wavegain "$out/bin/wavegain" + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/audio/wolf-shaper/default.nix b/pkgs/applications/audio/wolf-shaper/default.nix index a3c08e92b7234..2c71c2728dc29 100644 --- a/pkgs/applications/audio/wolf-shaper/default.nix +++ b/pkgs/applications/audio/wolf-shaper/default.nix @@ -27,6 +27,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib/lv2 mkdir -p $out/lib/dssi mkdir -p $out/lib/vst @@ -35,6 +37,8 @@ stdenv.mkDerivation rec { cp -r bin/wolf-shaper-dssi* $out/lib/dssi/ cp -r bin/wolf-shaper-vst.so $out/lib/vst/ cp -r bin/wolf-shaper $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/audio/xsynth-dssi/default.nix b/pkgs/applications/audio/xsynth-dssi/default.nix index 788453f51955f..6957223b55a0a 100644 --- a/pkgs/applications/audio/xsynth-dssi/default.nix +++ b/pkgs/applications/audio/xsynth-dssi/default.nix @@ -15,10 +15,14 @@ stdenv.mkDerivation rec { ladspaPlugins liblo ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/lib cp src/Xsynth_gtk $out/bin cp src/.libs/* $out/lib + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/blockchains/besu/default.nix b/pkgs/applications/blockchains/besu/default.nix index ef985a2806b7b..313c9b024b188 100644 --- a/pkgs/applications/blockchains/besu/default.nix +++ b/pkgs/applications/blockchains/besu/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation (finalAttrs: rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r bin $out/ mkdir -p $out/lib @@ -20,6 +22,8 @@ stdenv.mkDerivation (finalAttrs: rec { wrapProgram $out/bin/${pname} \ --set JAVA_HOME "${jre}" \ --suffix ${if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"} : ${lib.makeLibraryPath buildInputs} + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/applications/blockchains/ergo/default.nix b/pkgs/applications/blockchains/ergo/default.nix index ba24148ed51e4..0e980cf45481f 100644 --- a/pkgs/applications/blockchains/ergo/default.nix +++ b/pkgs/applications/blockchains/ergo/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + makeWrapper ${jre}/bin/java $out/bin/ergo --add-flags "-jar $src" + + runHook postInstall ''; passthru.tests = { inherit (nixosTests) ergo; }; diff --git a/pkgs/applications/blockchains/exodus/default.nix b/pkgs/applications/blockchains/exodus/default.nix index 5e13ece9a51e6..796ea0ac53efd 100644 --- a/pkgs/applications/blockchains/exodus/default.nix +++ b/pkgs/applications/blockchains/exodus/default.nix @@ -39,6 +39,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/applications cp -r . $out ln -s $out/Exodus $out/bin/Exodus @@ -46,6 +48,8 @@ stdenv.mkDerivation (finalAttrs: { ln -s $out/exodus.desktop $out/share/applications substituteInPlace $out/share/applications/exodus.desktop \ --replace 'Exec=bash -c "cd \`dirname %k\` && ./Exodus %u"' "Exec=Exodus %u" + + runHook postInstall ''; dontPatchELF = true; diff --git a/pkgs/applications/blockchains/sparrow/openimajgrabber.nix b/pkgs/applications/blockchains/sparrow/openimajgrabber.nix index 8fac6f1a27ae6..ca0094f508216 100644 --- a/pkgs/applications/blockchains/sparrow/openimajgrabber.nix +++ b/pkgs/applications/blockchains/sparrow/openimajgrabber.nix @@ -26,8 +26,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib cp hardware/core-video-capture/src-native/linux/OpenIMAJGrabber.so $out/lib + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/blockchains/tessera/default.nix b/pkgs/applications/blockchains/tessera/default.nix index 03bd6734a9a59..27b1e5e20e130 100644 --- a/pkgs/applications/blockchains/tessera/default.nix +++ b/pkgs/applications/blockchains/tessera/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + makeWrapper ${jre}/bin/java $out/bin/tessera --add-flags "-jar $src" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/blockchains/torq/default.nix b/pkgs/applications/blockchains/torq/default.nix index 7518508f64b1a..e0e8b8beaf97b 100644 --- a/pkgs/applications/blockchains/torq/default.nix +++ b/pkgs/applications/blockchains/torq/default.nix @@ -28,8 +28,12 @@ let # override npmInstallHook, we only care about the build/ directory installPhase = '' + runHook preInstall + mkdir $out cp -r build/* $out/ + + runHook postInstall ''; }; in diff --git a/pkgs/applications/blockchains/wasabiwallet/default.nix b/pkgs/applications/blockchains/wasabiwallet/default.nix index b010eb1184e74..6d7867b69ad87 100644 --- a/pkgs/applications/blockchains/wasabiwallet/default.nix +++ b/pkgs/applications/blockchains/wasabiwallet/default.nix @@ -49,6 +49,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/opt/${pname} $out/bin $out/share/applications cp -Rv . $out/opt/${pname} @@ -59,6 +61,8 @@ stdenv.mkDerivation rec { --suffix "LD_LIBRARY_PATH" : "${lib.makeLibraryPath runtimeLibs}" cp -v $desktopItem/share/applications/* $out/share/applications + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/blockchains/zcash/default.nix b/pkgs/applications/blockchains/zcash/default.nix index dbada09c1b6e9..5dfc8d40f0f51 100644 --- a/pkgs/applications/blockchains/zcash/default.nix +++ b/pkgs/applications/blockchains/zcash/default.nix @@ -41,7 +41,7 @@ rustPlatform.buildRustPackage.override { inherit stdenv; } rec { configurePhase = "configurePhase"; buildPhase = "buildPhase"; checkPhase = "checkPhase"; - installPhase = "installPhase"; + installPhase = "runHook preInstall; installPhase; runHook postInstall"; postPatch = '' # Have to do this here instead of in preConfigure because diff --git a/pkgs/applications/display-managers/lightdm-tiny-greeter/default.nix b/pkgs/applications/display-managers/lightdm-tiny-greeter/default.nix index 42e5e004a62a7..49bddbac282ef 100644 --- a/pkgs/applications/display-managers/lightdm-tiny-greeter/default.nix +++ b/pkgs/applications/display-managers/lightdm-tiny-greeter/default.nix @@ -27,8 +27,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + substituteInPlace "$out/share/xgreeters/lightdm-tiny-greeter.desktop" \ --replace "Exec=lightdm-tiny-greeter" "Exec=$out/bin/lightdm-tiny-greeter" + + runHook postInstall ''; passthru.xgreeters = linkFarm "lightdm-tiny-greeter-xgreeters" [{ diff --git a/pkgs/applications/editors/android-studio-for-platform/common.nix b/pkgs/applications/editors/android-studio-for-platform/common.nix index b0e7e1c839a42..f1efb1628815e 100644 --- a/pkgs/applications/editors/android-studio-for-platform/common.nix +++ b/pkgs/applications/editors/android-studio-for-platform/common.nix @@ -60,6 +60,8 @@ let ]; installPhase = '' + runHook preInstall + cp -r "./opt/${pname}/" $out wrapProgram $out/bin/studio.sh \ --set-default JAVA_HOME "$out/jbr" \ @@ -112,6 +114,8 @@ let # For Soong sync e2fsprogs ]}" + + runHook postInstall ''; }; diff --git a/pkgs/applications/editors/android-studio/common.nix b/pkgs/applications/editors/android-studio/common.nix index 09bc0d43212cf..f71027d9edb5d 100644 --- a/pkgs/applications/editors/android-studio/common.nix +++ b/pkgs/applications/editors/android-studio/common.nix @@ -89,6 +89,8 @@ let dontPatchShebangs = true; installPhase = '' + runHook preInstall + cp -r . $out wrapProgram $out/bin/studio.sh \ --set-default JAVA_HOME "$out/jbr" \ @@ -183,6 +185,8 @@ let ncurses5 zlib ]}" + + runHook postInstall ''; }; diff --git a/pkgs/applications/editors/cudatext/default.nix b/pkgs/applications/editors/cudatext/default.nix index 37b79d9815c3e..4c4be7e104137 100644 --- a/pkgs/applications/editors/cudatext/default.nix +++ b/pkgs/applications/editors/cudatext/default.nix @@ -88,6 +88,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 app/cudatext -t $out/bin install -dm755 $out/share/cudatext @@ -112,7 +114,9 @@ stdenv.mkDerivation rec { Text/code editor with lite UI. Syntax highlighting for 200+ languages. Config system in JSON files. Multi-carets and multi-selections. Search and replace with RegEx. Extendable by Python plugins and themes. - ''; + + runHook postInstall + ''; homepage = "https://cudatext.github.io/"; changelog = "https://cudatext.github.io/history.txt"; license = licenses.mpl20; diff --git a/pkgs/applications/editors/dhex/default.nix b/pkgs/applications/editors/dhex/default.nix index af6e547e63d39..f9d7f8a2d8ddf 100644 --- a/pkgs/applications/editors/dhex/default.nix +++ b/pkgs/applications/editors/dhex/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/man/man1 mkdir -p $out/share/man/man5 @@ -21,6 +23,8 @@ stdenv.mkDerivation rec { cp dhexrc.5 $out/share/man/man5 cp dhex_markers.5 $out/share/man/man5 cp dhex_searchlog.5 $out/share/man/man5 + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/editors/eclipse/plugins.nix b/pkgs/applications/editors/eclipse/plugins.nix index b40b08c97e5fe..1c9fa5c55cb87 100644 --- a/pkgs/applications/editors/eclipse/plugins.nix +++ b/pkgs/applications/editors/eclipse/plugins.nix @@ -57,6 +57,8 @@ rec { doCheck = false; installPhase = '' + runHook preInstall + dropinDir="$out/eclipse/dropins/${name}" # Install features. @@ -88,6 +90,8 @@ rec { fi done cd .. + + runHook postInstall ''; }); diff --git a/pkgs/applications/editors/elvis/default.nix b/pkgs/applications/editors/elvis/default.nix index 046aac459b53c..24fb780479c14 100644 --- a/pkgs/applications/editors/elvis/default.nix +++ b/pkgs/applications/editors/elvis/default.nix @@ -28,6 +28,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/elvis $out/share/elvis/doc cp elvis ref elvtags elvfmt $out/bin cp -R data/* $out/share/elvis @@ -37,6 +39,8 @@ stdenv.mkDerivation rec { for a in doc/*.man; do cp $a $out/share/man/man1/`basename $a .man`.1 done + + runHook postInstall ''; configureFlags = [ "--ioctl=termios" ]; diff --git a/pkgs/applications/editors/jupyter-kernels/wolfram/kernel.nix b/pkgs/applications/editors/jupyter-kernels/wolfram/kernel.nix index e1beb4048b14d..1afe58e4a45ec 100644 --- a/pkgs/applications/editors/jupyter-kernels/wolfram/kernel.nix +++ b/pkgs/applications/editors/jupyter-kernels/wolfram/kernel.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { dontConfigure = true; installPhase = '' + runHook preInstall + patchShebangs ./configure-jupyter.wls mkdir -p $out/share/Wolfram cp -r {WolframLanguageForJupyter,images,extras,LICENSE} $out/share/Wolfram + + runHook postInstall ''; # no tests diff --git a/pkgs/applications/editors/jupyter/kernel.nix b/pkgs/applications/editors/jupyter/kernel.nix index 3640de28e8acc..bda7206f088b2 100644 --- a/pkgs/applications/editors/jupyter/kernel.nix +++ b/pkgs/applications/editors/jupyter/kernel.nix @@ -35,6 +35,8 @@ in unpackCmd = "mkdir jupyter_kernels"; installPhase = '' + runHook preInstall + mkdir kernels ${concatStringsSep "\n" (mapAttrsToList (kernelName: unfilteredKernel: @@ -59,6 +61,8 @@ in mkdir $out cp -r kernels $out + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/editors/kakoune/plugins/overrides.nix b/pkgs/applications/editors/kakoune/plugins/overrides.nix index 6f60573f48b29..59e3280de0008 100644 --- a/pkgs/applications/editors/kakoune/plugins/overrides.nix +++ b/pkgs/applications/editors/kakoune/plugins/overrides.nix @@ -45,6 +45,8 @@ self: super: { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/kak/autoload/plugins/ cp kak-ansi-filter $out/bin/ # Hard-code path of filter and don't try to build when Kakoune boots @@ -53,6 +55,8 @@ self: super: { declare-option -hidden str ansi_filter %{'"$out"'/bin/kak-ansi-filter} /^declare-option.* ansi_filter /,/^}/d ' rc/ansi.kak >$out/share/kak/autoload/plugins/ansi.kak + + runHook postInstall ''; meta = with lib; { @@ -76,6 +80,8 @@ declare-option -hidden str ansi_filter %{'"$out"'/bin/kak-ansi-filter} }; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/kak/autoload/plugins/ substitute rc/plumb.kak $out/share/kak/autoload/plugins/plumb.kak \ --replace '9 plumb' '${plan9port}/bin/9 plumb' @@ -83,6 +89,8 @@ declare-option -hidden str ansi_filter %{'"$out"'/bin/kak-ansi-filter} --replace '9 9p' '${plan9port}/bin/9 9p' \ --replace 'kak -p' '${kakoune-unwrapped}/bin/kak -p' chmod +x $out/bin/edit-client + + runHook postInstall ''; meta = with lib; { @@ -180,10 +188,14 @@ declare-option -hidden str ansi_filter %{'"$out"'/bin/kak-ansi-filter} buildInputs = [ lua5_3 ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/kak/autoload/plugins/ cp quickscope.* $out/share/kak/autoload/plugins/ # substituteInPlace does not like the pipe sed -e 's,[|] *lua,|${lua5_3}/bin/lua,' quickscope.kak >$out/share/kak/autoload/plugins/quickscope.kak + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/editors/leo-editor/default.nix b/pkgs/applications/editors/leo-editor/default.nix index 1aa995d880510..41d6cd13d5158 100644 --- a/pkgs/applications/editors/leo-editor/default.nix +++ b/pkgs/applications/editors/leo-editor/default.nix @@ -39,6 +39,8 @@ mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out/share/icons/hicolor/32x32/apps" cp leo/Icons/leoapp32.png "$out/share/icons/hicolor/32x32/apps" @@ -53,6 +55,8 @@ mkDerivation rec { --add-flags "-O $out/share/leo-editor/launchLeo.py" wrapQtApp $out/bin/leo + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/editors/lite/default.nix b/pkgs/applications/editors/lite/default.nix index a58fb9756661d..a7f2b6b609513 100644 --- a/pkgs/applications/editors/lite/default.nix +++ b/pkgs/applications/editors/lite/default.nix @@ -43,10 +43,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib/${pname} cp -a lite $out/lib/${pname} cp -a data $out/lib/${pname} makeWrapper $out/lib/${pname}/lite $out/bin/lite + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/editors/manuskript/default.nix b/pkgs/applications/editors/manuskript/default.nix index 8fa589c13b5d4..4e91f042c4702 100644 --- a/pkgs/applications/editors/manuskript/default.nix +++ b/pkgs/applications/editors/manuskript/default.nix @@ -29,9 +29,13 @@ python3Packages.buildPythonApplication rec { buildPhase = ""; installPhase = '' + runHook preInstall + mkdir -p $out/share/${pname} cp -av bin/ i18n/ libs/ manuskript/ resources/ icons/ $out cp -r sample-projects/ $out/share/${pname} + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/editors/mg/default.nix b/pkgs/applications/editors/mg/default.nix index c54cd01dbf281..c09a0b45d7cae 100644 --- a/pkgs/applications/editors/mg/default.nix +++ b/pkgs/applications/editors/mg/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { makeFlags = [ "PKG_CONFIG=${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config" ]; installPhase = '' + runHook preInstall + install -m 555 -Dt $out/bin mg install -m 444 -Dt $out/share/man/man1 mg.1 + + runHook postInstall ''; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/applications/editors/music/tuxguitar/default.nix b/pkgs/applications/editors/music/tuxguitar/default.nix index a602de8a37b71..6498fe14ae154 100644 --- a/pkgs/applications/editors/music/tuxguitar/default.nix +++ b/pkgs/applications/editors/music/tuxguitar/default.nix @@ -17,6 +17,8 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r dist lib share $out/ cp tuxguitar.sh $out/bin/tuxguitar @@ -29,6 +31,8 @@ in stdenv.mkDerivation rec { --set JAVA "${jre}/bin/java" \ --prefix LD_LIBRARY_PATH : "$out/lib/:${lib.makeLibraryPath [ swt alsa-lib jack2 fluidsynth libpulseaudio ]}" \ --prefix CLASSPATH : "${swt}/jars/swt.jar:$out/lib/tuxguitar.jar:$out/lib/itext.jar" + + runHook postInstall ''; passthru.tests = { inherit (nixosTests) tuxguitar; }; diff --git a/pkgs/applications/editors/nano/nanorc/default.nix b/pkgs/applications/editors/nano/nanorc/default.nix index 5587c2c0243c3..9fa8f6677fdeb 100644 --- a/pkgs/applications/editors/nano/nanorc/default.nix +++ b/pkgs/applications/editors/nano/nanorc/default.nix @@ -17,9 +17,13 @@ in stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share install *.nanorc $out/share/ + + runHook postInstall ''; passthru.updateScript = writeScript "update.sh" '' diff --git a/pkgs/applications/editors/nedit/default.nix b/pkgs/applications/editors/nedit/default.nix index 374c5ee28c84a..6d8af61b9e4fc 100644 --- a/pkgs/applications/editors/nedit/default.nix +++ b/pkgs/applications/editors/nedit/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = "-DBUILD_UNTESTED_NEDIT -L${motif}/lib"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -p source/nedit source/nc $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/editors/oed/default.nix b/pkgs/applications/editors/oed/default.nix index 189dfe345c0dd..4b9f795e2d9ff 100644 --- a/pkgs/applications/editors/oed/default.nix +++ b/pkgs/applications/editors/oed/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -m755 -Dt $out/bin ed install -m644 -Dt $out/share/man/man1 ed.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/editors/scite/default.nix b/pkgs/applications/editors/scite/default.nix index 9c230a2984eb9..ce0c72b4d7cdd 100644 --- a/pkgs/applications/editors/scite/default.nix +++ b/pkgs/applications/editors/scite/default.nix @@ -28,7 +28,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + make install prefix=$out/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index 08cb334796f28..4efd466bac4ad 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -576,7 +576,11 @@ installPhase = let cargoTarget = stdenv.hostPlatform.rust.cargoShortTarget; in '' + runHook preInstall + install -D target/${cargoTarget}/release/libcord.${extension} $out/lib/cord.${extension} + + runHook postInstall ''; }; in @@ -593,7 +597,11 @@ ''; installPhase = '' + runHook preInstall + install -D cord $out/lua/cord.${extension} + + runHook postInstall ''; doInstallCheck = true; @@ -1560,7 +1568,11 @@ ]; preferLocalBuild = true; installPhase = '' + runHook preInstall + install -Dt $out/bin ftplugin/evinceSync.py + + runHook postInstall ''; }; # the vim plugin expects evinceSync.py to be a python file, but it is a C wrapper @@ -1621,8 +1633,12 @@ # remove pre-compiled binaries preBuild = "rm -rf static/*"; installPhase = '' + runHook preInstall + install -Dm 444 -t $out/static static/* install -Dm 444 -t $out/lua lua/* + + runHook postInstall ''; }; in diff --git a/pkgs/applications/editors/vim/plugins/updater.nix b/pkgs/applications/editors/vim/plugins/updater.nix index 00fb8b8dedc54..6dc526966acf5 100644 --- a/pkgs/applications/editors/vim/plugins/updater.nix +++ b/pkgs/applications/editors/vim/plugins/updater.nix @@ -27,6 +27,8 @@ buildPythonApplication { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib cp ${./update.py} $out/bin/vim-plugins-updater cp ${./get-plugins.nix} $out/bin/get-plugins.nix @@ -35,6 +37,8 @@ buildPythonApplication { makeWrapperArgs+=( --prefix PATH : "${lib.makeBinPath [ nix nix-prefetch-git neovim-unwrapped nurl ]}" --prefix PYTHONPATH : "${./.}:${../../../../../maintainers/scripts}" ) wrapPythonPrograms + + runHook postInstall ''; shellHook = '' diff --git a/pkgs/applications/editors/viw/default.nix b/pkgs/applications/editors/viw/default.nix index ad47edfe83e4d..dde2010486443 100644 --- a/pkgs/applications/editors/viw/default.nix +++ b/pkgs/applications/editors/viw/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { checkFlags = [ "test-command" "test-buffer" "test-state" ]; installPhase = '' + runHook preInstall + install -Dm 755 -t $out/bin viw install -Dm 644 -t $out/share/doc/${pname} README.md + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/editors/vscode/extensions/chenglou92.rescript-vscode/rescript-editor-analysis.nix b/pkgs/applications/editors/vscode/extensions/chenglou92.rescript-vscode/rescript-editor-analysis.nix index 7b2452a814bf8..94d87c706e594 100644 --- a/pkgs/applications/editors/vscode/extensions/chenglou92.rescript-vscode/rescript-editor-analysis.nix +++ b/pkgs/applications/editors/vscode/extensions/chenglou92.rescript-vscode/rescript-editor-analysis.nix @@ -34,7 +34,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -D -m0555 rescript-editor-analysis.exe $out/bin/rescript-editor-analysis.exe + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/editors/xxe-pe/default.nix b/pkgs/applications/editors/xxe-pe/default.nix index 6df56b9773bd5..b3b943deb3a83 100644 --- a/pkgs/applications/editors/xxe-pe/default.nix +++ b/pkgs/applications/editors/xxe-pe/default.nix @@ -47,6 +47,8 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p "${pkg_path}" mkdir -p "${pkg_path}" "$out/share/applications" cp -a * "${pkg_path}" @@ -59,6 +61,8 @@ stdenv.mkDerivation rec { mkdir -pv "$out/share/icons/hicolor/$res/apps" mv "$f" "$out/share/icons/hicolor/$res/apps/xxe.png" done; + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/emulators/craftos-pc/default.nix b/pkgs/applications/emulators/craftos-pc/default.nix index 535b50b0f138b..f673700afe64a 100644 --- a/pkgs/applications/emulators/craftos-pc/default.nix +++ b/pkgs/applications/emulators/craftos-pc/default.nix @@ -60,6 +60,8 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib $out/share/craftos $out/include DESTDIR=$out/bin make install cp ./craftos2-lua/src/liblua.so $out/lib @@ -77,6 +79,8 @@ stdenv.mkDerivation rec { mkdir -p $out/share/applications cp resources/linux-icons/CraftOS-PC.desktop $out/share/applications/CraftOS-PC.desktop + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/applications/emulators/darcnes/default.nix b/pkgs/applications/emulators/darcnes/default.nix index 7919e0a9009c3..885f9eeb6c341 100644 --- a/pkgs/applications/emulators/darcnes/default.nix +++ b/pkgs/applications/emulators/darcnes/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { patches = [ ./label.patch ]; buildInputs = [ libX11 libXt libXext libXaw ]; - installPhase = "install -Dt $out/bin darcnes"; + installPhase = "runHook preInstall; install -Dt $out/bin darcnes; runHook postInstall"; meta = { homepage = "https://web.archive.org/web/20130502171725/http://www.dridus.com/~nyef/darcnes/"; diff --git a/pkgs/applications/emulators/dlx/default.nix b/pkgs/applications/emulators/dlx/default.nix index 8230f2b52c9c8..65a8c699ef106 100644 --- a/pkgs/applications/emulators/dlx/default.nix +++ b/pkgs/applications/emulators/dlx/default.nix @@ -13,11 +13,15 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; installPhase = '' + runHook preInstall + mkdir -p $out/include/dlx $out/share/dlx/{examples,doc} $out/bin mv masm mon dasm $out/bin/ mv *.i auto.a $out/include/dlx/ mv *.a *.m $out/share/dlx/examples/ mv README.txt MANUAL.TXT $out/share/dlx/doc/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/emulators/kega-fusion/default.nix b/pkgs/applications/emulators/kega-fusion/default.nix index 9bf359b88ccd0..b37cd4fbc6df3 100644 --- a/pkgs/applications/emulators/kega-fusion/default.nix +++ b/pkgs/applications/emulators/kega-fusion/default.nix @@ -55,6 +55,8 @@ in stdenv.mkDerivation { nativeBuildInputs = [ upx ]; installPhase = '' + runHook preInstall + upx -d Fusion install -Dm755 Fusion "$out/lib/kega-fusion/Fusion" patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "${libPath}" "$out/lib/kega-fusion/Fusion" @@ -66,6 +68,8 @@ in stdenv.mkDerivation { mkdir -p "$out/bin" substitute "$runner" "$out/bin/kega-fusion" --subst-var out chmod +x "$out/bin/kega-fusion" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/emulators/mupen64plus/default.nix b/pkgs/applications/emulators/mupen64plus/default.nix index 81c86eeafecbe..71c173839e366 100644 --- a/pkgs/applications/emulators/mupen64plus/default.nix +++ b/pkgs/applications/emulators/mupen64plus/default.nix @@ -29,7 +29,11 @@ stdenv.mkDerivation rec { dash m64p_build.sh PREFIX="$out" COREDIR="$out/lib/" PLUGINDIR="$out/lib/mupen64plus" SHAREDIR="$out/share/mupen64plus" ''; installPhase = '' + runHook preInstall + dash m64p_install.sh DESTDIR="$out" PREFIX="" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/emulators/oberon-risc-emu/default.nix b/pkgs/applications/emulators/oberon-risc-emu/default.nix index 331473f59fedf..76d0456dd21c7 100644 --- a/pkgs/applications/emulators/oberon-risc-emu/default.nix +++ b/pkgs/applications/emulators/oberon-risc-emu/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation { buildInputs = [ SDL2 ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv risc $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/emulators/simplenes/default.nix b/pkgs/applications/emulators/simplenes/default.nix index 061717d5c6560..e5431df4c3dc5 100644 --- a/pkgs/applications/emulators/simplenes/default.nix +++ b/pkgs/applications/emulators/simplenes/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { buildInputs = [ sfml ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ./SimpleNES $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/emulators/wine/fonts.nix b/pkgs/applications/emulators/wine/fonts.nix index 0ee1b3973d86c..b6ae24a06f89f 100644 --- a/pkgs/applications/emulators/wine/fonts.nix +++ b/pkgs/applications/emulators/wine/fonts.nix @@ -9,7 +9,11 @@ stdenv.mkDerivation { inherit src; installPhase = '' + runHook preInstall + install *.ttf -Dt $out/share/fonts/wine + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/file-managers/mucommander/default.nix b/pkgs/applications/file-managers/mucommander/default.nix index 0a6ca746caee7..b1ddb9681b7c1 100644 --- a/pkgs/applications/file-managers/mucommander/default.nix +++ b/pkgs/applications/file-managers/mucommander/default.nix @@ -40,12 +40,16 @@ stdenv.mkDerivation (finalAttrs: { gradleBuildTask = "tgz"; installPhase = '' + runHook preInstall + mkdir -p $out/share/mucommander tar xvf build/distributions/mucommander-*.tgz --directory=$out/share/mucommander makeWrapper $out/share/mucommander/mucommander.sh $out/bin/mucommander \ --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name} \ --set JAVA_HOME ${jdk} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/file-managers/xplorer/default.nix b/pkgs/applications/file-managers/xplorer/default.nix index 9c3a04e8dde3b..74e934b909f82 100644 --- a/pkgs/applications/file-managers/xplorer/default.nix +++ b/pkgs/applications/file-managers/xplorer/default.nix @@ -43,7 +43,11 @@ let ]; yarnBuildScript = "prebuild"; installPhase = '' + runHook preInstall + cp -r out $out + + runHook postInstall ''; }); in diff --git a/pkgs/applications/gis/gmt/dcw.nix b/pkgs/applications/gis/gmt/dcw.nix index 8c26be6bb2d42..03ca825bd5faa 100644 --- a/pkgs/applications/gis/gmt/dcw.nix +++ b/pkgs/applications/gis/gmt/dcw.nix @@ -9,8 +9,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/dcw-gmt cp -rv ./* $out/share/dcw-gmt + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/gis/gmt/gshhg.nix b/pkgs/applications/gis/gmt/gshhg.nix index 62758c71d594e..451ecea52a265 100644 --- a/pkgs/applications/gis/gmt/gshhg.nix +++ b/pkgs/applications/gis/gmt/gshhg.nix @@ -9,8 +9,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/gshhg-gmt cp -rv ./* $out/share/gshhg-gmt + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/gis/udig/default.nix b/pkgs/applications/gis/udig/default.nix index 264445336cd3d..6779c6948e544 100644 --- a/pkgs/applications/gis/udig/default.nix +++ b/pkgs/applications/gis/udig/default.nix @@ -31,11 +31,15 @@ let nativeBuildInputs = [ unzip makeWrapper ]; installPhase = '' + runHook preInstall + install -dm755 $out/bin $out/opt/udig cp -r . $out/opt/udig makeWrapper $out/opt/udig/udig.sh $out/bin/udig \ --prefix PATH : ${jre8}/bin \ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ libXtst gdal ])} + + runHook postInstall ''; postFixup = '' @@ -56,10 +60,14 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/Applications/udig cp -R . $out/Applications/udig wrapProgram $out/Applications/udig/udig.app/Contents/MacOS/udig_internal \ --prefix DYLD_LIBRARY_PATH : ${lib.makeLibraryPath ([ gdal ])} + + runHook postInstall ''; }; in diff --git a/pkgs/applications/graphics/alchemy/default.nix b/pkgs/applications/graphics/alchemy/default.nix index 2b61004ed0e7a..13ab9b0a7a00c 100644 --- a/pkgs/applications/graphics/alchemy/default.nix +++ b/pkgs/applications/graphics/alchemy/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share cp -a . $out/share/alchemy cat >> $out/bin/alchemy << EOF @@ -20,6 +22,8 @@ stdenv.mkDerivation rec { ${jre}/bin/java -jar Alchemy.jar "$@" EOF chmod +x $out/bin/alchemy + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/graphics/apngasm/2.nix b/pkgs/applications/graphics/apngasm/2.nix index f581f9dd12456..d448aea61998b 100644 --- a/pkgs/applications/graphics/apngasm/2.nix +++ b/pkgs/applications/graphics/apngasm/2.nix @@ -19,7 +19,11 @@ stdenv.mkDerivation rec { NIX_CFLAGS_LINK = "-lzopfli"; installPhase = '' + runHook preInstall + install -Dt $out/bin apngasm + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/applications/graphics/avocode/default.nix b/pkgs/applications/graphics/avocode/default.nix index e9ab276606055..31522f0595619 100644 --- a/pkgs/applications/graphics/avocode/default.nix +++ b/pkgs/applications/graphics/avocode/default.nix @@ -71,6 +71,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + substituteInPlace avocode.desktop.in \ --replace /path/to/avocode-dir/Avocode $out/bin/avocode \ --replace /path/to/avocode-dir/avocode.png avocode @@ -85,6 +87,8 @@ stdenv.mkDerivation rec { mkdir $out/bin ln -s $out/avocode $out/bin/avocode ln -s ${mozjpeg}/bin/cjpeg $out/resources/cjpeg + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/graphics/fluxus/default.nix b/pkgs/applications/graphics/fluxus/default.nix index dfa518c5c5741..2e3de42c57e1f 100644 --- a/pkgs/applications/graphics/fluxus/default.nix +++ b/pkgs/applications/graphics/fluxus/default.nix @@ -63,8 +63,12 @@ stdenv.mkDerivation { sconsFlags+=" Prefix=$out" ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -r build$out/* $out/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/graphics/guetzli/default.nix b/pkgs/applications/graphics/guetzli/default.nix index 945416e3f03d9..a7a7b22aa3849 100644 --- a/pkgs/applications/graphics/guetzli/default.nix +++ b/pkgs/applications/graphics/guetzli/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation { buildInputs = [ libpng ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin install bin/Release/guetzli $out/bin/ + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/graphics/hello-wayland/default.nix b/pkgs/applications/graphics/hello-wayland/default.nix index 97b7da3e0f092..286631060098e 100644 --- a/pkgs/applications/graphics/hello-wayland/default.nix +++ b/pkgs/applications/graphics/hello-wayland/default.nix @@ -20,10 +20,14 @@ stdenv.mkDerivation { buildInputs = [ wayland wayland-protocols ]; installPhase = '' + runHook preInstall + runHook preBuild mkdir -p $out/bin install hello-wayland $out/bin runHook postBuild + + runHook postInstall ''; passthru.updateScript = unstableGitUpdater { }; diff --git a/pkgs/applications/graphics/jpegrescan/default.nix b/pkgs/applications/graphics/jpegrescan/default.nix index 7ec0e478a9b95..95c521247e9f1 100644 --- a/pkgs/applications/graphics/jpegrescan/default.nix +++ b/pkgs/applications/graphics/jpegrescan/default.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/jpegrescan mv README.md $out/share/jpegrescan/ mkdir $out/bin @@ -28,6 +30,8 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/jpegrescan \ --prefix PATH : "${libjpeg_original}/bin:" \ --prefix PERL5LIB : $PERL5LIB + + runHook postInstall ''; propagatedBuildInputs = [ perlPackages.FileSlurp ]; diff --git a/pkgs/applications/graphics/lightburn/default.nix b/pkgs/applications/graphics/lightburn/default.nix index 5877d6a013d5a..91248d0e013a1 100644 --- a/pkgs/applications/graphics/lightburn/default.nix +++ b/pkgs/applications/graphics/lightburn/default.nix @@ -28,9 +28,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share $out/bin cp -ar LightBurn $out/share/LightBurn ln -s $out/share/LightBurn/AppRun $out/bin/LightBurn + + runHook postInstall ''; dontWrapQtApps = true; diff --git a/pkgs/applications/graphics/odafileconverter/default.nix b/pkgs/applications/graphics/odafileconverter/default.nix index ba1d5bdce0738..942f70a371291 100644 --- a/pkgs/applications/graphics/odafileconverter/default.nix +++ b/pkgs/applications/graphics/odafileconverter/default.nix @@ -24,9 +24,13 @@ in mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib cp -vr $sourceRoot/usr/bin/ODAFileConverter_${version} $out/libexec cp -vr $sourceRoot/usr/share $out/share + + runHook postInstall ''; dontWrapQtApps = true; diff --git a/pkgs/applications/graphics/pencil/default.nix b/pkgs/applications/graphics/pencil/default.nix index 4b7b6f9b6a478..3cdefb9fcba52 100644 --- a/pkgs/applications/graphics/pencil/default.nix +++ b/pkgs/applications/graphics/pencil/default.nix @@ -63,6 +63,8 @@ in stdenv.mkDerivation rec { buildInputs = deps; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/opt $out/share/applications cp -R usr/share $out/ cp -R opt/pencil*/ $out/opt/pencil @@ -75,6 +77,8 @@ in stdenv.mkDerivation rec { # symlink the binary to bin/ ln -s $out/opt/pencil/pencil $out/bin/pencil + + runHook postInstall ''; diff --git a/pkgs/applications/graphics/pika/default.nix b/pkgs/applications/graphics/pika/default.nix index e1e5726eb54d3..c976a97399882 100644 --- a/pkgs/applications/graphics/pika/default.nix +++ b/pkgs/applications/graphics/pika/default.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation rec { sourceRoot = "Pika.app"; installPhase = '' + runHook preInstall + mkdir -p "$out/Applications/Pika.app" cp -R . "$out/Applications/Pika.app" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/graphics/pixelnuke/default.nix b/pkgs/applications/graphics/pixelnuke/default.nix index c40a41590b70e..5c26c022aaf5e 100644 --- a/pkgs/applications/graphics/pixelnuke/default.nix +++ b/pkgs/applications/graphics/pixelnuke/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ libevent glew glfw ]; installPhase = '' + runHook preInstall + install -Dm755 ./pixelnuke $out/bin/pixelnuke + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/graphics/pixinsight/default.nix b/pkgs/applications/graphics/pixinsight/default.nix index c034e23d4a78b..b4c72c7cc05d8 100644 --- a/pkgs/applications/graphics/pixinsight/default.nix +++ b/pkgs/applications/graphics/pixinsight/default.nix @@ -136,6 +136,8 @@ stdenv.mkDerivation (finalAttrs: { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/opt/PixInsight $out/share/{applications,mime/packages,icons/hicolor} bwrap --bind /build /build --bind $out/opt /opt --bind /nix /nix --dev /dev fakeroot script -ec "./installer \ @@ -153,6 +155,8 @@ stdenv.mkDerivation (finalAttrs: { # Remove signatures of plugins, as they are only working if actually installed # under /opt. In the Nix setup, they are causing trouble. find $out/opt/PixInsight/ -name "*.xsgn" -exec rm {} \; + + runHook postInstall ''; # Some very exotic Qt libraries are not available in nixpkgs diff --git a/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix b/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix index 05b018215bb1b..24f44f44da00f 100644 --- a/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix +++ b/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix @@ -37,10 +37,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/etc/udev/rules.d cp opt/brother/scanner/udev-rules/type1/NN-brother-mfp-type1.rules \ $out/etc/udev/rules.d/${libsaneUDevRuleNumber}-brother-libsane-type1.rules chmod 644 $out/etc/udev/rules.d/${libsaneUDevRuleNumber}-brother-libsane-type1.rules + + runHook postInstall ''; dontStrip = true; diff --git a/pkgs/applications/graphics/sane/backends/dsseries/default.nix b/pkgs/applications/graphics/sane/backends/dsseries/default.nix index 93e179d867d93..7445e994927cb 100644 --- a/pkgs/applications/graphics/sane/backends/dsseries/default.nix +++ b/pkgs/applications/graphics/sane/backends/dsseries/default.nix @@ -26,9 +26,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -dr etc $out cp -dr usr/lib64 $out/lib + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/applications/graphics/swingsane/default.nix b/pkgs/applications/graphics/swingsane/default.nix index 998c3d2110315..b9c66f98bd8df 100644 --- a/pkgs/applications/graphics/swingsane/default.nix +++ b/pkgs/applications/graphics/swingsane/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation rec { }; in '' + runHook preInstall + install -v -m 755 -d $out/share/java/swingsane/ install -v -m 644 *.jar $out/share/java/swingsane/ @@ -41,6 +43,8 @@ stdenv.mkDerivation rec { install -v -D -m 644 swingsane_512x512.png $out/share/pixmaps/swingsane.png cp -v -r ${desktopItem}/share/applications $out/share + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/graphics/texturepacker/default.nix b/pkgs/applications/graphics/texturepacker/default.nix index 37f07e9657a2d..63287625cd383 100644 --- a/pkgs/applications/graphics/texturepacker/default.nix +++ b/pkgs/applications/graphics/texturepacker/default.nix @@ -31,10 +31,14 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib cp usr/lib/texturepacker/{libGrantlee_Templates.so.5,libHQX.so.1.0.0,libPVRTexLib.so} $out/lib cp usr/lib/texturepacker/TexturePacker $out/bin cp -r usr/share $out + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/graphics/timelapse-deflicker/default.nix b/pkgs/applications/graphics/timelapse-deflicker/default.nix index 511ed8a0134af..ed56a5f1d06fe 100644 --- a/pkgs/applications/graphics/timelapse-deflicker/default.nix +++ b/pkgs/applications/graphics/timelapse-deflicker/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -m755 -D timelapse-deflicker.pl $out/bin/timelapse-deflicker wrapProgram $out/bin/timelapse-deflicker --set PERL5LIB $PERL5LIB + + runHook postInstall ''; nativeBuildInputs = [ makeWrapper ]; diff --git a/pkgs/applications/graphics/unigine-heaven/default.nix b/pkgs/applications/graphics/unigine-heaven/default.nix index 96492ef9e61aa..44f827323907f 100644 --- a/pkgs/applications/graphics/unigine-heaven/default.nix +++ b/pkgs/applications/graphics/unigine-heaven/default.nix @@ -46,6 +46,8 @@ stdenv.mkDerivation installPhase = '' + runHook preInstall + sh $src --target $name mkdir -p $out/lib/unigine/heaven/bin @@ -73,6 +75,8 @@ stdenv.mkDerivation done ln -s ${desktopItem}/share/applications/* $out/share/applications + + runHook postInstall ''; nativeBuildInputs = diff --git a/pkgs/applications/graphics/unigine-superposition/default.nix b/pkgs/applications/graphics/unigine-superposition/default.nix index 926fe1a1d744c..3dfa3c361cb49 100644 --- a/pkgs/applications/graphics/unigine-superposition/default.nix +++ b/pkgs/applications/graphics/unigine-superposition/default.nix @@ -65,6 +65,8 @@ let ]; installPhase = '' + runHook preInstall + bash $src --target $name --noexec mkdir -p $out/bin $out/lib/unigine/superposition/ cp -r $name/* $out/lib/unigine/superposition/ @@ -73,6 +75,8 @@ let wrapProgram $out/lib/unigine/superposition/Superposition \ --set QT_XKB_CONFIG_ROOT ${xkeyboard_config} \ --run "cd $out/lib/unigine/superposition/" + + runHook postInstall ''; dontUnpack = true; diff --git a/pkgs/applications/graphics/wings/default.nix b/pkgs/applications/graphics/wings/default.nix index 85237c94846a0..d96975fd7f560 100644 --- a/pkgs/applications/graphics/wings/default.nix +++ b/pkgs/applications/graphics/wings/default.nix @@ -33,6 +33,8 @@ stdenv.mkDerivation rec { # I did not test the *cl* part. I added the -pa just by imitation. installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib/wings-${version}/ebin cp ebin/* $out/lib/wings-${version}/ebin cp -R textures shaders plugins $out/lib/wings-${version} @@ -42,6 +44,8 @@ stdenv.mkDerivation rec { -pa $out/lib/wings-${version}/ebin -run wings_start start_halt "$@" EOF chmod +x $out/bin/wings + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/graphics/write_stylus/default.nix b/pkgs/applications/graphics/write_stylus/default.nix index be20635c50018..0a8616f4e6118 100644 --- a/pkgs/applications/graphics/write_stylus/default.nix +++ b/pkgs/applications/graphics/write_stylus/default.nix @@ -24,6 +24,8 @@ mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -R Write $out/ # symlink the binary to bin/ @@ -34,6 +36,8 @@ mkDerivation rec { ln -s ${desktopItem}/share/applications/* $out/share/applications/ mkdir -p $out/share/icons ln -s $out/Write/Write144x144.png $out/share/icons/write_stylus.png + + runHook postInstall ''; preFixup = let libPath = lib.makeLibraryPath [ diff --git a/pkgs/applications/graphics/xlife/default.nix b/pkgs/applications/graphics/xlife/default.nix index 482134269d2b2..61998d31ff96f 100644 --- a/pkgs/applications/graphics/xlife/default.nix +++ b/pkgs/applications/graphics/xlife/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation { hardeningDisable = [ "format" ]; installPhase = '' + runHook preInstall + install -Dm755 xlife -t $out/bin install -Dm755 lifeconv -t $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/graphics/xmountains/default.nix b/pkgs/applications/graphics/xmountains/default.nix index d7c70f18b5b62..65bfb4e78f594 100644 --- a/pkgs/applications/graphics/xmountains/default.nix +++ b/pkgs/applications/graphics/xmountains/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { buildInputs = [ xorg.xbitmaps xorg.libX11 ]; nativeBuildInputs = with xorg; [ imake gccmakedep ]; - installPhase = "install -Dm755 xmountains -t $out/bin"; + installPhase = "runHook preInstall; install -Dm755 xmountains -t $out/bin; runHook postInstall"; meta = with lib; { description = "X11 based fractal landscape generator"; diff --git a/pkgs/applications/graphics/zgrviewer/default.nix b/pkgs/applications/graphics/zgrviewer/default.nix index 980e631ad41f5..38fd5b63ffb57 100644 --- a/pkgs/applications/graphics/zgrviewer/default.nix +++ b/pkgs/applications/graphics/zgrviewer/default.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { buildInputs = [jre]; buildPhase = ""; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,share/java/zvtm/plugins,share/doc/zvtm} cp overview.html *.license.* "$out/share/doc/zvtm" @@ -19,6 +21,8 @@ stdenv.mkDerivation rec { echo '#!${runtimeShell}' > "$out/bin/zgrviewer" echo "${jre}/bin/java -jar '$out/share/java/zvtm/zgrviewer-${version}.jar' \"\$@\"" >> "$out/bin/zgrviewer" chmod a+x "$out/bin/zgrviewer" + + runHook postInstall ''; meta = { # Quicker to unpack locally than load Hydra diff --git a/pkgs/applications/graphics/zgv/default.nix b/pkgs/applications/graphics/zgv/default.nix index 8df5e82622494..4971a8efa79d7 100644 --- a/pkgs/applications/graphics/zgv/default.nix +++ b/pkgs/applications/graphics/zgv/default.nix @@ -28,8 +28,12 @@ stdenv.mkDerivation rec { patchFlags = [ "-p0" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp src/zgv $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/1password-gui/darwin.nix b/pkgs/applications/misc/1password-gui/darwin.nix index 66af74630c34d..2a0f92e78c2ac 100644 --- a/pkgs/applications/misc/1password-gui/darwin.nix +++ b/pkgs/applications/misc/1password-gui/darwin.nix @@ -24,8 +24,12 @@ stdenv.mkDerivation { sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/Applications cp -r *.app $out/Applications + + runHook postInstall ''; # 1Password is notarized. diff --git a/pkgs/applications/misc/ape/clex.nix b/pkgs/applications/misc/ape/clex.nix index a98695dab6825..935479dd1af6a 100644 --- a/pkgs/applications/misc/ape/clex.nix +++ b/pkgs/applications/misc/ape/clex.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out cp clex_lexicon.pl $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/ape/default.nix b/pkgs/applications/misc/ape/default.nix index e50d766a88b2b..7df8a37578c95 100644 --- a/pkgs/applications/misc/ape/default.nix +++ b/pkgs/applications/misc/ape/default.nix @@ -32,9 +32,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ape.exe $out makeWrapper $out/ape.exe $out/bin/ape --add-flags ace + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/asciiquarium/default.nix b/pkgs/applications/misc/asciiquarium/default.nix index 0ab79bb2134ab..27f9a34d8190f 100644 --- a/pkgs/applications/misc/asciiquarium/default.nix +++ b/pkgs/applications/misc/asciiquarium/default.nix @@ -13,11 +13,15 @@ in stdenv.mkDerivation { buildInputs = [ perlPackages.perl ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp asciiquarium $out/bin chmod +x $out/bin/asciiquarium wrapProgram $out/bin/asciiquarium \ --set PERL5LIB ${perlPackages.makeFullPerlPath [ perlPackages.TermAnimation ] } + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/audio/wavrsocvt/default.nix b/pkgs/applications/misc/audio/wavrsocvt/default.nix index 7b805496c2d8c..0016d81730930 100644 --- a/pkgs/applications/misc/audio/wavrsocvt/default.nix +++ b/pkgs/applications/misc/audio/wavrsocvt/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp wavrsocvt $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/bashSnippets/default.nix b/pkgs/applications/misc/bashSnippets/default.nix index f0f82a6f626cd..7f38d9ec73f56 100644 --- a/pkgs/applications/misc/bashSnippets/default.nix +++ b/pkgs/applications/misc/bashSnippets/default.nix @@ -34,11 +34,15 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p "$out"/bin "$out"/share/man/man1 ./install.sh all for file in "$out"/bin/*; do wrapProgram "$file" --prefix PATH : "${deps}" done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/bklk/default.nix b/pkgs/applications/misc/bklk/default.nix index a62eed5f8e1bc..a611c7c55b00a 100644 --- a/pkgs/applications/misc/bklk/default.nix +++ b/pkgs/applications/misc/bklk/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bklk $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/blender/wrapper.nix b/pkgs/applications/misc/blender/wrapper.nix index 8b5e8916a1388..c8a11ddd70f2f 100644 --- a/pkgs/applications/misc/blender/wrapper.nix +++ b/pkgs/applications/misc/blender/wrapper.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ blender.pythonPackages.wrapPython makeWrapper ]; installPhase = '' + runHook preInstall + mkdir $out/{share/applications,bin} -p sed 's/Exec=blender/Exec=${finalAttrs.finalPackage.pname}/g' $src/share/applications/blender.desktop > $out/share/applications/${finalAttrs.finalPackage.pname}.desktop cp -r $src/share/blender $out/share @@ -22,6 +24,8 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper ${blender}/bin/blender $out/bin/${finalAttrs.finalPackage.pname} \ --prefix PATH : $program_PATH \ --prefix PYTHONPATH : $program_PYTHONPATH + + runHook postInstall ''; pythonPath = extraModules; diff --git a/pkgs/applications/misc/bluetooth_battery/default.nix b/pkgs/applications/misc/bluetooth_battery/default.nix index 4158cdf8cc559..84f432f0d96cf 100644 --- a/pkgs/applications/misc/bluetooth_battery/default.nix +++ b/pkgs/applications/misc/bluetooth_battery/default.nix @@ -16,8 +16,12 @@ buildPythonApplication rec { format = "other"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp $src/bluetooth_battery.py $out/bin/bluetooth_battery + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/cataract/build.nix b/pkgs/applications/misc/cataract/build.nix index 860a49b5ce03e..b07655678a4c1 100644 --- a/pkgs/applications/misc/cataract/build.nix +++ b/pkgs/applications/misc/cataract/build.nix @@ -33,8 +33,12 @@ stdenv.mkDerivation { env.NIX_CFLAGS_COMPILE = "-fcommon"; installPhase = '' + runHook preInstall + mkdir $out/{bin,share} -p cp src/cgg{,-dirgen} $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/cura/plugins.nix b/pkgs/applications/misc/cura/plugins.nix index 12f7920d3bf72..c098706d941ad 100644 --- a/pkgs/applications/misc/cura/plugins.nix +++ b/pkgs/applications/misc/cura/plugins.nix @@ -20,8 +20,12 @@ let ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/cura/plugins/OctoPrintPlugin cp -rv . $out/lib/cura/plugins/OctoPrintPlugin/ + + runHook postInstall ''; meta = with lib; { @@ -59,8 +63,12 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib/cura/plugins/RawMouse cp -rv . $out/lib/cura/plugins/RawMouse/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/curaengine/stable.nix b/pkgs/applications/misc/curaengine/stable.nix index 0de7e18f172d7..1d7d64db7c884 100644 --- a/pkgs/applications/misc/curaengine/stable.nix +++ b/pkgs/applications/misc/curaengine/stable.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp build/CuraEngine $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/deco/default.nix b/pkgs/applications/misc/deco/default.nix index 5efa22e8843c9..55b60d4c746a7 100644 --- a/pkgs/applications/misc/deco/default.nix +++ b/pkgs/applications/misc/deco/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${pname} $out/bin chmod +x $out/bin/${pname} + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/misc/devilspie2/default.nix b/pkgs/applications/misc/devilspie2/default.nix index 830bfd19471a2..8fae2a575448c 100644 --- a/pkgs/applications/misc/devilspie2/default.nix +++ b/pkgs/applications/misc/devilspie2/default.nix @@ -13,9 +13,13 @@ stdenv.mkDerivation rec { buildInputs = [ glib gtk lua libwnck ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man/man1 cp bin/devilspie2 $out/bin cp devilspie2.1 $out/share/man/man1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/diffpdf/default.nix b/pkgs/applications/misc/diffpdf/default.nix index 98f85807806d9..cfd4285dc6486 100644 --- a/pkgs/applications/misc/diffpdf/default.nix +++ b/pkgs/applications/misc/diffpdf/default.nix @@ -26,6 +26,8 @@ mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man/man1 install -Dpm755 -D diffpdf $out/bin/diffpdf @@ -46,7 +48,9 @@ mkDerivation rec { Exec=$out/bin/diffpdf Terminal=false EOF - ''; + + runHook postInstall + ''; meta = { homepage = "http://www.qtrac.eu/diffpdfc.html"; diff --git a/pkgs/applications/misc/ding/default.nix b/pkgs/applications/misc/ding/default.nix index d0791b492f09f..52c5a85456aa5 100644 --- a/pkgs/applications/misc/ding/default.nix +++ b/pkgs/applications/misc/ding/default.nix @@ -24,6 +24,8 @@ stdenv.mkDerivation rec { patches = [ ./dict.patch ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/dict mkdir -p $out/share/man/man1 @@ -45,6 +47,8 @@ stdenv.mkDerivation rec { cp -v ding.desktop $out/share/applications/ wrapProgram $out/bin/ding --prefix PATH : ${lib.makeBinPath [ gnugrep aspellEnv tk fortune ]} --prefix ASPELL_CONF : "\"prefix ${aspellEnv};\"" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/dwmbar/default.nix b/pkgs/applications/misc/dwmbar/default.nix index 3f7e9c821a2ed..da90bfb7a8e6d 100644 --- a/pkgs/applications/misc/dwmbar/default.nix +++ b/pkgs/applications/misc/dwmbar/default.nix @@ -20,11 +20,15 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -d $out/share/dwmbar cp -r modules $out/share/dwmbar/ install -D -t $out/share/dwmbar/ config install -D -t $out/share/dwmbar/ bar.sh install -Dm755 -t $out/bin/ dwmbar + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/emem/default.nix b/pkgs/applications/misc/emem/default.nix index 043be629fd28e..1661b096e55e0 100644 --- a/pkgs/applications/misc/emem/default.nix +++ b/pkgs/applications/misc/emem/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cp $src $out/share/java/${pname}.jar cat > $out/bin/${pname} << EOF @@ -26,6 +28,8 @@ $jdk/bin/java -jar $out/share/java/${pname}.jar "\$@" EOF chmod +x $out/bin/${pname} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/et/default.nix b/pkgs/applications/misc/et/default.nix index de47efc07ef51..9f408634b1eb7 100644 --- a/pkgs/applications/misc/et/default.nix +++ b/pkgs/applications/misc/et/default.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp et $out/bin cp et-status.sh $out/bin/et-status + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/ff2mpv/default.nix b/pkgs/applications/misc/ff2mpv/default.nix index 27fd0ce892f7e..1210292ab12e2 100644 --- a/pkgs/applications/misc/ff2mpv/default.nix +++ b/pkgs/applications/misc/ff2mpv/default.nix @@ -20,9 +20,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib/mozilla/native-messaging-hosts cp ff2mpv.py $out/bin cp ff2mpv.json $out/lib/mozilla/native-messaging-hosts + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/misc/fluidd/default.nix b/pkgs/applications/misc/fluidd/default.nix index 1741e5f2d3254..10e1924b0cc10 100644 --- a/pkgs/applications/misc/fluidd/default.nix +++ b/pkgs/applications/misc/fluidd/default.nix @@ -21,8 +21,12 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/fluidd cp -r fluidd $out/share/fluidd/htdocs + + runHook postInstall ''; passthru.tests = { inherit (nixosTests) fluidd; }; diff --git a/pkgs/applications/misc/fusee-interfacee-tk/default.nix b/pkgs/applications/misc/fusee-interfacee-tk/default.nix index a7e19ed8af572..cb30fe13117c5 100644 --- a/pkgs/applications/misc/fusee-interfacee-tk/default.nix +++ b/pkgs/applications/misc/fusee-interfacee-tk/default.nix @@ -16,6 +16,8 @@ in stdenv.mkDerivation rec { buildInputs = [ pythonEnv ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin # The program isn't just called app, so I'm renaming it based on the repo name @@ -27,6 +29,8 @@ in stdenv.mkDerivation rec { # app.py depends on these to run cp *.py $out/bin/ cp intermezzo.bin $out/bin/intermezzo.bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/ganttproject-bin/default.nix b/pkgs/applications/misc/ganttproject-bin/default.nix index 0ea873da8477e..60894c0d6899d 100644 --- a/pkgs/applications/misc/ganttproject-bin/default.nix +++ b/pkgs/applications/misc/ganttproject-bin/default.nix @@ -32,6 +32,8 @@ stdenv.mkDerivation rec { ]; in '' + runHook preInstall + mkdir -pv "$out/share/ganttproject" cp -rv * "$out/share/ganttproject" @@ -43,6 +45,8 @@ stdenv.mkDerivation rec { mv -v "$out/share/ganttproject/ganttproject" "$out/bin" cp -rv "${desktopItem}/share/applications" "$out/share" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/gpsbabel/default.nix b/pkgs/applications/misc/gpsbabel/default.nix index fbacfb6984c6e..4c97aa9a603b9 100644 --- a/pkgs/applications/misc/gpsbabel/default.nix +++ b/pkgs/applications/misc/gpsbabel/default.nix @@ -68,6 +68,8 @@ stdenv.mkDerivation rec { dontWrapQtApps = true; installPhase = '' + runHook preInstall + install -Dm755 gpsbabel -t $out/bin '' + lib.optionalString withGUI (if stdenv.isDarwin then '' mkdir -p $out/Applications @@ -82,6 +84,8 @@ stdenv.mkDerivation rec { '') + lib.optionalString withDoc '' install -Dm655 gpsbabel.{html,pdf} -t $doc/share/doc/gpsbabel cp -r html $doc/share/doc/gpsbabel + + runHook postInstall ''; postFixup = lib.optionalString withGUI (if stdenv.isDarwin then '' diff --git a/pkgs/applications/misc/gpu-burn/default.nix b/pkgs/applications/misc/gpu-burn/default.nix index 97d6b674d5e57..cce99133994f8 100644 --- a/pkgs/applications/misc/gpu-burn/default.nix +++ b/pkgs/applications/misc/gpu-burn/default.nix @@ -26,9 +26,13 @@ stdenv.mkDerivation { LDFLAGS = "-L${cudatoolkit}/lib/stubs"; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share} cp gpu_burn $out/bin/ cp compare.ptx $out/share/ + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/misc/green-pdfviewer/default.nix b/pkgs/applications/misc/green-pdfviewer/default.nix index 9c3c8c95872ee..80b18a8e3d3a8 100644 --- a/pkgs/applications/misc/green-pdfviewer/default.nix +++ b/pkgs/applications/misc/green-pdfviewer/default.nix @@ -23,8 +23,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man1 make install PREFIX=$out MANDIR=$out/share + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/hello-unfree/default.nix b/pkgs/applications/misc/hello-unfree/default.nix index 7ff71814fb5eb..a091c2af82bfb 100644 --- a/pkgs/applications/misc/hello-unfree/default.nix +++ b/pkgs/applications/misc/hello-unfree/default.nix @@ -7,12 +7,16 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cat > $out/bin/hello-unfree << EOF #!${runtimeShell} echo "Hello, you are running an unfree system!" EOF chmod +x $out/bin/hello-unfree + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/misc/holochain-launcher/default.nix b/pkgs/applications/misc/holochain-launcher/default.nix index b438f6c6d5dfc..b312c014c765d 100644 --- a/pkgs/applications/misc/holochain-launcher/default.nix +++ b/pkgs/applications/misc/holochain-launcher/default.nix @@ -38,8 +38,12 @@ stdenv.mkDerivation rec { unpackCmd = "dpkg-deb -x $curSrc source"; installPhase = '' + runHook preInstall + mv usr $out mv $out/bin/holochain-launcher-${prerelease} $out/bin/holochain-launcher + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/applications/misc/houdini/runtime-build.nix b/pkgs/applications/misc/houdini/runtime-build.nix index 1c3083ebb7389..33309b71579c3 100644 --- a/pkgs/applications/misc/houdini/runtime-build.nix +++ b/pkgs/applications/misc/houdini/runtime-build.nix @@ -5,6 +5,8 @@ stdenv.mkDerivation { buildInputs = [ bc ]; installPhase = '' + runHook preInstall + patchShebangs houdini.install mkdir -p $out ./houdini.install --install-houdini \ @@ -16,6 +18,8 @@ stdenv.mkDerivation { --accept-EULA ${eulaDate} \ $out echo "licensingMode = localValidator" >> $out/houdini/Licensing.opt # does not seem to do anything any more. not sure, official docs do not say anything about it + + runHook postInstall ''; dontFixup = true; diff --git a/pkgs/applications/misc/hubstaff/default.nix b/pkgs/applications/misc/hubstaff/default.nix index d4c199d48939a..9fb8ed30aece0 100644 --- a/pkgs/applications/misc/hubstaff/default.nix +++ b/pkgs/applications/misc/hubstaff/default.nix @@ -36,6 +36,8 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + # remove files for 32-bit arch to skip building for this arch # but add -f flag to not fail if files were not found (new versions dont provide 32-bit arch) rm -rf x86 x86_64/lib64 @@ -53,6 +55,8 @@ stdenv.mkDerivation { # Why is this needed? SEGV otherwise. ln -s $opt/data/resources $opt/x86_64/resources + + runHook postInstall ''; # to test run: diff --git a/pkgs/applications/misc/ipmicfg/default.nix b/pkgs/applications/misc/ipmicfg/default.nix index 91dc01060099c..b2a0a40db3e6d 100644 --- a/pkgs/applications/misc/ipmicfg/default.nix +++ b/pkgs/applications/misc/ipmicfg/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" "$out/opt/ipmicfg" cp Linux/64bit/* "$out/opt/ipmicfg" @@ -20,6 +22,8 @@ stdenv.mkDerivation rec { "$out/opt/ipmicfg/IPMICFG-Linux.x86_64" ln -s "$out/opt/ipmicfg/IPMICFG-Linux.x86_64" "$out/bin/ipmicfg" + + runHook postInstall ''; dontPatchShebangs = true; # There are no scripts and it complains about null bytes. diff --git a/pkgs/applications/misc/joplin-desktop/default.nix b/pkgs/applications/misc/joplin-desktop/default.nix index 2118d623cd226..2720436c7c7bb 100644 --- a/pkgs/applications/misc/joplin-desktop/default.nix +++ b/pkgs/applications/misc/joplin-desktop/default.nix @@ -69,8 +69,12 @@ let sourceRoot = "Joplin.app"; installPhase = '' + runHook preInstall + mkdir -p $out/Applications/Joplin.app cp -R . $out/Applications/Joplin.app + + runHook postInstall ''; }; in diff --git a/pkgs/applications/misc/jotta-cli/default.nix b/pkgs/applications/misc/jotta-cli/default.nix index 4130f7867a75f..a7cea0fcc78f8 100644 --- a/pkgs/applications/misc/jotta-cli/default.nix +++ b/pkgs/applications/misc/jotta-cli/default.nix @@ -13,8 +13,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D usr/bin/jotta-cli usr/bin/jottad -t $out/bin/ mkdir -p $out/share/bash-completion/completions + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/misc/k2pdfopt/default.nix b/pkgs/applications/misc/k2pdfopt/default.nix index 32a0e31a315b2..76a7da6356e89 100644 --- a/pkgs/applications/misc/k2pdfopt/default.nix +++ b/pkgs/applications/misc/k2pdfopt/default.nix @@ -169,7 +169,11 @@ in stdenv.mkDerivation rec { NIX_LDFLAGS = "-lpthread"; installPhase = '' + runHook preInstall + install -D -m 755 k2pdfopt $out/bin/k2pdfopt + + runHook postInstall ''; preFixup = lib.optionalString enableTesseract '' diff --git a/pkgs/applications/misc/k40-whisperer/default.nix b/pkgs/applications/misc/k40-whisperer/default.nix index 5893ceb920f5b..594a28866f1e7 100644 --- a/pkgs/applications/misc/k40-whisperer/default.nix +++ b/pkgs/applications/misc/k40-whisperer/default.nix @@ -41,6 +41,8 @@ in stdenv.mkDerivation rec { buildPhase = ""; installPhase = '' + runHook preInstall + mkdir -p $out cp -p * $out @@ -52,6 +54,8 @@ in stdenv.mkDerivation rec { makeWrapper '${pythonEnv.interpreter}' $out/bin/k40-whisperer \ --add-flags $out/k40_whisperer.py \ --prefix PYTHONPATH : $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/keepass-plugins/charactercopy/default.nix b/pkgs/applications/misc/keepass-plugins/charactercopy/default.nix index dbe203566f09c..cd68d9ef455cd 100644 --- a/pkgs/applications/misc/keepass-plugins/charactercopy/default.nix +++ b/pkgs/applications/misc/keepass-plugins/charactercopy/default.nix @@ -14,8 +14,12 @@ let dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib/dotnet/keepass/ cp $src $out/lib/dotnet/keepass/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/keepass-plugins/keeagent/default.nix b/pkgs/applications/misc/keepass-plugins/keeagent/default.nix index 7dc75f604265c..bb9ac570c4eb5 100644 --- a/pkgs/applications/misc/keepass-plugins/keeagent/default.nix +++ b/pkgs/applications/misc/keepass-plugins/keeagent/default.nix @@ -23,8 +23,12 @@ let pluginFilename = "KeeAgent.plgx"; installPhase = '' + runHook preInstall + mkdir -p $out/lib/dotnet/keepass/ cp $pluginFilename $out/lib/dotnet/keepass/$pluginFilename + + runHook postInstall ''; }; in diff --git a/pkgs/applications/misc/keepass-plugins/keepasshttp/default.nix b/pkgs/applications/misc/keepass-plugins/keepasshttp/default.nix index be58f0e34cb3e..24f52102792da 100644 --- a/pkgs/applications/misc/keepass-plugins/keepasshttp/default.nix +++ b/pkgs/applications/misc/keepass-plugins/keepasshttp/default.nix @@ -25,8 +25,12 @@ let pluginFilename = "KeePassHttp.plgx"; installPhase = '' + runHook preInstall + mkdir -p $out/lib/dotnet/keepass/ cp $pluginFilename $out/lib/dotnet/keepass/$pluginFilename + + runHook postInstall ''; }; in diff --git a/pkgs/applications/misc/keepass-plugins/keepassrpc/default.nix b/pkgs/applications/misc/keepass-plugins/keepassrpc/default.nix index 0cd8d6b7ed80f..dd5b54b287f97 100644 --- a/pkgs/applications/misc/keepass-plugins/keepassrpc/default.nix +++ b/pkgs/applications/misc/keepass-plugins/keepassrpc/default.nix @@ -20,8 +20,12 @@ let dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib/dotnet/keepass/ cp $src $out/lib/dotnet/keepass/ + + runHook postInstall ''; }; in diff --git a/pkgs/applications/misc/keepass-plugins/keetraytotp/default.nix b/pkgs/applications/misc/keepass-plugins/keetraytotp/default.nix index 52cd719ca5834..d77be581946b7 100644 --- a/pkgs/applications/misc/keepass-plugins/keetraytotp/default.nix +++ b/pkgs/applications/misc/keepass-plugins/keetraytotp/default.nix @@ -14,8 +14,12 @@ let dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib/dotnet/keepass/ cp $src $out/lib/dotnet/keepass/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/keepass-plugins/otpkeyprov/default.nix b/pkgs/applications/misc/keepass-plugins/otpkeyprov/default.nix index abed55d91593a..e3b69f495a40a 100644 --- a/pkgs/applications/misc/keepass-plugins/otpkeyprov/default.nix +++ b/pkgs/applications/misc/keepass-plugins/otpkeyprov/default.nix @@ -23,8 +23,12 @@ let pluginFilename = "OtpKeyProv.plgx"; installPhase = '' + runHook preInstall + mkdir -p $out/lib/dotnet/keepass/ cp $pluginFilename $out/lib/dotnet/keepass/$pluginFilename + + runHook postInstall ''; }; in diff --git a/pkgs/applications/misc/keepass-plugins/qrcodeview/default.nix b/pkgs/applications/misc/keepass-plugins/qrcodeview/default.nix index 8e7ee2a49905d..995862f662590 100644 --- a/pkgs/applications/misc/keepass-plugins/qrcodeview/default.nix +++ b/pkgs/applications/misc/keepass-plugins/qrcodeview/default.nix @@ -14,8 +14,12 @@ let dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib/dotnet/keepass/ cp $src $out/lib/dotnet/keepass/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/koreader/default.nix b/pkgs/applications/misc/koreader/default.nix index d03b005d0b468..4ac92c148001a 100644 --- a/pkgs/applications/misc/koreader/default.nix +++ b/pkgs/applications/misc/koreader/default.nix @@ -49,6 +49,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -R usr/* $out/ ln -sf ${luajit_lua52}/bin/luajit $out/lib/koreader/luajit @@ -59,6 +61,8 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/koreader --prefix LD_LIBRARY_PATH : ${ lib.makeLibraryPath [ gtk3-x11 SDL2 glib stdenv.cc.cc.lib ] } + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/llpp/default.nix b/pkgs/applications/misc/llpp/default.nix index db089796222cb..c03432da02ad3 100644 --- a/pkgs/applications/misc/llpp/default.nix +++ b/pkgs/applications/misc/llpp/default.nix @@ -53,6 +53,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -d $out/bin install build/llpp $out/bin install misc/llpp.inotify $out/bin/llpp.inotify @@ -65,6 +67,8 @@ stdenv.mkDerivation rec { --prefix PATH ":" "$out/bin" \ --prefix PATH ":" "${inotify-tools}/bin" \ --prefix PATH ":" "${procps}/bin" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/ltwheelconf/default.nix b/pkgs/applications/misc/ltwheelconf/default.nix index b9c53a58b03de..0afbfc1ecec96 100644 --- a/pkgs/applications/misc/ltwheelconf/default.nix +++ b/pkgs/applications/misc/ltwheelconf/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation { buildInputs = [ libusb1 ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ltwheelconf $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/memo/default.nix b/pkgs/applications/misc/memo/default.nix index c6d9c58b0ad62..8b5029a8f3a9b 100644 --- a/pkgs/applications/misc/memo/default.nix +++ b/pkgs/applications/misc/memo/default.nix @@ -24,6 +24,8 @@ stdenv.mkDerivation rec { else "#pandoc_cmd=pandoc"; in '' + runHook preInstall + mkdir -p $out/{bin,share/man/man1,share/bash-completion/completions,share/zsh/site-functions} substituteInPlace memo \ --replace "ack_cmd=ack" "ack_cmd=${silver-searcher}/bin/ag" \ @@ -35,6 +37,8 @@ stdenv.mkDerivation rec { mv doc/memo.1 $out/share/man/man1/memo.1 mv completion/bash/memo.sh $out/share/bash-completion/completions/memo.sh mv completion/zsh/_memo $out/share/zsh/site-functions/_memo + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/misc/mencal/default.nix b/pkgs/applications/misc/mencal/default.nix index 011db7455fcf2..0d80dd53a3b12 100644 --- a/pkgs/applications/misc/mencal/default.nix +++ b/pkgs/applications/misc/mencal/default.nix @@ -10,8 +10,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp mencal $out/bin/ + + runHook postInstall ''; buildInputs = [ perl ]; diff --git a/pkgs/applications/misc/milu/default.nix b/pkgs/applications/misc/milu/default.nix index 333d58d500c83..0f4b40de78bc9 100644 --- a/pkgs/applications/misc/milu/default.nix +++ b/pkgs/applications/misc/milu/default.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bin/milu $out/bin + + runHook postInstall ''; nativeBuildInputs = [ pkg-config unzip ]; diff --git a/pkgs/applications/misc/monitorcontrol/default.nix b/pkgs/applications/misc/monitorcontrol/default.nix index db112415fda85..58fa776b07b44 100644 --- a/pkgs/applications/misc/monitorcontrol/default.nix +++ b/pkgs/applications/misc/monitorcontrol/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { sourceRoot = "MonitorControl.app"; installPhase = '' + runHook preInstall + mkdir -p "$out/Applications/MonitorControl.app" cp -R . "$out/Applications/MonitorControl.app" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/nanoblogger/default.nix b/pkgs/applications/misc/nanoblogger/default.nix index 102991f002566..d2949d17d787d 100644 --- a/pkgs/applications/misc/nanoblogger/default.nix +++ b/pkgs/applications/misc/nanoblogger/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { buildInputs = [ ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r * $out cat > $out/bin/nb << EOF @@ -19,6 +21,8 @@ stdenv.mkDerivation rec { $out/nb "\$@" EOF chmod 755 $out/bin/nb + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/misc/natural-docs/default.nix b/pkgs/applications/misc/natural-docs/default.nix index 7b614fe359dd5..19f9beb713f21 100644 --- a/pkgs/applications/misc/natural-docs/default.nix +++ b/pkgs/applications/misc/natural-docs/default.nix @@ -16,9 +16,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r . $out/ makeWrapper ${mono}/bin/mono $out/bin/NaturalDocs --add-flags "$out/NaturalDocs.exe" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/nerd-font-patcher/default.nix b/pkgs/applications/misc/nerd-font-patcher/default.nix index b4479f10309ee..0bdd9c5e97e9a 100644 --- a/pkgs/applications/misc/nerd-font-patcher/default.nix +++ b/pkgs/applications/misc/nerd-font-patcher/default.nix @@ -25,10 +25,14 @@ python3Packages.buildPythonApplication rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share $out/lib install -Dm755 font-patcher $out/bin/nerd-font-patcher cp -ra src/glyphs $out/share/ cp -ra bin/scripts/name_parser $out/lib/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/nix-tour/default.nix b/pkgs/applications/misc/nix-tour/default.nix index bde9e099a7276..8ebcdd401db3f 100644 --- a/pkgs/applications/misc/nix-tour/default.nix +++ b/pkgs/applications/misc/nix-tour/default.nix @@ -22,10 +22,14 @@ stdenv.mkDerivation rec { buildInputs = [ electron ]; installPhase = '' + runHook preInstall + install -d $out/bin $out/share/nix-tour cp -R * $out/share/nix-tour makeWrapper ${electron}/bin/electron $out/bin/nix-tour \ --add-flags $out/share/nix-tour/electron-main.js + + runHook postInstall ''; desktopItems = [ diff --git a/pkgs/applications/misc/notesnook/default.nix b/pkgs/applications/misc/notesnook/default.nix index 82ade89882a1b..28e1e4f028922 100644 --- a/pkgs/applications/misc/notesnook/default.nix +++ b/pkgs/applications/misc/notesnook/default.nix @@ -69,8 +69,12 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/Applications/Notesnook.app cp -R . $out/Applications/Notesnook.app + + runHook postInstall ''; }; in diff --git a/pkgs/applications/misc/omegat.nix b/pkgs/applications/misc/omegat.nix index 48756794b94f8..2288e20696e74 100644 --- a/pkgs/applications/misc/omegat.nix +++ b/pkgs/applications/misc/omegat.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation { unpackCmd = "unzip -o $curSrc"; # tries to go interactive without -o installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r lib docs images plugins scripts *.txt *.html OmegaT.jar $out/ @@ -23,6 +25,8 @@ stdenv.mkDerivation { exec ${jdk}/bin/java -jar -Xmx1024M $out/OmegaT.jar "\$@" EOF chmod +x $out/bin/omegat + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/onboard/default.nix b/pkgs/applications/misc/onboard/default.nix index d6c7da1ffefbd..0c1f6236dd8dd 100644 --- a/pkgs/applications/misc/onboard/default.nix +++ b/pkgs/applications/misc/onboard/default.nix @@ -159,10 +159,14 @@ python3.pkgs.buildPythonApplication rec { # setuptools to get distutils with python 3.12 installPhase = '' + runHook preInstall + ${(python3.withPackages (p: [ p.setuptools ])).interpreter} setup.py install --prefix="$out" cp onboard-default-settings.gschema.override.example $out/share/glib-2.0/schemas/10_onboard-default-settings.gschema.override glib-compile-schemas $out/share/glib-2.0/schemas/ + + runHook postInstall ''; # Remove ubuntu icons. diff --git a/pkgs/applications/misc/openbrf/default.nix b/pkgs/applications/misc/openbrf/default.nix index d2419ae25b9ec..8d2d23e0c41c4 100644 --- a/pkgs/applications/misc/openbrf/default.nix +++ b/pkgs/applications/misc/openbrf/default.nix @@ -34,6 +34,8 @@ mkDerivation { ''; installPhase = '' + runHook preInstall + install -Dm755 openBrf $out/share/openBrf/openBrf install -Dm644 carry_positions.txt $out/share/openBrf/carry_positions.txt install -Dm644 reference.brf $out/share/openBrf/reference.brf @@ -44,6 +46,8 @@ mkDerivation { mkdir -p "$out/bin" ln -s "$out/share/openBrf/openBrf" "$out/bin/openBrf" + + runHook postInstall ''; dontPatchELF = true; diff --git a/pkgs/applications/misc/otf2bdf/default.nix b/pkgs/applications/misc/otf2bdf/default.nix index 6653225b7f448..e1cd8fc7e7a28 100644 --- a/pkgs/applications/misc/otf2bdf/default.nix +++ b/pkgs/applications/misc/otf2bdf/default.nix @@ -20,9 +20,13 @@ stdenv.mkDerivation rec { buildInputs = [ freetype ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man/man1 install otf2bdf $out/bin cp otf2bdf.man $out/share/man/man1/otf2bdf.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/pdf-quench/default.nix b/pkgs/applications/misc/pdf-quench/default.nix index 6159bfc7c810f..d68ad120cc300 100644 --- a/pkgs/applications/misc/pdf-quench/default.nix +++ b/pkgs/applications/misc/pdf-quench/default.nix @@ -23,7 +23,11 @@ python3.pkgs.buildPythonApplication { doCheck = false; installPhase = '' + runHook preInstall + install -D -T -m 755 src/pdf_quench.py $out/bin/pdf-quench + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/pdfdiff/default.nix b/pkgs/applications/misc/pdfdiff/default.nix index c80396840e410..426ae0e176fda 100644 --- a/pkgs/applications/misc/pdfdiff/default.nix +++ b/pkgs/applications/misc/pdfdiff/default.nix @@ -28,10 +28,14 @@ python3Packages.buildPythonApplication rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp pdfdiff.py $out/bin/pdfdiff chmod +x $out/bin/pdfdiff - ''; + + runHook postInstall + ''; meta = with lib; { homepage = "https://github.com/cascremers/pdfdiff"; diff --git a/pkgs/applications/misc/pdfsam-basic/default.nix b/pkgs/applications/misc/pdfsam-basic/default.nix index d5138d542c5a2..91e6dd4575a72 100644 --- a/pkgs/applications/misc/pdfsam-basic/default.nix +++ b/pkgs/applications/misc/pdfsam-basic/default.nix @@ -22,10 +22,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cp -R opt/pdfsam-basic/ $out/ mkdir -p "$out"/share/icons cp --recursive ${desktopItem}/share/applications $out/share cp $out/icon.svg "$out"/share/icons/pdfsam-basic.svg + + runHook postInstall ''; desktopItem = makeDesktopItem { diff --git a/pkgs/applications/misc/pell/default.nix b/pkgs/applications/misc/pell/default.nix index 55b5dd3d37108..c3289df3140b2 100644 --- a/pkgs/applications/misc/pell/default.nix +++ b/pkgs/applications/misc/pell/default.nix @@ -12,12 +12,16 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share cp pell $out/bin cp resources/online.mp3 $out/share cp resources/offline.mp3 $out/share chmod +x $out/bin/pell + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/misc/phoc/default.nix b/pkgs/applications/misc/phoc/default.nix index 4e3eaacc47f84..a5069570fff6f 100644 --- a/pkgs/applications/misc/phoc/default.nix +++ b/pkgs/applications/misc/phoc/default.nix @@ -71,7 +71,7 @@ stdenv.mkDerivation (finalAttrs: { inherit (finalAttrs) src; preferLocalBuild = true; allowSubstitutes = false; - installPhase = "cp subprojects/packagefiles/wlroots/$name $out"; + installPhase = "runHook preInstall; cp subprojects/packagefiles/wlroots/$name $out; runHook postInstall"; }) ]; }); diff --git a/pkgs/applications/misc/playonlinux/default.nix b/pkgs/applications/misc/playonlinux/default.nix index 4f12fb470671e..14537eafec1d9 100644 --- a/pkgs/applications/misc/playonlinux/default.nix +++ b/pkgs/applications/misc/playonlinux/default.nix @@ -101,6 +101,8 @@ in stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -d $out/share/playonlinux cp -r . $out/share/playonlinux/ @@ -128,6 +130,8 @@ in stdenv.mkDerivation { for f in $out/share/playonlinux/bin/*; do bzip2 $f done + + runHook postInstall ''; dontWrapGApps = true; diff --git a/pkgs/applications/misc/polar-bookshelf1/default.nix b/pkgs/applications/misc/polar-bookshelf1/default.nix index 572a981b4ccf8..ff2d8c160d3f8 100644 --- a/pkgs/applications/misc/polar-bookshelf1/default.nix +++ b/pkgs/applications/misc/polar-bookshelf1/default.nix @@ -92,11 +92,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/polar-bookshelf $out/bin $out/lib mv opt/Polar\ Bookshelf/* $out/share/polar-bookshelf mv $out/share/polar-bookshelf/*.so $out/lib mv usr/share/* $out/share/ ln -s $out/share/polar-bookshelf/polar-bookshelf $out/bin/polar-bookshelf + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/applications/misc/premid/default.nix b/pkgs/applications/misc/premid/default.nix index 876c4c33de28e..70b9358bd2be8 100644 --- a/pkgs/applications/misc/premid/default.nix +++ b/pkgs/applications/misc/premid/default.nix @@ -50,6 +50,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,opt/PreMiD,share/pixmaps} mv * $out/opt/PreMiD @@ -63,6 +65,8 @@ stdenv.mkDerivation rec { --prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/${pname} ln -s $out/opt/PreMiD/${pname} $out/bin/ + + runHook postInstall ''; # This is the icon used by the desktop file diff --git a/pkgs/applications/misc/rescuetime/default.nix b/pkgs/applications/misc/rescuetime/default.nix index 41988c2829578..519c097c88cb8 100644 --- a/pkgs/applications/misc/rescuetime/default.nix +++ b/pkgs/applications/misc/rescuetime/default.nix @@ -26,6 +26,8 @@ in mkDerivation rec { sourceRoot=pkg ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp usr/bin/rescuetime $out/bin @@ -33,6 +35,8 @@ in mkDerivation rec { --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ --set-rpath "${lib.makeLibraryPath [ qt5.qtbase libXtst libXext libX11 libXScrnSaver ]}" \ $out/bin/rescuetime + + runHook postInstall ''; passthru.updateScript = writeScript "${pname}-updater" '' diff --git a/pkgs/applications/misc/rofi-menugen/default.nix b/pkgs/applications/misc/rofi-menugen/default.nix index 7d5cb9f3eb89e..031843a6b63c0 100644 --- a/pkgs/applications/misc/rofi-menugen/default.nix +++ b/pkgs/applications/misc/rofi-menugen/default.nix @@ -18,9 +18,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp menugen $out/bin/rofi-menugen cp menugenbase $out/bin/rofi-menugenbase + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/rofi-power-menu/default.nix b/pkgs/applications/misc/rofi-power-menu/default.nix index c16311e67db23..772951476fceb 100644 --- a/pkgs/applications/misc/rofi-power-menu/default.nix +++ b/pkgs/applications/misc/rofi-power-menu/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp rofi-power-menu $out/bin/rofi-power-menu cp dmenu-power-menu $out/bin/dmenu-power-menu + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/rofi-screenshot/default.nix b/pkgs/applications/misc/rofi-screenshot/default.nix index 6b1861dc8fc59..c09aff5595a21 100644 --- a/pkgs/applications/misc/rofi-screenshot/default.nix +++ b/pkgs/applications/misc/rofi-screenshot/default.nix @@ -44,7 +44,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 ${pname} $out/bin/${pname} + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/misc/sbagen/default.nix b/pkgs/applications/misc/sbagen/default.nix index 4ddfa6f9cf286..4692dfe33d6b1 100644 --- a/pkgs/applications/misc/sbagen/default.nix +++ b/pkgs/applications/misc/sbagen/default.nix @@ -16,10 +16,14 @@ stdenv.mkDerivation rec { buildPhase = "./mk"; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/sbagen/doc} cp -r --target-directory=$out/share/sbagen examples scripts river1.ogg river2.ogg cp sbagen $out/bin cp --target-directory=$out/share/sbagen/doc README.txt SBAGEN.txt theory{,2}.txt {wave,holosync,focus,TODO}.txt + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/misc/sequelpro/default.nix b/pkgs/applications/misc/sequelpro/default.nix index dd1aca73b7db8..b76714b295a8f 100644 --- a/pkgs/applications/misc/sequelpro/default.nix +++ b/pkgs/applications/misc/sequelpro/default.nix @@ -11,9 +11,13 @@ stdenv.mkDerivation { buildInputs = [ undmg ]; installPhase = '' + runHook preInstall + mkdir -p "$out/Applications/Sequel Pro.app" cp -R . "$out/Applications/Sequel Pro.app" chmod +x "$out/Applications/Sequel Pro.app/Contents/MacOS/Sequel Pro" + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/misc/sidequest/default.nix b/pkgs/applications/misc/sidequest/default.nix index c90a7116b6df2..52b05585f609f 100644 --- a/pkgs/applications/misc/sidequest/default.nix +++ b/pkgs/applications/misc/sidequest/default.nix @@ -50,10 +50,14 @@ nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p "$out/lib/SideQuest" "$out/bin" tar -xJf "$src" -C "$out/lib/SideQuest" --strip-components 1 ln -s "$out/lib/SideQuest/sidequest" "$out/bin" + + runHook postInstall ''; postFixup = let diff --git a/pkgs/applications/misc/sl1-to-photon/default.nix b/pkgs/applications/misc/sl1-to-photon/default.nix index 901265016f8ef..b1e632f3fd486 100644 --- a/pkgs/applications/misc/sl1-to-photon/default.nix +++ b/pkgs/applications/misc/sl1-to-photon/default.nix @@ -27,7 +27,11 @@ in dontUseSetuptoolsCheck = true; installPhase = '' + runHook preInstall + install -D -m 0755 SL1_to_Photon.py $out/bin/${pname} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/slic3r/default.nix b/pkgs/applications/misc/slic3r/default.nix index 102dc8f4b3c8d..19abb0ed4ec5d 100644 --- a/pkgs/applications/misc/slic3r/default.nix +++ b/pkgs/applications/misc/slic3r/default.nix @@ -75,6 +75,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/share/slic3r/" cp -r * "$out/share/slic3r/" wrapProgram "$out/share/slic3r/slic3r.pl" \ @@ -85,6 +87,8 @@ stdenv.mkDerivation rec { ln -s "$out/share/slic3r/var/Slic3r.png" "$out/share/pixmaps/slic3r.png" mkdir -p "$out/share/applications" cp "$desktopItem"/share/applications/* "$out/share/applications/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/speedread/default.nix b/pkgs/applications/misc/speedread/default.nix index e62edf48cbadc..900470d82bb41 100644 --- a/pkgs/applications/misc/speedread/default.nix +++ b/pkgs/applications/misc/speedread/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation rec { buildInputs = [ perl ]; installPhase = '' + runHook preInstall + install -m755 -D speedread $out/bin/speedread + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/ssh-tools/default.nix b/pkgs/applications/misc/ssh-tools/default.nix index 3e0b7e50d93ee..999cc9f9530ee 100644 --- a/pkgs/applications/misc/ssh-tools/default.nix +++ b/pkgs/applications/misc/ssh-tools/default.nix @@ -24,8 +24,12 @@ buildGoModule rec { buildInputs = [ perl ]; postInstall = '' + runHook preInstall + install cmd/{bash,perl}/ssh-*/ssh-* -t $out/bin installManPage man/*.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/stag/default.nix b/pkgs/applications/misc/stag/default.nix index 711d549d1ac35..9c72db4c379e1 100644 --- a/pkgs/applications/misc/stag/default.nix +++ b/pkgs/applications/misc/stag/default.nix @@ -27,7 +27,11 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ curses ]; installPhase = '' + runHook preInstall + make install PREFIX=$out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/styx/default.nix b/pkgs/applications/misc/styx/default.nix index 96278fd9c3222..7d5a637451952 100644 --- a/pkgs/applications/misc/styx/default.nix +++ b/pkgs/applications/misc/styx/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir $out install -D -m 777 src/styx.sh $out/bin/styx @@ -58,6 +60,8 @@ stdenv.mkDerivation rec { mkdir $themes cp -r themes/* $themes + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/subsurface/default.nix b/pkgs/applications/misc/subsurface/default.nix index e8cc4baf27575..df5f088e777da 100644 --- a/pkgs/applications/misc/subsurface/default.nix +++ b/pkgs/applications/misc/subsurface/default.nix @@ -81,10 +81,14 @@ let pluginsSubdir = "lib/qt-${qtbase.qtCompatVersion}/plugins"; installPhase = '' + runHook preInstall + mkdir -p $out $(dirname ${pluginsSubdir}/geoservices) mkdir -p ${pluginsSubdir}/geoservices mv *.so ${pluginsSubdir}/geoservices mv lib $out/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/sunwait/default.nix b/pkgs/applications/misc/sunwait/default.nix index f824011f1b868..e3668aecb8df6 100644 --- a/pkgs/applications/misc/sunwait/default.nix +++ b/pkgs/applications/misc/sunwait/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation (finalAttrs: { makeFlags = [ "C=${stdenv.cc.targetPrefix}c++" ]; installPhase = '' + runHook preInstall + install -Dm755 sunwait -t $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/misc/sway-contrib/default.nix b/pkgs/applications/misc/sway-contrib/default.nix index b0c8154f2c513..8a471e199cf2b 100644 --- a/pkgs/applications/misc/sway-contrib/default.nix +++ b/pkgs/applications/misc/sway-contrib/default.nix @@ -46,6 +46,8 @@ grimshot = stdenvNoCC.mkDerivation { nativeBuildInputs = [ makeWrapper installShellFiles ]; buildInputs = [ bash ]; installPhase = '' + runHook preInstall + installManPage grimshot.1 installShellCompletion --cmd grimshot grimshot-completion.bash @@ -61,6 +63,8 @@ grimshot = stdenvNoCC.mkDerivation { jq gnugrep ] }" + + runHook postInstall ''; doInstallCheck = true; @@ -96,7 +100,11 @@ in python3Packages.buildPythonApplication { propagatedBuildInputs = [ python3Packages.i3ipc ]; installPhase = '' + runHook preInstall + install -Dm 0755 $src/${lname}.py $out/bin/${lname}.py + + runHook postInstall ''; meta = with lib; meta // { diff --git a/pkgs/applications/misc/sway-launcher-desktop/default.nix b/pkgs/applications/misc/sway-launcher-desktop/default.nix index 7dd660dddb163..0b54f0e067d93 100644 --- a/pkgs/applications/misc/sway-launcher-desktop/default.nix +++ b/pkgs/applications/misc/sway-launcher-desktop/default.nix @@ -19,10 +19,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -d $out/bin install ${pname}.sh $out/bin/${pname} wrapProgram $out/bin/${pname} \ --prefix PATH : ${lib.makeBinPath [ gawk fzf ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/sweethome3d/editors.nix b/pkgs/applications/misc/sweethome3d/editors.nix index a426494b61f64..45fbd4ef1b1aa 100644 --- a/pkgs/applications/misc/sweethome3d/editors.nix +++ b/pkgs/applications/misc/sweethome3d/editors.nix @@ -54,6 +54,8 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/{java,applications} cp ${module}-${version}.jar $out/share/java/. @@ -61,6 +63,8 @@ let makeWrapper ${jdk}/bin/java $out/bin/$exec \ --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3.out}/share:${gsettings-desktop-schemas}/share:$out/share:$GSETTINGS_SCHEMAS_PATH" \ --add-flags "-jar $out/share/java/${module}-${version}.jar -d${toString stdenv.hostPlatform.parsed.cpu.bits}" + + runHook postInstall ''; dontStrip = true; diff --git a/pkgs/applications/misc/tasknc/default.nix b/pkgs/applications/misc/tasknc/default.nix index ff478d1415a42..13f0aab2e71af 100644 --- a/pkgs/applications/misc/tasknc/default.nix +++ b/pkgs/applications/misc/tasknc/default.nix @@ -33,6 +33,8 @@ stdenv.mkDerivation rec { buildFlags = [ "VERSION=${version}" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin/ mkdir -p $out/share/man/man1 mkdir -p $out/share/tasknc @@ -40,6 +42,8 @@ stdenv.mkDerivation rec { DESTDIR=$out PREFIX= MANPREFIX=/share/man make install wrapProgram $out/bin/tasknc --prefix PATH : ${taskwarrior2}/bin + + runHook postInstall ''; diff --git a/pkgs/applications/misc/taskopen/default.nix b/pkgs/applications/misc/taskopen/default.nix index ee40e19261a98..59ec13756e183 100644 --- a/pkgs/applications/misc/taskopen/default.nix +++ b/pkgs/applications/misc/taskopen/default.nix @@ -22,8 +22,12 @@ stdenv.mkDerivation rec { ++ (with perlPackages; [ JSON perl ]); installPhase = '' + runHook preInstall + make PREFIX=$out make PREFIX=$out install + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/misc/terminal-notifier/default.nix b/pkgs/applications/misc/terminal-notifier/default.nix index e2bd8dd2f9c56..66971c2f4c964 100644 --- a/pkgs/applications/misc/terminal-notifier/default.nix +++ b/pkgs/applications/misc/terminal-notifier/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/Applications mkdir -p $out/bin cp -r terminal-notifier.app $out/Applications @@ -23,6 +25,8 @@ stdenv.mkDerivation rec { exec ./Contents/MacOS/terminal-notifier "\$@" EOF chmod +x $out/bin/terminal-notifier + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/tpmmanager/default.nix b/pkgs/applications/misc/tpmmanager/default.nix index 763cd75ffdbfa..78d22f516573a 100644 --- a/pkgs/applications/misc/tpmmanager/default.nix +++ b/pkgs/applications/misc/tpmmanager/default.nix @@ -28,6 +28,8 @@ stdenv.mkDerivation rec { buildInputs = [ qtbase trousers ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -Dpm755 -D bin/tpmmanager $out/bin/tpmmanager @@ -41,7 +43,9 @@ stdenv.mkDerivation rec { Exec=$out/bin/tpmmanager Terminal=false EOF - ''; + + runHook postInstall + ''; meta = { homepage = "https://projects.sirrix.com/trac/tpmmanager"; diff --git a/pkgs/applications/misc/tthsum/default.nix b/pkgs/applications/misc/tthsum/default.nix index 603ddeca4fd7a..7b4cd1ee285fe 100644 --- a/pkgs/applications/misc/tthsum/default.nix +++ b/pkgs/applications/misc/tthsum/default.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man/man1 cp share/tthsum.1.gz $out/share/man/man1 cp obj-unix/tthsum $out/bin + + runHook postInstall ''; doCheck = !stdenv.isDarwin; diff --git a/pkgs/applications/misc/usync/default.nix b/pkgs/applications/misc/usync/default.nix index 7a5abda593029..fd6d4f82a65cd 100644 --- a/pkgs/applications/misc/usync/default.nix +++ b/pkgs/applications/misc/usync/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -m 555 -Dt $out/bin $pname + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/misc/veracrypt/default.nix b/pkgs/applications/misc/veracrypt/default.nix index a7b0eed9037b0..c244cb2a51f70 100644 --- a/pkgs/applications/misc/veracrypt/default.nix +++ b/pkgs/applications/misc/veracrypt/default.nix @@ -45,6 +45,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + install -Dm 755 Main/${pname} "$out/bin/${pname}" install -Dm 444 Resources/Icons/VeraCrypt-256x256.xpm "$out/share/pixmaps/${pname}.xpm" install -Dm 444 License.txt -t "$out/share/doc/${pname}/" @@ -52,6 +54,8 @@ stdenv.mkDerivation rec { substitute Setup/Linux/${pname}.desktop $out/share/applications/${pname}.desktop \ --replace "Exec=/usr/bin/veracrypt" "Exec=$out/bin/veracrypt" \ --replace "Icon=veracrypt" "Icon=veracrypt.xpm" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/vue/default.nix b/pkgs/applications/misc/vue/default.nix index 678aa886ce90f..55c6422a5af20 100644 --- a/pkgs/applications/misc/vue/default.nix +++ b/pkgs/applications/misc/vue/default.nix @@ -11,11 +11,15 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p "$out"/{share/vue,bin} cp ${src} "$out/share/vue/vue.jar" echo '#!${runtimeShell}' >> "$out/bin/vue" echo '${jre}/bin/java -jar "'"$out/share/vue/vue.jar"'" "$@"' >> "$out/bin/vue" chmod a+x "$out/bin/vue" + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/misc/weather/default.nix b/pkgs/applications/misc/weather/default.nix index 6f2d2045dd29f..9401ae3e656b0 100644 --- a/pkgs/applications/misc/weather/default.nix +++ b/pkgs/applications/misc/weather/default.nix @@ -20,6 +20,8 @@ stdenv.mkDerivation rec { # Upstream doesn't provide a setup.py or alike, so we follow: # http://fungi.yuggoth.org/weather/doc/install.rst#id3 installPhase = '' + runHook preInstall + site_packages=$out/${python3.sitePackages} install -Dt $out/bin -m 755 weather install -Dt $site_packages weather.py @@ -36,6 +38,8 @@ stdenv.mkDerivation rec { wrapPythonPrograms installManPage weather.1 weatherrc.5 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/xbattbar/default.nix b/pkgs/applications/misc/xbattbar/default.nix index 0ddb06b62acee..5ab8a029fe461 100644 --- a/pkgs/applications/misc/xbattbar/default.nix +++ b/pkgs/applications/misc/xbattbar/default.nix @@ -29,11 +29,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/libexec install -m 0755 xbattbar $out/bin/ install -m 0755 xbattbar-check-acpi $out/libexec/ install -m 0755 xbattbar-check-sys $out/libexec/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/xfontsel/default.nix b/pkgs/applications/misc/xfontsel/default.nix index 203b94b0845fa..57d2a2328ddb8 100644 --- a/pkgs/applications/misc/xfontsel/default.nix +++ b/pkgs/applications/misc/xfontsel/default.nix @@ -24,9 +24,13 @@ stdenv.mkDerivation rec { # directory will contain them. # hack: Copying the XFontSel app-defaults file to $HOME makes xfontsel work. installPhase = '' + runHook preInstall + make install appdefaultdir=$out/share/X11/app-defaults wrapProgram $out/bin/xfontsel \ --set XAPPLRESDIR $out/share/X11/app-defaults + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/xkblayout-state/default.nix b/pkgs/applications/misc/xkblayout-state/default.nix index 10bd1961f09c1..69d5728f926be 100644 --- a/pkgs/applications/misc/xkblayout-state/default.nix +++ b/pkgs/applications/misc/xkblayout-state/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp xkblayout-state $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/xkbmon/default.nix b/pkgs/applications/misc/xkbmon/default.nix index f9394c45342cb..a9f37e0570c82 100644 --- a/pkgs/applications/misc/xkbmon/default.nix +++ b/pkgs/applications/misc/xkbmon/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 ]; - installPhase = "install -D -t $out/bin xkbmon"; + installPhase = "runHook preInstall; install -D -t $out/bin xkbmon; runHook postInstall"; meta = with lib; { homepage = "https://github.com/xkbmon/xkbmon"; diff --git a/pkgs/applications/misc/xmind/default.nix b/pkgs/applications/misc/xmind/default.nix index 58b46208e510d..ed958afcc3c2b 100644 --- a/pkgs/applications/misc/xmind/default.nix +++ b/pkgs/applications/misc/xmind/default.nix @@ -42,6 +42,8 @@ stdenv.mkDerivation rec { then "XMind_i386" else "XMind_amd64"; in '' + runHook preInstall + mkdir -p $out/{bin,libexec/configuration/,share/{applications/,fonts/,icons/hicolor/scalable/apps/}} cp -r ${targetDir}/{configuration,p2,XMind{,.ini}} $out/libexec cp -r {plugins,features} $out/libexec/ @@ -68,6 +70,8 @@ stdenv.mkDerivation rec { chmod +x $out/bin/XMind ln -s ${jre8} $out/libexec/jre + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/xpdf/libxpdf.nix b/pkgs/applications/misc/xpdf/libxpdf.nix index 61c696f1309e5..fe01093705404 100644 --- a/pkgs/applications/misc/xpdf/libxpdf.nix +++ b/pkgs/applications/misc/xpdf/libxpdf.nix @@ -38,6 +38,8 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/goo mkdir -p $out/lib/fofi mkdir -p $out/lib/xpdf @@ -51,6 +53,8 @@ stdenv.mkDerivation { cp -v goo/*.h $out/include cp -v fofi/*.h $out/include cp -v xpdf/*.h $out/include + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/xrandr-invert-colors/default.nix b/pkgs/applications/misc/xrandr-invert-colors/default.nix index 6fd521f3cc5cf..f12edf79cf977 100644 --- a/pkgs/applications/misc/xrandr-invert-colors/default.nix +++ b/pkgs/applications/misc/xrandr-invert-colors/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { buildInputs = [ libXrandr ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv xrandr-invert-colors.bin xrandr-invert-colors install xrandr-invert-colors $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/misc/xrq/default.nix b/pkgs/applications/misc/xrq/default.nix index c37696c5f19d1..100e86c986193 100644 --- a/pkgs/applications/misc/xrq/default.nix +++ b/pkgs/applications/misc/xrq/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + make PREFIX=$out install + + runHook postInstall ''; outputs = [ "out" "man" ]; diff --git a/pkgs/applications/networking/apache-directory-studio/default.nix b/pkgs/applications/networking/apache-directory-studio/default.nix index 596ba95b7450b..689a56039ebce 100644 --- a/pkgs/applications/networking/apache-directory-studio/default.nix +++ b/pkgs/applications/networking/apache-directory-studio/default.nix @@ -27,6 +27,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper autoPatchelfHook ]; installPhase = '' + runHook preInstall + dest="$out/libexec/ApacheDirectoryStudio" mkdir -p "$dest" cp -r . "$dest" @@ -41,6 +43,8 @@ stdenv.mkDerivation rec { --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ webkitgtk ])} install -D icon.xpm "$out/share/pixmaps/apache-directory-studio.xpm" install -D -t "$out/share/applications" ${desktopItem}/share/applications/* + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/appgate-sdp/default.nix b/pkgs/applications/networking/appgate-sdp/default.nix index ed77e32e00144..63b19bb1875d7 100644 --- a/pkgs/applications/networking/appgate-sdp/default.nix +++ b/pkgs/applications/networking/appgate-sdp/default.nix @@ -114,6 +114,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cp -r $out/usr/share $out/share substituteInPlace $out/lib/systemd/system/appgate-dumb-resolver.service \ @@ -146,6 +148,8 @@ stdenv.mkDerivation rec { --set LD_LIBRARY_PATH $out/opt/appgate:${lib.makeLibraryPath deps} wrapProgram $out/opt/appgate/linux/set_dns --set PYTHONPATH $PYTHONPATH + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/browsers/chromium/browser.nix b/pkgs/applications/networking/browsers/chromium/browser.nix index 5b77afaaf3ebb..f73d75cfad634 100644 --- a/pkgs/applications/networking/browsers/chromium/browser.nix +++ b/pkgs/applications/networking/browsers/chromium/browser.nix @@ -13,6 +13,8 @@ mkChromiumDerivation (base: rec { sandboxExecutableName = "__chromium-suid-sandbox"; installPhase = '' + runHook preInstall + mkdir -p "$libExecPath" cp -v "$buildPath/"*.so "$buildPath/"*.pak "$buildPath/"*.bin "$libExecPath/" cp -v "$buildPath/libvulkan.so.1" "$libExecPath/" @@ -66,6 +68,8 @@ mkChromiumDerivation (base: rec { -e '/\[Desktop Entry\]/a\' \ -e 'StartupWMClass=chromium-browser' \ $out/share/applications/chromium-browser.desktop + + runHook postInstall ''; passthru = { inherit sandboxExecutableName; }; diff --git a/pkgs/applications/networking/browsers/chromium/ungoogled.nix b/pkgs/applications/networking/browsers/chromium/ungoogled.nix index cf3d0a7d73ad2..9640b7a7cfedd 100644 --- a/pkgs/applications/networking/browsers/chromium/ungoogled.nix +++ b/pkgs/applications/networking/browsers/chromium/ungoogled.nix @@ -36,8 +36,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir $out cp -R * $out/ wrapProgram $out/utils/patches.py --add-flags "apply" --prefix PATH : "${patch}/bin" + + runHook postInstall ''; } diff --git a/pkgs/applications/networking/browsers/firefox-bin/default.nix b/pkgs/applications/networking/browsers/firefox-bin/default.nix index 81abbb268397f..47eb8c65998eb 100644 --- a/pkgs/applications/networking/browsers/firefox-bin/default.nix +++ b/pkgs/applications/networking/browsers/firefox-bin/default.nix @@ -85,6 +85,8 @@ stdenv.mkDerivation { installPhase = '' + runHook preInstall + mkdir -p "$prefix/lib/firefox-bin-${version}" cp -r * "$prefix/lib/firefox-bin-${version}" @@ -94,6 +96,8 @@ stdenv.mkDerivation { # See: https://github.com/mozilla/policy-templates/blob/master/README.md mkdir -p "$out/lib/firefox-bin-${version}/distribution"; ln -s ${policiesJson} "$out/lib/firefox-bin-${version}/distribution/policies.json"; + + runHook postInstall ''; passthru = { diff --git a/pkgs/applications/networking/browsers/microsoft-edge/browser.nix b/pkgs/applications/networking/browsers/microsoft-edge/browser.nix index 71791ac711806..c1f490ed1bf2d 100644 --- a/pkgs/applications/networking/browsers/microsoft-edge/browser.nix +++ b/pkgs/applications/networking/browsers/microsoft-edge/browser.nix @@ -133,6 +133,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -R opt usr/bin usr/share $out @@ -173,6 +175,8 @@ stdenv.mkDerivation rec { substituteInPlace $out/opt/microsoft/${shortName}/xdg-settings \ --replace "\''${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" "\''${XDG_DATA_DIRS:-/run/current-system/sw/share}" \ --replace "\''${XDG_CONFIG_DIRS:-/etc/xdg}" "\''${XDG_CONFIG_DIRS:-/run/current-system/sw/etc/xdg}" + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/networking/browsers/nyxt/default.nix b/pkgs/applications/networking/browsers/nyxt/default.nix index d0a040748dc87..66d39acdead79 100644 --- a/pkgs/applications/networking/browsers/nyxt/default.nix +++ b/pkgs/applications/networking/browsers/nyxt/default.nix @@ -34,6 +34,8 @@ stdenv.mkDerivation rec { dontWrapGApps = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/applications/ sed "s/VERSION/$version/" $src/assets/nyxt.desktop > $out/share/applications/nyxt.desktop for i in 16 32 128 256 512; do @@ -45,6 +47,8 @@ stdenv.mkDerivation rec { --prefix PATH : ${lib.makeBinPath [ xclip wl-clipboard ]} \ --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "${GST_PLUGIN_SYSTEM_PATH_1_0}" \ --argv0 nyxt "''${gappsWrapperArgs[@]}" + + runHook postInstall ''; checkPhase = '' diff --git a/pkgs/applications/networking/browsers/opera/default.nix b/pkgs/applications/networking/browsers/opera/default.nix index 36327e5219946..7e169dd61872a 100644 --- a/pkgs/applications/networking/browsers/opera/default.nix +++ b/pkgs/applications/networking/browsers/opera/default.nix @@ -126,6 +126,8 @@ stdenv.mkDerivation rec { dontWrapQtApps = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r usr $out cp -r usr/share $out/share @@ -133,6 +135,8 @@ stdenv.mkDerivation rec { # we already using QT6, autopatchelf wants to patch this as well rm $out/usr/lib/x86_64-linux-gnu/opera/libqt5_shim.so ln -s $out/usr/bin/opera $out/bin/opera + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/browsers/qtchan/default.nix b/pkgs/applications/networking/browsers/qtchan/default.nix index eb2e9789caa56..91b7326a877c0 100644 --- a/pkgs/applications/networking/browsers/qtchan/default.nix +++ b/pkgs/applications/networking/browsers/qtchan/default.nix @@ -16,8 +16,12 @@ mkDerivation rec { qmakeFlags = [ "CONFIG-=app_bundle" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp qtchan $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/browsers/vivaldi/ffmpeg-codecs.nix b/pkgs/applications/networking/browsers/vivaldi/ffmpeg-codecs.nix index dafc914c1ac27..cde9160424ce2 100644 --- a/pkgs/applications/networking/browsers/vivaldi/ffmpeg-codecs.nix +++ b/pkgs/applications/networking/browsers/vivaldi/ffmpeg-codecs.nix @@ -18,7 +18,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -vD chromium-ffmpeg-${version}/chromium-ffmpeg/libffmpeg.so $out/lib/libffmpeg.so + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/browsers/w3m/default.nix b/pkgs/applications/networking/browsers/w3m/default.nix index 827202ae38181..29eb1eef3c8a2 100644 --- a/pkgs/applications/networking/browsers/w3m/default.nix +++ b/pkgs/applications/networking/browsers/w3m/default.nix @@ -15,7 +15,11 @@ let nativeBuildInputs = [ pkg-config boehmgc ]; makeFlags = [ "mktable" ]; installPhase = '' + runHook preInstall + install -D mktable $out/bin/mktable + + runHook postInstall ''; }; in stdenv.mkDerivation rec { diff --git a/pkgs/applications/networking/browsers/yandex-browser/default.nix b/pkgs/applications/networking/browsers/yandex-browser/default.nix index d4fa55f266763..1e2b32a2fb89d 100644 --- a/pkgs/applications/networking/browsers/yandex-browser/default.nix +++ b/pkgs/applications/networking/browsers/yandex-browser/default.nix @@ -141,6 +141,8 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cp $TMP/ya/{usr/share,opt} $out/ -R cp $out/share/applications/yandex-browser${app}.desktop $out/share/applications/${pname}.desktop || true rm -f $out/share/applications/yandex-browser.desktop @@ -149,6 +151,8 @@ in stdenv.mkDerivation rec { substituteInPlace $out/share/gnome-control-center/default-apps/yandex-browser${app}.xml --replace /opt/ $out/opt/ ln -sf ${vivaldi-ffmpeg-codecs}/lib/libffmpeg.so $out/opt/yandex/browser${app}/libffmpeg.so ln -sf $out/opt/yandex/browser${app}/yandex-browser${app} $out/bin/${pname} + + runHook postInstall ''; runtimeDependencies = map lib.getLib [ diff --git a/pkgs/applications/networking/charles/default.nix b/pkgs/applications/networking/charles/default.nix index 27c5ebf9e9c0f..39f4ba3c3b031 100644 --- a/pkgs/applications/networking/charles/default.nix +++ b/pkgs/applications/networking/charles/default.nix @@ -40,6 +40,8 @@ let nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + makeWrapper ${jdk}/bin/java $out/bin/charles \ --add-flags "-Xmx1024M -Dcharles.config='~/.charles.config' -jar $out/share/java/charles.jar" @@ -52,6 +54,8 @@ let mkdir -p $out/share/icons cp -r icon $out/share/icons/hicolor + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/cluster/docker-machine/hyperkit.nix b/pkgs/applications/networking/cluster/docker-machine/hyperkit.nix index d9af5c360d4c1..057c3fa81d971 100644 --- a/pkgs/applications/networking/cluster/docker-machine/hyperkit.nix +++ b/pkgs/applications/networking/cluster/docker-machine/hyperkit.nix @@ -10,7 +10,11 @@ buildGoModule rec { ''; installPhase = '' + runHook preInstall + install out/docker-machine-driver-hyperkit -Dt $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/cluster/docker-machine/kvm2.nix b/pkgs/applications/networking/cluster/docker-machine/kvm2.nix index c21cf5b4970e8..fd6f68b73b934 100644 --- a/pkgs/applications/networking/cluster/docker-machine/kvm2.nix +++ b/pkgs/applications/networking/cluster/docker-machine/kvm2.nix @@ -14,7 +14,11 @@ buildGoModule rec { ''; installPhase = '' + runHook preInstall + install out/docker-machine-driver-kvm2 -Dt $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/cluster/flink/default.nix b/pkgs/applications/networking/cluster/flink/default.nix index 65b4ddd2a7a98..5b645c51a67b4 100644 --- a/pkgs/applications/networking/cluster/flink/default.nix +++ b/pkgs/applications/networking/cluster/flink/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { buildInputs = [ jre ]; installPhase = '' + runHook preInstall + rm bin/*.bat || true mkdir -p $out/bin $out/opt/flink @@ -25,6 +27,8 @@ stdenv.mkDerivation rec { env.java.home: ${jre} env.log.dir: /tmp/flink-logs EOF + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/cluster/hadoop/containerExecutor.nix b/pkgs/applications/networking/cluster/hadoop/containerExecutor.nix index 7d5d2918e9b9f..519934cbe5924 100644 --- a/pkgs/applications/networking/cluster/hadoop/containerExecutor.nix +++ b/pkgs/applications/networking/cluster/hadoop/containerExecutor.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DHADOOP_CONF_DIR=/run/wrappers/yarn-nodemanager/etc/hadoop" ]; installPhase = '' + runHook preInstall + mkdir $out mv target/var/empty/local/bin $out/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index d9f20411a5a0e..7b300077af826 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -49,6 +49,8 @@ let buildInputs = lib.optionals stdenv.isLinux [ stdenv.cc.cc.lib openssl protobuf zlib snappy libtirpc ]; installPhase = '' + runHook preInstall + mkdir $out mv * $out/ '' + lib.optionalString stdenv.isLinux '' @@ -114,7 +116,9 @@ let designed to detect and handle failures at the application layer, so delivering a highly-availabile service on top of a cluster of computers, each of which may be prone to failures. - ''; + + runHook postInstall + ''; maintainers = with maintainers; [ illustris ]; platforms = attrNames platformAttrs; } (attrByPath [ stdenv.system "meta" ] {} platformAttrs); diff --git a/pkgs/applications/networking/cluster/kubetail/default.nix b/pkgs/applications/networking/cluster/kubetail/default.nix index 5fc1eaf488274..0fdcfe35eaeb6 100644 --- a/pkgs/applications/networking/cluster/kubetail/default.nix +++ b/pkgs/applications/networking/cluster/kubetail/default.nix @@ -14,10 +14,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ installShellFiles makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm755 kubetail "$out/bin/kubetail" wrapProgram $out/bin/kubetail --prefix PATH : ${lib.makeBinPath [ kubectl ]} installShellCompletion completion/kubetail.{bash,fish,zsh} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/cluster/minikube/default.nix b/pkgs/applications/networking/cluster/minikube/default.nix index 90f94c459742d..65ed8184eb045 100644 --- a/pkgs/applications/networking/cluster/minikube/default.nix +++ b/pkgs/applications/networking/cluster/minikube/default.nix @@ -53,6 +53,8 @@ buildGoModule rec { ''; installPhase = '' + runHook preInstall + install out/minikube -Dt $out/bin wrapProgram $out/bin/minikube --set MINIKUBE_WANTUPDATENOTIFICATION false @@ -62,6 +64,8 @@ buildGoModule rec { $out/bin/minikube completion $shell > minikube.$shell installShellCompletion minikube.$shell done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/cluster/odo/default.nix b/pkgs/applications/networking/cluster/odo/default.nix index f907f68914303..aa1d9ae3eeaba 100644 --- a/pkgs/applications/networking/cluster/odo/default.nix +++ b/pkgs/applications/networking/cluster/odo/default.nix @@ -18,8 +18,12 @@ buildGoModule rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a odo $out/bin + + runHook postInstall ''; passthru.tests.version = testers.testVersion { diff --git a/pkgs/applications/networking/cluster/pig/default.nix b/pkgs/applications/networking/cluster/pig/default.nix index 42938d1246f9e..f06892cd95999 100644 --- a/pkgs/applications/networking/cluster/pig/default.nix +++ b/pkgs/applications/networking/cluster/pig/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out mv * $out @@ -24,6 +26,8 @@ stdenv.mkDerivation rec { --prefix PATH : "${lib.makeBinPath [ jre bash ]}" \ --set JAVA_HOME "${jre}" --set HADOOP_PREFIX "${hadoop}" done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/cluster/rke2/builder.nix b/pkgs/applications/networking/cluster/rke2/builder.nix index 58a9d6c629ea8..72c0c8bf882dd 100644 --- a/pkgs/applications/networking/cluster/rke2/builder.nix +++ b/pkgs/applications/networking/cluster/rke2/builder.nix @@ -72,6 +72,8 @@ buildGoModule rec { subPackages = [ "." ]; installPhase = '' + runHook preInstall + install -D $GOPATH/bin/rke2 $out/bin/rke2 wrapProgram $out/bin/rke2 \ --prefix PATH : ${lib.makeBinPath buildInputs} @@ -80,6 +82,8 @@ buildGoModule rec { wrapProgram $out/bin/rke2-killall.sh \ --prefix PATH : ${lib.makeBinPath [ systemd gnugrep gnused ]} \ --prefix PATH : ${lib.makeBinPath buildInputs} + + runHook postInstall ''; doCheck = false; diff --git a/pkgs/applications/networking/cluster/spark/default.nix b/pkgs/applications/networking/cluster/spark/default.nix index f717ec92267f0..d3f40e7cc439c 100644 --- a/pkgs/applications/networking/cluster/spark/default.nix +++ b/pkgs/applications/networking/cluster/spark/default.nix @@ -25,6 +25,8 @@ let ++ lib.optional RSupport finalAttrs.R; installPhase = '' + runHook preInstall + mkdir -p "$out/opt" mv * $out/ for n in $(find $out/bin -type f -executable ! -name "find-spark-home"); do @@ -39,6 +41,8 @@ let done ln -s ${finalAttrs.hadoop} "$out/opt/hadoop" ${lib.optionalString RSupport ''ln -s ${finalAttrs.R} "$out/opt/R"''} + + runHook postInstall ''; passthru = { diff --git a/pkgs/applications/networking/cluster/terranix/default.nix b/pkgs/applications/networking/cluster/terranix/default.nix index 4eb04c628646f..8be5f3fde7058 100644 --- a/pkgs/applications/networking/cluster/terranix/default.nix +++ b/pkgs/applications/networking/cluster/terranix/default.nix @@ -14,11 +14,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,core,modules,lib} mv bin core modules lib share $out/ wrapProgram $out/bin/terranix-doc-json \ --prefix PATH : ${lib.makeBinPath [ jq nix ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/cluster/terraspace/default.nix b/pkgs/applications/networking/cluster/terraspace/default.nix index da45541108f69..58ce0ea0e3afd 100644 --- a/pkgs/applications/networking/cluster/terraspace/default.nix +++ b/pkgs/applications/networking/cluster/terraspace/default.nix @@ -14,10 +14,14 @@ in stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin makeWrapper ${rubyEnv}/bin/terraspace $out/bin/terraspace wrapProgram $out/bin/terraspace \ --prefix PATH : ${lib.makeBinPath [ rubyEnv.ruby ]} + + runHook postInstall ''; passthru.updateScript = bundlerUpdateScript "terraspace"; diff --git a/pkgs/applications/networking/cluster/tilt/assets.nix b/pkgs/applications/networking/cluster/tilt/assets.nix index a1edf18d594d3..b8bcacd88d567 100644 --- a/pkgs/applications/networking/cluster/tilt/assets.nix +++ b/pkgs/applications/networking/cluster/tilt/assets.nix @@ -79,8 +79,12 @@ stdenvNoCC.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -r build/. $out/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/droopy/default.nix b/pkgs/applications/networking/droopy/default.nix index 35176db8b2415..22e7623444860 100644 --- a/pkgs/applications/networking/droopy/default.nix +++ b/pkgs/applications/networking/droopy/default.nix @@ -25,9 +25,13 @@ stdenv.mkDerivation { nativeBuildInputs = [ wrapPython ]; installPhase = '' + runHook preInstall + install -vD droopy $out/bin/droopy install -vD -m 644 man/droopy.1 $out/share/man/man1/droopy.1 wrapPythonPrograms + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/geph/default.nix b/pkgs/applications/networking/geph/default.nix index 32b0fe1462946..53408c81973a5 100644 --- a/pkgs/applications/networking/geph/default.nix +++ b/pkgs/applications/networking/geph/default.nix @@ -121,6 +121,8 @@ in dontBuild = true; installPhase = '' + runHook preInstall + install -Dt $out/bin ${finalAttrs.gephgui-wry}/bin/gephgui-wry install -d $out/share/icons/hicolor for i in '16' '32' '64' '128' '256' @@ -132,6 +134,8 @@ in done install -Dt $out/share/applications flatpak/icons/io.geph.GephGui.desktop sed -i -e '/StartupWMClass/s/=.*/=gephgui-wry/' $out/share/applications/io.geph.GephGui.desktop + + runHook postInstall ''; meta = geph-meta // { diff --git a/pkgs/applications/networking/instant-messengers/briar-desktop/default.nix b/pkgs/applications/networking/instant-messengers/briar-desktop/default.nix index 9ce9801ae2ed0..1ecef725cfb39 100644 --- a/pkgs/applications/networking/instant-messengers/briar-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/briar-desktop/default.nix @@ -34,6 +34,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib} cp ${src} $out/lib/briar-desktop.jar makeWrapper ${openjdk}/bin/java $out/bin/briar-desktop \ @@ -41,6 +43,8 @@ stdenv.mkDerivation rec { --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libnotify ]}" + + runHook postInstall ''; fixupPhase = '' diff --git a/pkgs/applications/networking/instant-messengers/caprine-bin/build-from-dmg.nix b/pkgs/applications/networking/instant-messengers/caprine-bin/build-from-dmg.nix index 6a53bba026c5a..b602ed547ca86 100644 --- a/pkgs/applications/networking/instant-messengers/caprine-bin/build-from-dmg.nix +++ b/pkgs/applications/networking/instant-messengers/caprine-bin/build-from-dmg.nix @@ -22,10 +22,14 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ undmg ]; installPhase = '' + runHook preInstall + mkdir -p "$out/Applications/Caprine.app" cp -R . "$out/Applications/Caprine.app" mkdir "$out/bin" ln -s "$out/Applications/Caprine.app/Contents/MacOS/Caprine" "$out/bin/caprine" + + runHook postInstall ''; meta = metaCommon // { diff --git a/pkgs/applications/networking/instant-messengers/feishu/default.nix b/pkgs/applications/networking/instant-messengers/feishu/default.nix index 0a27f5b81b9c6..62055f15c5c8c 100644 --- a/pkgs/applications/networking/instant-messengers/feishu/default.nix +++ b/pkgs/applications/networking/instant-messengers/feishu/default.nix @@ -162,6 +162,8 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + # This deb file contains a setuid binary, # so 'dpkg -x' doesn't work here. dpkg --fsys-tarfile $src | tar --extract @@ -197,6 +199,8 @@ stdenv.mkDerivation { # e.g. openldap version 2.4 # so replace it with our own libcurl.so ln -sf ${curl}/lib/libcurl.so $out/opt/bytedance/feishu/libcurl.so + + runHook postInstall ''; passthru = { diff --git a/pkgs/applications/networking/instant-messengers/franz/generic.nix b/pkgs/applications/networking/instant-messengers/franz/generic.nix index dcbb29e61afcc..f5abf438d80d4 100644 --- a/pkgs/applications/networking/instant-messengers/franz/generic.nix +++ b/pkgs/applications/networking/instant-messengers/franz/generic.nix @@ -74,6 +74,8 @@ in stdenv.mkDerivation (rec { unpackPhase = "dpkg-deb -x $src ."; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r opt $out ln -s $out/opt/${name}/${pname} $out/bin @@ -82,6 +84,8 @@ in stdenv.mkDerivation (rec { cp -r usr/share $out substituteInPlace $out/share/applications/${pname}.desktop \ --replace /opt/${name}/${pname} ${pname} + + runHook postInstall ''; dontWrapGApps = true; diff --git a/pkgs/applications/networking/instant-messengers/jitsi/default.nix b/pkgs/applications/networking/instant-messengers/jitsi/default.nix index a9ee84fbbb955..e6e7b90e2e5ff 100644 --- a/pkgs/applications/networking/instant-messengers/jitsi/default.nix +++ b/pkgs/applications/networking/instant-messengers/jitsi/default.nix @@ -45,6 +45,8 @@ stdenv.mkDerivation rec { buildPhase = "ant make"; installPhase = '' + runHook preInstall + mkdir -p $out cp -a lib $out/ rm -rf $out/lib/native/solaris @@ -62,6 +64,8 @@ stdenv.mkDerivation rec { patchelf --set-rpath "$libPath" "$file" && \ patchelf --shrink-rpath "$file" done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/instant-messengers/oysttyer/default.nix b/pkgs/applications/networking/instant-messengers/oysttyer/default.nix index 5dc09ae1f3eec..71b595e951eaf 100644 --- a/pkgs/applications/networking/instant-messengers/oysttyer/default.nix +++ b/pkgs/applications/networking/instant-messengers/oysttyer/default.nix @@ -24,12 +24,16 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + ${coreutils}/bin/install -Dm755 \ oysttyer.pl \ $out/bin/oysttyer wrapProgram $out/bin/oysttyer \ --prefix PERL5LIB : $PERL5LIB + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/pidgin-xmpp-receipts/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/pidgin-xmpp-receipts/default.nix index f545b65cd8ea9..bb24c28548ced 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/pidgin-xmpp-receipts/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/pidgin-xmpp-receipts/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation { buildInputs = [ pidgin ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/pidgin/ cp xmpp-receipts.so $out/lib/pidgin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/purple-facebook/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/purple-facebook/default.nix index b1078c864de67..62f246ec2d50c 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/purple-facebook/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/purple-facebook/default.nix @@ -49,8 +49,12 @@ in stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/purple-2 cp pidgin/libpurple/protocols/facebook/.libs/*.so $out/lib/purple-2/ + + runHook postInstall ''; nativeBuildInputs = [ autoreconfHook ]; diff --git a/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/purple-lurch/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/purple-lurch/default.nix index 2348e1a877ec6..e7a2b096bd4c9 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/purple-lurch/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/purple-lurch/default.nix @@ -18,7 +18,11 @@ stdenv.mkDerivation rec { dontUseCmakeConfigure = true; installPhase = '' + runHook preInstall + install -Dm755 -t $out/lib/purple-2 build/lurch.so + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/purple-xmpp-http-upload/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/purple-xmpp-http-upload/default.nix index c52082e06c908..a0a4ed79c2f84 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/purple-xmpp-http-upload/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin/pidgin-plugins/purple-xmpp-http-upload/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation { buildInputs = [ pidgin glib libxml2 ]; installPhase = '' + runHook preInstall + install -Dm644 -t $out/lib/purple-2 jabber_http_file_upload.so + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/instant-messengers/signal-cli/default.nix b/pkgs/applications/networking/instant-messengers/signal-cli/default.nix index 0706ce657383e..5da3732d61a7c 100644 --- a/pkgs/applications/networking/instant-messengers/signal-cli/default.nix +++ b/pkgs/applications/networking/instant-messengers/signal-cli/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r lib $out/lib cp bin/signal-cli $out/bin/signal-cli @@ -42,6 +44,8 @@ stdenv.mkDerivation rec { export PATH=$PATH:$out/bin # --help returns non-0 exit code even when working signal-cli --version + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index 53f4338ac4d8c..be7e659fefec3 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -74,6 +74,8 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + # Delete unecessary libraries - these are provided by nixos. rm *.so.* *.so rm QtWebEngineProcess @@ -100,6 +102,8 @@ stdenv.mkDerivation rec { '' /* wayland is currently broken, remove when TS3 fixes that */ + '' --set QT_QPA_PLATFORM xcb \ --set NIX_REDIRECTS /usr/share/X11/xkb=${xkeyboard_config}/share/X11/xkb + + runHook postInstall ''; dontStrip = true; diff --git a/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/with-webkit.nix b/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/with-webkit.nix index f41713389679b..cb171fd9fd829 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/with-webkit.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/with-webkit.nix @@ -6,8 +6,12 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -r ${kotatogram-desktop}/share $out + + runHook postInstall ''; postFixup = '' mkdir -p $out/bin diff --git a/pkgs/applications/networking/instant-messengers/viber/default.nix b/pkgs/applications/networking/instant-messengers/viber/default.nix index 65f16353014d4..afd39f33690a5 100644 --- a/pkgs/applications/networking/instant-messengers/viber/default.nix +++ b/pkgs/applications/networking/instant-messengers/viber/default.nix @@ -114,6 +114,8 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + dpkg-deb -x $src $out mkdir -p $out/bin @@ -141,6 +143,8 @@ stdenv.mkDerivation { substituteInPlace $out/share/applications/viber.desktop \ --replace /opt/viber/Viber $out/opt/viber/Viber \ --replace /usr/share/ $out/share/ + + runHook postInstall ''; dontStrip = true; diff --git a/pkgs/applications/networking/instant-messengers/vk-cli/default.nix b/pkgs/applications/networking/instant-messengers/vk-cli/default.nix index b3425dcfb6f64..1739e4cdf2926 100644 --- a/pkgs/applications/networking/instant-messengers/vk-cli/default.nix +++ b/pkgs/applications/networking/instant-messengers/vk-cli/default.nix @@ -33,9 +33,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin/ mv $TMP/vk-${version}-64-bin vk-cli install -D vk-cli --target-directory=$out/bin/ + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/networking/instant-messengers/vk-messenger/default.nix b/pkgs/applications/networking/instant-messengers/vk-messenger/default.nix index 50be0777ae4eb..35707aaeb9c14 100644 --- a/pkgs/applications/networking/instant-messengers/vk-messenger/default.nix +++ b/pkgs/applications/networking/instant-messengers/vk-messenger/default.nix @@ -50,12 +50,16 @@ let ''; installPhase = '' + runHook preInstall + mkdir $out cd usr cp -r --parents bin $out cp -r --parents share/vk $out cp -r --parents share/applications $out cp -r --parents share/pixmaps $out + + runHook postInstall ''; }; @@ -67,8 +71,12 @@ let sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/Applications cp -r *.app $out/Applications + + runHook postInstall ''; }; in if stdenv.isDarwin then darwin else linux diff --git a/pkgs/applications/networking/instant-messengers/webex/default.nix b/pkgs/applications/networking/instant-messengers/webex/default.nix index 979a6abd7f3c7..44232059a95df 100644 --- a/pkgs/applications/networking/instant-messengers/webex/default.nix +++ b/pkgs/applications/networking/instant-messengers/webex/default.nix @@ -147,6 +147,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" "$out/share/applications" cp -r opt "$out" @@ -154,6 +156,8 @@ stdenv.mkDerivation rec { chmod +x $out/bin/webex mv "$out/opt/Webex/bin/webex.desktop" "$out/share/applications/webex.desktop" + + runHook postInstall ''; passthru.updateScript = writeScript "webex-update-script" '' diff --git a/pkgs/applications/networking/irc/glowing-bear/default.nix b/pkgs/applications/networking/irc/glowing-bear/default.nix index c493cae6d4637..12fe5bb6d0d68 100644 --- a/pkgs/applications/networking/irc/glowing-bear/default.nix +++ b/pkgs/applications/networking/irc/glowing-bear/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir $out cp index.html serviceworker.js webapp.manifest.json $out cp -R 3rdparty assets css directives js $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/irc/weechat/scripts/autosort/default.nix b/pkgs/applications/networking/irc/weechat/scripts/autosort/default.nix index 6cbcc117af040..73a17dcc6da9e 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/autosort/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/autosort/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/share cp $src $out/share/autosort.py + + runHook postInstall ''; passthru = { diff --git a/pkgs/applications/networking/irc/weechat/scripts/buffer_autoset/default.nix b/pkgs/applications/networking/irc/weechat/scripts/buffer_autoset/default.nix index 9ef4929629924..f7372f5bc2d4f 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/buffer_autoset/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/buffer_autoset/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation { passthru.scripts = [ "buffer_autoset.py" ]; installPhase = '' + runHook preInstall + install -D $src $out/share/buffer_autoset.py + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/irc/weechat/scripts/colorize_nicks/default.nix b/pkgs/applications/networking/irc/weechat/scripts/colorize_nicks/default.nix index 0b6d355797f30..a93600464b3cb 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/colorize_nicks/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/colorize_nicks/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/share cp $src $out/share/colorize_nicks.py + + runHook postInstall ''; passthru = { diff --git a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix index 65b5bbd5d6682..1299da163cdd6 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix @@ -38,9 +38,13 @@ stdenv.mkDerivation rec { passthru.scripts = [ "wee_slack.py" ]; installPhase = '' + runHook preInstall + mkdir -p $out/share cp wee_slack.py $out/share/wee_slack.py install -D -m 0444 weemoji.json $out/share/wee-slack/weemoji.json + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-autosort/default.nix b/pkgs/applications/networking/irc/weechat/scripts/weechat-autosort/default.nix index 010470c6fbaab..c7380d7b0c08e 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/weechat-autosort/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-autosort/default.nix @@ -13,7 +13,11 @@ stdenv.mkDerivation rec { passthru.scripts = [ "autosort.py" ]; installPhase = '' + runHook preInstall + install -D autosort.py $out/share/autosort.py + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-go/default.nix b/pkgs/applications/networking/irc/weechat/scripts/weechat-go/default.nix index 623b2570b475a..881479c4520d8 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/weechat-go/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-go/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation { passthru.scripts = [ "go.py" ]; installPhase = '' + runHook preInstall + install -D $src $out/share/go.py + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-grep/default.nix b/pkgs/applications/networking/irc/weechat/scripts/weechat-grep/default.nix index efc575bd3e29c..36215e55cd72b 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/weechat-grep/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-grep/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/share cp $src $out/share/grep.py + + runHook postInstall ''; passthru = { diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix-bridge/default.nix b/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix-bridge/default.nix index e51e6f061b07a..8e100fab13b70 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix-bridge/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix-bridge/default.nix @@ -29,12 +29,16 @@ stdenv.mkDerivation { passthru.scripts = [ "matrix.lua" ]; installPhase = '' + runHook preInstall + mkdir -p $out/{share,lib} cp {matrix.lua,olm.lua} $out/share cp ${cjson}/lib/lua/${cjson.lua.luaversion}/cjson.so $out/lib/cjson.so cp ${olm}/lib/libolm.so $out/lib/libolm.so cp ${luaffi}/lib/lua/${luaffi.lua.luaversion}/ffi.so $out/lib/ffi.so + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix b/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix index a67903c6fe98a..bcf9e78f6d382 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-matrix/default.nix @@ -69,6 +69,8 @@ in buildPythonPackage { format = "other"; installPhase = '' + runHook preInstall + mkdir -p $out/share $out/bin cp main.py $out/share/matrix.py @@ -84,6 +86,8 @@ in buildPythonPackage { mkdir -p $out/${python.sitePackages} cp -r matrix $out/${python.sitePackages}/matrix + + runHook postInstall ''; dontPatchShebangs = true; diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-notify-send/default.nix b/pkgs/applications/networking/irc/weechat/scripts/weechat-notify-send/default.nix index abd289d990375..6ded3630ec227 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/weechat-notify-send/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-notify-send/default.nix @@ -17,9 +17,13 @@ stdenv.mkDerivation rec { doCheck = false; installPhase = '' + runHook preInstall + install -D notify_send.py $out/share/notify_send.py substituteInPlace $out/share/notify_send.py \ --replace "'notify-send'" "'${libnotify}/bin/notify-send'" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix b/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix index fd5f376ad2636..2a9d4b80855e6 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix @@ -60,8 +60,12 @@ in stdenv.mkDerivation rec { passthru.scripts = [ "weechat_otr.py" ]; installPhase = '' + runHook preInstall + mkdir -p $out/share cp weechat_otr.py $out/share/weechat_otr.py + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/irc/weechat/scripts/zncplayback/default.nix b/pkgs/applications/networking/irc/weechat/scripts/zncplayback/default.nix index d15b130cae280..9f4e622982747 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/zncplayback/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/zncplayback/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/share cp $src $out/share/zncplayback.py + + runHook postInstall ''; passthru = { diff --git a/pkgs/applications/networking/irc/wraith/default.nix b/pkgs/applications/networking/irc/wraith/default.nix index c059babffe7b6..fcb780328146b 100644 --- a/pkgs/applications/networking/irc/wraith/default.nix +++ b/pkgs/applications/networking/irc/wraith/default.nix @@ -17,9 +17,13 @@ stdenv.mkDerivation rec { substituteInPlace src/libcrypto.cc --subst-var-by openssl ${lib.getLib openssl} ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a wraith $out/bin/wraith ln -s wraith $out/bin/hub + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/jmeter/default.nix b/pkgs/applications/networking/jmeter/default.nix index ab8589c839fc7..044502870d987 100644 --- a/pkgs/applications/networking/jmeter/default.nix +++ b/pkgs/applications/networking/jmeter/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper jre ]; installPhase = '' + runHook preInstall + mkdir $out rm bin/*.bat bin/*.cmd @@ -30,6 +32,8 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/jmeter --set JAVA_HOME "${jre}" wrapProgram $out/bin/jmeter.sh --set JAVA_HOME "${jre}" + + runHook postInstall ''; doInstallCheck = false; #NoClassDefFoundError: org/apache/logging/log4j/Level for tests diff --git a/pkgs/applications/networking/listadmin/default.nix b/pkgs/applications/networking/listadmin/default.nix index 6a4a2927d3ef3..0eb6d72631fad 100644 --- a/pkgs/applications/networking/listadmin/default.nix +++ b/pkgs/applications/networking/listadmin/default.nix @@ -16,6 +16,8 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man/man1 install -m 755 listadmin.pl $out/bin/listadmin installManPage listadmin.1 @@ -24,6 +26,8 @@ stdenvNoCC.mkDerivation rec { --prefix PERL5LIB : "${with perl.pkgs; makeFullPerlPath [ TextReform NetINET6Glue LWPProtocolHttps ]}" + + runHook postInstall ''; doInstallCheck = true; diff --git a/pkgs/applications/networking/mailreaders/lumail/default.nix b/pkgs/applications/networking/mailreaders/lumail/default.nix index e35d37dfe2240..f76e02f36a674 100644 --- a/pkgs/applications/networking/mailreaders/lumail/default.nix +++ b/pkgs/applications/networking/mailreaders/lumail/default.nix @@ -55,6 +55,8 @@ stdenv.mkDerivation { buildFlags = lib.optional debugBuild "lumail2-debug"; installPhase = '' + runHook preInstall + mkdir -p $out/bin || true install -m755 ${binaryName} $out/bin/ '' @@ -63,6 +65,8 @@ stdenv.mkDerivation { wrapProgram $out/bin/${binaryName} \ --prefix LUA_PATH : "${luaPath}" \ --prefix LUA_CPATH : "${luaCPath}" + + runHook postInstall ''; makeFlags = [ diff --git a/pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix b/pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix index 8fc12d5fd1707..3e9e112fb8222 100644 --- a/pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix +++ b/pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ pkg-config ]; buildInputs = [ glib notmuch ]; - installPhase = "install -D notmuch-addrlookup $out/bin/notmuch-addrlookup"; + installPhase = "runHook preInstall; install -D notmuch-addrlookup $out/bin/notmuch-addrlookup; runHook postInstall"; meta = with lib; { description = "Address lookup tool for Notmuch in C"; diff --git a/pkgs/applications/networking/mailreaders/notmuch/mutt.nix b/pkgs/applications/networking/mailreaders/notmuch/mutt.nix index 92d82f057fbdd..ffa2ecbc7e404 100644 --- a/pkgs/applications/networking/mailreaders/notmuch/mutt.nix +++ b/pkgs/applications/networking/mailreaders/notmuch/mutt.nix @@ -28,12 +28,16 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + ${coreutils}/bin/install -Dm755 \ ./contrib/notmuch-mutt/notmuch-mutt \ $out/bin/notmuch-mutt wrapProgram $out/bin/notmuch-mutt \ --prefix PERL5LIB : $PERL5LIB + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix index 5026afeaea0bf..40a854c886ae4 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix @@ -165,6 +165,8 @@ stdenv.mkDerivation { # on adding `gnupg` and `gpgme` into PATH/LD_LIBRARY_PATH. installPhase = '' + runHook preInstall + mkdir -p "$prefix/usr/lib/thunderbird-bin-${version}" cp -r * "$prefix/usr/lib/thunderbird-bin-${version}" @@ -194,6 +196,8 @@ stdenv.mkDerivation { # See: https://github.com/mozilla/policy-templates/blob/master/README.md mkdir -p "$out/lib/thunderbird-bin-${version}/distribution"; ln -s ${policiesJson} "$out/lib/thunderbird-bin-${version}/distribution/policies.json"; + + runHook postInstall ''; passthru.updateScript = import ./../../browsers/firefox-bin/update.nix { diff --git a/pkgs/applications/networking/misc/zammad/default.nix b/pkgs/applications/networking/misc/zammad/default.nix index 065749554ea10..e9580a17a775e 100644 --- a/pkgs/applications/networking/misc/zammad/default.nix +++ b/pkgs/applications/networking/misc/zammad/default.nix @@ -147,10 +147,14 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + cp -R . $out cp ${databaseConfig} $out/config/database.yml cp ${secretsConfig} $out/config/secrets.yml sed -i -e "s|info|debug|" $out/config/environments/production.rb + + runHook postInstall ''; passthru = { diff --git a/pkgs/applications/networking/misc/zammad/update.nix b/pkgs/applications/networking/misc/zammad/update.nix index 090fe338941be..fc7d685a698ce 100644 --- a/pkgs/applications/networking/misc/zammad/update.nix +++ b/pkgs/applications/networking/misc/zammad/update.nix @@ -13,10 +13,14 @@ stdenv.mkDerivation rec { name = "zammad-update-script"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${./update.sh} $out/bin/update.sh patchShebangs $out/bin/update.sh wrapProgram $out/bin/update.sh --prefix PATH : ${lib.makeBinPath buildInputs} + + runHook postInstall ''; dontUnpack = true; diff --git a/pkgs/applications/networking/mumble/overlay.nix b/pkgs/applications/networking/mumble/overlay.nix index 40c0d3e4c3ea5..6a53bb9983718 100644 --- a/pkgs/applications/networking/mumble/overlay.nix +++ b/pkgs/applications/networking/mumble/overlay.nix @@ -11,6 +11,8 @@ in stdenv.mkDerivation { patches = mumble.patches or []; installPhase = '' + runHook preInstall + mkdir -p $out/lib ln -s ${mumble}/lib/libmumble.so.1 $out/lib/ @@ -22,6 +24,8 @@ in stdenv.mkDerivation { install -Dm755 auxiliary_files/run_scripts/mumble-overlay.in $out/bin/mumble-overlay sed -i "s,/usr/lib,$out/lib,g" $out/bin/mumble-overlay sed -i '2iPATH="${binPath}:$PATH"' $out/bin/mumble-overlay + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/networking/offrss/default.nix b/pkgs/applications/networking/offrss/default.nix index 081f7d96c1aa2..80e2058f42846 100644 --- a/pkgs/applications/networking/offrss/default.nix +++ b/pkgs/applications/networking/offrss/default.nix @@ -5,8 +5,12 @@ stdenv.mkDerivation rec { version = "1.3"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp offrss $out/bin + + runHook postInstall ''; buildInputs = [ curl libmrss ] diff --git a/pkgs/applications/networking/p2p/soulseekqt/default.nix b/pkgs/applications/networking/p2p/soulseekqt/default.nix index 9587bd0a93047..43e514123a532 100644 --- a/pkgs/applications/networking/p2p/soulseekqt/default.nix +++ b/pkgs/applications/networking/p2p/soulseekqt/default.nix @@ -28,6 +28,8 @@ mkDerivation rec { buildInputs = [ qtmultimedia stdenv.cc.cc ]; installPhase = '' + runHook preInstall + binary="$(realpath ${appextracted}/AppRun)" install -Dm755 $binary -t $out/bin @@ -43,6 +45,8 @@ mkDerivation rec { mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps convert -resize "$size"x"$size" $icon $out/share/icons/hicolor/"$size"x"$size"/apps/$(basename $icon) done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/p2p/tremc/default.nix b/pkgs/applications/networking/p2p/tremc/default.nix index 6a75a02d854b3..fd586af4b11a0 100644 --- a/pkgs/applications/networking/p2p/tremc/default.nix +++ b/pkgs/applications/networking/p2p/tremc/default.nix @@ -48,8 +48,12 @@ python3Packages.buildPythonApplication rec { makeWrapperArgs = ["--prefix PATH : ${lib.escapeShellArg wrapperPath}"]; installPhase = '' + runHook preInstall + make DESTDIR=$out install wrapPythonPrograms + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/p2p/vuze/default.nix b/pkgs/applications/networking/p2p/vuze/default.nix index e246017576851..4a4978a201722 100644 --- a/pkgs/applications/networking/p2p/vuze/default.nix +++ b/pkgs/applications/networking/p2p/vuze/default.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation rec { buildPhase = "ant"; installPhase = '' + runHook preInstall + install -D dist/Vuze_0000-00.jar $out/share/java/Vuze_${version}-00.jar makeWrapper ${jre}/bin/java $out/bin/vuze \ --add-flags "-Xmx256m -Djava.library.path=${swt}/lib -cp $out/share/java/Vuze_${version}-00.jar:${swt}/jars/swt.jar org.gudy.azureus2.ui.swt.Main" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/p2p/zeronet/default.nix b/pkgs/applications/networking/p2p/zeronet/default.nix index d0a358a5ba15b..b1eaf61d5eceb 100644 --- a/pkgs/applications/networking/p2p/zeronet/default.nix +++ b/pkgs/applications/networking/p2p/zeronet/default.nix @@ -22,8 +22,12 @@ python3Packages.buildPythonApplication rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share cp -r plugins src tools *.py $out/share/ + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/networking/pcloud/default.nix b/pkgs/applications/networking/pcloud/default.nix index ccc0d924cac37..fcf6eaf870038 100644 --- a/pkgs/applications/networking/pcloud/default.nix +++ b/pkgs/applications/networking/pcloud/default.nix @@ -77,6 +77,8 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir "$out" cp -ar . "$out/app" cd "$out" @@ -112,6 +114,8 @@ stdenv.mkDerivation { EOF chmod +x bin/pcloud + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/ps2client/default.nix b/pkgs/applications/networking/ps2client/default.nix index 87d4e75c33e3a..d6ed68f947887 100644 --- a/pkgs/applications/networking/ps2client/default.nix +++ b/pkgs/applications/networking/ps2client/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + make PREFIX=$out install + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/remote/nice-dcv-client/default.nix b/pkgs/applications/networking/remote/nice-dcv-client/default.nix index 6898d0f66d47c..3065a65a312da 100644 --- a/pkgs/applications/networking/remote/nice-dcv-client/default.nix +++ b/pkgs/applications/networking/remote/nice-dcv-client/default.nix @@ -56,6 +56,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin/ mkdir -p $out/lib64/ mv usr/bin/dcvviewer $out/bin/dcvviewer @@ -73,6 +75,8 @@ stdenv.mkDerivation rec { # we already ship libffi.so.7 ln -s ${lib.getLib libffi}/lib/libffi.so $out/lib64/libffi.so.6 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/remote/teamviewer/default.nix b/pkgs/applications/networking/remote/teamviewer/default.nix index edebb68591937..11ac6bf2cde85 100644 --- a/pkgs/applications/networking/remote/teamviewer/default.nix +++ b/pkgs/applications/networking/remote/teamviewer/default.nix @@ -52,6 +52,8 @@ mkDerivation rec { buildInputs = [ minizip icu63 nss ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/teamviewer $out/bin $out/share/applications cp -a opt/teamviewer/* $out/share/teamviewer rm -R \ @@ -103,6 +105,8 @@ mkDerivation rec { --replace '/lib64/ld-linux-x86-64.so.2' '${glibc.out}/lib/ld-linux-x86-64.so.2' substituteInPlace $out/share/teamviewer/tv_bin/script/tvw_config \ --replace '/var/run/' '/run/' + + runHook postInstall ''; makeWrapperArgs = [ diff --git a/pkgs/applications/networking/resilio-sync/default.nix b/pkgs/applications/networking/resilio-sync/default.nix index f9f74a4af5b5f..4b5ab4bf714fb 100644 --- a/pkgs/applications/networking/resilio-sync/default.nix +++ b/pkgs/applications/networking/resilio-sync/default.nix @@ -34,7 +34,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -D rslsync "$out/bin/rslsync" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/seahub/default.nix b/pkgs/applications/networking/seahub/default.nix index 604ba4772710a..886d4b3c04ec5 100644 --- a/pkgs/applications/networking/seahub/default.nix +++ b/pkgs/applications/networking/seahub/default.nix @@ -69,9 +69,13 @@ python.pkgs.buildPythonApplication rec { ]; installPhase = '' + runHook preInstall + cp -dr --no-preserve='ownership' . $out/ wrapProgram $out/manage.py \ --prefix PYTHONPATH : "$PYTHONPATH:$out/thirdpart:" + + runHook postInstall ''; passthru = { diff --git a/pkgs/applications/networking/sieve-connect/default.nix b/pkgs/applications/networking/sieve-connect/default.nix index 6bc3e1f7d50ae..2741706b24230 100644 --- a/pkgs/applications/networking/sieve-connect/default.nix +++ b/pkgs/applications/networking/sieve-connect/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { buildFlags = [ "PERL5LIB=${perlPackages.makePerlPath [ perlPackages.FileSlurp ]}" "bin" "man" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -m 755 sieve-connect $out/bin installManPage sieve-connect.1 @@ -33,6 +35,8 @@ stdenv.mkDerivation rec { --prefix PERL5LIB : "${with perlPackages; makePerlPath [ AuthenSASL Socket6 IOSocketINET6 IOSocketSSL NetSSLeay NetDNS TermReadKey TermReadLineGnu ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/spideroak/default.nix b/pkgs/applications/networking/spideroak/default.nix index c1531a25b5480..38728ccda9392 100644 --- a/pkgs/applications/networking/spideroak/default.nix +++ b/pkgs/applications/networking/spideroak/default.nix @@ -28,6 +28,8 @@ in stdenv.mkDerivation { unpackCmd = "tar -xzf $curSrc"; installPhase = '' + runHook preInstall + mkdir "$out" cp -r "./"* "$out" mkdir "$out/bin" @@ -46,6 +48,8 @@ in stdenv.mkDerivation { --set SpiderOak_EXEC_SCRIPT $out/bin/spideroak sed -i 's/^Exec=.*/Exec=spideroak/' $out/share/applications/SpiderOakONE.desktop + + runHook postInstall ''; nativeBuildInputs = [ patchelf makeWrapper ]; diff --git a/pkgs/applications/networking/sync/rsync/rrsync.nix b/pkgs/applications/networking/sync/rsync/rrsync.nix index 67cec6eeeeafa..bb9253f5a42cd 100644 --- a/pkgs/applications/networking/sync/rsync/rrsync.nix +++ b/pkgs/applications/networking/sync/rsync/rrsync.nix @@ -20,9 +20,13 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp support/rrsync $out/bin chmod a+x $out/bin/rrsync + + runHook postInstall ''; meta = rsync.meta // { diff --git a/pkgs/applications/networking/synology-drive-client/default.nix b/pkgs/applications/networking/synology-drive-client/default.nix index d4ab94315bf96..12983d01051d9 100644 --- a/pkgs/applications/networking/synology-drive-client/default.nix +++ b/pkgs/applications/networking/synology-drive-client/default.nix @@ -74,8 +74,12 @@ let sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/Applications/ cp -R 'Synology Drive Client.app' $out/Applications/ + + runHook postInstall ''; }; in if stdenv.isDarwin then darwin else linux diff --git a/pkgs/applications/networking/testssl/default.nix b/pkgs/applications/networking/testssl/default.nix index 678262243e2ae..76165a543a1de 100644 --- a/pkgs/applications/networking/testssl/default.nix +++ b/pkgs/applications/networking/testssl/default.nix @@ -29,10 +29,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D testssl.sh $out/bin/testssl.sh cp -r etc $out wrapProgram $out/bin/testssl.sh --prefix PATH ':' ${lib.makeBinPath buildInputs} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/tmpmail/default.nix b/pkgs/applications/networking/tmpmail/default.nix index 55a42eebebd27..a6c2ae7474796 100644 --- a/pkgs/applications/networking/tmpmail/default.nix +++ b/pkgs/applications/networking/tmpmail/default.nix @@ -18,10 +18,14 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ makeWrapper installShellFiles ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -Dm755 -t $out/bin tmpmail installManPage tmpmail.1 wrapProgram $out/bin/tmpmail --prefix PATH : ${lib.makeBinPath [ w3m curl jq xclip ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/networking/twingate/default.nix b/pkgs/applications/networking/twingate/default.nix index 9537ab4c17846..7b31863f4ec25 100644 --- a/pkgs/applications/networking/twingate/default.nix +++ b/pkgs/applications/networking/twingate/default.nix @@ -42,12 +42,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir $out mv etc $out/ mv usr/bin $out/bin mv usr/sbin/* $out/bin mv usr/lib $out/lib mv usr/share $out/share + + runHook postInstall ''; passthru.tests = { inherit (nixosTests) twingate; }; diff --git a/pkgs/applications/networking/wgnord/default.nix b/pkgs/applications/networking/wgnord/default.nix index 9f781d713873f..b56522a9090d6 100644 --- a/pkgs/applications/networking/wgnord/default.nix +++ b/pkgs/applications/networking/wgnord/default.nix @@ -31,9 +31,13 @@ resholve.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -Dm 755 wgnord -t $out/bin/ install -Dm 644 countries.txt -t $out/share/ install -Dm 644 countries_iso31662.txt -t $out/share/ + + runHook postInstall ''; solutions.default = { diff --git a/pkgs/applications/office/atlassian-cli/default.nix b/pkgs/applications/office/atlassian-cli/default.nix index d6c4db65c1504..43afa977699ed 100644 --- a/pkgs/applications/office/atlassian-cli/default.nix +++ b/pkgs/applications/office/atlassian-cli/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/doc/atlassian-cli} cp -r lib $out/share/java cp -r README.txt license $out/share/doc/atlassian-cli @@ -36,6 +38,8 @@ stdenv.mkDerivation rec { --subst-var-by tool $tool chmod +x $out/bin/$tool done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/office/beancount/bean-add.nix b/pkgs/applications/office/beancount/bean-add.nix index 9d451668eff69..c646928a7ec0f 100644 --- a/pkgs/applications/office/beancount/bean-add.nix +++ b/pkgs/applications/office/beancount/bean-add.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation { propagatedBuildInputs = with python3Packages; [ python ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin/ cp bean-add $out/bin/bean-add chmod +x $out/bin/bean-add + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/office/beebeep/default.nix b/pkgs/applications/office/beebeep/default.nix index 63843433b3c54..e565e6e74c55e 100644 --- a/pkgs/applications/office/beebeep/default.nix +++ b/pkgs/applications/office/beebeep/default.nix @@ -29,8 +29,12 @@ mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp * $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/office/docear/default.nix b/pkgs/applications/office/docear/default.nix index 3f0544d56f6e9..20907461fc8b5 100644 --- a/pkgs/applications/office/docear/default.nix +++ b/pkgs/applications/office/docear/default.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation { buildPhase = ""; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share cp -R * $out/share @@ -29,7 +31,9 @@ stdenv.mkDerivation { --add-flags "$out/share/docear.sh" chmod 0755 $out/bin/docear - ''; + + runHook postInstall + ''; meta = with lib; { description = "Unique solution to academic literature management"; diff --git a/pkgs/applications/office/pdfmm/default.nix b/pkgs/applications/office/pdfmm/default.nix index 9f4f17f893c9b..3d84d2a2e7a60 100644 --- a/pkgs/applications/office/pdfmm/default.nix +++ b/pkgs/applications/office/pdfmm/default.nix @@ -23,7 +23,11 @@ resholve.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -Dm 0755 pdfmm $out/bin/pdfmm + + runHook postInstall ''; solutions.default = { diff --git a/pkgs/applications/office/roam-research/linux.nix b/pkgs/applications/office/roam-research/linux.nix index 04a05d95ffc2f..09a3f5e644b98 100644 --- a/pkgs/applications/office/roam-research/linux.nix +++ b/pkgs/applications/office/roam-research/linux.nix @@ -47,6 +47,8 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ dpkg ]; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" mv opt "$out/" @@ -57,6 +59,8 @@ in stdenv.mkDerivation rec { substituteInPlace $out/share/applications/roam-research.desktop \ --replace "/opt/Roam Research/roam-research" "roam-research" + + runHook postInstall ''; # autoPatchelfHook/patchelf are not used because they cause the binary to coredump. diff --git a/pkgs/applications/office/timetrap/default.nix b/pkgs/applications/office/timetrap/default.nix index 1bdc846638354..4ce60ec5e4e0e 100644 --- a/pkgs/applications/office/timetrap/default.nix +++ b/pkgs/applications/office/timetrap/default.nix @@ -30,6 +30,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ installShellFiles ]; installPhase = '' + runHook preInstall + mkdir $out; cd $out; @@ -42,6 +44,8 @@ stdenv.mkDerivation { installShellCompletion --cmd $c --bash ${ttGem}/lib/ruby/gems/*/gems/timetrap*/completions/bash/*; installShellCompletion --cmd $c --zsh ${ttGem}/lib/ruby/gems/*/gems/timetrap*/completions/zsh/*; done; + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/office/todo.txt-cli/default.nix b/pkgs/applications/office/todo.txt-cli/default.nix index fbeea83996278..d509a2a731009 100644 --- a/pkgs/applications/office/todo.txt-cli/default.nix +++ b/pkgs/applications/office/todo.txt-cli/default.nix @@ -11,12 +11,16 @@ in stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + install -vd $out/bin install -vm 755 todo.sh $out/bin install -vd $out/share/bash-completion/completions install -vm 644 todo_completion $out/share/bash-completion/completions/todo install -vd $out/etc/todo install -vm 644 todo.cfg $out/etc/todo/config + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/office/todofi.sh/default.nix b/pkgs/applications/office/todofi.sh/default.nix index 5581c3d4f7dc4..c6b5126fb1868 100644 --- a/pkgs/applications/office/todofi.sh/default.nix +++ b/pkgs/applications/office/todofi.sh/default.nix @@ -24,7 +24,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm 755 todofi.sh -t $out/bin + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/qubes/qubes-core-vchan-xen/default.nix b/pkgs/applications/qubes/qubes-core-vchan-xen/default.nix index 7def14890300d..c3dc02a4d8c70 100644 --- a/pkgs/applications/qubes/qubes-core-vchan-xen/default.nix +++ b/pkgs/applications/qubes/qubes-core-vchan-xen/default.nix @@ -21,7 +21,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + make install DESTDIR=$out PREFIX=/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/radio/cloudlog/default.nix b/pkgs/applications/radio/cloudlog/default.nix index 00aa166d41b0a..5b4caa995a256 100644 --- a/pkgs/applications/radio/cloudlog/default.nix +++ b/pkgs/applications/radio/cloudlog/default.nix @@ -23,8 +23,12 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir $out/ cp -R ./* $out + + runHook postInstall ''; passthru = { diff --git a/pkgs/applications/radio/dmrconfig/default.nix b/pkgs/applications/radio/dmrconfig/default.nix index e235d68d365bd..62135dc4e1f6f 100644 --- a/pkgs/applications/radio/dmrconfig/default.nix +++ b/pkgs/applications/radio/dmrconfig/default.nix @@ -33,9 +33,13 @@ stdenv.mkDerivation rec { makeFlags = [ "VERSION=${version}" "GITCOUNT=0" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib/udev/rules.d make install install 99-dmr.rules $out/lib/udev/rules.d/99-dmr.rules + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/radio/qradiolink/default.nix b/pkgs/applications/radio/qradiolink/default.nix index ab413ca82e386..496af01a2aff1 100644 --- a/pkgs/applications/radio/qradiolink/default.nix +++ b/pkgs/applications/radio/qradiolink/default.nix @@ -41,9 +41,13 @@ gnuradio3_8.pkgs.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D qradiolink $out/bin/qradiolink install -Dm644 src/res/icon.png $out/share/pixmaps/qradiolink.png install -Dm644 qradiolink.desktop $out/share/applications/qradiolink.desktop + + runHook postInstall ''; buildInputs = [ diff --git a/pkgs/applications/radio/rscw/default.nix b/pkgs/applications/radio/rscw/default.nix index 7fe638df61d0c..02a7c70980c6c 100644 --- a/pkgs/applications/radio/rscw/default.nix +++ b/pkgs/applications/radio/rscw/default.nix @@ -21,10 +21,14 @@ stdenv.mkDerivation rec { buildInputs = [ gtk2 fftw ]; installPhase = '' + runHook preInstall + install -D -m 0755 noisycw $out/bin/noisycw install -D -m 0755 rs12tlmdec $out/bin/rs12tlmdec install -D -m 0755 rscw $out/bin/rscw install -D -m 0755 rscwx $out/bin/rscwx + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/radio/sdrplay/default.nix b/pkgs/applications/radio/sdrplay/default.nix index 9d9ee298e09c0..b200a4701b27c 100644 --- a/pkgs/applications/radio/sdrplay/default.nix +++ b/pkgs/applications/radio/sdrplay/default.nix @@ -41,6 +41,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib,include,lib/udev/rules.d} majorVersion="${lib.concatStringsSep "." (lib.take 1 (builtins.splitVersion version))}" majorMinorVersion="${lib.concatStringsSep "." (lib.take 2 (builtins.splitVersion version))}" @@ -51,6 +53,8 @@ stdenv.mkDerivation rec { cp "${arch}/sdrplay_apiService" $out/bin/ cp -r inc/* $out/include/ cp 66-mirics.rules $out/lib/udev/rules.d/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/astronomy/astrolabe-generator/default.nix b/pkgs/applications/science/astronomy/astrolabe-generator/default.nix index 603fb8087266f..618bfd4ffb1b6 100644 --- a/pkgs/applications/science/astronomy/astrolabe-generator/default.nix +++ b/pkgs/applications/science/astronomy/astrolabe-generator/default.nix @@ -14,11 +14,15 @@ stdenv.mkDerivation rec { sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/java} cp AstrolabeGenerator-${version}.jar $out/share/java makeWrapper ${jre}/bin/java $out/bin/AstrolabeGenerator \ --add-flags "-jar $out/share/java/AstrolabeGenerator-${version}.jar" + + runHook postInstall ''; meta = with lib;{ diff --git a/pkgs/applications/science/astronomy/astrolog/default.nix b/pkgs/applications/science/astronomy/astrolog/default.nix index a2e2e0f02cf6d..df30b803d88ff 100644 --- a/pkgs/applications/science/astronomy/astrolog/default.nix +++ b/pkgs/applications/science/astronomy/astrolog/default.nix @@ -38,6 +38,8 @@ stdenv.mkDerivation { sha256 = "001bmqyldsbk4bdliqfl4a9ydrh1ff13wccvfniwaxlmvkridx2q"; }; in '' + runHook preInstall + mkdir -p $out/bin $out/astrolog cp *.as $out/astrolog install astrolog $out/bin @@ -52,6 +54,8 @@ stdenv.mkDerivation { mkdir -p $out/ephemeris cp -r ${moonsEphemeris}/*.se1 $out/ephemeris ''} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/bayescan/default.nix b/pkgs/applications/science/biology/bayescan/default.nix index e715ff4b45b06..b92a6726158d7 100644 --- a/pkgs/applications/science/biology/bayescan/default.nix +++ b/pkgs/applications/science/biology/bayescan/default.nix @@ -23,10 +23,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/doc/bayescan cp bayescan_${version} $out/bin cp -r ../*pdf ../input_examples ../"R functions" $out/share/doc/bayescan + + runHook postInstall ''; env.NIX_CFLAGS_COMPILE = toString [ "-std=c++14" ]; diff --git a/pkgs/applications/science/biology/bedtools/default.nix b/pkgs/applications/science/biology/bedtools/default.nix index 19df156ae17cc..d9e3f7baaa93b 100644 --- a/pkgs/applications/science/biology/bedtools/default.nix +++ b/pkgs/applications/science/biology/bedtools/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { cxx = if stdenv.cc.isClang then "clang++" else "g++"; cc = if stdenv.cc.isClang then "clang" else "gcc"; buildPhase = "make prefix=$out SHELL=${stdenv.shell} CXX=${cxx} CC=${cc} -j $NIX_BUILD_CORES"; - installPhase = "make prefix=$out SHELL=${stdenv.shell} CXX=${cxx} CC=${cc} install"; + installPhase = "runHook preInstall; make prefix=$out SHELL=${stdenv.shell} CXX=${cxx} CC=${cc} install; runHook postInstall"; meta = with lib; { description = "Powerful toolset for genome arithmetic"; diff --git a/pkgs/applications/science/biology/bftools/default.nix b/pkgs/applications/science/biology/bftools/default.nix index 6b8a7fd96d099..39f8c8499b252 100644 --- a/pkgs/applications/science/biology/bftools/default.nix +++ b/pkgs/applications/science/biology/bftools/default.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + find . -maxdepth 1 -perm -111 -type f -not -name "*.sh" \ -exec install -vD {} "$out"/bin/{} \; @@ -23,6 +25,8 @@ stdenv.mkDerivation rec { substituteInPlace $file --replace "\$BF_DIR" $out/libexec done substituteInPlace $out/libexec/bf.sh --replace "\$BF_JAR_DIR" $out/share/java + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/science/biology/ecopcr/default.nix b/pkgs/applications/science/biology/ecopcr/default.nix index c5ab32a68838d..20e799fd4af55 100644 --- a/pkgs/applications/science/biology/ecopcr/default.nix +++ b/pkgs/applications/science/biology/ecopcr/default.nix @@ -16,12 +16,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -v ecoPCR $out/bin cp -v ecogrep $out/bin cp -v ecofind $out/bin cp -v ../tools/ecoPCRFormat.py $out/bin/ecoPCRFormat chmod a+x $out/bin/ecoPCRFormat + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/est-sfs/default.nix b/pkgs/applications/science/biology/est-sfs/default.nix index c306cfd71c392..79f478b5870e8 100644 --- a/pkgs/applications/science/biology/est-sfs/default.nix +++ b/pkgs/applications/science/biology/est-sfs/default.nix @@ -16,10 +16,14 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/doc/${pname} cp est-sfs $out/bin cp est-sfs-documentation.pdf $out/share/doc/${pname} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/fastp/default.nix b/pkgs/applications/science/biology/fastp/default.nix index 0495da0e3c3df..1854313970e56 100644 --- a/pkgs/applications/science/biology/fastp/default.nix +++ b/pkgs/applications/science/biology/fastp/default.nix @@ -20,7 +20,11 @@ stdenv.mkDerivation rec { buildInputs = [ zlib libdeflate isa-l ]; installPhase = '' + runHook preInstall + install -D fastp $out/bin/fastp + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/freebayes/default.nix b/pkgs/applications/science/biology/freebayes/default.nix index 0ceaab4ab46be..a4d5b941f0754 100644 --- a/pkgs/applications/science/biology/freebayes/default.nix +++ b/pkgs/applications/science/biology/freebayes/default.nix @@ -22,7 +22,11 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = "-fcommon"; installPhase = '' + runHook preInstall + install -vD bin/freebayes bin/bamleftalign scripts/* -t $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/gatk/default.nix b/pkgs/applications/science/biology/gatk/default.nix index 50dc0613c743f..b6bcaab73b22f 100644 --- a/pkgs/applications/science/biology/gatk/default.nix +++ b/pkgs/applications/science/biology/gatk/default.nix @@ -14,10 +14,14 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -m755 -D $src/gatk-package-${version}-local.jar $out/bin/ install -m755 -D $src/gatk-package-${version}-spark.jar $out/bin/ install -m755 -D $src/gatk $out/bin/ + + runHook postInstall ''; postFixup = '' wrapProgram $out/bin/gatk --prefix PATH : ${lib.makeBinPath [ jre ]} diff --git a/pkgs/applications/science/biology/hisat2/default.nix b/pkgs/applications/science/biology/hisat2/default.nix index 67c39031b773a..e653e7b9b8496 100644 --- a/pkgs/applications/science/biology/hisat2/default.nix +++ b/pkgs/applications/science/biology/hisat2/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { buildInputs = [ python3 perl ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp hisat2 \ hisat2-inspect-l \ @@ -33,6 +35,8 @@ stdenv.mkDerivation rec { hisat2_extract_splice_sites.py \ hisat2_simulate_reads.py \ $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/igv/default.nix b/pkgs/applications/science/biology/igv/default.nix index 0c74b65c98a26..fa47c096f5ed4 100644 --- a/pkgs/applications/science/biology/igv/default.nix +++ b/pkgs/applications/science/biology/igv/default.nix @@ -9,6 +9,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -pv $out/{share,bin} cp -Rv * $out/share/ @@ -23,6 +25,8 @@ stdenv.mkDerivation rec { chmod +x $out/bin/igv chmod +x $out/bin/igvtools + + runHook postInstall ''; nativeBuildInputs = [ wrapGAppsHook3 ]; diff --git a/pkgs/applications/science/biology/itsx/default.nix b/pkgs/applications/science/biology/itsx/default.nix index 366b4add2ed77..9dbc40dad55f4 100644 --- a/pkgs/applications/science/biology/itsx/default.nix +++ b/pkgs/applications/science/biology/itsx/default.nix @@ -19,9 +19,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc && cp -a bin $out/ cp *pdf $out/share/doc cp -r ITSx_db $out/share + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/minimap2/default.nix b/pkgs/applications/science/biology/minimap2/default.nix index 5597b5504678d..9fb70cce0f702 100644 --- a/pkgs/applications/science/biology/minimap2/default.nix +++ b/pkgs/applications/science/biology/minimap2/default.nix @@ -16,10 +16,14 @@ stdenv.mkDerivation rec { makeFlags = lib.optionals stdenv.isAarch64 [ "arm_neon=1" "aarch64=1" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp minimap2 $out/bin mkdir -p $out/share/man/man1 cp minimap2.1 $out/share/man/man1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/muscle/default.nix b/pkgs/applications/science/biology/muscle/default.nix index cdcf6c7b50aa8..56e4920f9f5d2 100644 --- a/pkgs/applications/science/biology/muscle/default.nix +++ b/pkgs/applications/science/biology/muscle/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation rec { sourceRoot = "${src.name}/src"; installPhase = '' + runHook preInstall + install -m755 -D Linux/muscle $out/bin/muscle + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/picard-tools/default.nix b/pkgs/applications/science/biology/picard-tools/default.nix index e8786fe4b9c0e..da11692402f93 100644 --- a/pkgs/applications/science/biology/picard-tools/default.nix +++ b/pkgs/applications/science/biology/picard-tools/default.nix @@ -15,10 +15,14 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/libexec/picard cp $src $out/libexec/picard/picard.jar mkdir -p $out/bin makeWrapper ${jre}/bin/java $out/bin/picard --add-flags "-jar $out/libexec/picard/picard.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/platypus/default.nix b/pkgs/applications/science/biology/platypus/default.nix index 56e1852213961..7ffc9f051b2f4 100644 --- a/pkgs/applications/science/biology/platypus/default.nix +++ b/pkgs/applications/science/biology/platypus/default.nix @@ -22,11 +22,15 @@ in stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/libexec/platypus cp -r ./* $out/libexec/platypus mkdir -p $out/bin makeWrapper ${python}/bin/python $out/bin/platypus --add-flags "$out/libexec/platypus/bin/Platypus.py" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/plink-ng/default.nix b/pkgs/applications/science/biology/plink-ng/default.nix index b91655ac8fdac..e8f595a9c250c 100644 --- a/pkgs/applications/science/biology/plink-ng/default.nix +++ b/pkgs/applications/science/biology/plink-ng/default.nix @@ -26,8 +26,12 @@ stdenv.mkDerivation rec { makefile = "Makefile.std"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp plink $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/biology/quast/default.nix b/pkgs/applications/science/biology/quast/default.nix index f280f81fae842..178ced4c07f2b 100644 --- a/pkgs/applications/science/biology/quast/default.nix +++ b/pkgs/applications/science/biology/quast/default.nix @@ -23,6 +23,8 @@ pythonPackages.buildPythonApplication rec { dontBuild = true; installPhase = '' + runHook preInstall + substituteInPlace quast_libs/bedtools/Makefile \ --replace "/bin/bash" "${bash}/bin/bash" mkdir -p "$out/${python.sitePackages}" @@ -30,6 +32,8 @@ pythonPackages.buildPythonApplication rec { ${python.pythonOnBuildForHost.interpreter} setup.py install \ --install-lib=$out/${python.sitePackages} \ --prefix="$out" + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/science/biology/samblaster/default.nix b/pkgs/applications/science/biology/samblaster/default.nix index f16d0e42d8ef5..5c6ef24ce67ac 100644 --- a/pkgs/applications/science/biology/samblaster/default.nix +++ b/pkgs/applications/science/biology/samblaster/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { makeFlags = [ "CPP=${stdenv.cc.targetPrefix}c++" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp samblaster $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/samtools/samtools_0_1_19.nix b/pkgs/applications/science/biology/samtools/samtools_0_1_19.nix index edb3a9a9da5bb..0e5da08ea739c 100644 --- a/pkgs/applications/science/biology/samtools/samtools_0_1_19.nix +++ b/pkgs/applications/science/biology/samtools/samtools_0_1_19.nix @@ -16,11 +16,15 @@ stdenv.mkDerivation rec { buildInputs = [ zlib ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/man cp samtools $out/bin cp samtools.1 $out/share/man + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/seaview/default.nix b/pkgs/applications/science/biology/seaview/default.nix index 06549748018d6..fbf38b8e6d26c 100644 --- a/pkgs/applications/science/biology/seaview/default.nix +++ b/pkgs/applications/science/biology/seaview/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { buildInputs = [ fltk libjpeg ]; patchPhase = "sed -i 's#PATH=/bin:/usr/bin rm#'${coreutils}/bin/rm'#' seaview.cxx"; - installPhase = "mkdir -p $out/bin; cp seaview $out/bin"; + installPhase = "runHook preInstall; mkdir -p $out/bin; cp seaview $out/bin; runHook postInstall"; meta = with lib; { description = "GUI for molecular phylogeny"; diff --git a/pkgs/applications/science/biology/snpeff/default.nix b/pkgs/applications/science/biology/snpeff/default.nix index 269d6e307f1da..8e278726480b8 100644 --- a/pkgs/applications/science/biology/snpeff/default.nix +++ b/pkgs/applications/science/biology/snpeff/default.nix @@ -15,12 +15,16 @@ stdenv.mkDerivation rec { sourceRoot = "snpEff"; installPhase = '' + runHook preInstall + mkdir -p $out/libexec/snpeff cp *.jar *.config $out/libexec/snpeff mkdir -p $out/bin makeWrapper ${jre}/bin/java $out/bin/snpeff --add-flags "-jar $out/libexec/snpeff/snpEff.jar" makeWrapper ${jre}/bin/java $out/bin/snpsift --add-flags "-jar $out/libexec/snpeff/SnpSift.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/subread/default.nix b/pkgs/applications/science/biology/subread/default.nix index 62ea61af91926..a7c8f423cbd14 100644 --- a/pkgs/applications/science/biology/subread/default.nix +++ b/pkgs/applications/science/biology/subread/default.nix @@ -25,8 +25,12 @@ stdenv.mkDerivation rec { makeFlags = [ "CC_EXEC=cc" ]; installPhase = '' + runHook preInstall + mkdir $out cp -r ../bin $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/trimal/default.nix b/pkgs/applications/science/biology/trimal/default.nix index f822fe50b1648..eef2f3a4e6d6e 100644 --- a/pkgs/applications/science/biology/trimal/default.nix +++ b/pkgs/applications/science/biology/trimal/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a trimal readal statal $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/biology/varscan/default.nix b/pkgs/applications/science/biology/varscan/default.nix index bf6d16c3701d2..3c19b8247b792 100644 --- a/pkgs/applications/science/biology/varscan/default.nix +++ b/pkgs/applications/science/biology/varscan/default.nix @@ -15,10 +15,14 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/libexec/varscan cp $src $out/libexec/varscan/varscan.jar mkdir -p $out/bin makeWrapper ${jre}/bin/java $out/bin/varscan --add-flags "-jar $out/libexec/varscan/varscan.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/chemistry/cp2k/default.nix b/pkgs/applications/science/chemistry/cp2k/default.nix index 8a831fe23b742..df438bfd636c1 100644 --- a/pkgs/applications/science/chemistry/cp2k/default.nix +++ b/pkgs/applications/science/chemistry/cp2k/default.nix @@ -202,6 +202,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/cp2k cp exe/${arch}/* $out/bin @@ -217,6 +219,8 @@ stdenv.mkDerivation rec { --set OMP_NUM_THREADS 1 cp -r data/* $out/share/cp2k + + runHook postInstall ''; passthru = { inherit mpi; }; diff --git a/pkgs/applications/science/chemistry/jmol/default.nix b/pkgs/applications/science/chemistry/jmol/default.nix index a48019febb1de..465b3bc9f3b64 100644 --- a/pkgs/applications/science/chemistry/jmol/default.nix +++ b/pkgs/applications/science/chemistry/jmol/default.nix @@ -40,6 +40,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/share/jmol" "$out/bin" ${unzip}/bin/unzip jsmol.zip -d "$out/share/" @@ -47,6 +49,8 @@ stdenv.mkDerivation rec { cp *.jar jmol.sh "$out/share/jmol" cp -r ${desktopItem}/share/applications $out/share cp jmol $out/bin + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/applications/science/chemistry/marvin/default.nix b/pkgs/applications/science/chemistry/marvin/default.nix index e1e911e2d4dfb..410fb3d6ff95a 100644 --- a/pkgs/applications/science/chemistry/marvin/default.nix +++ b/pkgs/applications/science/chemistry/marvin/default.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + wrapBin() { makeWrapper $1 $out/bin/$(basename $1) \ --set INSTALL4J_JAVA_HOME "${openjdk17}" \ @@ -34,6 +36,8 @@ stdenv.mkDerivation rec { ${lib.concatStrings (map (name: '' substitute ${./. + "/${name}.desktop"} $out/share/applications/${name}.desktop --subst-var out '') [ "LicenseManager" "MarvinSketch" "MarvinView" ])} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/chemistry/siesta/default.nix b/pkgs/applications/science/chemistry/siesta/default.nix index 2ec4d37f73ed2..d5c4ac9fbddbe 100644 --- a/pkgs/applications/science/chemistry/siesta/default.nix +++ b/pkgs/applications/science/chemistry/siesta/default.nix @@ -58,8 +58,12 @@ stdenv.mkDerivation rec { ''); installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a siesta $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/computer-architecture/timeloop/default.nix b/pkgs/applications/science/computer-architecture/timeloop/default.nix index 7fc5da8dfa89a..281dbb0bd54c8 100644 --- a/pkgs/applications/science/computer-architecture/timeloop/default.nix +++ b/pkgs/applications/science/computer-architecture/timeloop/default.nix @@ -82,12 +82,16 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + cp -r ./bin ./lib $out mkdir -p $out/share cp -r ./doc $out/share mkdir -p $out/data cp -r ./problem-shapes ./configs $out/data - ''; + + runHook postInstall + ''; meta = with lib; { description = "Chip modeling/mapping benchmarking framework"; diff --git a/pkgs/applications/science/electronics/eagle/eagle.nix b/pkgs/applications/science/electronics/eagle/eagle.nix index 6302c2dbfa384..29fcd3cd4a5c3 100644 --- a/pkgs/applications/science/electronics/eagle/eagle.nix +++ b/pkgs/applications/science/electronics/eagle/eagle.nix @@ -37,6 +37,8 @@ let ]; installPhase = '' + runHook preInstall + # Extract eagle tarball mkdir "$out" tar -xzf "$src" -C "$out" @@ -68,6 +70,8 @@ let cp "$desktopItem"/share/applications/* "$out"/share/applications/ mkdir -p "$out"/share/pixmaps ln -s "$out/eagle-${version}/bin/eagle-logo.png" "$out"/share/pixmaps/eagle.png + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/electronics/kicad/addons/kikit.nix b/pkgs/applications/science/electronics/kicad/addons/kikit.nix index b6d3cf3e72054..0cf1c019dd6d2 100644 --- a/pkgs/applications/science/electronics/kicad/addons/kikit.nix +++ b/pkgs/applications/science/electronics/kicad/addons/kikit.nix @@ -42,8 +42,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir $out mv build/${targetSpec.resultZip} $out/${addonPath} + + runHook postInstall ''; meta = kikit-module.meta // { diff --git a/pkgs/applications/science/geometry/tetgen/1.4.nix b/pkgs/applications/science/geometry/tetgen/1.4.nix index f67bf198443ab..e2b3bbc205192 100644 --- a/pkgs/applications/science/geometry/tetgen/1.4.nix +++ b/pkgs/applications/science/geometry/tetgen/1.4.nix @@ -10,8 +10,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp tetgen $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/logic/abella/default.nix b/pkgs/applications/science/logic/abella/default.nix index 7878626d6e9a3..231a5f668b953 100644 --- a/pkgs/applications/science/logic/abella/default.nix +++ b/pkgs/applications/science/logic/abella/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = with ocamlPackages; [ cmdliner yojson ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin rsync -av _build/default/src/abella.exe $out/bin/abella @@ -23,6 +25,8 @@ stdenv.mkDerivation (finalAttrs: { mkdir -p $out/share/abella/examples rsync -av examples/ $out/share/abella/examples/ + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/logic/acgtk/default.nix b/pkgs/applications/science/logic/acgtk/default.nix index 37c7b527a9134..5112f823ab277 100644 --- a/pkgs/applications/science/logic/acgtk/default.nix +++ b/pkgs/applications/science/logic/acgtk/default.nix @@ -28,7 +28,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + dune install --prefix $out --libdir $OCAMLFIND_DESTDIR + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/aiger/default.nix b/pkgs/applications/science/logic/aiger/default.nix index 5b9e8f62aa01c..a7186122e75f1 100644 --- a/pkgs/applications/science/logic/aiger/default.nix +++ b/pkgs/applications/science/logic/aiger/default.nix @@ -26,6 +26,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $dev/include $lib/lib # Do the installation manually, as the Makefile has odd @@ -46,6 +48,8 @@ stdenv.mkDerivation rec { cp -v aiger.o $lib/lib cp -v aiger.h $dev/include + + runHook postInstall ''; outputs = [ "out" "dev" "lib" ]; diff --git a/pkgs/applications/science/logic/avy/default.nix b/pkgs/applications/science/logic/avy/default.nix index 38fef51c56e6d..fef0fd8b617c1 100644 --- a/pkgs/applications/science/logic/avy/default.nix +++ b/pkgs/applications/science/logic/avy/default.nix @@ -33,8 +33,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp avy/src/{avy,avybmc} $out/bin/ + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/logic/btor2tools/default.nix b/pkgs/applications/science/logic/btor2tools/default.nix index a66637150bdfd..f7777a4880b8a 100644 --- a/pkgs/applications/science/logic/btor2tools/default.nix +++ b/pkgs/applications/science/logic/btor2tools/default.nix @@ -22,11 +22,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; installPhase = '' + runHook preInstall + mkdir -p $out $dev/include/btor2parser/ $lib/lib cp -vr bin $out cp -v ../src/btor2parser/btor2parser.h $dev/include/btor2parser cp -v lib/libbtor2parser.* $lib/lib + + runHook postInstall ''; outputs = [ "out" "dev" "lib" ]; diff --git a/pkgs/applications/science/logic/cedille/default.nix b/pkgs/applications/science/logic/cedille/default.nix index 1ac3ff3fe310a..a0d73de29e4b4 100644 --- a/pkgs/applications/science/logic/cedille/default.nix +++ b/pkgs/applications/science/logic/cedille/default.nix @@ -37,12 +37,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin/ cedille install -Dm755 -t $out/bin/ core/cedille-core install -Dm644 -t $out/share/info docs/info/cedille-info-main.info mkdir -p $out/lib/ cp -r lib/ $out/lib/cedille/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/celf/default.nix b/pkgs/applications/science/logic/celf/default.nix index e1f0c237f6732..92868279ee6d8 100644 --- a/pkgs/applications/science/logic/celf/default.nix +++ b/pkgs/applications/science/logic/celf/default.nix @@ -21,9 +21,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp .heap* $out/bin/ ./.mkexec ${smlnj}/bin/sml $out/bin celf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/clprover/clprover.nix b/pkgs/applications/science/logic/clprover/clprover.nix index 543c6cb4310bd..f70a14b5d4144 100644 --- a/pkgs/applications/science/logic/clprover/clprover.nix +++ b/pkgs/applications/science/logic/clprover/clprover.nix @@ -11,10 +11,14 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir $out cp -r bin $out/bin mkdir -p $out/share/clprover cp -r examples $out/share/clprover/examples + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/drat-trim/default.nix b/pkgs/applications/science/logic/drat-trim/default.nix index fb8468f4fbda6..fa045229aa0b0 100644 --- a/pkgs/applications/science/logic/drat-trim/default.nix +++ b/pkgs/applications/science/logic/drat-trim/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -Dt $out/bin drat-trim lrat-check + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/fast-downward/default.nix b/pkgs/applications/science/logic/fast-downward/default.nix index c18a610467470..5962c96089eb2 100644 --- a/pkgs/applications/science/logic/fast-downward/default.nix +++ b/pkgs/applications/science/logic/fast-downward/default.nix @@ -34,6 +34,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 builds/release/bin/downward $out/libexec/fast-downward/downward cp -r builds/release/bin/translate $out/libexec/fast-downward/ install -Dm755 fast-downward.py $out/bin/fast-downward @@ -55,6 +57,8 @@ stdenv.mkDerivation rec { substituteInPlace $out/${python3.sitePackages}/driver/arguments.py \ --replace 'args.build = "release"' "args.build = \"$out/libexec/fast-downward\"" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/gappa/default.nix b/pkgs/applications/science/logic/gappa/default.nix index 2eb8567aaa4ce..74e75e70d105b 100644 --- a/pkgs/applications/science/logic/gappa/default.nix +++ b/pkgs/applications/science/logic/gappa/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { buildInputs = [ gmp mpfr boost.dev ]; buildPhase = "./remake"; - installPhase = "./remake install"; + installPhase = "runHook preInstall; ./remake install; runHook postInstall"; meta = { homepage = "http://gappa.gforge.inria.fr/"; diff --git a/pkgs/applications/science/logic/hol_light/default.nix b/pkgs/applications/science/logic/hol_light/default.nix index 59389f11a2828..25ab1e2d6a2e3 100644 --- a/pkgs/applications/science/logic/hol_light/default.nix +++ b/pkgs/applications/science/logic/hol_light/default.nix @@ -48,10 +48,14 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir -p "$out/lib/hol_light" "$out/bin" cp -a . $out/lib/hol_light echo "${start_script}" > "$out/bin/hol_light" chmod a+x "$out/bin/hol_light" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/leo3/binary.nix b/pkgs/applications/science/logic/leo3/binary.nix index e8af3fdaab1a3..24d96b5ec7e3b 100644 --- a/pkgs/applications/science/logic/leo3/binary.nix +++ b/pkgs/applications/science/logic/leo3/binary.nix @@ -11,11 +11,15 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,lib/java/leo3} cp "${src}" "$out/lib/java/leo3/leo3.jar" echo "#!${runtimeShell}" > "$out/bin/leo3" echo "'${openjdk}/bin/java' -jar '$out/lib/java/leo3/leo3.jar' \"\$@\"" >> "$out/bin/leo3" chmod a+x "$out/bin/leo3" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/lingeling/default.nix b/pkgs/applications/science/logic/lingeling/default.nix index 1abf38b49cf82..14f5efda45899 100644 --- a/pkgs/applications/science/logic/lingeling/default.nix +++ b/pkgs/applications/science/logic/lingeling/default.nix @@ -28,12 +28,16 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $lib/lib $dev/include cp lglib.h $dev/include cp liblgl.a $lib/lib cp lingeling plingeling treengeling ilingeling blimc $out/bin + + runHook postInstall ''; outputs = [ "out" "dev" "lib" ]; diff --git a/pkgs/applications/science/logic/ltl2ba/default.nix b/pkgs/applications/science/logic/ltl2ba/default.nix index 19ade58fbfaa1..54488533fbab2 100644 --- a/pkgs/applications/science/logic/ltl2ba/default.nix +++ b/pkgs/applications/science/logic/ltl2ba/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv ltl2ba $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/logic/mcy/default.nix b/pkgs/applications/science/logic/mcy/default.nix index 343b50dfd7ef9..450ae629d5cf5 100644 --- a/pkgs/applications/science/logic/mcy/default.nix +++ b/pkgs/applications/science/logic/mcy/default.nix @@ -34,11 +34,15 @@ stdenv.mkDerivation { # the build needs a bit of work... buildPhase = "true"; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/mcy/{dash,scripts} install mcy.py $out/bin/mcy && chmod +x $out/bin/mcy install mcy-dash.py $out/bin/mcy-dash && chmod +x $out/bin/mcy-dash cp -r dash/. $out/share/mcy/dash/. cp -r scripts/. $out/share/mcy/scripts/. + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/logic/metis-prover/default.nix b/pkgs/applications/science/logic/metis-prover/default.nix index bd6f71860bdb9..ea496e11c8388 100644 --- a/pkgs/applications/science/logic/metis-prover/default.nix +++ b/pkgs/applications/science/logic/metis-prover/default.nix @@ -19,7 +19,11 @@ stdenv.mkDerivation { buildPhase = "make mlton"; installPhase = '' + runHook preInstall + install -Dm0755 bin/mlton/metis $out/bin/metis + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/nusmv/default.nix b/pkgs/applications/science/logic/nusmv/default.nix index d7ecbc7cd8874..ba1fe4cd08e96 100644 --- a/pkgs/applications/science/logic/nusmv/default.nix +++ b/pkgs/applications/science/logic/nusmv/default.nix @@ -21,10 +21,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoPatchelfHook ]; installPhase = '' + runHook preInstall + install -m755 -D bin/NuSMV $out/bin/NuSMV install -m755 -D bin/ltl2smv $out/bin/ltl2smv cp -r include $out/include cp -r share $out/share + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/open-wbo/default.nix b/pkgs/applications/science/logic/open-wbo/default.nix index 2290ff29224b4..5e5d8c00e4656 100644 --- a/pkgs/applications/science/logic/open-wbo/default.nix +++ b/pkgs/applications/science/logic/open-wbo/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation { makeFlags = [ "r" ]; installPhase = '' + runHook preInstall + install -Dm0755 open-wbo_release $out/bin/open-wbo + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/picosat/default.nix b/pkgs/applications/science/logic/picosat/default.nix index 1fef05069a696..48eb8432dc72a 100644 --- a/pkgs/applications/science/logic/picosat/default.nix +++ b/pkgs/applications/science/logic/picosat/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation rec { "SONAME=-Wl,-install_name,$(out)/lib/libpicosat.so"; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib $out/share $out/include/picosat cp picomus picomcs picosat picogcnf "$out"/bin @@ -32,7 +34,9 @@ stdenv.mkDerivation rec { cp libpicosat.so "$out"/lib cp picosat.h "$out"/include/picosat - ''; + + runHook postInstall + ''; meta = { description = "SAT solver with proof and core support"; diff --git a/pkgs/applications/science/logic/prover9/default.nix b/pkgs/applications/science/logic/prover9/default.nix index a82e44c8a5109..ac8373fb4bdb2 100644 --- a/pkgs/applications/science/logic/prover9/default.nix +++ b/pkgs/applications/science/logic/prover9/default.nix @@ -27,8 +27,12 @@ stdenv.mkDerivation { checkPhase = "make test1"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bin/* $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/redprl/default.nix b/pkgs/applications/science/logic/redprl/default.nix index a6354a091665e..c1f62f006ea09 100644 --- a/pkgs/applications/science/logic/redprl/default.nix +++ b/pkgs/applications/science/logic/redprl/default.nix @@ -23,8 +23,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv ./bin/redprl $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/satallax/default.nix b/pkgs/applications/science/logic/satallax/default.nix index bd3e9d3e8351e..a22c57408b3f0 100644 --- a/pkgs/applications/science/logic/satallax/default.nix +++ b/pkgs/applications/science/logic/satallax/default.nix @@ -52,6 +52,8 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-reserved-user-defined-literal"; installPhase = '' + runHook preInstall + mkdir -p "$out/share/doc/satallax" "$out/bin" "$out/lib" "$out/lib/satallax" cp bin/satallax.opt "$out/bin/satallax" wrapProgram "$out/bin/satallax" \ @@ -65,6 +67,8 @@ stdenv.mkDerivation rec { cp -r modes "$out/lib/satallax/" cp -r problems "$out/lib/satallax/" cp -r coq* "$out/lib/satallax/" + + runHook postInstall ''; doCheck = stdenv.isLinux; diff --git a/pkgs/applications/science/logic/saw-tools/default.nix b/pkgs/applications/science/logic/saw-tools/default.nix index b6291bfae3698..b85ffab849c26 100644 --- a/pkgs/applications/science/logic/saw-tools/default.nix +++ b/pkgs/applications/science/logic/saw-tools/default.nix @@ -29,6 +29,8 @@ stdenv.mkDerivation { src = saw-bin; installPhase = '' + runHook preInstall + mkdir -p $out/lib $out/share mv bin $out/bin @@ -39,6 +41,8 @@ stdenv.mkDerivation { # Add a clang symlink for easy building with a suitable compiler. ln -s ${clang}/bin/clang $out/bin/saw-clang + + runHook postInstall ''; fixupPhase = '' diff --git a/pkgs/applications/science/logic/spass/default.nix b/pkgs/applications/science/logic/spass/default.nix index 77b297b4fbbbd..3d026a2571af4 100644 --- a/pkgs/applications/science/logic/spass/default.nix +++ b/pkgs/applications/science/logic/spass/default.nix @@ -25,8 +25,12 @@ stdenv.mkDerivation { make RM="rm -f" proparser.c ${extraTools} opt ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -m0755 SPASS ${extraTools} $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/statverif/default.nix b/pkgs/applications/science/logic/statverif/default.nix index 1f62389775517..62811ee21ab1b 100644 --- a/pkgs/applications/science/logic/statverif/default.nix +++ b/pkgs/applications/science/logic/statverif/default.nix @@ -21,9 +21,13 @@ stdenv.mkDerivation rec { patchPhase = "patch -p1 < ${pf-patch}"; buildPhase = "./build"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ./proverif $out/bin/statverif cp ./proveriftotex $out/bin/statveriftotex + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/logic/symbiyosys/default.nix b/pkgs/applications/science/logic/symbiyosys/default.nix index c3df8340d20c8..bbb6788d09d47 100644 --- a/pkgs/applications/science/logic/symbiyosys/default.nix +++ b/pkgs/applications/science/logic/symbiyosys/default.nix @@ -39,12 +39,16 @@ stdenv.mkDerivation { buildPhase = "true"; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/yosys/python3 cp sbysrc/sby_*.py $out/share/yosys/python3/ cp sbysrc/sby.py $out/bin/sby chmod +x $out/bin/sby + + runHook postInstall ''; doCheck = false; # not all provers are yet packaged... diff --git a/pkgs/applications/science/logic/tlaplus/default.nix b/pkgs/applications/science/logic/tlaplus/default.nix index f478bf204d4f3..6ac8084afbe15 100644 --- a/pkgs/applications/science/logic/tlaplus/default.nix +++ b/pkgs/applications/science/logic/tlaplus/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/java $out/bin cp $src $out/share/java/tla2tools.jar @@ -24,6 +26,8 @@ stdenv.mkDerivation rec { --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar pcal.trans" makeWrapper ${jre}/bin/java $out/bin/tlatex \ --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar tla2tex.TLA" + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/logic/tlaplus/tlaplus18.nix b/pkgs/applications/science/logic/tlaplus/tlaplus18.nix index 2bd0f4b835647..c7d0a812f5ef8 100644 --- a/pkgs/applications/science/logic/tlaplus/tlaplus18.nix +++ b/pkgs/applications/science/logic/tlaplus/tlaplus18.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/java $out/bin cp $src $out/share/java/tla2tools.jar @@ -26,6 +28,8 @@ stdenv.mkDerivation rec { --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar tla2tex.TLA" makeWrapper ${jre}/bin/java $out/bin/tlarepl \ --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar tlc2.REPL" + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/logic/tlaplus/tlaps.nix b/pkgs/applications/science/logic/tlaplus/tlaps.nix index 59afbc094e40d..c3d1157e315c1 100644 --- a/pkgs/applications/science/logic/tlaplus/tlaps.nix +++ b/pkgs/applications/science/logic/tlaplus/tlaps.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ ocaml isabelle cvc3 perl wget which ]; installPhase = '' + runHook preInstall + mkdir -pv "$out" export HOME="$out" export PATH=$out/bin:$PATH @@ -40,6 +42,8 @@ stdenv.mkDerivation rec { ./configure --prefix $out make all make install + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/logic/tptp/default.nix b/pkgs/applications/science/logic/tptp/default.nix index 5df511ebaa8e7..8831250efb4ed 100644 --- a/pkgs/applications/science/logic/tptp/default.nix +++ b/pkgs/applications/science/logic/tptp/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { buildInputs = [ tcsh yap perl ]; installPhase = '' + runHook preInstall + sharedir=$out/share/tptp mkdir -p $sharedir @@ -34,6 +36,8 @@ stdenv.mkDerivation rec { ln -s $sharedir/TPTP2X/tptp2X $out/bin ln -s $sharedir/Scripts/tptp2T $out/bin ln -s $sharedir/Scripts/tptp4X $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/twelf/default.nix b/pkgs/applications/science/logic/twelf/default.nix index 67779b2b5722f..19cbc9cf5d91f 100644 --- a/pkgs/applications/science/logic/twelf/default.nix +++ b/pkgs/applications/science/logic/twelf/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin rsync -av bin/{*,.heap} $out/bin/ bin/.mkexec ${smlnj}/bin/sml $out/ twelf-server twelf-server @@ -32,6 +34,8 @@ stdenv.mkDerivation rec { rsync -av examples/ $out/share/twelf/examples/ mkdir -p $out/share/twelf/vim rsync -av vim/ $out/share/twelf/vim/ + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/logic/vampire/default.nix b/pkgs/applications/science/logic/vampire/default.nix index e86f22613ad47..603093cbb203d 100644 --- a/pkgs/applications/science/logic/vampire/default.nix +++ b/pkgs/applications/science/logic/vampire/default.nix @@ -41,7 +41,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -m0755 -D vampire_z3_rel* $out/bin/vampire + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/logic/verifast/default.nix b/pkgs/applications/science/logic/verifast/default.nix index a1f5ec65a3be3..654ca9960dc96 100644 --- a/pkgs/applications/science/logic/verifast/default.nix +++ b/pkgs/applications/science/logic/verifast/default.nix @@ -30,6 +30,8 @@ stdenv.mkDerivation rec { dontConfigure = true; dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -R bin $out/libexec @@ -38,6 +40,8 @@ stdenv.mkDerivation rec { ${patchLib "$out/libexec/libz3.so"} ln -s $out/libexec/verifast $out/bin/verifast ln -s $out/libexec/vfide $out/bin/vfide + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/logic/why3/with-provers.nix b/pkgs/applications/science/logic/why3/with-provers.nix index 95d5b95718dd9..71d14dd1ad727 100644 --- a/pkgs/applications/science/logic/why3/with-provers.nix +++ b/pkgs/applications/science/logic/why3/with-provers.nix @@ -27,7 +27,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin makeWrapper ${why3}/bin/why3 $out/bin/why3 --add-flags "--config $out/share/why3/why3.conf" + + runHook postInstall ''; } diff --git a/pkgs/applications/science/logic/workcraft/default.nix b/pkgs/applications/science/logic/workcraft/default.nix index ba95bc2239ab2..dbd9d92b7a597 100644 --- a/pkgs/applications/science/logic/workcraft/default.nix +++ b/pkgs/applications/science/logic/workcraft/default.nix @@ -14,13 +14,17 @@ stdenv.mkDerivation rec { dontConfigure = true; installPhase = '' + runHook preInstall + mkdir -p $out/share cp -r * $out/share mkdir $out/bin makeWrapper $out/share/workcraft $out/bin/workcraft \ --set JAVA_HOME "${jre}" \ --set _JAVA_OPTIONS '-Dawt.useSystemAAFontSettings=gasp'; - ''; + + runHook postInstall +''; meta = { homepage = "https://workcraft.org/"; diff --git a/pkgs/applications/science/logic/z3/tptp.nix b/pkgs/applications/science/logic/z3/tptp.nix index 15f6770404ef2..dcb3e83c38e07 100644 --- a/pkgs/applications/science/logic/z3/tptp.nix +++ b/pkgs/applications/science/logic/z3/tptp.nix @@ -17,9 +17,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp "z3_tptp5" "$out/bin/" ln -s "z3_tptp5" "$out/bin/z3-tptp" + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/machine-learning/sc2-headless/default.nix b/pkgs/applications/science/machine-learning/sc2-headless/default.nix index 37128ce67e39d..306d7ee130cb5 100644 --- a/pkgs/applications/science/machine-learning/sc2-headless/default.nix +++ b/pkgs/applications/science/machine-learning/sc2-headless/default.nix @@ -29,6 +29,8 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out cp -r . "$out" rm -r $out/Libs @@ -36,6 +38,8 @@ in stdenv.mkDerivation rec { cp -ur "${maps.minigames}"/* "${maps.melee}"/* "${maps.ladder2017season1}"/* "${maps.ladder2017season2}"/* "${maps.ladder2017season3}"/* \ "${maps.ladder2017season4}"/* "${maps.ladder2018season1}"/* "${maps.ladder2018season2}"/* \ "${maps.ladder2018season3}"/* "${maps.ladder2018season4}"/* "${maps.ladder2019season1}"/* "$out"/Maps/ + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/applications/science/machine-learning/uarmsolver/default.nix b/pkgs/applications/science/machine-learning/uarmsolver/default.nix index 2f24f782927bc..e52d015db6073 100644 --- a/pkgs/applications/science/machine-learning/uarmsolver/default.nix +++ b/pkgs/applications/science/machine-learning/uarmsolver/default.nix @@ -18,7 +18,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; installPhase = '' + runHook preInstall + install -D -t $out/bin uARMSolver + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/math/LiE/default.nix b/pkgs/applications/science/math/LiE/default.nix index dbc66fe2a05fe..2c1149b52051b 100644 --- a/pkgs/applications/science/math/LiE/default.nix +++ b/pkgs/applications/science/math/LiE/default.nix @@ -37,6 +37,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -vp $out/bin cp -v Lie.exe $out @@ -44,5 +46,7 @@ stdenv.mkDerivation { cp -v LEARN* $out cp -v INFO* $out + + runHook postInstall ''; } diff --git a/pkgs/applications/science/math/bliss/default.nix b/pkgs/applications/science/math/bliss/default.nix index 5673fcc34d959..94b4624482f09 100644 --- a/pkgs/applications/science/math/bliss/default.nix +++ b/pkgs/applications/science/math/bliss/default.nix @@ -21,11 +21,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/doc/bliss $out/lib $out/include/bliss mv bliss $out/bin mv html/* COPYING* $out/share/doc/bliss mv *.a $out/lib mv *.h *.hh $out/include/bliss + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/math/calculix/default.nix b/pkgs/applications/science/math/calculix/default.nix index 8af2ea9f4bceb..cf24d0769c57c 100644 --- a/pkgs/applications/science/math/calculix/default.nix +++ b/pkgs/applications/science/math/calculix/default.nix @@ -31,7 +31,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm0755 ccx_${version} $out/bin/ccx + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/math/cplex/default.nix b/pkgs/applications/science/math/cplex/default.nix index ddc950b30664b..7201e8bdcc973 100644 --- a/pkgs/applications/science/math/cplex/default.nix +++ b/pkgs/applications/science/math/cplex/default.nix @@ -40,6 +40,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin ln -s $out/opl/bin/x86-64_linux/oplrun\ $out/opl/bin/x86-64_linux/oplrunjava\ @@ -47,6 +49,8 @@ stdenv.mkDerivation rec { $out/cplex/bin/x86-64_linux/cplex\ $out/cpoptimizer/bin/x86-64_linux/cpoptimizer\ $out/bin + + runHook postInstall ''; fixupPhase = diff --git a/pkgs/applications/science/math/geogebra/default.nix b/pkgs/applications/science/math/geogebra/default.nix index 5fa4862bb9b40..c188ba92d997a 100644 --- a/pkgs/applications/science/math/geogebra/default.nix +++ b/pkgs/applications/science/math/geogebra/default.nix @@ -53,6 +53,8 @@ let nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -D geogebra/* -t "$out/libexec/geogebra/" # The bundled jogl (required for 3D graphics) links to libXxf86vm, and loads libGL at runtime @@ -69,6 +71,8 @@ let install -Dm644 "${srcIcon}" \ "$out/share/icons/hicolor/scalable/apps/geogebra.svg" + + runHook postInstall ''; }; @@ -90,8 +94,12 @@ let nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + install -dm755 $out/Applications unzip $src -d $out/Applications + + runHook postInstall ''; }; in diff --git a/pkgs/applications/science/math/geogebra/geogebra6.nix b/pkgs/applications/science/math/geogebra/geogebra6.nix index 40169a72e4a6f..f6404f3a2e934 100644 --- a/pkgs/applications/science/math/geogebra/geogebra6.nix +++ b/pkgs/applications/science/math/geogebra/geogebra6.nix @@ -59,6 +59,8 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/libexec/geogebra/ $out/bin cp -r GeoGebra-linux-x64/{resources,locales} "$out/" makeWrapper ${lib.getBin electron}/bin/electron $out/bin/geogebra \ @@ -69,6 +71,8 @@ let install -Dm644 "${srcIcon}" \ "$out/share/icons/hicolor/scalable/apps/geogebra.svg" + + runHook postInstall ''; }; @@ -88,8 +92,12 @@ let nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + install -dm755 $out/Applications unzip $src -d $out/Applications + + runHook postInstall ''; meta = meta // { diff --git a/pkgs/applications/science/math/glsurf/default.nix b/pkgs/applications/science/math/glsurf/default.nix index 0edaa32babd70..d55986f42fdf8 100644 --- a/pkgs/applications/science/math/glsurf/default.nix +++ b/pkgs/applications/science/math/glsurf/default.nix @@ -55,12 +55,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/doc/glsurf cp ./src/glsurf.opt $out/bin/glsurf cp ./doc/doc.pdf $out/share/doc/glsurf cp -r ./examples $out/share/doc/glsurf wrapProgram "$out/bin/glsurf" --set CC "${cc}/bin/${cc.targetPrefix}cc" + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/math/gurobi/default.nix b/pkgs/applications/science/math/gurobi/default.nix index eff61579a5f99..9381c56a3a3d6 100644 --- a/pkgs/applications/science/math/gurobi/default.nix +++ b/pkgs/applications/science/math/gurobi/default.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation rec { makeFlags = [ "--directory=src/build" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bin/* $out/bin/ rm $out/bin/gurobi.sh @@ -39,6 +41,8 @@ stdenv.mkDerivation rec { mkdir -p $out/share/java ln -s $out/lib/gurobi.jar $out/share/java/ ln -s $out/lib/gurobi-javadoc.jar $out/share/java/ + + runHook postInstall ''; passthru.libSuffix = lib.replaceStrings [ "." ] [ "" ] (lib.versions.majorMinor version); diff --git a/pkgs/applications/science/math/hmetis/default.nix b/pkgs/applications/science/math/hmetis/default.nix index 1c0152b7bfc77..baa7dbe2a4e02 100644 --- a/pkgs/applications/science/math/hmetis/default.nix +++ b/pkgs/applications/science/math/hmetis/default.nix @@ -27,10 +27,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/doc/hmetis $out/lib mv $binaryFiles $out/bin mv manual.pdf $out/share/doc/hmetis mv libhmetis.a $out/lib + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/math/mathematica/10.nix b/pkgs/applications/science/math/mathematica/10.nix index e5ab259b8f70b..d2f4293be3641 100644 --- a/pkgs/applications/science/math/mathematica/10.nix +++ b/pkgs/applications/science/math/mathematica/10.nix @@ -86,12 +86,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cd Installer # don't restrict PATH, that has already been done sed -i -e 's/^PATH=/# PATH=/' MathInstaller echo "=== Running MathInstaller ===" ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/Mathematica -platforms=${platform} -silent + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/applications/science/math/mathematica/11.nix b/pkgs/applications/science/math/mathematica/11.nix index 5b9460f76e06d..c9bb944d5cbdb 100644 --- a/pkgs/applications/science/math/mathematica/11.nix +++ b/pkgs/applications/science/math/mathematica/11.nix @@ -87,6 +87,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cd Installer # don't restrict PATH, that has already been done sed -i -e 's/^PATH=/# PATH=/' MathInstaller @@ -106,6 +108,8 @@ stdenv.mkDerivation rec { line=$(grep -n QT_PLUGIN_PATH $path | sed 's/:.*//') sed -i -e "$line iexport QT_XKB_CONFIG_ROOT=\"${xkeyboard_config}/share/X11/xkb\"" $path done + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/applications/science/math/mathematica/9.nix b/pkgs/applications/science/math/mathematica/9.nix index c2fc07c532fc9..46dffaa855a40 100644 --- a/pkgs/applications/science/math/mathematica/9.nix +++ b/pkgs/applications/science/math/mathematica/9.nix @@ -76,12 +76,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cd Installer # don't restrict PATH, that has already been done sed -i -e 's/^PATH=/# PATH=/' MathInstaller echo "=== Running MathInstaller ===" ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/Mathematica -platforms=${platform} -silent + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/applications/science/math/msieve/default.nix b/pkgs/applications/science/math/msieve/default.nix index a5af9e844eca4..3f92ead713bde 100644 --- a/pkgs/applications/science/math/msieve/default.nix +++ b/pkgs/applications/science/math/msieve/default.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation rec { makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "all" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin/ cp msieve $out/bin/ + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/math/nauty/default.nix b/pkgs/applications/science/math/nauty/default.nix index c1feeffdcb6d9..0521199f23d92 100644 --- a/pkgs/applications/science/math/nauty/default.nix +++ b/pkgs/applications/science/math/nauty/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,share/doc/nauty} "$dev"/{lib,include/nauty} find . -type f -perm -111 \! -name '*.*' \! -name configure -exec cp '{}' "$out/bin" \; @@ -32,6 +34,8 @@ stdenv.mkDerivation rec { for i in *.a; do cp "$i" "$dev/lib/lib$i"; done + + runHook postInstall ''; checkTarget = "checks"; diff --git a/pkgs/applications/science/math/palp/default.nix b/pkgs/applications/science/math/palp/default.nix index a3b54b78f99bc..cdcf57229ba71 100644 --- a/pkgs/applications/science/math/palp/default.nix +++ b/pkgs/applications/science/math/palp/default.nix @@ -43,6 +43,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin for file in poly class cws nef mori; do cp -p $file.x "$out/bin/$file-${dim}d.x" @@ -52,6 +54,8 @@ stdenv.mkDerivation rec { for file in poly class cws nef mori; do ln -sf $file-6d.x $file.x done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/math/perseus/default.nix b/pkgs/applications/science/math/perseus/default.nix index 63836b7dc76ec..fda50bd0d1f5d 100644 --- a/pkgs/applications/science/math/perseus/default.nix +++ b/pkgs/applications/science/math/perseus/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp perseus $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/math/ripser/default.nix b/pkgs/applications/science/math/ripser/default.nix index 38a00d504406b..341d43cba5177 100644 --- a/pkgs/applications/science/math/ripser/default.nix +++ b/pkgs/applications/science/math/ripser/default.nix @@ -41,8 +41,12 @@ stdenv.mkDerivation { buildPhase = "c++ ripser.cpp -o ripser $buildFlags"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ripser $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index b21bb07e6a646..24d105ce9966e 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -129,8 +129,12 @@ stdenv.mkDerivation rec { buildPhase = "# do nothing"; installPhase = '' + runHook preInstall + cp -r . "$out" tar xkzf ${configure-src} -C "$out" rm "$out/configure" + + runHook postInstall ''; } diff --git a/pkgs/applications/science/math/sage/sage-tests.nix b/pkgs/applications/science/math/sage/sage-tests.nix index 1a415ae65e96a..77131d5ce1fc6 100644 --- a/pkgs/applications/science/math/sage/sage-tests.nix +++ b/pkgs/applications/science/math/sage/sage-tests.nix @@ -38,12 +38,16 @@ stdenv.mkDerivation { buildPhase = "#do nothing"; installPhase = '' + runHook preInstall + # This output is not actually needed for anything, the package just # exists to decouple the sage build from its t ests. mkdir -p "$out/bin" # Like a symlink, but make sure that $0 points to the original. makeWrapper "${sage-with-env}/bin/sage" "$out/bin/sage" + + runHook postInstall ''; doInstallCheck = true; diff --git a/pkgs/applications/science/math/sage/sage-with-env.nix b/pkgs/applications/science/math/sage/sage-with-env.nix index 88c753e89c9da..c81e05fcd0444 100644 --- a/pkgs/applications/science/math/sage/sage-with-env.nix +++ b/pkgs/applications/science/math/sage/sage-with-env.nix @@ -107,6 +107,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/var/lib/sage" cp -r installed "$out/var/lib/sage" @@ -127,6 +129,8 @@ stdenv.mkDerivation rec { cp -f '${sage-env}/sage-env' "$out/bin/sage-env" substituteInPlace "$out/bin/sage-env" \ --subst-var-by sage-local "$out" + + runHook postInstall ''; passthru = { diff --git a/pkgs/applications/science/math/sage/sage.nix b/pkgs/applications/science/math/sage/sage.nix index 81b55e841d244..58ea35f6baaaa 100644 --- a/pkgs/applications/science/math/sage/sage.nix +++ b/pkgs/applications/science/math/sage/sage.nix @@ -29,12 +29,16 @@ stdenv.mkDerivation rec { buildPhase = "#do nothing"; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" makeWrapper "${sage-with-env}/bin/sage" "$out/bin/sage" \ --set SAGE_DOC_SRC_OVERRIDE "${src}/src/doc" ${ lib.optionalString withDoc "--set SAGE_DOC_OVERRIDE ${sagedoc}/share/doc/sage" } \ --prefix JUPYTER_PATH : "${jupyter-kernel-specs}" + + runHook postInstall ''; doInstallCheck = withDoc; diff --git a/pkgs/applications/science/math/sage/sagedoc.nix b/pkgs/applications/science/math/sage/sagedoc.nix index cbf593398ac44..a9820fb03ab95 100644 --- a/pkgs/applications/science/math/sage/sagedoc.nix +++ b/pkgs/applications/science/math/sage/sagedoc.nix @@ -37,6 +37,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cd "$SAGE_DOC_OVERRIDE" mkdir -p "$out/share/doc/sage" @@ -50,6 +52,8 @@ stdenv.mkDerivation rec { ln -rs html/en/_static $_dir done mv html/en/_static{.tmp,} + + runHook postInstall ''; doCheck = true; diff --git a/pkgs/applications/science/math/sage/threejs-sage.nix b/pkgs/applications/science/math/sage/threejs-sage.nix index bc7230f333ab1..8e63c4a541bb3 100644 --- a/pkgs/applications/science/math/sage/threejs-sage.nix +++ b/pkgs/applications/science/math/sage/threejs-sage.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out/lib/node_modules/three/" cp version "$out/lib/node_modules/three" cp -r build "$out/lib/node_modules/three/$(cat version)" + + runHook postInstall ''; } diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix index ee84ae440b304..6e4c03fd5b623 100644 --- a/pkgs/applications/science/math/singular/default.nix +++ b/pkgs/applications/science/math/singular/default.nix @@ -100,6 +100,8 @@ stdenv.mkDerivation rec { doCheck = true; # very basic checks, does not test any libraries installPhase = '' + runHook preInstall + make install '' + lib.optionalString enableDocs '' # Sage uses singular.info, which is not installed by default @@ -108,6 +110,8 @@ stdenv.mkDerivation rec { '' + '' # Make sure patchelf picks up the right libraries rm -rf libpolys factory resources omalloc Singular + + runHook postInstall ''; # singular tests are a bit complicated, see diff --git a/pkgs/applications/science/math/weka/default.nix b/pkgs/applications/science/math/weka/default.nix index 6f907ba9c0c39..d6770be785af3 100644 --- a/pkgs/applications/science/math/weka/default.nix +++ b/pkgs/applications/science/math/weka/default.nix @@ -14,11 +14,15 @@ stdenv.mkDerivation rec { # The -Xmx1000M comes suggested from their download page: # https://www.cs.waikato.ac.nz/ml/weka/downloading.html installPhase = '' + runHook preInstall + mkdir -pv $out/share/weka cp -Rv * $out/share/weka makeWrapper ${jre}/bin/java $out/bin/weka \ --add-flags "-Xmx1000M -jar $out/share/weka/weka.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/math/wolfram-engine/default.nix b/pkgs/applications/science/math/wolfram-engine/default.nix index 4ce49e6cad4ca..2317f4411590c 100644 --- a/pkgs/applications/science/math/wolfram-engine/default.nix +++ b/pkgs/applications/science/math/wolfram-engine/default.nix @@ -92,6 +92,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cd Installer sed -i -e 's/^PATH=/# PATH=/' -e 's/=`id -[ug]`/=0/' MathInstaller @@ -134,6 +136,8 @@ stdenv.mkDerivation rec { # Install man pages installManPage $out/libexec/${dirName}/SystemFiles/SystemDocumentation/Unix/* + + runHook postInstall ''; # This is primarily an IO bound build; there's little benefit to building remotely. diff --git a/pkgs/applications/science/misc/convertall/default.nix b/pkgs/applications/science/misc/convertall/default.nix index 534562b028d89..d1808b084a556 100644 --- a/pkgs/applications/science/misc/convertall/default.nix +++ b/pkgs/applications/science/misc/convertall/default.nix @@ -18,7 +18,11 @@ in stdenv.mkDerivation rec { propagatedBuildInputs = [ pyqt5 ]; installPhase = '' + runHook preInstall + python3 install.py -p $out -x + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/science/misc/cytoscape/default.nix b/pkgs/applications/science/misc/cytoscape/default.nix index 392a529f0dedd..b40de2098c526 100644 --- a/pkgs/applications/science/misc/cytoscape/default.nix +++ b/pkgs/applications/science/misc/cytoscape/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { buildInputs = [ jre ]; installPhase = '' + runHook preInstall + mkdir -pv $out/{share,bin} cp -Rv * $out/share/ @@ -32,6 +34,8 @@ stdenv.mkDerivation rec { --set JAVA "${jre}/bin/java" chmod +x $out/bin/cytoscape + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/misc/foldingathome/control.nix b/pkgs/applications/science/misc/foldingathome/control.nix index a64c973914c66..ce345c27ce951 100644 --- a/pkgs/applications/science/misc/foldingathome/control.nix +++ b/pkgs/applications/science/misc/foldingathome/control.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { dpkg-deb -x ${src} ./ ''; - installPhase = "cp -ar usr $out"; + installPhase = "runHook preInstall; cp -ar usr $out; runHook postInstall"; postFixup = '' sed -e "s|/usr/bin|$out/bin|g" -i $out/share/applications/FAHControl.desktop diff --git a/pkgs/applications/science/misc/foldingathome/viewer.nix b/pkgs/applications/science/misc/foldingathome/viewer.nix index bb2c3c0abe30e..f740e2e3e99c1 100644 --- a/pkgs/applications/science/misc/foldingathome/viewer.nix +++ b/pkgs/applications/science/misc/foldingathome/viewer.nix @@ -42,7 +42,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cp -ar usr $out + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/misc/gephi/default.nix b/pkgs/applications/science/misc/gephi/default.nix index fe638bde1ba46..73238f8e9b7ec 100644 --- a/pkgs/applications/science/misc/gephi/default.nix +++ b/pkgs/applications/science/misc/gephi/default.nix @@ -17,6 +17,8 @@ maven.buildMavenPackage rec { nativeBuildInputs = [ jdk11 ]; installPhase = '' + runHook preInstall + cp -r modules/application/target/gephi $out # remove garbage @@ -29,6 +31,8 @@ maven.buildMavenPackage rec { cp ${jogl}/share/java/glue*.jar $out/gephi/modules/ext/org.gephi.visualization/org-jogamp-gluegen/ printf "\n\njdkhome=${jdk11}\n" >> $out/etc/gephi.conf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/misc/golly/default.nix b/pkgs/applications/science/misc/golly/default.nix index b509387fe8838..71d8436a2b0a3 100644 --- a/pkgs/applications/science/misc/golly/default.nix +++ b/pkgs/applications/science/misc/golly/default.nix @@ -36,6 +36,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp ../golly ../bgolly "$out/bin" @@ -44,6 +46,8 @@ stdenv.mkDerivation rec { mkdir -p "$out/share/golly" cp -r ../{Help,Patterns,Scripts,Rules} "$out/share/golly" + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/science/misc/netlogo/default.nix b/pkgs/applications/science/misc/netlogo/default.nix index 20d001d8dba23..bccc56f6c773e 100644 --- a/pkgs/applications/science/misc/netlogo/default.nix +++ b/pkgs/applications/science/misc/netlogo/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -pv $out/share/netlogo $out/share/icons/hicolor/256x256/apps $out/share/applications $out/share/doc cp -rv app $out/share/netlogo cp -v readme.md $out/share/doc/ @@ -42,6 +44,8 @@ stdenv.mkDerivation rec { cp $src1 $out/share/icons/hicolor/256x256/apps/netlogo.png cp ${desktopItem}/share/applications/* $out/share/applications + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/misc/openrefine/default.nix b/pkgs/applications/science/misc/openrefine/default.nix index 6d169db23b925..6338278f65bb9 100644 --- a/pkgs/applications/science/misc/openrefine/default.nix +++ b/pkgs/applications/science/misc/openrefine/default.nix @@ -37,8 +37,12 @@ let dontNpmBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -r modules/core/3rdparty/* $out/ + + runHook postInstall ''; }; @@ -60,6 +64,8 @@ in maven.buildMavenPackage { doCheck = false; installPhase = '' + runHook preInstall + mkdir -p $out/lib/server/target/lib cp -r server/target/lib/* $out/lib/server/target/lib/ cp server/target/openrefine-*-server.jar $out/lib/server/target/lib/ @@ -81,6 +87,8 @@ in maven.buildMavenPackage { mkdir -p $out/bin cp refine $out/bin/ + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/applications/science/molecular-dynamics/dl-poly-classic/default.nix b/pkgs/applications/science/molecular-dynamics/dl-poly-classic/default.nix index 75ab576212d76..d932fc7dab855 100644 --- a/pkgs/applications/science/molecular-dynamics/dl-poly-classic/default.nix +++ b/pkgs/applications/science/molecular-dynamics/dl-poly-classic/default.nix @@ -28,8 +28,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -v ../execute/DLPOLY.X $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/physics/crystfel/default.nix b/pkgs/applications/science/physics/crystfel/default.nix index e7eb69fb4e1c1..4dd7aefc9cbe7 100644 --- a/pkgs/applications/science/physics/crystfel/default.nix +++ b/pkgs/applications/science/physics/crystfel/default.nix @@ -102,9 +102,13 @@ let # mosflm statically links against its own libccp4, which as the syminfo.lib environment variable problem. # Here, we circumvent it by creating a little wrapper script that calls mosflm after setting the SYMINFO variable. installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${mosflmBinary} $out/bin/mosflm-raw makeWrapper $out/bin/mosflm-raw $out/bin/mosflm --set SYMINFO ${libccp4}/share/syminfo.lib --add-flags -n + + runHook postInstall ''; }; diff --git a/pkgs/applications/science/physics/fasthenry/default.nix b/pkgs/applications/science/physics/fasthenry/default.nix index 6b9a73f6dd175..9a614809c173d 100644 --- a/pkgs/applications/science/physics/fasthenry/default.nix +++ b/pkgs/applications/science/physics/fasthenry/default.nix @@ -40,12 +40,16 @@ stdenv.mkDerivation rec { ''); installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r bin/* $out/bin/ mkdir -p $out/share/doc/${pname}-${version} cp -r doc/* $out/share/doc/${pname}-${version} mkdir -p $out/share/${pname}-${version}/examples cp -r examples/* $out/share/${pname}-${version}/examples + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/physics/quantomatic/default.nix b/pkgs/applications/science/physics/quantomatic/default.nix index 05011313bccea..c7da2e90def3c 100644 --- a/pkgs/applications/science/physics/quantomatic/default.nix +++ b/pkgs/applications/science/physics/quantomatic/default.nix @@ -15,10 +15,14 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/libexec/quantomatic cp $src $out/libexec/quantomatic/quantomatic.jar mkdir -p $out/bin makeWrapper ${jre}/bin/java $out/bin/quantomatic --add-flags "-jar $out/libexec/quantomatic/quantomatic.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/programming/fdr/default.nix b/pkgs/applications/science/programming/fdr/default.nix index 2237d9528701e..d6b9b919c1854 100644 --- a/pkgs/applications/science/programming/fdr/default.nix +++ b/pkgs/applications/science/programming/fdr/default.nix @@ -20,6 +20,8 @@ stdenv.mkDerivation { dontConfigure = true; installPhase = '' + runHook preInstall + mkdir -p "$out" # shipped Qt is buggy @@ -57,6 +59,8 @@ stdenv.mkDerivation { patchelf --set-rpath "$libPath:$out/lib" \ "$out/lib/$l" done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/programming/groove/default.nix b/pkgs/applications/science/programming/groove/default.nix index 6350d0badee9f..fa0a69f946e1e 100644 --- a/pkgs/applications/science/programming/groove/default.nix +++ b/pkgs/applications/science/programming/groove/default.nix @@ -24,6 +24,8 @@ in stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/groove cp -r bin lib $out/share/groove/ @@ -42,6 +44,8 @@ in stdenv.mkDerivation rec { mkdir -p $out/share/icons/hicolor/{16x16,32x32}/apps icotool -x -i 1 -o $out/share/icons/hicolor/32x32/apps/groove.png groove-green-g.ico icotool -x -i 2 -o $out/share/icons/hicolor/16x16/apps/groove.png groove-green-g.ico + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/science/robotics/emuflight-configurator/default.nix b/pkgs/applications/science/robotics/emuflight-configurator/default.nix index 66b9cf0efa8ea..fbe33e5210519 100644 --- a/pkgs/applications/science/robotics/emuflight-configurator/default.nix +++ b/pkgs/applications/science/robotics/emuflight-configurator/default.nix @@ -15,12 +15,16 @@ stdenv.mkDerivation rec { buildInputs = [ gsettings-desktop-schemas gtk3 ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/${pname} cp -r . $out/share/${pname}/ install -m 444 -D icon/emu_icon_128.png $out/share/icons/hicolor/128x128/apps/${pname}.png makeWrapper ${nwjs}/bin/nw $out/bin/${pname} --add-flags $out/share/${pname} + + runHook postInstall ''; desktopItems = [ diff --git a/pkgs/applications/science/robotics/mujoco/default.nix b/pkgs/applications/science/robotics/mujoco/default.nix index f36d316164aac..0978cc3663181 100644 --- a/pkgs/applications/science/robotics/mujoco/default.nix +++ b/pkgs/applications/science/robotics/mujoco/default.nix @@ -85,8 +85,12 @@ let }; installPhase = '' + runHook preInstall + mkdir -p $out/include/tmd cp ${name}/include/tmd/${name}.h $out/include/tmd/ + + runHook postInstall ''; }; diff --git a/pkgs/applications/science/robotics/sumorobot-manager/default.nix b/pkgs/applications/science/robotics/sumorobot-manager/default.nix index eb9322f0fb222..0407fda0e8ea8 100644 --- a/pkgs/applications/science/robotics/sumorobot-manager/default.nix +++ b/pkgs/applications/science/robotics/sumorobot-manager/default.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation rec { buildPhase = "true"; installPhase = '' + runHook preInstall + mkdir -p $out/opt/sumorobot-manager cp -r main.py lib res $out/opt/sumorobot-manager chmod -R 644 $out/opt/sumorobot-manager/lib/* @@ -28,6 +30,8 @@ stdenv.mkDerivation rec { dos2unix $out/opt/sumorobot-manager/main.py makeQtWrapper $out/opt/sumorobot-manager/main.py $out/bin/sumorobot-manager \ --chdir "$out/opt/sumorobot-manager" + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/applications/search/grepm/default.nix b/pkgs/applications/search/grepm/default.nix index c3adbb2ab8b05..98d4cb361816f 100644 --- a/pkgs/applications/search/grepm/default.nix +++ b/pkgs/applications/search/grepm/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation { buildInputs = [ perlPackages.grepmail mutt ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a $src $out/bin/grepm chmod +x $out/bin/grepm @@ -21,6 +23,8 @@ stdenv.mkDerivation { -e "s:^grepmail:${perlPackages.grepmail}/bin/grepmail:" \ -e "s:^\( *\)mutt:\1${mutt}/bin/mutt:" \ $out/bin/grepm + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/terminal-emulators/foot/default.nix b/pkgs/applications/terminal-emulators/foot/default.nix index e7eb39e8a756b..79abb46b5fd76 100644 --- a/pkgs/applications/terminal-emulators/foot/default.nix +++ b/pkgs/applications/terminal-emulators/foot/default.nix @@ -47,7 +47,11 @@ let buildInputs = [ python3 ]; installPhase = '' + runHook preInstall + install -Dm755 $src $out + + runHook postInstall ''; }; diff --git a/pkgs/applications/terminal-emulators/hyper/default.nix b/pkgs/applications/terminal-emulators/hyper/default.nix index 4db56792b7337..fc8c3adb07472 100644 --- a/pkgs/applications/terminal-emulators/hyper/default.nix +++ b/pkgs/applications/terminal-emulators/hyper/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" mv opt "$out/" @@ -41,6 +43,8 @@ stdenv.mkDerivation rec { substituteInPlace $out/share/applications/hyper.desktop \ --replace "/opt/Hyper/hyper" "hyper" + + runHook postInstall ''; passthru.tests.test = nixosTests.terminal-emulators.hyper; diff --git a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-autocomplete-all-the-things/default.nix b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-autocomplete-all-the-things/default.nix index 6217bc0659a22..27c6cc43901ef 100644 --- a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-autocomplete-all-the-things/default.nix +++ b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-autocomplete-all-the-things/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/lib/urxvt/perl cp autocomplete-ALL-the-things $out/lib/urxvt/perl + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-font-size/default.nix b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-font-size/default.nix index fa356081a8703..f2dab7351053a 100644 --- a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-font-size/default.nix +++ b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-font-size/default.nix @@ -12,12 +12,16 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + substituteInPlace font-size \ --replace "xrdb -merge" "${xrdb}/bin/xrdb -merge" \ --replace "xlsfonts" "${xlsfonts}/bin/xlsfonts" mkdir -p $out/lib/urxvt/perl cp font-size $out/lib/urxvt/perl + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-perl/default.nix b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-perl/default.nix index 64a1ed125ac80..01aba91986c35 100644 --- a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-perl/default.nix +++ b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-perl/default.nix @@ -12,12 +12,16 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + substituteInPlace fullscreen \ --replace "wmctrl" "${wmctrl}/bin/wmctrl" mkdir -p $out/lib/urxvt/perl cp fullscreen $out/lib/urxvt/perl cp newterm $out/lib/urxvt/perl + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-perls/default.nix b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-perls/default.nix index 33bf75c841bf3..194bb4fc025bc 100644 --- a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-perls/default.nix +++ b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-perls/default.nix @@ -12,11 +12,15 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/lib/urxvt/perl cp keyboard-select $out/lib/urxvt/perl cp deprecated/clipboard \ deprecated/url-select \ $out/lib/urxvt/perl + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-resize-font/default.nix b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-resize-font/default.nix index 95b369b70f99c..ed11b50e0152c 100644 --- a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-resize-font/default.nix +++ b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-resize-font/default.nix @@ -13,8 +13,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/lib/urxvt/perl cp resize-font $out/lib/urxvt/perl + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-theme-switch/default.nix b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-theme-switch/default.nix index 2bfc9669338ad..44511619e2e2f 100644 --- a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-theme-switch/default.nix +++ b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-theme-switch/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/lib/urxvt/perl sed -i -e "s|/usr/bin/env||" color-themes cp color-themes $out/lib/urxvt/perl + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-vtwheel/default.nix b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-vtwheel/default.nix index 7d3d69122f627..0eece21f0b843 100644 --- a/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-vtwheel/default.nix +++ b/pkgs/applications/terminal-emulators/rxvt-unicode-plugins/urxvt-vtwheel/default.nix @@ -11,9 +11,13 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + sed -i 's|#! perl|#! ${perl}/bin/perl|g' vtwheel mkdir -p $out/lib/urxvt/perl cp vtwheel $out/lib/urxvt/perl + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/terminal-emulators/stupidterm/default.nix b/pkgs/applications/terminal-emulators/stupidterm/default.nix index f10d91229376b..4bf73ced549c3 100644 --- a/pkgs/applications/terminal-emulators/stupidterm/default.nix +++ b/pkgs/applications/terminal-emulators/stupidterm/default.nix @@ -18,12 +18,16 @@ stdenv.mkDerivation { makeFlags = [ "PKGCONFIG=${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config" "binary=stupidterm" ]; installPhase = '' + runHook preInstall + install -D stupidterm $out/bin/stupidterm install -D -m 644 stupidterm.desktop $out/share/applications/stupidterm.desktop install -D -m 644 stupidterm.ini $out/share/stupidterm/stupidterm.ini substituteInPlace $out/share/applications/stupidterm.desktop \ --replace "Exec=st" "Exec=$out/bin/stupidterm" + + runHook postInstall ''; passthru.tests.test = nixosTests.terminal-emulators.stupidterm; diff --git a/pkgs/applications/version-management/bcompare/default.nix b/pkgs/applications/version-management/bcompare/default.nix index 33b4cb0f90b54..b641216bd1561 100644 --- a/pkgs/applications/version-management/bcompare/default.nix +++ b/pkgs/applications/version-management/bcompare/default.nix @@ -32,6 +32,8 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib,share} cp -R usr/{bin,lib,share} $out/ @@ -46,6 +48,8 @@ let # Create symlink bzip2 library ln -s ${bzip2.out}/lib/libbz2.so.1 $out/lib/beyondcompare/libbz2.so.1.0 + + runHook postInstall ''; nativeBuildInputs = [ autoPatchelfHook ]; @@ -73,8 +77,12 @@ let nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out/Applications/BCompare.app cp -R . $out/Applications/BCompare.app + + runHook postInstall ''; }; diff --git a/pkgs/applications/version-management/bfg-repo-cleaner/default.nix b/pkgs/applications/version-management/bfg-repo-cleaner/default.nix index a759c1e860051..bd0d87e917e6d 100644 --- a/pkgs/applications/version-management/bfg-repo-cleaner/default.nix +++ b/pkgs/applications/version-management/bfg-repo-cleaner/default.nix @@ -17,10 +17,14 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/java mkdir -p $out/bin cp $src $out/share/java/$jarName makeWrapper "${jre}/bin/java" $out/bin/bfg --add-flags "-cp $out/share/java/$jarName com.madgag.git.bfg.cli.Main" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/darcs-to-git/default.nix b/pkgs/applications/version-management/darcs-to-git/default.nix index 14348921054b2..b5d85edd4b23e 100644 --- a/pkgs/applications/version-management/darcs-to-git/default.nix +++ b/pkgs/applications/version-management/darcs-to-git/default.nix @@ -25,7 +25,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -vD darcs-to-git "$out/bin/darcs-to-git" + + runHook postInstall ''; doCheck = true; diff --git a/pkgs/applications/version-management/fast-export/default.nix b/pkgs/applications/version-management/fast-export/default.nix index a4d9c030c9b49..525b16f4dc8ff 100644 --- a/pkgs/applications/version-management/fast-export/default.nix +++ b/pkgs/applications/version-management/fast-export/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { buildInputs = [mercurial.python mercurial]; installPhase = '' + runHook preInstall + binPath=$out/bin libexecPath=$out/libexec/${pname} sitepackagesPath=$out/${mercurial.python.sitePackages} @@ -32,6 +34,8 @@ stdenv.mkDerivation rec { --prefix PATH : "${git}/bin":"${mercurial.python}/bin":$libexec \ --prefix PYTHONPATH : "${mercurial}/${mercurial.python.sitePackages}":$sitepackagesPath done + + runHook postInstall ''; doInstallCheck = true; diff --git a/pkgs/applications/version-management/fossil/default.nix b/pkgs/applications/version-management/fossil/default.nix index b1b828d479598..7f26f2d3118ec 100644 --- a/pkgs/applications/version-management/fossil/default.nix +++ b/pkgs/applications/version-management/fossil/default.nix @@ -68,11 +68,15 @@ stdenv.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin INSTALLDIR=$out/bin make install installManPage fossil.1 installShellCompletion --name fossil.bash tools/fossil-autocomplete.bash + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/git-annex-remote-rclone/default.nix b/pkgs/applications/version-management/git-annex-remote-rclone/default.nix index 4d1a7b2ade1d8..5344088ce57ee 100644 --- a/pkgs/applications/version-management/git-annex-remote-rclone/default.nix +++ b/pkgs/applications/version-management/git-annex-remote-rclone/default.nix @@ -14,9 +14,13 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin git-annex-remote-rclone wrapProgram "$out/bin/git-annex-remote-rclone" \ --prefix PATH ":" "${lib.makeBinPath [ rclone ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/git-cache/default.nix b/pkgs/applications/version-management/git-cache/default.nix index a099f92f504db..dd96449ae0bb3 100644 --- a/pkgs/applications/version-management/git-cache/default.nix +++ b/pkgs/applications/version-management/git-cache/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + install -Dm555 git-cache $out/bin/git-cache + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/git-fire/default.nix b/pkgs/applications/version-management/git-fire/default.nix index bc7e9f4840b71..5be517e9a6520 100644 --- a/pkgs/applications/version-management/git-fire/default.nix +++ b/pkgs/applications/version-management/git-fire/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + install -D -m755 $src/git-fire $out/bin/git-fire + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/git-ftp/default.nix b/pkgs/applications/version-management/git-ftp/default.nix index a3087249caddb..ab907da709554 100644 --- a/pkgs/applications/version-management/git-ftp/default.nix +++ b/pkgs/applications/version-management/git-ftp/default.nix @@ -39,7 +39,11 @@ resholve.mkDerivation rec { ]; installPhase = '' + runHook preInstall + make install-all prefix=$out + + runHook postInstall ''; nativeBuildInputs = [ pandoc man ]; diff --git a/pkgs/applications/version-management/git-open/default.nix b/pkgs/applications/version-management/git-open/default.nix index 1b4153f2ad1d8..3876f40d3c8ab 100644 --- a/pkgs/applications/version-management/git-open/default.nix +++ b/pkgs/applications/version-management/git-open/default.nix @@ -22,12 +22,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv git-open $out/bin installManPage git-open.1 wrapProgram $out/bin/git-open \ --prefix PATH : "${lib.makeBinPath [ gnugrep ]}" \ --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/git-radar/default.nix b/pkgs/applications/version-management/git-radar/default.nix index 4bc6a3f8c531d..ee42d2e5f217b 100644 --- a/pkgs/applications/version-management/git-radar/default.nix +++ b/pkgs/applications/version-management/git-radar/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp git-radar fetch.sh prompt.bash prompt.zsh radar-base.sh $out ln -s $out/git-radar $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/git-recent/default.nix b/pkgs/applications/version-management/git-recent/default.nix index 52b4a49d19b99..8db2b94b47c45 100644 --- a/pkgs/applications/version-management/git-recent/default.nix +++ b/pkgs/applications/version-management/git-recent/default.nix @@ -19,10 +19,14 @@ stdenv.mkDerivation rec { buildPhase = null; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp git-recent $out/bin wrapProgram $out/bin/git-recent \ --prefix PATH : "${lib.makeBinPath [ git less util-linux ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/git-remote-gcrypt/default.nix b/pkgs/applications/version-management/git-remote-gcrypt/default.nix index d3f53b704eeb0..8bb6789d51af9 100644 --- a/pkgs/applications/version-management/git-remote-gcrypt/default.nix +++ b/pkgs/applications/version-management/git-remote-gcrypt/default.nix @@ -20,10 +20,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ docutils makeWrapper ]; installPhase = '' + runHook preInstall + prefix="$out" ./install.sh wrapProgram "$out/bin/git-remote-gcrypt" \ --prefix PATH ":" "${lib.makeBinPath [ gnupg curl rsync coreutils gawk gnused gnugrep ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/git-reparent/default.nix b/pkgs/applications/version-management/git-reparent/default.nix index 38a66d6db1db6..3653b1630d9e8 100644 --- a/pkgs/applications/version-management/git-reparent/default.nix +++ b/pkgs/applications/version-management/git-reparent/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -m755 -Dt $out/bin git-reparent + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/version-management/git-secret/default.nix b/pkgs/applications/version-management/git-secret/default.nix index 6c0613a28df7a..dc7a39fa394b0 100644 --- a/pkgs/applications/version-management/git-secret/default.nix +++ b/pkgs/applications/version-management/git-secret/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -D git-secret $out/bin/git-secret wrapProgram $out/bin/git-secret \ @@ -21,6 +23,8 @@ stdenv.mkDerivation rec { mkdir $out/share cp -r man $out/share + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/version-management/git-secrets/default.nix b/pkgs/applications/version-management/git-secrets/default.nix index a2f2045a3ddcf..c9ebe4fb3ee1c 100644 --- a/pkgs/applications/version-management/git-secrets/default.nix +++ b/pkgs/applications/version-management/git-secrets/default.nix @@ -16,11 +16,15 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -m755 -Dt $out/bin git-secrets install -m444 -Dt $out/share/man/man1 git-secrets.1 wrapProgram $out/bin/git-secrets \ --prefix PATH : "${lib.makeBinPath [ git coreutils ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/git-stree/default.nix b/pkgs/applications/version-management/git-stree/default.nix index d15db48902fa1..8afa829d08afa 100644 --- a/pkgs/applications/version-management/git-stree/default.nix +++ b/pkgs/applications/version-management/git-stree/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/bash-completion/completions install -m 0755 git-stree $out/bin/ install -m 0644 git-stree-completion.bash $out/share/bash-completion/completions/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/git-sync/default.nix b/pkgs/applications/version-management/git-sync/default.nix index 3ff96da704e07..c696e0b74c475 100644 --- a/pkgs/applications/version-management/git-sync/default.nix +++ b/pkgs/applications/version-management/git-sync/default.nix @@ -16,9 +16,13 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a git-* $out/bin/ cp -a contrib/git-* $out/bin/ + + runHook postInstall ''; wrapperPath = with lib; makeBinPath ([ diff --git a/pkgs/applications/version-management/git-test/default.nix b/pkgs/applications/version-management/git-test/default.nix index fb8619249b55f..f8b0813e2e6cb 100644 --- a/pkgs/applications/version-management/git-test/default.nix +++ b/pkgs/applications/version-management/git-test/default.nix @@ -16,11 +16,15 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -m755 -Dt $out/bin git-test install -m444 -Dt $out/share/man/man1 git-test.1 wrapProgram $out/bin/git-test \ --prefix PATH : "${lib.makeBinPath [ git ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/git-when-merged/default.nix b/pkgs/applications/version-management/git-when-merged/default.nix index 36336d964cc35..67321e333e16d 100644 --- a/pkgs/applications/version-management/git-when-merged/default.nix +++ b/pkgs/applications/version-management/git-when-merged/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation rec { buildInputs = [ python3 ]; installPhase = '' + runHook preInstall + install -D --target-directory $out/bin/ bin/git-when-merged + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/git2cl/default.nix b/pkgs/applications/version-management/git2cl/default.nix index cddc6eb7e2fe9..f7d53720bfd07 100644 --- a/pkgs/applications/version-management/git2cl/default.nix +++ b/pkgs/applications/version-management/git2cl/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { buildInputs = [ perl ]; installPhase = '' + runHook preInstall + install -D -m755 git2cl $out/bin/git2cl install -D -m644 README $out/share/doc/git2cl/README + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/version-management/gitolite/default.nix b/pkgs/applications/version-management/gitolite/default.nix index df0c759760321..f0dfb20bd4a60 100644 --- a/pkgs/applications/version-management/gitolite/default.nix +++ b/pkgs/applications/version-management/gitolite/default.nix @@ -35,9 +35,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin perl ./install -to $out/bin echo ${version} > $out/bin/VERSION + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/applications/version-management/gitstatus/default.nix b/pkgs/applications/version-management/gitstatus/default.nix index 2e2fc5af2c4c3..2b0cf3ca258ce 100644 --- a/pkgs/applications/version-management/gitstatus/default.nix +++ b/pkgs/applications/version-management/gitstatus/default.nix @@ -20,6 +20,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 usrbin/gitstatusd $out/bin/gitstatusd install -Dm444 gitstatus.plugin.sh -t $out/share/gitstatus/ install -Dm444 gitstatus.plugin.zsh -t $out/share/gitstatus/ @@ -30,6 +32,8 @@ stdenv.mkDerivation rec { # because the FHS directories don't start at / substituteInPlace install \ --replace "_gitstatus_install_main ." "_gitstatus_install_main $out" + + runHook postInstall ''; # Don't install the "install" and "build.info" files, which the end user diff --git a/pkgs/applications/version-management/nitpick/default.nix b/pkgs/applications/version-management/nitpick/default.nix index f1f52baf03366..23f68d0dda0c2 100644 --- a/pkgs/applications/version-management/nitpick/default.nix +++ b/pkgs/applications/version-management/nitpick/default.nix @@ -19,11 +19,15 @@ buildPythonPackage rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/src install -m 755 -t $out/share/src nitpick.py mkdir -p $out/bin ln -s $out/share/src/nitpick.py $out/bin/nitpick + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/version-management/p4d/default.nix b/pkgs/applications/version-management/p4d/default.nix index d7dcd1405575b..b29c59e9a2973 100644 --- a/pkgs/applications/version-management/p4d/default.nix +++ b/pkgs/applications/version-management/p4d/default.nix @@ -32,8 +32,12 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + install -D -t $out/bin p4broker p4d p4p install -D -t $out/doc/p4d -m 0644 *.txt + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/p4v/darwin.nix b/pkgs/applications/version-management/p4v/darwin.nix index d3d3568b9f2e2..5bacea48503ee 100644 --- a/pkgs/applications/version-management/p4v/darwin.nix +++ b/pkgs/applications/version-management/p4v/darwin.nix @@ -9,6 +9,8 @@ stdenv.mkDerivation { sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/Applications $out/bin # Install Qt applications. @@ -20,5 +22,7 @@ stdenv.mkDerivation { mv p4vc $out/bin substituteInPlace $out/bin/p4vc \ --replace /Applications $out/Applications + + runHook postInstall ''; } diff --git a/pkgs/applications/version-management/p4v/linux.nix b/pkgs/applications/version-management/p4v/linux.nix index 316ff8dbeb199..a8f4470eadb0f 100644 --- a/pkgs/applications/version-management/p4v/linux.nix +++ b/pkgs/applications/version-management/p4v/linux.nix @@ -76,10 +76,14 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -r bin lib $out addAutoPatchelfSearchPath $out/lib ln -s "${qtbase}/${qtbase.qtPluginPrefix}" $out/lib/plugins + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/applications/version-management/subgit/default.nix b/pkgs/applications/version-management/subgit/default.nix index 308d1b80034ea..d70e1e4cf0278 100644 --- a/pkgs/applications/version-management/subgit/default.nix +++ b/pkgs/applications/version-management/subgit/default.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip makeWrapper ]; installPhase = '' + runHook preInstall + mkdir $out; cp -r bin lib $out; wrapProgram $out/bin/subgit --set JAVA_HOME ${jre}; + + runHook postInstall ''; src = fetchurl { diff --git a/pkgs/applications/version-management/svn2git/default.nix b/pkgs/applications/version-management/svn2git/default.nix index 89ea5c0e84ae2..c619071f16998 100644 --- a/pkgs/applications/version-management/svn2git/default.nix +++ b/pkgs/applications/version-management/svn2git/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -r lib $out/ @@ -27,6 +29,8 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/svn2git \ --set RUBYLIB $out/lib \ --prefix PATH : ${git}/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/version-management/tig/default.nix b/pkgs/applications/version-management/tig/default.nix index b4a8533d468ee..217e754718f9c 100644 --- a/pkgs/applications/version-management/tig/default.nix +++ b/pkgs/applications/version-management/tig/default.nix @@ -28,6 +28,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + make install make install-doc @@ -44,6 +46,8 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/tig \ --prefix PATH ':' "${git}/bin" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/version-management/tkrev/default.nix b/pkgs/applications/version-management/tkrev/default.nix index 66c1aa4d0e12e..e4cef544cad32 100644 --- a/pkgs/applications/version-management/tkrev/default.nix +++ b/pkgs/applications/version-management/tkrev/default.nix @@ -19,7 +19,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + ./doinstall.tcl $out + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/version-management/transcrypt/default.nix b/pkgs/applications/version-management/transcrypt/default.nix index 5000037b0c8af..2eada9b5d75d4 100644 --- a/pkgs/applications/version-management/transcrypt/default.nix +++ b/pkgs/applications/version-management/transcrypt/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { buildInputs = [ git openssl coreutils util-linux gnugrep gnused gawk ]; installPhase = '' + runHook preInstall + install -m 755 -D transcrypt $out/bin/transcrypt install -m 644 -D man/transcrypt.1 $out/share/man/man1/transcrypt.1 install -m 644 -D contrib/bash/transcrypt $out/share/bash-completion/completions/transcrypt @@ -28,6 +30,8 @@ stdenv.mkDerivation rec { echo "${lib.makeBinPath [ git openssl coreutils gawk ]}:" EOF chmod +x $out/bin/transcrypt-depspathprefix + + runHook postInstall ''; passthru.tests.version = testers.testVersion { diff --git a/pkgs/applications/video/adl/default.nix b/pkgs/applications/video/adl/default.nix index 46e2bc492a87b..529e0b79bdf62 100644 --- a/pkgs/applications/video/adl/default.nix +++ b/pkgs/applications/video/adl/default.nix @@ -38,10 +38,14 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp $src/adl $out/bin wrapProgram $out/bin/adl \ --prefix PATH : ${lib.makeBinPath buildInputs} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/video/dvd-slideshow/default.nix b/pkgs/applications/video/dvd-slideshow/default.nix index 6499b6153c8da..fad8fa173c5ab 100644 --- a/pkgs/applications/video/dvd-slideshow/default.nix +++ b/pkgs/applications/video/dvd-slideshow/default.nix @@ -44,6 +44,8 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp dvd-slideshow "$out/bin/dvd-slideshow.real" cp dvd-menu "$out/bin/dvd-menu.real" @@ -60,6 +62,8 @@ in stdenv.mkDerivation rec { ln -s dvd-slideshow.sh "$out/bin/jigl2slideshow" cp -a man "$out/" + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/video/filebot/default.nix b/pkgs/applications/video/filebot/default.nix index 3fb98c8d71894..87207897afe24 100644 --- a/pkgs/applications/video/filebot/default.nix +++ b/pkgs/applications/video/filebot/default.nix @@ -30,6 +30,8 @@ in stdenv.mkDerivation (finalAttrs: { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/opt $out/bin # Since FileBot has dependencies on relative paths between files, all required files are copied to the same location as is. cp -r filebot.sh lib/ jar/ $out/opt/ @@ -42,6 +44,8 @@ in stdenv.mkDerivation (finalAttrs: { --prefix PATH : ${lib.makeBinPath [ openjdk17 ]} # Expose the binary in bin to make runnable. ln -s $out/opt/filebot.sh $out/bin/filebot + + runHook postInstall ''; passthru.updateScript = genericUpdater { diff --git a/pkgs/applications/video/flirc/default.nix b/pkgs/applications/video/flirc/default.nix index b051bae6b0dcc..f7efaf6217ea8 100644 --- a/pkgs/applications/video/flirc/default.nix +++ b/pkgs/applications/video/flirc/default.nix @@ -37,8 +37,12 @@ stdenv.mkDerivation { # udev rules don't appear in the official package # https://flirc.gitbooks.io/flirc-instructions/content/linux.html installPhase = '' + runHook preInstall + install -D -t $out/bin/ Flirc flirc_util install -D ${./99-flirc.rules} $out/lib/udev/rules.d/99-flirc.rules + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/video/frigate/web.nix b/pkgs/applications/video/frigate/web.nix index be530c5c3637d..0b469d6664dae 100644 --- a/pkgs/applications/video/frigate/web.nix +++ b/pkgs/applications/video/frigate/web.nix @@ -21,6 +21,10 @@ buildNpmPackage { npmDepsHash = "sha256-+36quezGArqIM9dM+UihwcIgmE3EVmJQThuicLgDW4A="; installPhase = '' + runHook preInstall + cp -rv dist/ $out + + runHook postInstall ''; } diff --git a/pkgs/applications/video/jftui/default.nix b/pkgs/applications/video/jftui/default.nix index e30ba77dd8738..c86718edf112d 100644 --- a/pkgs/applications/video/jftui/default.nix +++ b/pkgs/applications/video/jftui/default.nix @@ -28,7 +28,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -Dm555 build/jftui $out/bin/jftui + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/video/lightworks/default.nix b/pkgs/applications/video/lightworks/default.nix index c803e906e2d81..123fe76c1c364 100644 --- a/pkgs/applications/video/lightworks/default.nix +++ b/pkgs/applications/video/lightworks/default.nix @@ -71,6 +71,8 @@ let unpackPhase = "dpkg-deb -x ${src} ./"; installPhase = '' + runHook preInstall + mkdir -p $out/bin substitute usr/bin/lightworks $out/bin/lightworks \ --replace "/usr/lib/lightworks" "$out/lib/lightworks" @@ -97,6 +99,8 @@ let --set FONTCONFIG_FILE $out/lib/lightworks/fonts.conf cp -r usr/share $out/share + + runHook postInstall ''; dontPatchELF = true; diff --git a/pkgs/applications/video/mapmap/default.nix b/pkgs/applications/video/mapmap/default.nix index 39904f8291593..146263a051546 100644 --- a/pkgs/applications/video/mapmap/default.nix +++ b/pkgs/applications/video/mapmap/default.nix @@ -54,12 +54,16 @@ mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp mapmap $out/bin/mapmap mkdir -p $out/share/applications/ sed 's|Icon=/usr/share/icons/hicolor/scalable/apps/mapmap.svg|Icon=mapmap|g' resources/texts/mapmap.desktop > $out/share/applications/mapmap.desktop mkdir -p $out/share/icons/hicolor/scalable/apps/ cp resources/images/logo/mapmap.* $out/share/icons/hicolor/scalable/apps/ + + runHook postInstall ''; # RPATH in /tmp hack diff --git a/pkgs/applications/video/mkclean/default.nix b/pkgs/applications/video/mkclean/default.nix index 49c270c410693..cd8dc889af98a 100644 --- a/pkgs/applications/video/mkclean/default.nix +++ b/pkgs/applications/video/mkclean/default.nix @@ -22,9 +22,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib} mv release/gcc_linux_*/*.* $out/lib mv release/gcc_linux_*/* $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix index 47e5604eea5df..ab6c851d727dc 100644 --- a/pkgs/applications/video/mplayer/default.nix +++ b/pkgs/applications/video/mplayer/default.nix @@ -57,8 +57,12 @@ let src = codecs_src; installPhase = '' + runHook preInstall + mkdir $out cp -prv * $out + + runHook postInstall ''; meta.license = lib.licenses.unfree; diff --git a/pkgs/applications/video/mpv-shim-default-shaders/default.nix b/pkgs/applications/video/mpv-shim-default-shaders/default.nix index 7e1dfbae4a4d3..c7d04e53b5f40 100644 --- a/pkgs/applications/video/mpv-shim-default-shaders/default.nix +++ b/pkgs/applications/video/mpv-shim-default-shaders/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/${pname} cp -r shaders *.json $out/share/${pname} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/video/mpv/scripts/inhibit-gnome.nix b/pkgs/applications/video/mpv/scripts/inhibit-gnome.nix index 02a54a2cf4751..ead4da6f332de 100644 --- a/pkgs/applications/video/mpv/scripts/inhibit-gnome.nix +++ b/pkgs/applications/video/mpv/scripts/inhibit-gnome.nix @@ -30,7 +30,11 @@ stdenv.mkDerivation rec { passthru.scriptName = "mpv_inhibit_gnome.so"; installPhase = '' + runHook preInstall + install -D ./lib/mpv_inhibit_gnome.so $out/share/mpv/scripts/mpv_inhibit_gnome.so + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/video/mpv/scripts/vr-reversal.nix b/pkgs/applications/video/mpv/scripts/vr-reversal.nix index 6fb91e9ad780a..3bda63d1d618b 100644 --- a/pkgs/applications/video/mpv/scripts/vr-reversal.nix +++ b/pkgs/applications/video/mpv/scripts/vr-reversal.nix @@ -26,8 +26,12 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/mpv/scripts cp -r 360plugin.lua $out/share/mpv/scripts/ + + runHook postInstall ''; passthru.scriptName = "360plugin.lua"; diff --git a/pkgs/applications/video/obs-studio/plugins/looking-glass-obs.nix b/pkgs/applications/video/obs-studio/plugins/looking-glass-obs.nix index b581dc4402227..988efd06e2ac4 100644 --- a/pkgs/applications/video/obs-studio/plugins/looking-glass-obs.nix +++ b/pkgs/applications/video/obs-studio/plugins/looking-glass-obs.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation { env.NIX_CFLAGS_COMPILE = "-mavx"; installPhase = '' + runHook preInstall + mkdir -p $out/lib/obs-plugins/ mv liblooking-glass-obs.so $out/lib/obs-plugins/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/video/obs-studio/plugins/obs-backgroundremoval/default.nix b/pkgs/applications/video/obs-studio/plugins/obs-backgroundremoval/default.nix index 638d0785f4c80..38c996ff4f037 100644 --- a/pkgs/applications/video/obs-studio/plugins/obs-backgroundremoval/default.nix +++ b/pkgs/applications/video/obs-studio/plugins/obs-backgroundremoval/default.nix @@ -40,7 +40,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cmake --install build_x86_64 --prefix "$out" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/video/omxplayer/default.nix b/pkgs/applications/video/omxplayer/default.nix index c9c77c1bbcb95..8069464fb86a6 100644 --- a/pkgs/applications/video/omxplayer/default.nix +++ b/pkgs/applications/video/omxplayer/default.nix @@ -85,8 +85,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp omxplayer.bin $out/bin + + runHook postInstall ''; buildInputs = [ raspberrypifw ffmpeg pcre boost freetype zlib ]; diff --git a/pkgs/applications/video/p2pvc/default.nix b/pkgs/applications/video/p2pvc/default.nix index 703676b4615d9..978bb0727a1a7 100644 --- a/pkgs/applications/video/p2pvc/default.nix +++ b/pkgs/applications/video/p2pvc/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation { enableParallelBuilding = true; - installPhase = "mkdir -p $out/bin; cp p2pvc $out/bin/"; + installPhase = "runHook preInstall; mkdir -p $out/bin; cp p2pvc $out/bin/; runHook postInstall"; src = fetchFromGitHub { owner = "mofarrell"; diff --git a/pkgs/applications/video/pyca/default.nix b/pkgs/applications/video/pyca/default.nix index 52463c4689313..5083d45cfae56 100644 --- a/pkgs/applications/video/pyca/default.nix +++ b/pkgs/applications/video/pyca/default.nix @@ -36,8 +36,12 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/static cp -R pyca/ui/static/* $out/static/ + + runHook postInstall ''; }; diff --git a/pkgs/applications/video/subdl/default.nix b/pkgs/applications/video/subdl/default.nix index 61b5af2f0b57b..049ad91dad8af 100644 --- a/pkgs/applications/video/subdl/default.nix +++ b/pkgs/applications/video/subdl/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation { buildInputs = [ python3 ]; installPhase = '' + runHook preInstall + install -vD subdl $out/bin/subdl + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/video/vcs/default.nix b/pkgs/applications/video/vcs/default.nix index 105823fec3ab6..4f91c5b34b0ae 100644 --- a/pkgs/applications/video/vcs/default.nix +++ b/pkgs/applications/video/vcs/default.nix @@ -24,11 +24,15 @@ stdenv.mkDerivation { inherit dejavu_fonts; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv vcs $out/bin/vcs substituteAllInPlace $out/bin/vcs chmod +x $out/bin/vcs wrapProgram $out/bin/vcs --argv0 vcs --set PATH "${lib.makeBinPath runtimeDeps}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/video/webtorrent_desktop/default.nix b/pkgs/applications/video/webtorrent_desktop/default.nix index 9fd34a1eed1fc..b36087336d5ca 100644 --- a/pkgs/applications/video/webtorrent_desktop/default.nix +++ b/pkgs/applications/video/webtorrent_desktop/default.nix @@ -21,6 +21,8 @@ buildNpmPackage { makeCacheWritable = true; npmRebuildFlags = [ "--ignore-scripts" ]; installPhase = '' + runHook preInstall + ## Rebuild node_modules for production ## after babel compile has finished rm -r node_modules @@ -46,6 +48,8 @@ buildNpmPackage { sed "s#/opt/webtorrent-desktop#$out/bin#" \ < static/linux/share/applications/webtorrent-desktop.desktop \ > $out/share/applications/webtorrent-desktop.desktop + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix index a8a4863d6bf3b..1bae6a3f970c5 100644 --- a/pkgs/applications/virtualization/docker/default.nix +++ b/pkgs/applications/virtualization/docker/default.nix @@ -134,6 +134,8 @@ rec { ''; installPhase = '' + runHook preInstall + install -Dm755 ./bundles/dynbinary-daemon/dockerd $out/libexec/docker/dockerd install -Dm755 ./bundles/dynbinary-daemon/docker-proxy $out/libexec/docker/docker-proxy @@ -154,6 +156,8 @@ rec { install -Dm755 ./contrib/dockerd-rootless.sh $out/libexec/docker/dockerd-rootless.sh makeWrapper $out/libexec/docker/dockerd-rootless.sh $out/bin/dockerd-rootless \ --prefix PATH : "$out/libexec/docker:$extraPath:$extraUserPath" + + runHook postInstall ''; DOCKER_BUILDTAGS = lib.optional withSystemd "journald" @@ -219,6 +223,8 @@ rec { outputs = ["out"] ++ lib.optional (lib.versionOlder version "23") "man"; installPhase = '' + runHook preInstall + install -Dm755 ./build/docker $out/libexec/docker/docker makeWrapper $out/libexec/docker/docker $out/bin/docker \ @@ -249,6 +255,8 @@ rec { ./man/md2man-all.sh -q installManPage man/*/*.[1-9] + + runHook postInstall ''; passthru = { diff --git a/pkgs/applications/virtualization/docker/gc.nix b/pkgs/applications/virtualization/docker/gc.nix index 29df4bfea3a55..6692db6747882 100644 --- a/pkgs/applications/virtualization/docker/gc.nix +++ b/pkgs/applications/virtualization/docker/gc.nix @@ -13,11 +13,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp docker-gc $out/bin chmod +x $out/bin/docker-gc wrapProgram $out/bin/docker-gc \ --prefix PATH : "${lib.makeBinPath [ docker coreutils procps gnused findutils gnugrep ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/virtualization/lkl/default.nix b/pkgs/applications/virtualization/lkl/default.nix index c889dc5ff50af..380e2a5255dcc 100644 --- a/pkgs/applications/virtualization/lkl/default.nix +++ b/pkgs/applications/virtualization/lkl/default.nix @@ -42,6 +42,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $lib/lib $dev cp tools/lkl/bin/lkl-hijack.sh $out/bin @@ -54,6 +56,8 @@ stdenv.mkDerivation rec { cp tools/lkl/liblkl.a \ tools/lkl/lib/liblkl.so \ tools/lkl/lib/hijack/liblkl-hijack.so $lib/lib + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/applications/virtualization/qboot/default.nix b/pkgs/applications/virtualization/qboot/default.nix index e0d833d0c2d50..9f9f0f7918d67 100644 --- a/pkgs/applications/virtualization/qboot/default.nix +++ b/pkgs/applications/virtualization/qboot/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation { nativeBuildInputs = [ meson ninja ]; installPhase = '' + runHook preInstall + mkdir -p $out cp bios.bin bios.bin.elf $out/. + + runHook postInstall ''; hardeningDisable = [ "stackprotector" "pic" ]; diff --git a/pkgs/applications/virtualization/remotebox/default.nix b/pkgs/applications/virtualization/remotebox/default.nix index 3e7c50690896e..5759571d556bf 100644 --- a/pkgs/applications/virtualization/remotebox/default.nix +++ b/pkgs/applications/virtualization/remotebox/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -pv $out/bin substituteInPlace remotebox --replace "\$Bin/" "\$Bin/../" @@ -23,6 +25,8 @@ stdenv.mkDerivation rec { mkdir -pv $out/share/applications cp -pv packagers-readme/*.desktop $out/share/applications + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix index 9173e94740520..6a8ebdde58226 100644 --- a/pkgs/applications/virtualization/virtualbox/default.nix +++ b/pkgs/applications/virtualization/virtualbox/default.nix @@ -204,6 +204,8 @@ in stdenv.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + libexec="$out/libexec/virtualbox" share="${if enableHardening then "$out/share/virtualbox" else "$libexec"}" @@ -253,6 +255,8 @@ in stdenv.mkDerivation (finalAttrs: { mkdir -p "$out/share/virtualbox" cp -rv src/VBox/Main/UnattendedTemplates "$out/share/virtualbox" ln -s "${finalAttrs.virtualboxGuestAdditionsIso}" "$out/share/virtualbox/VBoxGuestAdditions.iso" + + runHook postInstall ''; preFixup = optionalString (!headless) '' diff --git a/pkgs/applications/virtualization/vmware-workstation/default.nix b/pkgs/applications/virtualization/vmware-workstation/default.nix index 83d2361a99900..e5f830682105e 100644 --- a/pkgs/applications/virtualization/vmware-workstation/default.nix +++ b/pkgs/applications/virtualization/vmware-workstation/default.nix @@ -88,8 +88,12 @@ let }; installPhase = '' + runHook preInstall + mkdir -p $out/lib cp .libs/libgdbm*.so* $out/lib/ + + runHook postInstall ''; }); @@ -167,6 +171,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p \ $out/bin \ $out/etc/vmware \ @@ -419,6 +425,8 @@ stdenv.mkDerivation rec { wrapProgram $out/lib/vmware/bin/vmware-vmx rm $out/lib/vmware/bin/vmware-vmx ln -s /run/wrappers/bin/vmware-vmx $out/lib/vmware/bin/vmware-vmx + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/virtualization/x11docker/default.nix b/pkgs/applications/virtualization/x11docker/default.nix index 1e400088693b3..0fda8b17406a0 100644 --- a/pkgs/applications/virtualization/x11docker/default.nix +++ b/pkgs/applications/virtualization/x11docker/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { # Don't install `x11docker-gui`, because requires `kaptain` dependency installPhase = '' + runHook preInstall + install -D x11docker "$out/bin/x11docker"; wrapProgram "$out/bin/x11docker" \ --prefix PATH : "${lib.makeBinPath [ getopt gnugrep gawk ps mount iproute2 nx-libs xorg.xdpyinfo xorg.xhost xorg.xinit ]}" + + runHook postInstall ''; meta = { diff --git a/pkgs/applications/virtualization/xhyve/default.nix b/pkgs/applications/virtualization/xhyve/default.nix index 2d66f8351411f..390c79764ea0a 100644 --- a/pkgs/applications/virtualization/xhyve/default.nix +++ b/pkgs/applications/virtualization/xhyve/default.nix @@ -23,8 +23,12 @@ stdenv.mkDerivation rec { makeFlags = [ "CFLAGS+=-Wno-shift-sign-overflow" ''CFLAGS+=-DVERSION=\"${version}\"'' ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp build/xhyve $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/window-managers/2bwm/default.nix b/pkgs/applications/window-managers/2bwm/default.nix index 09f3a0ebce628..d8e2de1280678 100644 --- a/pkgs/applications/window-managers/2bwm/default.nix +++ b/pkgs/applications/window-managers/2bwm/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { buildInputs = [ libxcb xcbutilkeysyms xcbutilwm libX11 xcbutil xcbutilxrm ]; - installPhase = "make install DESTDIR=$out PREFIX=\"\""; + installPhase = "runHook preInstall; make install DESTDIR=$out PREFIX=\"\"; runHook postInstall"; meta = with lib; { homepage = "https://github.com/venam/2bwm"; diff --git a/pkgs/applications/window-managers/i3/easyfocus.nix b/pkgs/applications/window-managers/i3/easyfocus.nix index a1f0895bff6d7..f153430b18c7c 100644 --- a/pkgs/applications/window-managers/i3/easyfocus.nix +++ b/pkgs/applications/window-managers/i3/easyfocus.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation { # Makefile has no rule for 'install' installPhase = '' + runHook preInstall + mkdir -p $out/bin cp i3-easyfocus $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/window-managers/i3/wk-switch.nix b/pkgs/applications/window-managers/i3/wk-switch.nix index fadcfe9908dae..4d3f736f1d26f 100644 --- a/pkgs/applications/window-managers/i3/wk-switch.nix +++ b/pkgs/applications/window-managers/i3/wk-switch.nix @@ -18,8 +18,12 @@ python3Packages.buildPythonApplication rec { doCheck = false; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp i3-wk-switch.py "$out/bin/i3-wk-switch" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/window-managers/lwm/default.nix b/pkgs/applications/window-managers/lwm/default.nix index 1a2e388bdc349..051068b502b90 100644 --- a/pkgs/applications/window-managers/lwm/default.nix +++ b/pkgs/applications/window-managers/lwm/default.nix @@ -22,9 +22,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -dm755 $out/bin $out/share/man/man1 install -m755 lwm $out/bin/lwm install -m644 lwm.man $out/share/man/man1/lwm.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/applications/window-managers/stumpish/default.nix b/pkgs/applications/window-managers/stumpish/default.nix index c776e66da886e..11e39d53239a5 100644 --- a/pkgs/applications/window-managers/stumpish/default.nix +++ b/pkgs/applications/window-managers/stumpish/default.nix @@ -30,7 +30,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + cp util/stumpish/stumpish $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/build-support/checkpoint-build.nix b/pkgs/build-support/checkpoint-build.nix index f1202ca1ce0aa..818287edcfc03 100644 --- a/pkgs/build-support/checkpoint-build.nix +++ b/pkgs/build-support/checkpoint-build.nix @@ -49,11 +49,15 @@ rec { # build tools that build in the source directory, instead of # having a separate build directory such as the Linux kernel. installPhase = '' + runHook preInstall + runHook preCheckpointInstall mkdir -p $out/outputs cp -r ./* $out/outputs/ runHook postCheckpointInstall unset postPhases + + runHook postInstall ''; dontFixup = true; diff --git a/pkgs/build-support/dev-shell-tools/tests/default.nix b/pkgs/build-support/dev-shell-tools/tests/default.nix index 06ef7e393e324..8c60f82a9e10a 100644 --- a/pkgs/build-support/dev-shell-tools/tests/default.nix +++ b/pkgs/build-support/dev-shell-tools/tests/default.nix @@ -110,7 +110,7 @@ lib.recurseIntoAttrs { dontFixup = true; doCheck = true; - installPhase = "touch $out"; + installPhase = "runHook preInstall; touch $out; runHook postInstall"; checkPhase = '' fail() { diff --git a/pkgs/build-support/docker/nix-prefetch-docker.nix b/pkgs/build-support/docker/nix-prefetch-docker.nix index 18accd135c04e..eb8ef51c5e520 100644 --- a/pkgs/build-support/docker/nix-prefetch-docker.nix +++ b/pkgs/build-support/docker/nix-prefetch-docker.nix @@ -8,10 +8,14 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + install -vD ${./nix-prefetch-docker} $out/bin/$name; wrapProgram $out/bin/$name \ --prefix PATH : ${lib.makeBinPath [ nix skopeo jq ]} \ --set HOME /homeless-shelter + + runHook postInstall ''; preferLocalBuild = true; diff --git a/pkgs/build-support/dotnet/dotnetenv/build-solution.nix b/pkgs/build-support/dotnet/dotnetenv/build-solution.nix index b3372b9421777..f7a71dd6b921b 100644 --- a/pkgs/build-support/dotnet/dotnetenv/build-solution.nix +++ b/pkgs/build-support/dotnet/dotnetenv/build-solution.nix @@ -31,41 +31,43 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + addDeps() { - if [ -f $1/nix-support/dotnet-assemblies ] - then - for i in $(cat $1/nix-support/dotnet-assemblies) - do - windowsPath=$(cygpath --windows $i) - assemblySearchPaths="$assemblySearchPaths;$windowsPath" - - addDeps $i - done - fi + if [ -f $1/nix-support/dotnet-assemblies ] + then + for i in $(cat $1/nix-support/dotnet-assemblies) + do + windowsPath=$(cygpath --windows $i) + assemblySearchPaths="$assemblySearchPaths;$windowsPath" + + addDeps $i + done + fi } for i in ${toString assemblyInputs} do - windowsPath=$(cygpath --windows $i) - echo "Using assembly path: $windowsPath" + windowsPath=$(cygpath --windows $i) + echo "Using assembly path: $windowsPath" - if [ "$assemblySearchPaths" = "" ] - then - assemblySearchPaths="$windowsPath" - else - assemblySearchPaths="$assemblySearchPaths;$windowsPath" - fi + if [ "$assemblySearchPaths" = "" ] + then + assemblySearchPaths="$windowsPath" + else + assemblySearchPaths="$assemblySearchPaths;$windowsPath" + fi - addDeps $i + addDeps $i done echo "Assembly search paths are: $assemblySearchPaths" if [ "$assemblySearchPaths" != "" ] then - echo "Using assembly search paths args: $assemblySearchPathsArg" - export AssemblySearchPaths=$assemblySearchPaths + echo "Using assembly search paths args: $assemblySearchPathsArg" + export AssemblySearchPaths=$assemblySearchPaths fi mkdir -p $out @@ -81,5 +83,7 @@ stdenv.mkDerivation { do echo $i >> $out/nix-support/dotnet-assemblies done + + runHook postInstall ''; } diff --git a/pkgs/build-support/dotnet/make-nuget-deps/default.nix b/pkgs/build-support/dotnet/make-nuget-deps/default.nix index 341ab82ccddb5..420318acafa10 100644 --- a/pkgs/build-support/dotnet/make-nuget-deps/default.nix +++ b/pkgs/build-support/dotnet/make-nuget-deps/default.nix @@ -53,10 +53,14 @@ lib.makeOverridable( ''; installPhase = '' + runHook preInstall + dir=$out/share/nuget/packages/${lib.toLower pname}/${lib.toLower version} mkdir -p $dir cp -r . $dir echo {} > "$dir"/.nupkg.metadata + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/build-support/expand-response-params/default.nix b/pkgs/build-support/expand-response-params/default.nix index 6868ab97d8964..5441f7b93e43c 100644 --- a/pkgs/build-support/expand-response-params/default.nix +++ b/pkgs/build-support/expand-response-params/default.nix @@ -22,8 +22,12 @@ stdenv.mkDerivation { NIX_CC_USE_RESPONSE_FILE=0 "$CC" -std=c99 -O3 -o "expand-response-params" expand-response-params.c ''; installPhase = '' + runHook preInstall + mkdir -p $prefix/bin mv expand-response-params $prefix/bin/ + + runHook postInstall ''; meta = { diff --git a/pkgs/build-support/fetchgx/default.nix b/pkgs/build-support/fetchgx/default.nix index 93f60c0a9cac8..6940ad10eb247 100644 --- a/pkgs/build-support/fetchgx/default.nix +++ b/pkgs/build-support/fetchgx/default.nix @@ -23,7 +23,11 @@ stdenvNoCC.mkDerivation { ''; installPhase = '' + runHook preInstall + mv vendor $out + + runHook postInstall ''; preferLocalBuild = true; diff --git a/pkgs/build-support/fetchmavenartifact/default.nix b/pkgs/build-support/fetchmavenartifact/default.nix index 0f3cd4e64dd61..557fe52976986 100644 --- a/pkgs/build-support/fetchmavenartifact/default.nix +++ b/pkgs/build-support/fetchmavenartifact/default.nix @@ -64,8 +64,12 @@ in # By moving the jar to $out/share/java we make it discoverable by java # packages packages that mention this derivation in their buildInputs. installPhase = '' + runHook preInstall + mkdir -p $out/share/java ln -s ${jar} $out/share/java/${filename} + + runHook postInstall ''; # We also add a `jar` attribute that can be used to easily obtain the path # to the downloaded jar file. diff --git a/pkgs/build-support/icon-conv-tools/default.nix b/pkgs/build-support/icon-conv-tools/default.nix index 442f1f2235fa6..ba1c9780cc6c6 100644 --- a/pkgs/build-support/icon-conv-tools/default.nix +++ b/pkgs/build-support/icon-conv-tools/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { cp -p * "$out/bin" ''; - installPhase = "true"; + installPhase = "runHook preInstall; true; runHook postInstall"; dontPatchELF = true; dontStrip = true; diff --git a/pkgs/build-support/mono-dll-fixer/default.nix b/pkgs/build-support/mono-dll-fixer/default.nix index 09a986015eeda..b237830c374fb 100644 --- a/pkgs/build-support/mono-dll-fixer/default.nix +++ b/pkgs/build-support/mono-dll-fixer/default.nix @@ -4,8 +4,12 @@ stdenv.mkDerivation { dllFixer = ./dll-fixer.pl; dontUnpack = true; installPhase = '' + runHook preInstall + substitute $dllFixer $out --subst-var-by perl $perl/bin/perl chmod +x $out + + runHook postInstall ''; inherit perl; } diff --git a/pkgs/build-support/nuke-references/default.nix b/pkgs/build-support/nuke-references/default.nix index 4472d6eeddc10..33901fe19efef 100644 --- a/pkgs/build-support/nuke-references/default.nix +++ b/pkgs/build-support/nuke-references/default.nix @@ -21,9 +21,13 @@ stdenvNoCC.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin substituteAll ${./nuke-refs.sh} $out/bin/nuke-refs chmod a+x $out/bin/nuke-refs + + runHook postInstall ''; postFixup = lib.optionalString darwinCodeSign '' diff --git a/pkgs/build-support/pkg-config-wrapper/default.nix b/pkgs/build-support/pkg-config-wrapper/default.nix index 4a6c189bd0a48..dfe63823761e9 100644 --- a/pkgs/build-support/pkg-config-wrapper/default.nix +++ b/pkgs/build-support/pkg-config-wrapper/default.nix @@ -62,6 +62,8 @@ stdenv.mkDerivation { installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/nix-support wrap() { @@ -84,6 +86,8 @@ stdenv.mkDerivation { # at this.) + '' ln -s ${pkg-config}/share $out/share + + runHook postInstall ''; setupHooks = [ diff --git a/pkgs/build-support/release/default.nix b/pkgs/build-support/release/default.nix index f5ab2db1a7541..9db7e18be51c0 100644 --- a/pkgs/build-support/release/default.nix +++ b/pkgs/build-support/release/default.nix @@ -114,6 +114,8 @@ rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/{tarballs,nix-support} tar cJf "$out/tarballs/nixexprs.tar.xz" \ @@ -129,6 +131,8 @@ rec { touch "$out/nix-support/failed" fi done + + runHook postInstall ''; meta = meta // { diff --git a/pkgs/build-support/remove-references-to/default.nix b/pkgs/build-support/remove-references-to/default.nix index 1277cdb04fd7c..4ab33cdecfe3f 100644 --- a/pkgs/build-support/remove-references-to/default.nix +++ b/pkgs/build-support/remove-references-to/default.nix @@ -19,9 +19,13 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin substituteAll ${./remove-references-to.sh} $out/bin/remove-references-to chmod a+x $out/bin/remove-references-to + + runHook postInstall ''; postFixup = lib.optionalString darwinCodeSign '' diff --git a/pkgs/build-support/rust/build-rust-package/sysroot/default.nix b/pkgs/build-support/rust/build-rust-package/sysroot/default.nix index 240866b56e0cf..ae43a8c422974 100644 --- a/pkgs/build-support/rust/build-rust-package/sysroot/default.nix +++ b/pkgs/build-support/rust/build-rust-package/sysroot/default.nix @@ -19,6 +19,8 @@ in rustPlatform.buildRustPackage { doCheck = false; installPhase = '' + runHook preInstall + export LIBS_DIR=$out/lib/rustlib/${shortTarget}/lib mkdir -p $LIBS_DIR for f in target/${shortTarget}/release/deps/*.{rlib,rmeta}; do @@ -28,6 +30,8 @@ in rustPlatform.buildRustPackage { export RUST_SYSROOT=$(rustc --print=sysroot) host=${stdenv.buildPlatform.rust.rustcTarget} cp -r $RUST_SYSROOT/lib/rustlib/$host $out + + runHook postInstall ''; # allows support for cross-compilation diff --git a/pkgs/build-support/rust/fetch-cargo-tarball/default.nix b/pkgs/build-support/rust/fetch-cargo-tarball/default.nix index adbfe98d81039..02af24386fc1f 100644 --- a/pkgs/build-support/rust/fetch-cargo-tarball/default.nix +++ b/pkgs/build-support/rust/fetch-cargo-tarball/default.nix @@ -4,7 +4,7 @@ let cargo-vendor-normalise = stdenv.mkDerivation { src = ./cargo-vendor-normalise.py; nativeBuildInputs = [ python3.pkgs.wrapPython ]; dontUnpack = true; - installPhase = "install -D $src $out/bin/cargo-vendor-normalise"; + installPhase = "runHook preInstall; install -D $src $out/bin/cargo-vendor-normalise; runHook postInstall"; pythonPath = [ python3.pkgs.toml ]; postFixup = "wrapPythonPrograms"; doInstallCheck = true; @@ -103,9 +103,13 @@ in stdenv.mkDerivation ({ # Build a reproducible tar, per instructions at https://reproducible-builds.org/docs/archives/ installPhase = '' + runHook preInstall + tar --owner=0 --group=0 --numeric-owner --format=gnu \ --sort=name --mtime="@$SOURCE_DATE_EPOCH" \ -czf $out $name + + runHook postInstall ''; inherit (hash_) outputHashAlgo outputHash; diff --git a/pkgs/build-support/rust/sysroot/src.nix b/pkgs/build-support/rust/sysroot/src.nix index 664702e82c31b..02e7d5d65de2e 100644 --- a/pkgs/build-support/rust/sysroot/src.nix +++ b/pkgs/build-support/rust/sysroot/src.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + export RUSTC_SRC=${rustPlatform.rustLibSrc.override { }} '' + lib.optionalString (originalCargoToml != null) '' @@ -22,5 +24,7 @@ stdenv.mkDerivation { echo '#![no_std]' > $out/src/lib.rs cp Cargo.toml $out/Cargo.toml cp ${./Cargo.lock} $out/Cargo.lock + + runHook postInstall ''; } diff --git a/pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix b/pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix index 9881ed1016cc1..42801240ff90d 100644 --- a/pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix +++ b/pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix @@ -24,7 +24,11 @@ stdenv.mkDerivation { runHook postCheck ''; installPhase = '' + runHook preInstall + [[ $TEST_RAN == 1 && $TEST_POST_HOOK_RAN == 1 ]] touch $out + + runHook postInstall ''; } diff --git a/pkgs/build-support/src-only/default.nix b/pkgs/build-support/src-only/default.nix index cd8572629cad8..f6eebc0177e1d 100644 --- a/pkgs/build-support/src-only/default.nix +++ b/pkgs/build-support/src-only/default.nix @@ -13,7 +13,7 @@ let in stdenv.mkDerivation (args // { name = "${name}-source"; - installPhase = "cp -pr --reflink=auto -- . $out"; + installPhase = "runHook preInstall; cp -pr --reflink=auto -- . $out; runHook postInstall"; outputs = [ "out" ]; separateDebugInfo = false; dontUnpack = false; diff --git a/pkgs/build-support/testers/shellcheck/tester.nix b/pkgs/build-support/testers/shellcheck/tester.nix index 66f048f230959..17d5df1387fc0 100644 --- a/pkgs/build-support/testers/shellcheck/tester.nix +++ b/pkgs/build-support/testers/shellcheck/tester.nix @@ -23,6 +23,10 @@ stdenv.mkDerivation { | xargs -0 shellcheck ''; installPhase = '' + runHook preInstall + touch $out + + runHook postInstall ''; } diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index 686819725d59a..8df28c0b58c3b 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -877,7 +877,7 @@ rec { preferLocalBuild = true; allowSubstitutes = false; phases = "unpackPhase patchPhase installPhase"; - installPhase = "cp -R ./ $out"; + installPhase = "runHook preInstall; cp -R ./ $out; runHook postInstall"; } # Carry `meta` information from the underlying `src` if present. // (optionalAttrs (src?meta) { inherit (src) meta; }) diff --git a/pkgs/by-name/al/alephone/package.nix b/pkgs/by-name/al/alephone/package.nix index 79a228259960c..1a3084d4c3ede 100644 --- a/pkgs/by-name/al/alephone/package.nix +++ b/pkgs/by-name/al/alephone/package.nix @@ -148,11 +148,15 @@ stdenv.mkDerivation (finalAttrs: { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/data/$pname $out/share/applications cp -a * $out/data/$pname cp $desktopItem/share/applications/* $out/share/applications makeWrapper ${alephone}/bin/alephone $out/bin/$pname \ --add-flags $out/data/$pname + + runHook postInstall ''; } // extraArgs diff --git a/pkgs/by-name/an/anyk/package.nix b/pkgs/by-name/an/anyk/package.nix index 4e9a92081d5d2..ee9250858fbd2 100644 --- a/pkgs/by-name/an/anyk/package.nix +++ b/pkgs/by-name/an/anyk/package.nix @@ -105,6 +105,8 @@ in stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir $out cp -r application $out/opt @@ -121,6 +123,8 @@ in stdenv.mkDerivation { ln -s $out/opt/abevjava.png $out/share/pixmaps/anyk.png ln -s $out/opt/abevjava.png $out/share/icons/anyk.png + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/as/asn/package.nix b/pkgs/by-name/as/asn/package.nix index ea730ba622308..814ada607ca6c 100644 --- a/pkgs/by-name/as/asn/package.nix +++ b/pkgs/by-name/as/asn/package.nix @@ -29,10 +29,14 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -Dv asn "$out/bin/asn" wrapProgram $out/bin/asn \ --prefix PATH : "${lib.makeBinPath [ curl whois bind mtr jq ipcalc grepcidr nmap aha ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/au/audiobookshelf/package.nix b/pkgs/by-name/au/audiobookshelf/package.nix index a1a4df946704e..a7d2b8a337686 100644 --- a/pkgs/by-name/au/audiobookshelf/package.nix +++ b/pkgs/by-name/au/audiobookshelf/package.nix @@ -72,6 +72,8 @@ buildNpmPackage { npmDepsHash = source.depsHash; installPhase = '' + runHook preInstall + mkdir -p $out/opt/client cp -r index.js server package* node_modules $out/opt/ cp -r ${client}/lib/node_modules/${pname}-client/dist $out/opt/client/dist @@ -81,6 +83,8 @@ buildNpmPackage { echo " exec ${nodejs}/bin/node $out/opt/index.js" >> $out/bin/${pname} chmod +x $out/bin/${pname} + + runHook postInstall ''; passthru = { diff --git a/pkgs/by-name/az/azure-cli/package.nix b/pkgs/by-name/az/azure-cli/package.nix index f7f7f8cb0b262..7e9762d882cee 100644 --- a/pkgs/by-name/az/azure-cli/package.nix +++ b/pkgs/by-name/az/azure-cli/package.nix @@ -81,6 +81,8 @@ let namePaths = map (p: "${p.pname},${p}/${python3.sitePackages}") withExtensions; in '' + runHook preInstall + for line in ${lib.concatStringsSep " " namePaths}; do name=$(echo $line | cut -d',' -f1) path=$(echo $line | cut -d',' -f2) @@ -89,6 +91,8 @@ let ln -s $path/$f $out/$name/$f done done + + runHook postInstall ''; }; in diff --git a/pkgs/by-name/ba/bankstown-lv2/package.nix b/pkgs/by-name/ba/bankstown-lv2/package.nix index 7cbe4708ff385..c09b46accf9c6 100644 --- a/pkgs/by-name/ba/bankstown-lv2/package.nix +++ b/pkgs/by-name/ba/bankstown-lv2/package.nix @@ -17,11 +17,15 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-yRzM4tcYc6mweTpLnnlCeKgP00L2wRgHamtUzK9Kstc="; installPhase = '' + runHook preInstall + export LIBDIR=$out/lib mkdir -p $LIBDIR make make install + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ba/bant/package.nix b/pkgs/by-name/ba/bant/package.nix index d7bd9feb5b64c..7808ac06dfa54 100644 --- a/pkgs/by-name/ba/bant/package.nix +++ b/pkgs/by-name/ba/bant/package.nix @@ -50,7 +50,11 @@ in buildBazelPackage rec { buildAttrs = { installPhase = '' + runHook preInstall + install -D --strip bazel-bin/bant/bant "$out/bin/bant" + + runHook postInstall ''; }; diff --git a/pkgs/by-name/ba/batik/package.nix b/pkgs/by-name/ba/batik/package.nix index 18bdb7c37e195..75e89ef76504b 100644 --- a/pkgs/by-name/ba/batik/package.nix +++ b/pkgs/by-name/ba/batik/package.nix @@ -33,6 +33,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/java cp *.jar lib/*.jar $out/share/java chmod +x $out/share/java/*.jar @@ -43,6 +45,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { --add-flags "-classpath $classpath" \ --add-flags "org.apache.batik.apps.$appName.Main" done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/bo/bobcat/package.nix b/pkgs/by-name/bo/bobcat/package.nix index b873862fe7ed1..ab098db750ba6 100644 --- a/pkgs/by-name/bo/bobcat/package.nix +++ b/pkgs/by-name/bo/bobcat/package.nix @@ -56,11 +56,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + runHook preBuild ./build install x runHook postBuild + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/bt/btrfs-auto-snapshot/package.nix b/pkgs/by-name/bt/btrfs-auto-snapshot/package.nix index 7392a0c5809d1..e70c1e2a0da07 100644 --- a/pkgs/by-name/bt/btrfs-auto-snapshot/package.nix +++ b/pkgs/by-name/bt/btrfs-auto-snapshot/package.nix @@ -29,7 +29,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm755 btrfs-auto-snapshot $out/bin/btrfs-auto-snapshot + + runHook postInstall ''; wrapperPath = diff --git a/pkgs/by-name/bu/budgie-desktop-with-plugins/package.nix b/pkgs/by-name/bu/budgie-desktop-with-plugins/package.nix index 2e09fcf99e41c..ef449ece80108 100644 --- a/pkgs/by-name/bu/budgie-desktop-with-plugins/package.nix +++ b/pkgs/by-name/bu/budgie-desktop-with-plugins/package.nix @@ -33,10 +33,14 @@ stdenv.mkDerivation { allowSubstitutes = false; installPhase = '' + runHook preInstall + mkdir -p $out for i in $(cat $pathsPath); do ${xorg.lndir}/bin/lndir -silent $i $out done + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/by-name/ca/cano/package.nix b/pkgs/by-name/ca/cano/package.nix index 5702ce5fb19ff..dcdcdcab9bd9a 100644 --- a/pkgs/by-name/ca/cano/package.nix +++ b/pkgs/by-name/ca/cano/package.nix @@ -34,14 +34,13 @@ stdenv.mkDerivation (finalAttrs: { installPhase = '' runHook preInstall + install -Dm755 build/cano -t $out/bin - install -Dm755 build/cano -t $out/bin + mkdir -p $out/share + cp -r docs/help $out/share + installManPage docs/cano.1 - mkdir -p $out/share - cp -r docs/help $out/share - installManPage docs/cano.1 - - runHook postInstall + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/ce/certificate-ripper/package.nix b/pkgs/by-name/ce/certificate-ripper/package.nix index 72cdd6787a937..39beae0f0341e 100644 --- a/pkgs/by-name/ce/certificate-ripper/package.nix +++ b/pkgs/by-name/ce/certificate-ripper/package.nix @@ -32,7 +32,11 @@ let ]; installPhase = '' + runHook preInstall + install -Dm644 target/crip.jar $out + + runHook postInstall ''; }; in diff --git a/pkgs/by-name/ch/chow-centaur/package.nix b/pkgs/by-name/ch/chow-centaur/package.nix index 87c8bc35b1b9b..33f9c8a6d4d15 100644 --- a/pkgs/by-name/ch/chow-centaur/package.nix +++ b/pkgs/by-name/ch/chow-centaur/package.nix @@ -36,10 +36,14 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/lv2 $out/lib/vst3 cd ChowCentaur/ChowCentaur_artefacts/Release cp -r LV2/ChowCentaur.lv2 $out/lib/lv2 cp -r VST3/ChowCentaur.vst3 $out/lib/vst3 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ch/chow-kick/package.nix b/pkgs/by-name/ch/chow-kick/package.nix index 25eae2931c034..43d13e4bc0aa5 100644 --- a/pkgs/by-name/ch/chow-kick/package.nix +++ b/pkgs/by-name/ch/chow-kick/package.nix @@ -90,10 +90,14 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/lv2 $out/lib/vst3 $out/bin cp -r ChowKick_artefacts/Release/LV2/ChowKick.lv2 $out/lib/lv2 cp -r ChowKick_artefacts/Release/VST3/ChowKick.vst3 $out/lib/vst3 cp ChowKick_artefacts/Release/Standalone/ChowKick $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ch/chow-phaser/package.nix b/pkgs/by-name/ch/chow-phaser/package.nix index 87f22c9da1c57..dd0f522b87cf7 100644 --- a/pkgs/by-name/ch/chow-phaser/package.nix +++ b/pkgs/by-name/ch/chow-phaser/package.nix @@ -55,6 +55,8 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/lv2 $out/lib/vst3 $out/bin $out/share/doc/ChowPhaser/ cd ChowPhaserMono_artefacts/Release cp libChowPhaserMono_SharedCode.a $out/lib @@ -64,6 +66,8 @@ stdenv.mkDerivation (finalAttrs: { cp libChowPhaserStereo_SharedCode.a $out/lib cp -r VST3/ChowPhaserStereo.vst3 $out/lib/vst3 cp Standalone/ChowPhaserStereo $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ch/chow-tape-model/package.nix b/pkgs/by-name/ch/chow-tape-model/package.nix index a233e2352d7f1..771fa88f20c72 100644 --- a/pkgs/by-name/ch/chow-tape-model/package.nix +++ b/pkgs/by-name/ch/chow-tape-model/package.nix @@ -98,6 +98,8 @@ stdenv.mkDerivation (finalAttrs: { postPatch = "cd Plugin"; installPhase = '' + runHook preInstall + mkdir -p $out/lib/lv2 $out/lib/vst3 $out/lib/clap $out/bin $out/share/doc/CHOWTapeModel/ cd CHOWTapeModel_artefacts/${finalAttrs.cmakeBuildType} cp -r LV2/CHOWTapeModel.lv2 $out/lib/lv2 @@ -105,6 +107,8 @@ stdenv.mkDerivation (finalAttrs: { cp -r CLAP/CHOWTapeModel.clap $out/lib/clap cp Standalone/CHOWTapeModel $out/bin cp ../../../../Manual/ChowTapeManual.pdf $out/share/doc/CHOWTapeModel/ + + runHook postInstall ''; # JUCE dlopens these, make sure they are in rpath diff --git a/pkgs/by-name/ci/cinnamon-translations/package.nix b/pkgs/by-name/ci/cinnamon-translations/package.nix index 503db8783de4e..563dd9dd5a07b 100644 --- a/pkgs/by-name/ci/cinnamon-translations/package.nix +++ b/pkgs/by-name/ci/cinnamon-translations/package.nix @@ -20,7 +20,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mv usr $out # files get installed like so: msgfmt -o usr/share/locale/$lang/LC_MESSAGES/$dir.mo $file + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ci/ciscoPacketTracer7/package.nix b/pkgs/by-name/ci/ciscoPacketTracer7/package.nix index 620e7420439b2..8f989913813ab 100644 --- a/pkgs/by-name/ci/ciscoPacketTracer7/package.nix +++ b/pkgs/by-name/ci/ciscoPacketTracer7/package.nix @@ -26,9 +26,13 @@ let nativeBuildInputs = [ dpkg makeWrapper ]; installPhase = '' + runHook preInstall + dpkg-deb -x $src $out makeWrapper "$out/opt/pt/bin/PacketTracer7" "$out/bin/packettracer7" \ --prefix LD_LIBRARY_PATH : "$out/opt/pt/bin" + + runHook postInstall ''; }; @@ -71,8 +75,12 @@ in stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir $out ${lndir}/bin/lndir -silent ${fhs} $out + + runHook postInstall ''; desktopItems = [ desktopItem ]; diff --git a/pkgs/by-name/co/connman-ncurses/package.nix b/pkgs/by-name/co/connman-ncurses/package.nix index 53b488159823d..91d124b4a3234 100644 --- a/pkgs/by-name/co/connman-ncurses/package.nix +++ b/pkgs/by-name/co/connman-ncurses/package.nix @@ -27,8 +27,12 @@ stdenv.mkDerivation { env.NIX_CFLAGS_COMPILE = "-Wno-error"; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp -va connman_ncurses "$out/bin/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/co/connman-notify/package.nix b/pkgs/by-name/co/connman-notify/package.nix index 4b9002441a926..94a59065e742e 100644 --- a/pkgs/by-name/co/connman-notify/package.nix +++ b/pkgs/by-name/co/connman-notify/package.nix @@ -22,8 +22,12 @@ python3Packages.buildPythonApplication { strictDeps = false; installPhase = '' + runHook preInstall + install -D -t $out/bin connman-notify install -D -t $out/share/doc README.rst + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/co/connman_dmenu/package.nix b/pkgs/by-name/co/connman_dmenu/package.nix index 6c4d3dd26ec0e..a35ee0f3b0ee6 100644 --- a/pkgs/by-name/co/connman_dmenu/package.nix +++ b/pkgs/by-name/co/connman_dmenu/package.nix @@ -21,8 +21,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp connman_dmenu $out/bin/ + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/co/coz/package.nix b/pkgs/by-name/co/coz/package.nix index 2938a60b46de5..88fd1eaae83c0 100644 --- a/pkgs/by-name/co/coz/package.nix +++ b/pkgs/by-name/co/coz/package.nix @@ -38,6 +38,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/man/man1 make install prefix=$out @@ -45,6 +47,8 @@ stdenv.mkDerivation rec { chmod -x $out/include/coz.h wrapPythonPrograms + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/cr/crabfit-frontend/package.nix b/pkgs/by-name/cr/crabfit-frontend/package.nix index f6f3bc8a8c40a..dbcc116c288ec 100644 --- a/pkgs/by-name/cr/crabfit-frontend/package.nix +++ b/pkgs/by-name/cr/crabfit-frontend/package.nix @@ -99,12 +99,16 @@ stdenv.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + mkdir $out cp -R .next/* $out cp -R public $out/standalone/ cp -R .next/static $out/standalone/.next ln -s /var/cache/crabfit $out/standalone/.next/cache + + runHook postInstall ''; passthru.tests = [ nixosTests.crabfit ]; diff --git a/pkgs/by-name/cr/criterion/tests/001-version.nix b/pkgs/by-name/cr/criterion/tests/001-version.nix index 25a98b5a0c306..7dddc54ff361f 100644 --- a/pkgs/by-name/cr/criterion/tests/001-version.nix +++ b/pkgs/by-name/cr/criterion/tests/001-version.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${name} $out/bin/${name} + + runHook postInstall ''; meta.mainProgram = name; diff --git a/pkgs/by-name/cu/cups-kyocera-3500-4500/package.nix b/pkgs/by-name/cu/cups-kyocera-3500-4500/package.nix index 14f89056daf93..e9eb0a75aa6da 100644 --- a/pkgs/by-name/cu/cups-kyocera-3500-4500/package.nix +++ b/pkgs/by-name/cu/cups-kyocera-3500-4500/package.nix @@ -60,6 +60,8 @@ stdenv.mkDerivation rec { propagatedBuildInputs = with python3Packages; [ reportlab pypdf3 setuptools ]; installPhase = '' + runHook preInstall + # allow cups to find the ppd files mkdir -p $out/share/cups/model mv ./usr/share/kyocera${kyodialog_version_short}/ppd${kyodialog_version_short} $out/share/cups/model/Kyocera @@ -73,6 +75,8 @@ stdenv.mkDerivation rec { wrapPythonProgramsIn $out/lib/cups/filter "$propagatedBuildInputs" install -Dm444 usr/share/doc/kyodialog/copyright $out/share/doc/${pname}/copyright + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/de/desktop-postflop/package.nix b/pkgs/by-name/de/desktop-postflop/package.nix index 4f81bfa4943fb..8257d2b56c687 100644 --- a/pkgs/by-name/de/desktop-postflop/package.nix +++ b/pkgs/by-name/de/desktop-postflop/package.nix @@ -28,8 +28,12 @@ rustPlatform.buildRustPackage rec { npmDepsHash = "sha256-HWZLicyKL2FHDjZQj9/CRwVi+uc/jHmVNxtlDuclf7s="; installPhase = '' + runHook preInstall + mkdir -p $out cp -r dist/* $out + + runHook postInstall ''; }; diff --git a/pkgs/by-name/dg/dgoss/package.nix b/pkgs/by-name/dg/dgoss/package.nix index 55014119c8265..8034324427a66 100644 --- a/pkgs/by-name/dg/dgoss/package.nix +++ b/pkgs/by-name/dg/dgoss/package.nix @@ -17,8 +17,12 @@ resholve.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + sed -i '2i GOSS_PATH=${goss}/bin/goss' extras/dgoss/dgoss install -D extras/dgoss/dgoss $out/bin/dgoss + + runHook postInstall ''; solutions = { diff --git a/pkgs/by-name/dh/dhcpig/package.nix b/pkgs/by-name/dh/dhcpig/package.nix index 679a91e4b0c95..f5c71f1a01cd8 100644 --- a/pkgs/by-name/dh/dhcpig/package.nix +++ b/pkgs/by-name/dh/dhcpig/package.nix @@ -24,7 +24,11 @@ python3.pkgs.buildPythonApplication rec { ]; installPhase = '' + runHook preInstall + install -Dm755 pig.py $out/bin/dhcpig + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/di/direnv/package.nix b/pkgs/by-name/di/direnv/package.nix index 033f73249f0b9..8969477d1c689 100644 --- a/pkgs/by-name/di/direnv/package.nix +++ b/pkgs/by-name/di/direnv/package.nix @@ -24,7 +24,11 @@ buildGoModule rec { ''; installPhase = '' + runHook preInstall + make install PREFIX=$out + + runHook postInstall ''; nativeCheckInputs = [ fish zsh ]; diff --git a/pkgs/by-name/ec/ecc/package.nix b/pkgs/by-name/ec/ecc/package.nix index cf91d52875ccb..1422921f24bc5 100644 --- a/pkgs/by-name/ec/ecc/package.nix +++ b/pkgs/by-name/ec/ecc/package.nix @@ -34,12 +34,16 @@ let ''; installPhase = '' + runHook preInstall + # We don't use the default `make install` because we are looking to create a # directory structure compatible with `build.rs` of `ecc`. mkdir -p $out/src/libbpf # some headers are required cp -r src/libbpf/include $out/src/libbpf cp src/bpftool $out/src + + runHook postInstall ''; }; diff --git a/pkgs/by-name/em/emulationstation-de/package.nix b/pkgs/by-name/em/emulationstation-de/package.nix index 9fc0cf1f7bc36..96a6b5919d61a 100644 --- a/pkgs/by-name/em/emulationstation-de/package.nix +++ b/pkgs/by-name/em/emulationstation-de/package.nix @@ -44,8 +44,12 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + install -D ../emulationstation $out/bin/emulationstation cp -r ../resources/ $out/bin/resources/ + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/en/encled/package.nix b/pkgs/by-name/en/encled/package.nix index 8b48f11bc8b00..00fc03044e642 100644 --- a/pkgs/by-name/en/encled/package.nix +++ b/pkgs/by-name/en/encled/package.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + install -Dm0755 -t $out/bin/ encled install -Dm0644 -t $out/share/man/man8 encled.8 + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/fi/firecracker/package.nix b/pkgs/by-name/fi/firecracker/package.nix index 7f93af1ced703..b95e6db0f221d 100644 --- a/pkgs/by-name/fi/firecracker/package.nix +++ b/pkgs/by-name/fi/firecracker/package.nix @@ -51,9 +51,13 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -D firecracker $out/bin/firecracker install -D jailer $out/bin/jailer + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/fi/fitsverify/package.nix b/pkgs/by-name/fi/fitsverify/package.nix index b755e71616f80..ca845d8d48ee3 100644 --- a/pkgs/by-name/fi/fitsverify/package.nix +++ b/pkgs/by-name/fi/fitsverify/package.nix @@ -26,7 +26,11 @@ stdenv.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + install -D fitsverify $out/bin/fitsverify + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/fl/flaresolverr/package.nix b/pkgs/by-name/fl/flaresolverr/package.nix index 07e02231997c3..dead4e995152e 100644 --- a/pkgs/by-name/fl/flaresolverr/package.nix +++ b/pkgs/by-name/fl/flaresolverr/package.nix @@ -59,12 +59,16 @@ stdenv.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/${finalAttrs.pname}-${finalAttrs.version}} cp -r * $out/share/${finalAttrs.pname}-${finalAttrs.version}/. makeWrapper ${python}/bin/python $out/bin/flaresolverr \ --add-flags "$out/share/${finalAttrs.pname}-${finalAttrs.version}/src/flaresolverr.py" \ --prefix PATH : "${lib.makeBinPath [ xorg.xvfb ]}" + + runHook postInstall ''; passthru = { diff --git a/pkgs/by-name/fo/forgejo/generic.nix b/pkgs/by-name/fo/forgejo/generic.nix index a2a1e51850bce..d08a4a5ab6fa6 100644 --- a/pkgs/by-name/fo/forgejo/generic.nix +++ b/pkgs/by-name/fo/forgejo/generic.nix @@ -44,8 +44,12 @@ let # override npmInstallHook installPhase = '' + runHook preInstall + mkdir $out cp -R ./public $out/ + + runHook postInstall ''; }; in diff --git a/pkgs/by-name/gh/gh-f/package.nix b/pkgs/by-name/gh/gh-f/package.nix index 6b10219f8a81e..1cdb9bdfdeb1e 100644 --- a/pkgs/by-name/gh/gh-f/package.nix +++ b/pkgs/by-name/gh/gh-f/package.nix @@ -36,7 +36,11 @@ stdenvNoCC.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -D -m755 "gh-f" "$out/bin/gh-f" + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/by-name/gh/gh-notify/package.nix b/pkgs/by-name/gh/gh-notify/package.nix index 402d409e6cae5..bf99be1d71372 100644 --- a/pkgs/by-name/gh/gh-notify/package.nix +++ b/pkgs/by-name/gh/gh-notify/package.nix @@ -37,7 +37,11 @@ stdenvNoCC.mkDerivation { ]; installPhase = '' + runHook preInstall + install -D -m755 "gh-notify" "$out/bin/gh-notify" + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/by-name/gh/ghi/package.nix b/pkgs/by-name/gh/ghi/package.nix index 5c17846aab754..b34ff2c5e44ff 100644 --- a/pkgs/by-name/gh/ghi/package.nix +++ b/pkgs/by-name/gh/ghi/package.nix @@ -30,9 +30,13 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ finalAttrs.env.wrappedRuby ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ghi $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/gi/git-standup/package.nix b/pkgs/by-name/gi/git-standup/package.nix index ba8af35849f42..b94bec0618cd2 100644 --- a/pkgs/by-name/gi/git-standup/package.nix +++ b/pkgs/by-name/gi/git-standup/package.nix @@ -16,10 +16,14 @@ stdenv.mkDerivation (finalAttrs: { dontBuild = true; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin git-standup wrapProgram $out/bin/git-standup \ --prefix PATH : "${lib.makeBinPath [ git ]}" + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/gi/gitea/package.nix b/pkgs/by-name/gi/gitea/package.nix index 81625263a3566..39bfe7e7627cf 100644 --- a/pkgs/by-name/gi/gitea/package.nix +++ b/pkgs/by-name/gi/gitea/package.nix @@ -30,8 +30,12 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -R public $out/ + + runHook postInstall ''; }; in buildGoModule rec { diff --git a/pkgs/by-name/gn/gnucap/package.nix b/pkgs/by-name/gn/gnucap/package.nix index b80e46b42d51a..3aa591286ed01 100644 --- a/pkgs/by-name/gn/gnucap/package.nix +++ b/pkgs/by-name/gn/gnucap/package.nix @@ -64,8 +64,12 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${wrapper} $out/bin/gnucap + + runHook postInstall ''; inherit meta; diff --git a/pkgs/by-name/h2/h2/package.nix b/pkgs/by-name/h2/h2/package.nix index 5398d1eef0c5c..ce8f37d741451 100644 --- a/pkgs/by-name/h2/h2/package.nix +++ b/pkgs/by-name/h2/h2/package.nix @@ -31,6 +31,8 @@ maven.buildMavenPackage rec { doCheck = false; installPhase = '' + runHook preInstall + mkdir -p $out/share/java install -Dm644 h2/target/h2-${version}.jar $out/share/java @@ -39,6 +41,8 @@ maven.buildMavenPackage rec { mkdir -p $doc/share/doc/h2 cp -r h2/src/docsrc/* $doc/share/doc/h2 + + runHook postInstall ''; passthru.updateScript = nix-update-script { diff --git a/pkgs/by-name/he/hentai-at-home/package.nix b/pkgs/by-name/he/hentai-at-home/package.nix index 29809e10ab64f..ce76e6dee2cc9 100644 --- a/pkgs/by-name/he/hentai-at-home/package.nix +++ b/pkgs/by-name/he/hentai-at-home/package.nix @@ -33,12 +33,16 @@ stdenvNoCC.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/java cp build/HentaiAtHome.jar $out/share/java mkdir -p $out/bin makeWrapper ${jre_headless}/bin/java $out/bin/HentaiAtHome \ --add-flags "${javaOpts} -jar $out/share/java/HentaiAtHome.jar" + + runHook postInstall ''; doInstallCheck = true; diff --git a/pkgs/by-name/ii/iina/package.nix b/pkgs/by-name/ii/iina/package.nix index 1d3dea15fa19a..eb7ef8d5f1020 100644 --- a/pkgs/by-name/ii/iina/package.nix +++ b/pkgs/by-name/ii/iina/package.nix @@ -20,9 +20,13 @@ stdenvNoCC.mkDerivation (finalAttrs: { sourceRoot = "IINA.app"; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,Applications/IINA.app} cp -R . "$out/Applications/IINA.app" ln -s "$out/Applications/IINA.app/Contents/MacOS/iina-cli" "$out/bin/iina" + + runHook postInstall ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/is/isabelle/components/isabelle-linter.nix b/pkgs/by-name/is/isabelle/components/isabelle-linter.nix index 1be4ac532d05e..3ac78ff480d24 100644 --- a/pkgs/by-name/is/isabelle/components/isabelle-linter.nix +++ b/pkgs/by-name/is/isabelle/components/isabelle-linter.nix @@ -20,9 +20,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + dir=$out/Isabelle${isabelle.version}/contrib/${pname}-${version} mkdir -p $dir cp -r * $dir/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/is/isabelle/package.nix b/pkgs/by-name/is/isabelle/package.nix index 3adf58f467a3e..67ad7edfd9438 100644 --- a/pkgs/by-name/is/isabelle/package.nix +++ b/pkgs/by-name/is/isabelle/package.nix @@ -41,8 +41,12 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib cp libsha1.so $out/lib/ + + runHook postInstall ''; }; in stdenv.mkDerivation (finalAttrs: rec { @@ -182,6 +186,8 @@ in stdenv.mkDerivation (finalAttrs: rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv $TMP/$dirname $out cd $out/$dirname @@ -194,6 +200,8 @@ in stdenv.mkDerivation (finalAttrs: rec { # desktop item mkdir -p "$out/share" cp -r "${desktopItem}/share/applications" "$out/share/applications" + + runHook postInstall ''; desktopItem = makeDesktopItem { diff --git a/pkgs/by-name/jq/jq-zsh-plugin/package.nix b/pkgs/by-name/jq/jq-zsh-plugin/package.nix index 3e06f6d58872f..1994777061f06 100644 --- a/pkgs/by-name/jq/jq-zsh-plugin/package.nix +++ b/pkgs/by-name/jq/jq-zsh-plugin/package.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { dontConfigure = true; dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/jq-zsh-plugin/ cp jq.plugin.zsh $out/share/jq-zsh-plugin cp -r bin/ $out/share/jq-zsh-plugin @@ -30,6 +32,8 @@ stdenv.mkDerivation rec { substituteInPlace $out/share/jq-zsh-plugin/bin/jq-paths --replace-fail ":-jq" ":-${jq}/bin/jq" substituteInPlace $out/share/jq-zsh-plugin/bin/jq-repl --replace-fail ":-jq" ":-${jq}/bin/jq" substituteInPlace $out/share/jq-zsh-plugin/bin/jq-repl-preview --replace-fail ":-jq" ":-${jq}/bin/jq" + + runHook postInstall ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/ju/junest/package.nix b/pkgs/by-name/ju/junest/package.nix index 2890f345964b9..db1a1df8f634d 100644 --- a/pkgs/by-name/ju/junest/package.nix +++ b/pkgs/by-name/ju/junest/package.nix @@ -14,11 +14,15 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/lib cp -r $src/bin/ $out/ cp -r $src/lib/ $out/ substituteInPlace $out/lib/core/common.sh --replace-fail "wget" ${lib.getExe wget} + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/ks/ks/package.nix b/pkgs/by-name/ks/ks/package.nix index ab80aa2b6bc12..9abe4dc0c8d72 100644 --- a/pkgs/by-name/ks/ks/package.nix +++ b/pkgs/by-name/ks/ks/package.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation (finalAttrs: { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${finalAttrs.pname} $out/bin/ + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/ld/ldc/bootstrap.nix b/pkgs/by-name/ld/ldc/bootstrap.nix index 2a23e755c7cf6..5343279c5ffe4 100644 --- a/pkgs/by-name/ld/ldc/bootstrap.nix +++ b/pkgs/by-name/ld/ldc/bootstrap.nix @@ -34,9 +34,13 @@ in stdenv.mkDerivation { propagatedBuildInputs = [ curl tzdata ]; installPhase = '' + runHook preInstall + mkdir -p $out mv bin etc import lib LICENSE README $out/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ld/ldc/package.nix b/pkgs/by-name/ld/ldc/package.nix index 112a9eeb1d8ed..6fb39f26a478d 100644 --- a/pkgs/by-name/ld/ldc/package.nix +++ b/pkgs/by-name/ld/ldc/package.nix @@ -165,8 +165,12 @@ stdenv.mkDerivation (finalAttrs: { ldc2 ${lib.escapeShellArgs finalAttrs.dFlags} -of=test $src ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv test $out/bin + + runHook postInstall ''; }); in { diff --git a/pkgs/by-name/li/libertine-g/package.nix b/pkgs/by-name/li/libertine-g/package.nix index 2f472e345c0fc..0569c0c9baa93 100644 --- a/pkgs/by-name/li/libertine-g/package.nix +++ b/pkgs/by-name/li/libertine-g/package.nix @@ -10,8 +10,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype cp -r *.ttf $out/share/fonts/truetype + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/li/libigl/package.nix b/pkgs/by-name/li/libigl/package.nix index 085915ea352f3..6290f7a09efc9 100644 --- a/pkgs/by-name/li/libigl/package.nix +++ b/pkgs/by-name/li/libigl/package.nix @@ -18,8 +18,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { # We could also properly use CMake, but we would have to heavily patch it # to avoid configure-time downloads of many things. installPhase = '' + runHook preInstall + mkdir -p $out/include cp -r include/igl $out/include + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/li/librearp-lv2/package.nix b/pkgs/by-name/li/librearp-lv2/package.nix index 82c78aa76d7ec..440653b459aa5 100644 --- a/pkgs/by-name/li/librearp-lv2/package.nix +++ b/pkgs/by-name/li/librearp-lv2/package.nix @@ -37,9 +37,13 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/lv2 cd LibreArp_artefacts/Release cp -r LV2/LibreArp.lv2 $out/lib/lv2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/li/librearp/package.nix b/pkgs/by-name/li/librearp/package.nix index 9bd1beac345d4..f8a457a41d936 100644 --- a/pkgs/by-name/li/librearp/package.nix +++ b/pkgs/by-name/li/librearp/package.nix @@ -37,9 +37,13 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/vst3 cd LibreArp_artefacts/Release cp -r VST3/LibreArp.vst3 $out/lib/vst3 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/li/linux-scripts/package.nix b/pkgs/by-name/li/linux-scripts/package.nix index f317538be7e70..79d4f7232a64d 100644 --- a/pkgs/by-name/li/linux-scripts/package.nix +++ b/pkgs/by-name/li/linux-scripts/package.nix @@ -50,8 +50,12 @@ stdenvNoCC.mkDerivation dontBuild = true; installPhase = '' + runHook preInstall + ${toWrapScriptLines "extract-ikconfig"} ${toWrapScriptLines "extract-vmlinux"} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/li/linuxhw-edid-fetcher/package.nix b/pkgs/by-name/li/linuxhw-edid-fetcher/package.nix index 18c91f1b18cdc..2cf4aaa41d4dd 100644 --- a/pkgs/by-name/li/linuxhw-edid-fetcher/package.nix +++ b/pkgs/by-name/li/linuxhw-edid-fetcher/package.nix @@ -46,11 +46,15 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" ln -s "$fetch" "$out/bin/" ${lib.optionalString (displays != { }) '' install -D --mode=444 --target-directory="$out/lib/firmware/edid" *.bin ''} + + runHook postInstall ''; passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch=master" ]; }; diff --git a/pkgs/by-name/li/listmonk/frontend.nix b/pkgs/by-name/li/listmonk/frontend.nix index 1584526d4b232..6913984690021 100644 --- a/pkgs/by-name/li/listmonk/frontend.nix +++ b/pkgs/by-name/li/listmonk/frontend.nix @@ -26,8 +26,12 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = '' + runHook preInstall + mkdir $out cp -R dist/* $out + + runHook postInstall ''; inherit meta; diff --git a/pkgs/by-name/ll/lldap-cli/package.nix b/pkgs/by-name/ll/lldap-cli/package.nix index 6bec2c2426627..19efda71e21d2 100644 --- a/pkgs/by-name/ll/lldap-cli/package.nix +++ b/pkgs/by-name/ll/lldap-cli/package.nix @@ -36,9 +36,13 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + install -Dm555 lldap-cli -t $out/bin wrapProgram $out/bin/lldap-cli \ --prefix PATH : ${lib.makeBinPath [ bash coreutils gnugrep gnused jq curl ]} + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/lo/localsend/package.nix b/pkgs/by-name/lo/localsend/package.nix index 8fbfc3acbf0d0..a575ce848b259 100644 --- a/pkgs/by-name/lo/localsend/package.nix +++ b/pkgs/by-name/lo/localsend/package.nix @@ -86,9 +86,13 @@ let sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/Applications cp -r *.app $out/Applications makeBinaryWrapper $out/Applications/LocalSend.app/Contents/MacOS/LocalSend $out/bin/localsend + + runHook postInstall ''; meta = metaCommon // { diff --git a/pkgs/by-name/ls/lsd2dsl/package.nix b/pkgs/by-name/ls/lsd2dsl/package.nix index 4ab26b40a7c2e..6638582d97b9c 100644 --- a/pkgs/by-name/ls/lsd2dsl/package.nix +++ b/pkgs/by-name/ls/lsd2dsl/package.nix @@ -46,7 +46,11 @@ stdenv.mkDerivation rec { }); installPhase = '' + runHook preInstall + install -Dm755 console/lsd2dsl gui/lsd2dsl-qtgui -t $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ls/lse/package.nix b/pkgs/by-name/ls/lse/package.nix index 52d050e5ba7c3..c0c91fe4cd7a4 100644 --- a/pkgs/by-name/ls/lse/package.nix +++ b/pkgs/by-name/ls/lse/package.nix @@ -22,10 +22,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp lse.sh $out/bin/lse.sh wrapProgram $out/bin/lse.sh \ --prefix PATH : ${lib.makeBinPath [ bash ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ma/matrix-brandy/package.nix b/pkgs/by-name/ma/matrix-brandy/package.nix index 2733c97598e8b..770abead9c85b 100644 --- a/pkgs/by-name/ma/matrix-brandy/package.nix +++ b/pkgs/by-name/ma/matrix-brandy/package.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp brandy $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ma/maven/build-maven.nix b/pkgs/by-name/ma/maven/build-maven.nix index 7ac8afdde225a..beeb281b576d4 100644 --- a/pkgs/by-name/ma/maven/build-maven.nix +++ b/pkgs/by-name/ma/maven/build-maven.nix @@ -81,8 +81,12 @@ in { buildPhase = "mvn --offline --settings ${settings} compile"; installPhase = '' + runHook preInstall + mvn --offline --settings ${settings} package mv target/*.jar $out + + runHook postInstall ''; }; } diff --git a/pkgs/by-name/me/meletrix-udev-rules/package.nix b/pkgs/by-name/me/meletrix-udev-rules/package.nix index 43fd2b94cdd5b..ac56510a73dc2 100644 --- a/pkgs/by-name/me/meletrix-udev-rules/package.nix +++ b/pkgs/by-name/me/meletrix-udev-rules/package.nix @@ -12,7 +12,11 @@ stdenvNoCC.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + install -Dpm644 $src $out/lib/udev/rules.d/70-meletrix.rules + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/me/meritous/package.nix b/pkgs/by-name/me/meritous/package.nix index 8b0a176938aac..7e17a58a9ab84 100644 --- a/pkgs/by-name/me/meritous/package.nix +++ b/pkgs/by-name/me/meritous/package.nix @@ -23,9 +23,13 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ SDL SDL_image SDL_mixer zlib ]; installPhase = '' + runHook preInstall + install -m 555 -D meritous $out/bin/meritous mkdir -p $out/share/meritous cp -r dat/* $out/share/meritous/ + + runHook postInstall ''; hardeningDisable = [ "stackprotector" "fortify" ]; diff --git a/pkgs/by-name/mf/mfcj880dwlpr/package.nix b/pkgs/by-name/mf/mfcj880dwlpr/package.nix index cbfcd2b54b9c4..2c6c4e458c788 100644 --- a/pkgs/by-name/mf/mfcj880dwlpr/package.nix +++ b/pkgs/by-name/mf/mfcj880dwlpr/package.nix @@ -43,6 +43,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + dpkg-deb -x $src $out substituteInPlace $out/opt/brother/Printers/mfcj880dw/lpd/filtermfcj880dw \ --replace-fail /opt "$out/opt" @@ -80,7 +82,9 @@ stdenv.mkDerivation rec { --prefix PATH ":" ${ lib.makeBinPath [ coreutils gnused gawk ] } wrapProgram $out/opt/brother/Printers/mfcj880dw/lpd/filtermfcj880dw \ --prefix PATH ":" ${ lib.makeBinPath [ coreutils gnused file ghostscript a2ps ] } - ''; + + runHook postInstall + ''; meta = with lib; { description = "Brother MFC-J880DW LPR driver"; diff --git a/pkgs/by-name/mi/mint-artwork/package.nix b/pkgs/by-name/mi/mint-artwork/package.nix index e74c9e7dc542a..e5035980a2bb2 100644 --- a/pkgs/by-name/mi/mint-artwork/package.nix +++ b/pkgs/by-name/mi/mint-artwork/package.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir $out # note: we fuck up a bunch of stuff but idc @@ -36,6 +38,8 @@ stdenv.mkDerivation rec { mv etc $out/etc mv usr/share $out/share + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/mr/mricron/package.nix b/pkgs/by-name/mr/mricron/package.nix index d79f59bced84c..09b39195969b5 100644 --- a/pkgs/by-name/mr/mricron/package.nix +++ b/pkgs/by-name/mr/mricron/package.nix @@ -48,11 +48,15 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/icons/hicolor/256x256/apps install -Dm777 ./MRIcron $out/bin/mricron install -Dm444 -t $out/share/icons/hicolor/scalable/apps/ ./Resources/mricron.svg + + runHook postInstall ''; desktopItems = [ diff --git a/pkgs/by-name/mu/mumps/package.nix b/pkgs/by-name/mu/mumps/package.nix index a02d7901617ea..f7998595aff3c 100644 --- a/pkgs/by-name/mu/mumps/package.nix +++ b/pkgs/by-name/mu/mumps/package.nix @@ -56,12 +56,16 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = '' + runHook preInstall + mkdir $out cp -r include lib $out # Add some compatibility with coin-or-mumps ln -s $out/include $out/include/mumps cp libseq/mumps_mpi.h $out/include + + runHook postInstall ''; nativeBuildInputs = [ gfortran ]; diff --git a/pkgs/by-name/na/nanopb/generator.nix b/pkgs/by-name/na/nanopb/generator.nix index 15d4e0605b80e..33e9c73510a80 100644 --- a/pkgs/by-name/na/nanopb/generator.nix +++ b/pkgs/by-name/na/nanopb/generator.nix @@ -18,10 +18,14 @@ stdenvNoCC.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${generator-out}/bin/protoc-gen-nanopb $out/bin/ cp ${generator-out}/bin/nanopb_generator $out/bin/ wrapPythonPrograms cp ${generator-out}/bin/nanopb_generator.py $out/bin/ + + runHook postInstall ''; } diff --git a/pkgs/by-name/ne/nerdfetch/package.nix b/pkgs/by-name/ne/nerdfetch/package.nix index 659cc3deb9c3e..a592b96b332ec 100644 --- a/pkgs/by-name/ne/nerdfetch/package.nix +++ b/pkgs/by-name/ne/nerdfetch/package.nix @@ -18,8 +18,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { dontConfigure = true; dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp $src/nerdfetch $out/bin + + runHook postInstall ''; passthru.updateScript = gitUpdater { diff --git a/pkgs/by-name/ne/netbird-dashboard/package.nix b/pkgs/by-name/ne/netbird-dashboard/package.nix index f8a6ecb8291a0..8475e14db135f 100644 --- a/pkgs/by-name/ne/netbird-dashboard/package.nix +++ b/pkgs/by-name/ne/netbird-dashboard/package.nix @@ -19,7 +19,11 @@ buildNpmPackage rec { npmFlags = [ "--legacy-peer-deps" ]; installPhase = '' + runHook preInstall + cp -R out $out + + runHook postInstall ''; env = { diff --git a/pkgs/by-name/ni/nim_builder/package.nix b/pkgs/by-name/ni/nim_builder/package.nix index 8466ab8535c93..2ce392227cfff 100644 --- a/pkgs/by-name/ni/nim_builder/package.nix +++ b/pkgs/by-name/ni/nim_builder/package.nix @@ -10,7 +10,11 @@ stdenv.mkDerivation { nim c --nimcache:$TMPDIR nim_builder ''; installPhase = '' + runHook preInstall + install -Dt $out/bin nim_builder + + runHook postInstall ''; meta = { description = "Internal Nixpkgs utility for buildNimPackage"; diff --git a/pkgs/by-name/ni/nix-lib-nmd/package.nix b/pkgs/by-name/ni/nix-lib-nmd/package.nix index 2fbfa758056cd..b417c4755ec49 100644 --- a/pkgs/by-name/ni/nix-lib-nmd/package.nix +++ b/pkgs/by-name/ni/nix-lib-nmd/package.nix @@ -16,8 +16,12 @@ in stdenv.mkDerivation { outputHash = "sha256-7BQmDJBo7rzv0rgfRiUAR3HvKkUHQ6x0umhBRhAAyzM="; installPhase = '' + runHook preInstall + mkdir -v "$out" cp -rv * "$out" + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/ni/nix-lib-nmt/package.nix b/pkgs/by-name/ni/nix-lib-nmt/package.nix index ed792ae2883d9..6c2e5cf347c94 100644 --- a/pkgs/by-name/ni/nix-lib-nmt/package.nix +++ b/pkgs/by-name/ni/nix-lib-nmt/package.nix @@ -16,8 +16,12 @@ in stdenv.mkDerivation { outputHash = "sha256-N7kGGDDXsXtc1S3Nqw7lCIbnVHtGNNLM1oO+Xe64hSE="; installPhase = '' + runHook preInstall + mkdir -pv "$out" cp -rv * "$out" + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/ni/nixos-anywhere/package.nix b/pkgs/by-name/ni/nixos-anywhere/package.nix index 55a7deb1b4424..0ecb797b818ba 100644 --- a/pkgs/by-name/ni/nixos-anywhere/package.nix +++ b/pkgs/by-name/ni/nixos-anywhere/package.nix @@ -39,6 +39,8 @@ stdenv.mkDerivation (finalAttrs: { }; nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -D -m 0755 src/nixos-anywhere.sh $out/bin/nixos-anywhere install -D -m 0755 src/get-facts.sh $out/bin/get-facts.sh @@ -46,6 +48,8 @@ stdenv.mkDerivation (finalAttrs: { # https://github.com/numtide/nixos-anywhere/issues/62 wrapProgram $out/bin/nixos-anywhere \ --prefix PATH : ${lib.makeBinPath runtimeDeps} --suffix PATH : ${lib.makeBinPath [ openssh ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/no/noto-fonts-cjk-sans/package.nix b/pkgs/by-name/no/noto-fonts-cjk-sans/package.nix index 5c7ab7684b62c..e435af7498543 100644 --- a/pkgs/by-name/no/noto-fonts-cjk-sans/package.nix +++ b/pkgs/by-name/no/noto-fonts-cjk-sans/package.nix @@ -18,7 +18,11 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -m444 -Dt $out/share/fonts/opentype/noto-cjk Sans/Variable/OTC/*.otf.ttc + + runHook postInstall ''; passthru.tests.noto-fonts = nixosTests.noto-fonts; diff --git a/pkgs/by-name/no/noto-fonts-cjk-serif/package.nix b/pkgs/by-name/no/noto-fonts-cjk-serif/package.nix index 8fbc05ff269ce..cedcd3d74f525 100644 --- a/pkgs/by-name/no/noto-fonts-cjk-serif/package.nix +++ b/pkgs/by-name/no/noto-fonts-cjk-serif/package.nix @@ -18,7 +18,11 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -m444 -Dt $out/share/fonts/opentype/noto-cjk Serif/Variable/OTC/*.otf.ttc + + runHook postInstall ''; passthru.tests.noto-fonts = nixosTests.noto-fonts; diff --git a/pkgs/by-name/nv/nvidia-container-toolkit/nvidia-docker.nix b/pkgs/by-name/nv/nvidia-container-toolkit/nvidia-docker.nix index f2ff4bafaf776..f6e185add6abe 100644 --- a/pkgs/by-name/nv/nvidia-container-toolkit/nvidia-docker.nix +++ b/pkgs/by-name/nv/nvidia-container-toolkit/nvidia-docker.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bin/nvidia-docker $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/oc/ocenaudio/package.nix b/pkgs/by-name/oc/ocenaudio/package.nix index a78ce59e49301..5e036545a9e73 100644 --- a/pkgs/by-name/oc/ocenaudio/package.nix +++ b/pkgs/by-name/oc/ocenaudio/package.nix @@ -38,6 +38,8 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out dpkg -x $src $out cp -av $out/opt/ocenaudio/* $out @@ -51,6 +53,8 @@ stdenv.mkDerivation rec { # Create symlink bzip2 library ln -s ${bzip2.out}/lib/libbz2.so.1 $out/lib/libbz2.so.1.0 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/op/open-scq30/package.nix b/pkgs/by-name/op/open-scq30/package.nix index 33d4e47c76fb8..fb0ab843ae3fb 100644 --- a/pkgs/by-name/op/open-scq30/package.nix +++ b/pkgs/by-name/op/open-scq30/package.nix @@ -61,7 +61,11 @@ rustPlatform.buildRustPackage rec { ''; installPhase = '' + runHook preInstall + cargo make --profile release install + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/op/opengist/package.nix b/pkgs/by-name/op/opengist/package.nix index 03b23225ada81..fb32ae4deb536 100644 --- a/pkgs/by-name/op/opengist/package.nix +++ b/pkgs/by-name/op/opengist/package.nix @@ -29,8 +29,12 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -R public $out + + runHook postInstall ''; npmDepsHash = "sha256-Sy321tIQOOrypk+EOGGixEzrPdhA9U8Hak+DOS+d00A="; diff --git a/pkgs/by-name/op/openscap/package.nix b/pkgs/by-name/op/openscap/package.nix index 4f807219d31fc..21c856db3ba79 100755 --- a/pkgs/by-name/op/openscap/package.nix +++ b/pkgs/by-name/op/openscap/package.nix @@ -143,9 +143,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + make install installManPage $out/share/man8/*.8 rm -rf $out/share/man8 + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/ou/outfox/package.nix b/pkgs/by-name/ou/outfox/package.nix index b38e096823ec2..86bc16ab99a5c 100644 --- a/pkgs/by-name/ou/outfox/package.nix +++ b/pkgs/by-name/ou/outfox/package.nix @@ -61,10 +61,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/OutFox $out/share/applications cp -r ./. $out/share/OutFox ln -s ${desktop}/share/applications/project-outfox.desktop $out/share/applications/project-outfox.desktop makeWrapper $out/share/OutFox/OutFox $out/bin/OutFox --argv0 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ov/ovh-ttyrec/package.nix b/pkgs/by-name/ov/ovh-ttyrec/package.nix index 550df6531ced7..5ca60bdf5d629 100644 --- a/pkgs/by-name/ov/ovh-ttyrec/package.nix +++ b/pkgs/by-name/ov/ovh-ttyrec/package.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ zstd ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,man} cp ttytime ttyplay ttyrec $out/bin cp docs/*.1 $out/man + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/pe/percona-toolkit/package.nix b/pkgs/by-name/pe/percona-toolkit/package.nix index e544bfef1710e..baff5c873efde 100644 --- a/pkgs/by-name/pe/percona-toolkit/package.nix +++ b/pkgs/by-name/pe/percona-toolkit/package.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin # make sure dest already exists before symlink # this prevents installing a broken link into the path @@ -28,6 +30,8 @@ stdenv.mkDerivation { for cmd in ${perconaToolkit}/bin/*; do ln -s $cmd $out/bin done + + runHook postInstall ''; dontStrip = true; diff --git a/pkgs/by-name/po/popcorntime/package.nix b/pkgs/by-name/po/popcorntime/package.nix index 28fd5b60e6898..ccf10f8356637 100644 --- a/pkgs/by-name/po/popcorntime/package.nix +++ b/pkgs/by-name/po/popcorntime/package.nix @@ -63,6 +63,8 @@ stdenv.mkDerivation rec { # Extract and copy executable in $out/bin installPhase = '' + runHook preInstall + mkdir -p $out/share/applications $out/bin $out/opt/bin $out/share/icons/hicolor/scalable/apps/ # we can't unzip it in $out/lib, because nw.js will start with # an empty screen. Therefore it will be unzipped in a non-typical @@ -74,6 +76,8 @@ stdenv.mkDerivation rec { ln -s $out/opt/popcorntime/src/app/images/icon.png $out/share/icons/hicolor/scalable/apps/popcorntime.png ln -s ${desktopItem}/share/applications/popcorntime.desktop $out/share/applications/popcorntime.desktop + + runHook postInstall ''; # GSETTINGS_SCHEMAS_PATH is not set in installPhase diff --git a/pkgs/by-name/po/portfolio/package.nix b/pkgs/by-name/po/portfolio/package.nix index 3f65974c9d3a1..f059027021c54 100644 --- a/pkgs/by-name/po/portfolio/package.nix +++ b/pkgs/by-name/po/portfolio/package.nix @@ -51,6 +51,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/portfolio cp -av ./* $out/portfolio @@ -63,6 +65,8 @@ stdenv.mkDerivation rec { cp ${desktopItem}/share/applications/* $out/share/applications mkdir -p $out/share/pixmaps ln -s $out/portfolio/icon.xpm $out/share/pixmaps/portfolio.xpm + + runHook postInstall ''; passthru.updateScript = gitUpdater { url = "https://github.com/buchen/portfolio.git"; }; diff --git a/pkgs/by-name/po/posterazor/package.nix b/pkgs/by-name/po/posterazor/package.nix index 6ccb0598506ed..a5f5aae858566 100644 --- a/pkgs/by-name/po/posterazor/package.nix +++ b/pkgs/by-name/po/posterazor/package.nix @@ -34,8 +34,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp PosteRazor $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/pr/prevo-data/package.nix b/pkgs/by-name/pr/prevo-data/package.nix index c73af66dd69c0..6bb8a6893614d 100644 --- a/pkgs/by-name/pr/prevo-data/package.nix +++ b/pkgs/by-name/pr/prevo-data/package.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/prevo cp prevo.db $out/share/prevo/ + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/pr/prometheus-jmx-javaagent/package.nix b/pkgs/by-name/pr/prometheus-jmx-javaagent/package.nix index 49ca4c9d6d840..2c36e42de28f4 100644 --- a/pkgs/by-name/pr/prometheus-jmx-javaagent/package.nix +++ b/pkgs/by-name/pr/prometheus-jmx-javaagent/package.nix @@ -19,9 +19,13 @@ stdenv.mkDerivation ( dontUnpack = true; installPhase = '' + runHook preInstall + env mkdir -p $out/lib cp $src $out/lib/${jarName} + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/pr/protoc-gen-js/package.nix b/pkgs/by-name/pr/protoc-gen-js/package.nix index 78d03e9b2b7be..cb7ec88160466 100644 --- a/pkgs/by-name/pr/protoc-gen-js/package.nix +++ b/pkgs/by-name/pr/protoc-gen-js/package.nix @@ -22,8 +22,12 @@ buildBazelPackage rec { fetchAttrs.sha256 = "sha256-WOBlZ0XNrl5UxIaSDxZeOfzS2a8ZkrKdTLKHBDC9UNQ="; buildAttrs.installPhase = '' + runHook preInstall + mkdir -p $out/bin install -Dm755 bazel-bin/generator/protoc-gen-js $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/pu/purescm/package.nix b/pkgs/by-name/pu/purescm/package.nix index 0eebd7f23e179..8b5586336abf3 100644 --- a/pkgs/by-name/pu/purescm/package.nix +++ b/pkgs/by-name/pu/purescm/package.nix @@ -37,9 +37,13 @@ let }; installPhase = '' + runHook preInstall + mkdir -p $out/share/${pname} cp -r node_modules/ $out/share/${pname} ln -s $out/share/${pname}/node_modules/.bin $out/bin + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/by-name/qn/qnial/package.nix b/pkgs/by-name/qn/qnial/package.nix index 0ba34b8a65723..80a6229c09cbd 100644 --- a/pkgs/by-name/qn/qnial/package.nix +++ b/pkgs/by-name/qn/qnial/package.nix @@ -36,10 +36,14 @@ stdenv.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + cd .. mkdir -p $out/bin $out/lib cp build/nial $out/bin/ cp -r niallib $out/lib/ + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/qr/qrcode/package.nix b/pkgs/by-name/qr/qrcode/package.nix index 0d919daf81377..025cf7c453be0 100644 --- a/pkgs/by-name/qr/qrcode/package.nix +++ b/pkgs/by-name/qr/qrcode/package.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation { makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,share/doc/qrcode} cp qrcode "$out/bin" cp DOCUMENTATION LICENCE "$out/share/doc/qrcode" + + runHook postInstall ''; passthru.updateScript = unstableGitUpdater { }; diff --git a/pkgs/by-name/qw/qwerty-fr/package.nix b/pkgs/by-name/qw/qwerty-fr/package.nix index f898073f77c1b..ce13795be1145 100644 --- a/pkgs/by-name/qw/qwerty-fr/package.nix +++ b/pkgs/by-name/qw/qwerty-fr/package.nix @@ -16,8 +16,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/X11/xkb/symbols cp $src/linux/us_qwerty-fr $out/share/X11/xkb/symbols + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ra/rainbowcrack/package.nix b/pkgs/by-name/ra/rainbowcrack/package.nix index bc138dbc9c743..bd69b81ccfb32 100644 --- a/pkgs/by-name/ra/rainbowcrack/package.nix +++ b/pkgs/by-name/ra/rainbowcrack/package.nix @@ -33,10 +33,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm644 $out/rainbowcrack-1.8-linux64/*.txt $out/share/rainbowcrack install -Dm755 $out/rainbowcrack-1.8-linux64/rt* $out/rainbowcrack-1.8-linux64/rcrack $out/bin chmod +x $out/bin/* rm -rf $out/rainbowcrack-1.8-linux64 + + runHook postInstall ''; runtimeDependencies = [ alglib ]; diff --git a/pkgs/by-name/ra/rasm/package.nix b/pkgs/by-name/ra/rasm/package.nix index 5e79bb7ae9b8f..50186313bcc3c 100644 --- a/pkgs/by-name/ra/rasm/package.nix +++ b/pkgs/by-name/ra/rasm/package.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation rec { makeFlags = [ "EXEC=rasm" ]; installPhase = '' + runHook preInstall + install -Dt $out/bin rasm + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/ra/raspberrypi-eeprom/package.nix b/pkgs/by-name/ra/raspberrypi-eeprom/package.nix index 4c72c2a4fd5ed..e287f3fbfeed2 100644 --- a/pkgs/by-name/ra/raspberrypi-eeprom/package.nix +++ b/pkgs/by-name/ra/raspberrypi-eeprom/package.nix @@ -33,6 +33,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp rpi-eeprom-config rpi-eeprom-update rpi-eeprom-digest "$out/bin" @@ -41,6 +43,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { dirname_suffix="''${dirname/#firmware-}" cp -rP "$dirname" "$out/lib/firmware/raspberrypi/bootloader-$dirname_suffix" done + + runHook postInstall ''; fixupPhase = '' diff --git a/pkgs/by-name/re/redmine/package.nix b/pkgs/by-name/re/redmine/package.nix index 7dbd0434ba41b..d688b03bfc7f7 100644 --- a/pkgs/by-name/re/redmine/package.nix +++ b/pkgs/by-name/re/redmine/package.nix @@ -32,6 +32,8 @@ in ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share cp -r . $out/share/redmine for i in config files log plugins public/plugin_assets public/themes tmp; do @@ -40,6 +42,8 @@ in done makeWrapper ${rubyEnv.wrappedRuby}/bin/ruby $out/bin/rdm-mailhandler.rb --add-flags $out/share/redmine/extra/mail_handler/rdm-mailhandler.rb + + runHook postInstall ''; passthru.tests.redmine = nixosTests.redmine; diff --git a/pkgs/by-name/rk/rkbin/package.nix b/pkgs/by-name/rk/rkbin/package.nix index 5579703daca09..b768760b28341 100644 --- a/pkgs/by-name/rk/rkbin/package.nix +++ b/pkgs/by-name/rk/rkbin/package.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir $out mv bin doc $out/ + + runHook postInstall ''; passthru = { diff --git a/pkgs/by-name/rk/rkboot/package.nix b/pkgs/by-name/rk/rkboot/package.nix index 5e71406967a62..24aecba97180f 100644 --- a/pkgs/by-name/rk/rkboot/package.nix +++ b/pkgs/by-name/rk/rkboot/package.nix @@ -24,6 +24,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out if [ -z "$(ls -A rkboot)" ]; then echo "Error: The 'rkboot' directory is empty." @@ -31,6 +33,8 @@ stdenv.mkDerivation { else mv rkboot $out/bin fi + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/rm/rmfakecloud/webui.nix b/pkgs/by-name/rm/rmfakecloud/webui.nix index 98c4822a90b3a..732508da0fac0 100644 --- a/pkgs/by-name/rm/rmfakecloud/webui.nix +++ b/pkgs/by-name/rm/rmfakecloud/webui.nix @@ -26,7 +26,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cp -r ui/build/* $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/s3/s3proxy/package.nix b/pkgs/by-name/s3/s3proxy/package.nix index 72f18af79cc13..b5583210aff6f 100644 --- a/pkgs/by-name/s3/s3proxy/package.nix +++ b/pkgs/by-name/s3/s3proxy/package.nix @@ -26,10 +26,14 @@ maven.buildMavenPackage { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -D --mode=644 --target-directory=$out/share/s3proxy target/s3proxy-${version}-jar-with-dependencies.jar makeWrapper ${jre}/bin/java $out/bin/s3proxy \ --add-flags "-jar $out/share/s3proxy/s3proxy-${version}-jar-with-dependencies.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/sc/screego/package.nix b/pkgs/by-name/sc/screego/package.nix index 923b6e58a5098..d102f1d45550d 100644 --- a/pkgs/by-name/sc/screego/package.nix +++ b/pkgs/by-name/sc/screego/package.nix @@ -37,7 +37,11 @@ let ]; installPhase = '' + runHook preInstall + cp -r build $out + + runHook postInstall ''; }; diff --git a/pkgs/by-name/sh/sha2wordlist/package.nix b/pkgs/by-name/sh/sha2wordlist/package.nix index c3a6710efb176..82d212a6f51d6 100644 --- a/pkgs/by-name/sh/sha2wordlist/package.nix +++ b/pkgs/by-name/sh/sha2wordlist/package.nix @@ -25,8 +25,12 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -m 755 sha2wordlist $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/sh/shab/package.nix b/pkgs/by-name/sh/shab/package.nix index bbc60921903d6..7b6b521e3584d 100644 --- a/pkgs/by-name/sh/shab/package.nix +++ b/pkgs/by-name/sh/shab/package.nix @@ -27,8 +27,12 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ./shab $out/bin/shab + + runHook postInstall ''; installCheckPhase = '' diff --git a/pkgs/by-name/sk/skypeexport/package.nix b/pkgs/by-name/sk/skypeexport/package.nix index c8af575c78957..352956636d9fc 100644 --- a/pkgs/by-name/sk/skypeexport/package.nix +++ b/pkgs/by-name/sk/skypeexport/package.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ boost ]; preConfigure = "cd src/SkypeExport/_gccbuild/linux"; - installPhase = "install -Dt $out/bin SkypeExport"; + installPhase = "runHook preInstall; install -Dt $out/bin SkypeExport; runHook postInstall"; meta = with lib; { description = "Export Skype history to HTML"; diff --git a/pkgs/by-name/sl/slimserver/package.nix b/pkgs/by-name/sl/slimserver/package.nix index b88f72b0d1181..722ec1913a12b 100644 --- a/pkgs/by-name/sl/slimserver/package.nix +++ b/pkgs/by-name/sl/slimserver/package.nix @@ -149,11 +149,15 @@ perlPackages.buildPerlPackage rec { doCheck = false; installPhase = '' + runHook preInstall + cp -r . $out wrapProgram $out/slimserver.pl --prefix LD_LIBRARY_PATH : "${libPath}" --prefix PATH : "${binPath}" wrapProgram $out/scanner.pl --prefix LD_LIBRARY_PATH : "${libPath}" --prefix PATH : "${binPath}" mkdir $out/bin ln -s $out/slimserver.pl $out/bin/slimserver + + runHook postInstall ''; outputs = [ "out" ]; diff --git a/pkgs/by-name/sl/slskd/package.nix b/pkgs/by-name/sl/slskd/package.nix index ffe0ae1b4ba89..85de9a9ceaf41 100644 --- a/pkgs/by-name/sl/slskd/package.nix +++ b/pkgs/by-name/sl/slskd/package.nix @@ -38,7 +38,11 @@ let nodejs = nodejs_18; npmDepsHash = "sha256-06qQ1y870TrkXhkHYADjnWVhdyiLWEqdDt3qrJ1BBFo="; installPhase = '' + runHook preInstall + cp -r build $out + + runHook postInstall ''; }; diff --git a/pkgs/by-name/sr/srht-gen-oauth-tok/package.nix b/pkgs/by-name/sr/srht-gen-oauth-tok/package.nix index 581521e0edd93..d92ac73a5b2f1 100644 --- a/pkgs/by-name/sr/srht-gen-oauth-tok/package.nix +++ b/pkgs/by-name/sr/srht-gen-oauth-tok/package.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { buildInputs = [ perl ]; nativeBuildInputs = [ perl ]; - installPhase = "install -Dm755 srht-gen-oauth-tok $out/bin/srht-gen-oauth-tok"; + installPhase = "runHook preInstall; install -Dm755 srht-gen-oauth-tok $out/bin/srht-gen-oauth-tok; runHook postInstall"; passthru.tests.sourcehut = nixosTests.sourcehut; diff --git a/pkgs/by-name/st/starpls-bin/package.nix b/pkgs/by-name/st/starpls-bin/package.nix index c6106ebd61266..577336320fba3 100644 --- a/pkgs/by-name/st/starpls-bin/package.nix +++ b/pkgs/by-name/st/starpls-bin/package.nix @@ -20,7 +20,11 @@ stdenv.mkDerivation (finalAttrs: { dontBuild = true; installPhase = '' + runHook preInstall + install -D $src $out/bin/starpls + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/st/storcli/package.nix b/pkgs/by-name/st/storcli/package.nix index bb1e92247663c..5059f19e5801c 100644 --- a/pkgs/by-name/st/storcli/package.nix +++ b/pkgs/by-name/st/storcli/package.nix @@ -33,8 +33,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { dontBuild = true; installPhase = '' + runHook preInstall + install -D ./opt/MegaRAID/storcli/storcli64 $out/bin/storcli64 ln -s storcli64 $out/bin/storcli + + runHook postInstall ''; # Not needed because the binary is statically linked diff --git a/pkgs/by-name/su/su-exec/package.nix b/pkgs/by-name/su/su-exec/package.nix index f9ab5d503f5b2..80578d0f91ee8 100644 --- a/pkgs/by-name/su/su-exec/package.nix +++ b/pkgs/by-name/su/su-exec/package.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a su-exec $out/bin/su-exec + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/sv/svp/package.nix b/pkgs/by-name/sv/svp/package.nix index 30e540ba74165..323a3827237ca 100644 --- a/pkgs/by-name/sv/svp/package.nix +++ b/pkgs/by-name/sv/svp/package.nix @@ -81,6 +81,8 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/opt for f in "installer/"*.7z; do 7z -bd -bb0 -y x -o"$out/opt/" "$f" || true @@ -91,6 +93,8 @@ let mv "$out/opt/svp-manager4-''${SIZE}.png" "$out/share/icons/hicolor/''${SIZE}x''${SIZE}/apps/svp-manager4.png" done rm -f $out/opt/{add,remove}-menuitem.sh + + runHook postInstall ''; }; diff --git a/pkgs/by-name/te/tegola/package.nix b/pkgs/by-name/te/tegola/package.nix index f4847781f04f6..c9375e17a282e 100644 --- a/pkgs/by-name/te/tegola/package.nix +++ b/pkgs/by-name/te/tegola/package.nix @@ -18,7 +18,11 @@ let npmDepsHash = "sha256-rhUdWt1X5/F0uvT8gI1T9ei6Y+HK1tKj2fuTKlMAwJk="; installPhase = '' + runHook preInstall + cp -r dist $out + + runHook postInstall ''; }; in diff --git a/pkgs/by-name/te/tetrio-desktop/tetrio-plus.nix b/pkgs/by-name/te/tetrio-desktop/tetrio-plus.nix index 9c12dd1b9a454..c751ecc985cf6 100644 --- a/pkgs/by-name/te/tetrio-desktop/tetrio-plus.nix +++ b/pkgs/by-name/te/tetrio-desktop/tetrio-plus.nix @@ -67,7 +67,11 @@ let ''; installPhase = '' + runHook preInstall + cp -r pkg/ $out + + runHook postInstall ''; doCheck = false; @@ -142,12 +146,16 @@ stdenv.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + runHook preinstall mkdir -p $out asar pack out $out/app.asar runHook postinstall + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/tm/tmux-cssh/package.nix b/pkgs/by-name/tm/tmux-cssh/package.nix index 7da4293dc0c81..30c87a8a13d4c 100644 --- a/pkgs/by-name/tm/tmux-cssh/package.nix +++ b/pkgs/by-name/tm/tmux-cssh/package.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp tmux-cssh $out/bin/tmux-cssh wrapProgram $out/bin/tmux-cssh --suffix PATH : ${tmux}/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/to/tomb/package.nix b/pkgs/by-name/to/tomb/package.nix index 94d7cf2b34a6f..b745ad3e96f11 100644 --- a/pkgs/by-name/to/tomb/package.nix +++ b/pkgs/by-name/to/tomb/package.nix @@ -45,6 +45,8 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 tomb $out/bin/tomb install -Dm644 doc/tomb.1 $out/share/man/man1/tomb.1 @@ -66,6 +68,8 @@ stdenvNoCC.mkDerivation rec { util-linux ] } + + runHook postInstall ''; passthru = { diff --git a/pkgs/by-name/to/torctl/package.nix b/pkgs/by-name/to/torctl/package.nix index 706ec96a59e04..0cbaa3daaacc1 100644 --- a/pkgs/by-name/to/torctl/package.nix +++ b/pkgs/by-name/to/torctl/package.nix @@ -15,10 +15,14 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,etc/{systemd,bash_completion.d}} cp -R torctl $out/bin cp -R bash-completion $out/etc/bash_completion.d/ cp -R service $out/etc/systemd/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/tr/tribler/package.nix b/pkgs/by-name/tr/tribler/package.nix index 3d30b91cfcc27..c7469eafe2336 100644 --- a/pkgs/by-name/tr/tribler/package.nix +++ b/pkgs/by-name/tr/tribler/package.nix @@ -83,6 +83,8 @@ stdenv.mkDerivation (finalAttrs: { ]); installPhase = '' + runHook preInstall + mkdir -pv $out # Nasty hack; call wrapPythonPrograms to set program_PYTHONPATH. wrapPythonPrograms @@ -99,6 +101,8 @@ stdenv.mkDerivation (finalAttrs: { cp $out/build/debian/tribler/usr/share/pixmaps/tribler_big.xpm $out/share/icons/tribler.xpm mkdir -p $out/share/copyright/tribler mv $out/LICENSE $out/share/copyright/tribler + + runHook postInstall ''; shellHook = '' diff --git a/pkgs/by-name/tr/tridactyl-native/package.nix b/pkgs/by-name/tr/tridactyl-native/package.nix index 3506f82c0b799..22672ee54d99c 100644 --- a/pkgs/by-name/tr/tridactyl-native/package.nix +++ b/pkgs/by-name/tr/tridactyl-native/package.nix @@ -13,9 +13,13 @@ buildNimPackage { lockFile = ./lock.json; installPhase = '' + runHook preInstall + mkdir -p "$out/lib/mozilla/native-messaging-hosts" sed -i -e "s|REPLACE_ME_WITH_SED|$out/bin/native_main|" "tridactyl.json" cp tridactyl.json "$out/lib/mozilla/native-messaging-hosts/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ue/uemacs/package.nix b/pkgs/by-name/ue/uemacs/package.nix index 4ed609868666a..3905f5d0ec31d 100644 --- a/pkgs/by-name/ue/uemacs/package.nix +++ b/pkgs/by-name/ue/uemacs/package.nix @@ -27,8 +27,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/uemacs} make install + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/ve/verible/package.nix b/pkgs/by-name/ve/verible/package.nix index 11ace1650d774..70a530ce52916 100644 --- a/pkgs/by-name/ve/verible/package.nix +++ b/pkgs/by-name/ve/verible/package.nix @@ -69,6 +69,8 @@ buildBazelPackage rec { buildAttrs = { installPhase = '' + runHook preInstall + mkdir -p "$out/bin" install bazel-bin/common/tools/verible-patch-tool "$out/bin" @@ -83,6 +85,8 @@ buildBazelPackage rec { install $V_TOOLS_DIR/preprocessor/verible-verilog-preprocessor "$out/bin" install $V_TOOLS_DIR/project/verible-verilog-project "$out/bin" install $V_TOOLS_DIR/syntax/verible-verilog-syntax "$out/bin" + + runHook postInstall ''; }; diff --git a/pkgs/by-name/wg/wg-access-server/package.nix b/pkgs/by-name/wg/wg-access-server/package.nix index e10210f31da4c..94a79914e9be5 100644 --- a/pkgs/by-name/wg/wg-access-server/package.nix +++ b/pkgs/by-name/wg/wg-access-server/package.nix @@ -38,7 +38,11 @@ buildGoModule rec { sourceRoot = "${src.name}/website"; installPhase = '' + runHook preInstall + mv build $out + + runHook postInstall ''; }; diff --git a/pkgs/by-name/wi/windmill/package.nix b/pkgs/by-name/wi/windmill/package.nix index d576f2699bf66..314fd230a795b 100644 --- a/pkgs/by-name/wi/windmill/package.nix +++ b/pkgs/by-name/wi/windmill/package.nix @@ -56,8 +56,12 @@ let nativeBuildInputs = [ python3 pkg-config ]; installPhase = '' + runHook preInstall + mkdir -p $out/share mv build $out/share/windmill-frontend + + runHook postInstall ''; }; in diff --git a/pkgs/by-name/wi/wiremock/package.nix b/pkgs/by-name/wi/wiremock/package.nix index 75e4c30f64b40..870f1c95ee2d7 100644 --- a/pkgs/by-name/wi/wiremock/package.nix +++ b/pkgs/by-name/wi/wiremock/package.nix @@ -22,11 +22,15 @@ stdenvNoCC.mkDerivation (finalAttrs: { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p "$out"/{share/wiremock,bin} cp ${finalAttrs.src} "$out/share/wiremock/wiremock.jar" makeWrapper ${jre}/bin/java $out/bin/${finalAttrs.meta.mainProgram} \ --add-flags "-jar $out/share/wiremock/wiremock.jar" + + runHook postInstall ''; passthru = { diff --git a/pkgs/by-name/wt/wtwitch/package.nix b/pkgs/by-name/wt/wtwitch/package.nix index 0035e184540c3..f733f11e8dc4c 100644 --- a/pkgs/by-name/wt/wtwitch/package.nix +++ b/pkgs/by-name/wt/wtwitch/package.nix @@ -40,6 +40,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ scdoc installShellFiles makeWrapper ]; installPhase = '' + runHook preInstall + installManPage wtwitch.1 installShellCompletion --cmd wtwitch \ --bash src/wtwitch-completion.bash \ @@ -59,6 +61,8 @@ stdenv.mkDerivation rec { procps streamlink ])} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/xi/xilinx-bootgen/package.nix b/pkgs/by-name/xi/xilinx-bootgen/package.nix index 9190d87986a1c..4ee2fce229ab1 100644 --- a/pkgs/by-name/xi/xilinx-bootgen/package.nix +++ b/pkgs/by-name/xi/xilinx-bootgen/package.nix @@ -21,7 +21,11 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; installPhase = '' + runHook preInstall + install -Dm755 bootgen $out/bin/bootgen + + runHook postInstall ''; meta = { diff --git a/pkgs/by-name/yc/ycmd/package.nix b/pkgs/by-name/yc/ycmd/package.nix index 325a8d95e6bcb..0bd4d39c3fad5 100644 --- a/pkgs/by-name/yc/ycmd/package.nix +++ b/pkgs/by-name/yc/ycmd/package.nix @@ -55,6 +55,8 @@ stdenv.mkDerivation { # # symlink completion backends where ycmd expects them installPhase = '' + runHook preInstall + rm -rf ycmd/tests find third_party -type d -name "test" -exec rm -rf {} + @@ -85,6 +87,8 @@ stdenv.mkDerivation { '' + lib.optionalString withTypescript '' TARGET=$out/lib/ycmd/third_party/tsserver ln -sf ${typescript} $TARGET + + runHook postInstall ''; # fixup the argv[0] and replace __file__ with the corresponding path so diff --git a/pkgs/by-name/za/zapret/package.nix b/pkgs/by-name/za/zapret/package.nix index b0dad91d4cb7f..4b1cb41e966a7 100644 --- a/pkgs/by-name/za/zapret/package.nix +++ b/pkgs/by-name/za/zapret/package.nix @@ -34,6 +34,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/usr/share/zapret/init.d/sysv mkdir -p $out/usr/share/docs @@ -67,6 +69,8 @@ stdenv.mkDerivation { done ln -s ../usr/share/zapret/init.d/sysv/init.d $out/bin/zapret + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/by-name/zi/zitadel/console.nix b/pkgs/by-name/zi/zitadel/console.nix index 5ffd0a2223eca..6aa5c91be265c 100644 --- a/pkgs/by-name/zi/zitadel/console.nix +++ b/pkgs/by-name/zi/zitadel/console.nix @@ -54,7 +54,11 @@ mkYarnPackage rec { ''; installPhase = '' + runHook preInstall + cp -r deps/console/dist/console $out + + runHook postInstall ''; doDist = false; diff --git a/pkgs/by-name/zi/zitadel/package.nix b/pkgs/by-name/zi/zitadel/package.nix index d744ed153c838..f53f6f5186a25 100644 --- a/pkgs/by-name/zi/zitadel/package.nix +++ b/pkgs/by-name/zi/zitadel/package.nix @@ -72,7 +72,11 @@ let ''; installPhase = '' + runHook preInstall + cp -r ${outputPath} $out + + runHook postInstall ''; outputHashMode = "recursive"; @@ -128,8 +132,12 @@ buildGoModule rec { doCheck = false; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -Dm755 $GOPATH/bin/zitadel $out/bin/ + + runHook postInstall ''; passthru = { diff --git a/pkgs/by-name/zs/zsh-wd/package.nix b/pkgs/by-name/zs/zsh-wd/package.nix index dec73b7227656..56730d79dcfb6 100644 --- a/pkgs/by-name/zs/zsh-wd/package.nix +++ b/pkgs/by-name/zs/zsh-wd/package.nix @@ -14,10 +14,14 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ installShellFiles ]; installPhase = '' + runHook preInstall + install -Dm755 wd.plugin.zsh $out/share/wd/wd.plugin.zsh install -Dm755 wd.sh $out/share/wd/wd.sh installManPage wd.1 installShellCompletion --zsh _wd.sh + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/common-updater/scripts.nix b/pkgs/common-updater/scripts.nix index d5ee3b58c504b..fd372778bcbcd 100644 --- a/pkgs/common-updater/scripts.nix +++ b/pkgs/common-updater/scripts.nix @@ -27,6 +27,8 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${./scripts}/* $out/bin @@ -40,5 +42,7 @@ stdenv.mkDerivation { # wrap python scripts makeWrapperArgs+=( --prefix PATH : "${lib.makeBinPath [ nix ]}" ) wrapPythonPrograms + + runHook postInstall ''; } diff --git a/pkgs/data/documentation/anarchism/default.nix b/pkgs/data/documentation/anarchism/default.nix index b9cedffa19484..6d3c5cba57395 100644 --- a/pkgs/data/documentation/anarchism/default.nix +++ b/pkgs/data/documentation/anarchism/default.nix @@ -20,10 +20,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc/anarchism $out/share/applications $out/share/icons/hicolor/scalable/apps cp -r {html,markdown} $out/share/doc/anarchism cp debian/anarchism.svg $out/share/icons/hicolor/scalable/apps cp debian/anarchism.desktop $out/share/applications + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/documentation/bgnet/default.nix b/pkgs/data/documentation/bgnet/default.nix index a69a2d7a64f93..6992fd4290f18 100644 --- a/pkgs/data/documentation/bgnet/default.nix +++ b/pkgs/data/documentation/bgnet/default.nix @@ -20,7 +20,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -Dm644 src/bgnet.html $out/share/doc/bgnet/html/index.html + + runHook postInstall ''; nativeBuildInputs = [ python3 pandoc ]; diff --git a/pkgs/data/documentation/linux-manual/default.nix b/pkgs/data/documentation/linux-manual/default.nix index e9cfe258a7fa2..f5a6d37cf9563 100644 --- a/pkgs/data/documentation/linux-manual/default.nix +++ b/pkgs/data/documentation/linux-manual/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mandir=$out/share/man/man9 mkdir -p $mandir @@ -29,6 +31,8 @@ stdenv.mkDerivation rec { | scripts/split-man.pl '$mandir kernel-doc test -f $mandir/kmalloc.9 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/documentation/mustache-spec/default.nix b/pkgs/data/documentation/mustache-spec/default.nix index ce611c192f669..3be97cbd277f6 100644 --- a/pkgs/data/documentation/mustache-spec/default.nix +++ b/pkgs/data/documentation/mustache-spec/default.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/{man/man5,doc/html} cp man/mustache.5 $out/man/man5 cp man/mustache.5.html $out/doc/html + + runHook postInstall ''; meta = rec { diff --git a/pkgs/data/documentation/nginx-doc/default.nix b/pkgs/data/documentation/nginx-doc/default.nix index 4c0409e2e19c9..b954c66a0ba31 100644 --- a/pkgs/data/documentation/nginx-doc/default.nix +++ b/pkgs/data/documentation/nginx-doc/default.nix @@ -25,8 +25,12 @@ stdenv.mkDerivation { # /en subdirectory must exist, relative links expect it. installPhase = '' + runHook preInstall + mkdir -p $out/share/doc/nginx mv libxslt/en $out/share/doc/nginx + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/documentation/scheme-manpages/default.nix b/pkgs/data/documentation/scheme-manpages/default.nix index 96d8d9ac1194b..ab954996d9c9a 100644 --- a/pkgs/data/documentation/scheme-manpages/default.nix +++ b/pkgs/data/documentation/scheme-manpages/default.nix @@ -14,8 +14,12 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/man cp -r man3/ man7/ $out/share/man/ + + runHook postInstall ''; passthru.updateScript = unstableGitUpdater { }; diff --git a/pkgs/data/documentation/std-man-pages/default.nix b/pkgs/data/documentation/std-man-pages/default.nix index 1fd83700f85a0..0c8279eb23f56 100644 --- a/pkgs/data/documentation/std-man-pages/default.nix +++ b/pkgs/data/documentation/std-man-pages/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { outputDevdoc = "out"; installPhase = '' + runHook preInstall + mkdir -p $out/share/man cp -R * $out/share/man + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/agave/default.nix b/pkgs/data/fonts/agave/default.nix index cd0344afb3592..e1311994d5795 100644 --- a/pkgs/data/fonts/agave/default.nix +++ b/pkgs/data/fonts/agave/default.nix @@ -23,7 +23,11 @@ in stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + install -D $srcs -t $out/share/fonts/truetype/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/alegreya-sans/default.nix b/pkgs/data/fonts/alegreya-sans/default.nix index cc0cd6cac9b90..af744a486aedc 100644 --- a/pkgs/data/fonts/alegreya-sans/default.nix +++ b/pkgs/data/fonts/alegreya-sans/default.nix @@ -12,10 +12,14 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D -m 444 fonts/otf/* -t $out/share/fonts/otf install -D -m 444 fonts/ttf/* -t $out/share/fonts/ttf install -D -m 444 fonts/webfonts/*.woff -t $out/share/fonts/woff install -D -m 444 fonts/webfonts/*.woff2 -t $out/share/fonts/woff2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/alegreya/default.nix b/pkgs/data/fonts/alegreya/default.nix index 03efbff4ebf5b..88a1a090a02d0 100644 --- a/pkgs/data/fonts/alegreya/default.nix +++ b/pkgs/data/fonts/alegreya/default.nix @@ -12,10 +12,14 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D -m 444 fonts/otf/* -t $out/share/fonts/otf install -D -m 444 fonts/ttf/* -t $out/share/fonts/ttf install -D -m 444 fonts/webfonts/*.woff -t $out/share/fonts/woff install -D -m 444 fonts/webfonts/*.woff2 -t $out/share/fonts/woff2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/bront/default.nix b/pkgs/data/fonts/bront/default.nix index 36e6adb380dfd..d1d33a9ddde45 100644 --- a/pkgs/data/fonts/bront/default.nix +++ b/pkgs/data/fonts/bront/default.nix @@ -12,7 +12,11 @@ stdenvNoCC.mkDerivation { }; installPhase = '' + runHook preInstall + install -m444 -Dt $out/share/fonts/truetype *Bront.ttf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/carlito/default.nix b/pkgs/data/fonts/carlito/default.nix index a83d8a547a15c..e10b4fd67b49e 100644 --- a/pkgs/data/fonts/carlito/default.nix +++ b/pkgs/data/fonts/carlito/default.nix @@ -10,10 +10,14 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/etc/fonts/conf.d mkdir -p $out/share/fonts/truetype cp -v *.ttf $out/share/fonts/truetype cp -v ${./calibri-alias.conf} $out/etc/fonts/conf.d/30-calibri.conf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/cherry/default.nix b/pkgs/data/fonts/cherry/default.nix index c69bb0715dc67..08b56d2ccc9dd 100644 --- a/pkgs/data/fonts/cherry/default.nix +++ b/pkgs/data/fonts/cherry/default.nix @@ -19,11 +19,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/misc cp *.otb $out/share/fonts/misc # create fonts.dir so NixOS xorg module adds to fp mkfontdir $out/share/fonts/misc + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/clearlyU/default.nix b/pkgs/data/fonts/clearlyU/default.nix index c0824cf7d40e7..0e179e6a35d03 100644 --- a/pkgs/data/fonts/clearlyU/default.nix +++ b/pkgs/data/fonts/clearlyU/default.nix @@ -20,10 +20,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + # install otb and bdf fonts fontDir="$out/share/fonts" install -m 644 -D *.bdf *.otb -t "$fontDir" mkfontdir "$fontDir" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/comic-neue/default.nix b/pkgs/data/fonts/comic-neue/default.nix index 66eb4087efaa7..ad0d7246a587c 100644 --- a/pkgs/data/fonts/comic-neue/default.nix +++ b/pkgs/data/fonts/comic-neue/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -pv $out/share/{doc/${pname}-${version},fonts/{opentype,truetype,WOFF,WOFF2}} cp -v ${pname}-${version}/{FONTLOG,OFL-FAQ,OFL}.txt $out/share/doc/ cp -v ${pname}-${version}/Booklet-ComicNeue.pdf $out/share/doc/ @@ -20,6 +22,8 @@ stdenv.mkDerivation rec { cp -v ${pname}-${version}/TTF/ComicNeue/*.ttf $out/share/fonts/truetype cp -v ${pname}-${version}/WebFonts/*.woff $out/share/fonts/WOFF cp -v ${pname}-${version}/WebFonts/*.woff2 $out/share/fonts/WOFF2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/creep/default.nix b/pkgs/data/fonts/creep/default.nix index fa4938798edc6..102c3d895be30 100644 --- a/pkgs/data/fonts/creep/default.nix +++ b/pkgs/data/fonts/creep/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D -m644 creep.otb creep.bdf -t "$out/share/fonts/misc/" mkfontdir "$out/share/fonts/misc" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/dejavu-fonts/default.nix b/pkgs/data/fonts/dejavu-fonts/default.nix index 1fdb20ff3ced5..0fa82d3ff42e9 100644 --- a/pkgs/data/fonts/dejavu-fonts/default.nix +++ b/pkgs/data/fonts/dejavu-fonts/default.nix @@ -39,7 +39,7 @@ let preBuild = "patchShebangs scripts"; - installPhase = "install -m444 -Dt $out/share/fonts/truetype build/*.ttf"; + installPhase = "runHook preInstall; install -m444 -Dt $out/share/fonts/truetype build/*.ttf; runHook postInstall"; inherit meta; }; diff --git a/pkgs/data/fonts/edukai/default.nix b/pkgs/data/fonts/edukai/default.nix index d5b9e25c2eb54..da352bd6c647c 100644 --- a/pkgs/data/fonts/edukai/default.nix +++ b/pkgs/data/fonts/edukai/default.nix @@ -12,8 +12,12 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/ mv *.ttf $out/share/fonts/ + + runHook postInstall ''; meta = { diff --git a/pkgs/data/fonts/eduli/default.nix b/pkgs/data/fonts/eduli/default.nix index beb89d49fc364..e93a304efe0fe 100644 --- a/pkgs/data/fonts/eduli/default.nix +++ b/pkgs/data/fonts/eduli/default.nix @@ -12,10 +12,14 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/ for name in *.ttf; do mv "$name" "$out/share/fonts/$(echo $name | sed -r 's/(.*)\(.*\)\.ttf/\1.ttf/')" done + + runHook postInstall ''; meta = { diff --git a/pkgs/data/fonts/edusong/default.nix b/pkgs/data/fonts/edusong/default.nix index fa4d13693b12f..f06edb84069f3 100644 --- a/pkgs/data/fonts/edusong/default.nix +++ b/pkgs/data/fonts/edusong/default.nix @@ -12,8 +12,12 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/ mv *.ttf $out/share/fonts/ + + runHook postInstall ''; meta = { diff --git a/pkgs/data/fonts/emojione/default.nix b/pkgs/data/fonts/emojione/default.nix index 629e46fe79711..6270536c22a08 100644 --- a/pkgs/data/fonts/emojione/default.nix +++ b/pkgs/data/fonts/emojione/default.nix @@ -38,7 +38,11 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + install -Dm755 build/EmojiOneColor-SVGinOT.ttf $out/share/fonts/truetype/EmojiOneColor-SVGinOT.ttf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/gohufont/default.nix b/pkgs/data/fonts/gohufont/default.nix index 6892742de7999..9922c9d7016ec 100644 --- a/pkgs/data/fonts/gohufont/default.nix +++ b/pkgs/data/fonts/gohufont/default.nix @@ -48,6 +48,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + # install the psf fonts (for the virtual console) fontDir="$out/share/consolefonts" install -D -m 644 -t "$fontDir" psf/*.psf @@ -56,6 +58,8 @@ stdenv.mkDerivation rec { fontDir="$out/share/fonts/misc" install -D -m 644 -t "$fontDir" *.pcf *.otb mkfontdir "$fontDir" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/gubbi/default.nix b/pkgs/data/fonts/gubbi/default.nix index 0b6b42493fe35..5675fdb75e7c6 100644 --- a/pkgs/data/fonts/gubbi/default.nix +++ b/pkgs/data/fonts/gubbi/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { preBuild = "patchShebangs generate.pe"; - installPhase = "install -Dm444 -t $out/share/fonts/truetype/ Gubbi.ttf"; + installPhase = "runHook preInstall; install -Dm444 -t $out/share/fonts/truetype/ Gubbi.ttf; runHook postInstall"; meta = with lib; { inherit (src.meta) homepage; diff --git a/pkgs/data/fonts/inconsolata/default.nix b/pkgs/data/fonts/inconsolata/default.nix index 79431995a496c..64d94227eee70 100644 --- a/pkgs/data/fonts/inconsolata/default.nix +++ b/pkgs/data/fonts/inconsolata/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + install -m644 --target $out/share/fonts/truetype/inconsolata -D $src/ofl/inconsolata/static/*.ttf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/inconsolata/lgc.nix b/pkgs/data/fonts/inconsolata/lgc.nix index 945fafcfcc52a..63459dae4aebe 100644 --- a/pkgs/data/fonts/inconsolata/lgc.nix +++ b/pkgs/data/fonts/inconsolata/lgc.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ fontforge ]; installPhase = '' + runHook preInstall + find . -name '*.ttf' -exec install -m444 -Dt $out/share/fonts/truetype {} \; find . -name '*.otf' -exec install -m444 -Dt $out/share/fonts/opentype {} \; install -m444 -Dt $out/share/doc/${pname}-${version} LICENSE README + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/kochi-substitute/default.nix b/pkgs/data/fonts/kochi-substitute/default.nix index 071db9b13dfb0..82d7ba717ec6d 100644 --- a/pkgs/data/fonts/kochi-substitute/default.nix +++ b/pkgs/data/fonts/kochi-substitute/default.nix @@ -24,9 +24,13 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype cp ./share/fonts/truetype/kochi/kochi-gothic-subst.ttf $out/share/fonts/truetype/ cp ./share/fonts/truetype/kochi/kochi-mincho-subst.ttf $out/share/fonts/truetype/ + + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/data/fonts/liberation-fonts/default.nix b/pkgs/data/fonts/liberation-fonts/default.nix index 0160ebfdc4500..dfc09ffe3e92e 100644 --- a/pkgs/data/fonts/liberation-fonts/default.nix +++ b/pkgs/data/fonts/liberation-fonts/default.nix @@ -18,12 +18,16 @@ let inherit nativeBuildInputs postPatch; installPhase = '' + runHook preInstall + find . -name '*.ttf' -exec install -m444 -Dt $out/share/fonts/truetype {} \; for i in ${toString docsToInstall}; do # not all docs exist in all versions install -m444 -Dt $out/share/doc/${pname}-${version} $i || true done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/liberation-sans-narrow/default.nix b/pkgs/data/fonts/liberation-sans-narrow/default.nix index 281bfa4c42b0f..c6f92b13fcd18 100644 --- a/pkgs/data/fonts/liberation-sans-narrow/default.nix +++ b/pkgs/data/fonts/liberation-sans-narrow/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { buildInputs = [ fontforge python3Packages.fonttools python3 ]; installPhase = '' + runHook preInstall + find . -name '*Narrow*.ttf' -exec install -m444 -Dt $out/share/fonts/truetype {} \; install -m444 -Dt $out/doc/${pname}-${version} AUTHORS ChangeLog COPYING License.txt README.rst + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/libre-caslon/default.nix b/pkgs/data/fonts/libre-caslon/default.nix index d89d4c41c0f3b..849bbd3cca266 100644 --- a/pkgs/data/fonts/libre-caslon/default.nix +++ b/pkgs/data/fonts/libre-caslon/default.nix @@ -25,11 +25,15 @@ stdenv.mkDerivation rec { sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/opentype mkdir -p $out/share/doc/${pname}-${version} cp -v "libre-caslon-text-${version}-src/fonts/OTF/"*.otf $out/share/fonts/opentype/ cp -v "libre-caslon-display-${version}-src/fonts/OTF/"*.otf $out/share/fonts/opentype/ cp -v libre-caslon-text-${version}-src/README.md libre-caslon-text-${version}-src/FONTLOG.txt $out/share/doc/${pname}-${version} + + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/data/fonts/line-awesome/default.nix b/pkgs/data/fonts/line-awesome/default.nix index d9f7818dd2f79..d6d185cf730c4 100644 --- a/pkgs/data/fonts/line-awesome/default.nix +++ b/pkgs/data/fonts/line-awesome/default.nix @@ -15,12 +15,16 @@ stdenv.mkDerivation rec { sourceRoot = "${version}/fonts"; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype mkdir -p $out/share/fonts/woff mkdir -p $out/share/fonts/woff2 cp *.ttf $out/share/fonts/truetype cp *.woff $out/share/fonts/woff cp *.woff2 $out/share/fonts/woff2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/maple-font/default.nix b/pkgs/data/fonts/maple-font/default.nix index a90a1e830171c..8de5a12485e9b 100644 --- a/pkgs/data/fonts/maple-font/default.nix +++ b/pkgs/data/fonts/maple-font/default.nix @@ -19,9 +19,13 @@ let sourceRoot = "."; nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + find . -name '*.ttf' -exec install -Dt $out/share/fonts/truetype {} \; find . -name '*.otf' -exec install -Dt $out/share/fonts/opentype {} \; find . -name '*.woff2' -exec install -Dt $out/share/fonts/woff2 {} \; + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/merriweather-sans/default.nix b/pkgs/data/fonts/merriweather-sans/default.nix index 397f42236b52c..4ea528d9f2ba7 100644 --- a/pkgs/data/fonts/merriweather-sans/default.nix +++ b/pkgs/data/fonts/merriweather-sans/default.nix @@ -18,10 +18,14 @@ stdenvNoCC.mkDerivation rec { # Python dependencies to package (fontmake, gftools) installPhase = '' + runHook preInstall + install -m444 -Dt $out/share/fonts/truetype/${pname} fonts/ttfs/*.ttf install -m444 -Dt $out/share/fonts/woff/${pname} fonts/woff/*.woff install -m444 -Dt $out/share/fonts/woff2/${pname} fonts/woff2/*.woff2 # TODO: install variable version? + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/merriweather/default.nix b/pkgs/data/fonts/merriweather/default.nix index f658f7943eb29..3c36a7139c83f 100644 --- a/pkgs/data/fonts/merriweather/default.nix +++ b/pkgs/data/fonts/merriweather/default.nix @@ -18,11 +18,15 @@ stdenvNoCC.mkDerivation rec { # Python dependencies to package (fontmake, gftools) installPhase = '' + runHook preInstall + install -m444 -Dt $out/share/fonts/opentype/${pname} fonts/otf/*.otf install -m444 -Dt $out/share/fonts/truetype/${pname} fonts/ttfs/*.ttf install -m444 -Dt $out/share/fonts/woff/${pname} fonts/woff/*.woff install -m444 -Dt $out/share/fonts/woff2/${pname} fonts/woff2/*.woff2 # TODO: install variable version? + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/meslo-lg/default.nix b/pkgs/data/fonts/meslo-lg/default.nix index e0dc649bc7217..a44f150b321f7 100644 --- a/pkgs/data/fonts/meslo-lg/default.nix +++ b/pkgs/data/fonts/meslo-lg/default.nix @@ -27,8 +27,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype cp *.ttf $out/share/fonts/truetype + + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/data/fonts/meslo-lgs-nf/default.nix b/pkgs/data/fonts/meslo-lgs-nf/default.nix index 51dacaba366c2..d1bbdd61fb003 100644 --- a/pkgs/data/fonts/meslo-lgs-nf/default.nix +++ b/pkgs/data/fonts/meslo-lgs-nf/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype cp $src/*.ttf $out/share/fonts/truetype + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/migmix/default.nix b/pkgs/data/fonts/migmix/default.nix index 5c5212189e207..bb4f817dff510 100644 --- a/pkgs/data/fonts/migmix/default.nix +++ b/pkgs/data/fonts/migmix/default.nix @@ -26,7 +26,11 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + find $srcs -name '*.ttf' -exec install -m644 -Dt $out/share/fonts/truetype/migmix {} \; + + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/data/fonts/migu/default.nix b/pkgs/data/fonts/migu/default.nix index 76c4afc706e66..92b121e019a27 100644 --- a/pkgs/data/fonts/migu/default.nix +++ b/pkgs/data/fonts/migu/default.nix @@ -26,7 +26,11 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + find $srcs -name '*.ttf' | xargs install -m644 --target $out/share/fonts/truetype/migu -D + + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/data/fonts/mno16/default.nix b/pkgs/data/fonts/mno16/default.nix index 59597120c1003..b03fc41cf7c10 100644 --- a/pkgs/data/fonts/mno16/default.nix +++ b/pkgs/data/fonts/mno16/default.nix @@ -11,8 +11,12 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype cp fonts/*.ttf $out/share/fonts/truetype/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/mona-sans/default.nix b/pkgs/data/fonts/mona-sans/default.nix index c8be0b40a041f..2a2ff9ca236a8 100644 --- a/pkgs/data/fonts/mona-sans/default.nix +++ b/pkgs/data/fonts/mona-sans/default.nix @@ -15,8 +15,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { }; installPhase = '' + runHook preInstall + install -D -m444 -t $out/share/fonts/opentype fonts/otf/*.otf install -D -m444 -t $out/share/fonts/truetype fonts/ttf/*.ttf fonts/variable/*.ttf + + runHook postInstall ''; meta = { diff --git a/pkgs/data/fonts/monoid/default.nix b/pkgs/data/fonts/monoid/default.nix index f6875a482d08b..db96502ac4afa 100644 --- a/pkgs/data/fonts/monoid/default.nix +++ b/pkgs/data/fonts/monoid/default.nix @@ -36,8 +36,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -m444 -Dt $out/share/fonts/truetype _release/* install -m444 -Dt $out/share/doc Readme.md + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/nafees/default.nix b/pkgs/data/fonts/nafees/default.nix index e23528aefe805..5bb4d4896d68e 100644 --- a/pkgs/data/fonts/nafees/default.nix +++ b/pkgs/data/fonts/nafees/default.nix @@ -33,9 +33,13 @@ stdenv.mkDerivation { sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype cp *.ttf $out/share/fonts/truetype # cp $riqa/*.ttf $out/share/fonts/truetype + + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/data/fonts/nasin-nanpa/default.nix b/pkgs/data/fonts/nasin-nanpa/default.nix index 339c89dd9b0b4..604db11a77bce 100644 --- a/pkgs/data/fonts/nasin-nanpa/default.nix +++ b/pkgs/data/fonts/nasin-nanpa/default.nix @@ -12,8 +12,12 @@ stdenvNoCC.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/opentype cp $src $out/share/fonts/opentype/nasin-nanpa.otf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/navilu/default.nix b/pkgs/data/fonts/navilu/default.nix index 8aaf36e60ed11..31272f71ac6b4 100644 --- a/pkgs/data/fonts/navilu/default.nix +++ b/pkgs/data/fonts/navilu/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { preBuild = "patchShebangs generate.pe"; - installPhase = "install -Dm444 -t $out/share/fonts/truetype/ Navilu.ttf"; + installPhase = "runHook preInstall; install -Dm444 -t $out/share/fonts/truetype/ Navilu.ttf; runHook postInstall"; meta = with lib; src.meta // { description = "Kannada handwriting font"; diff --git a/pkgs/data/fonts/nerdfonts/default.nix b/pkgs/data/fonts/nerdfonts/default.nix index b2576d0fca468..b7bcdb5a44ada 100644 --- a/pkgs/data/fonts/nerdfonts/default.nix +++ b/pkgs/data/fonts/nerdfonts/default.nix @@ -47,12 +47,16 @@ stdenv.mkDerivation (finalAttrs: { ls *.otf *.ttf ''; installPhase = '' + runHook preInstall + find -name \*.otf -exec mkdir -p $out/share/fonts/opentype/NerdFonts \; -exec mv {} $out/share/fonts/opentype/NerdFonts \; find -name \*.ttf -exec mkdir -p $out/share/fonts/truetype/NerdFonts \; -exec mv {} $out/share/fonts/truetype/NerdFonts \; ${lib.optionalString (! enableWindowsFonts) '' rm -rfv $out/share/fonts/opentype/NerdFonts/*Windows\ Compatible.* rm -rfv $out/share/fonts/truetype/NerdFonts/*Windows\ Compatible.* ''} + + runHook postInstall ''; passthru.updateScript = ./update.sh; diff --git a/pkgs/data/fonts/ocr-a/default.nix b/pkgs/data/fonts/ocr-a/default.nix index 216b960994d7a..b34d3ef8669cb 100644 --- a/pkgs/data/fonts/ocr-a/default.nix +++ b/pkgs/data/fonts/ocr-a/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + install -D -m 0644 $src $out/share/fonts/truetype/OCRA.ttf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/poly/default.nix b/pkgs/data/fonts/poly/default.nix index 50dfb50203543..3971601d00c70 100644 --- a/pkgs/data/fonts/poly/default.nix +++ b/pkgs/data/fonts/poly/default.nix @@ -22,9 +22,13 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/opentype cp ${regular} $out/share/fonts/opentype/Poly-Regular.otf cp ${italic} $out/share/fonts/opentype/Poly-Italic.otf + + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/data/fonts/profont/default.nix b/pkgs/data/fonts/profont/default.nix index a617d61cc98fa..f1b0645fdd02b 100644 --- a/pkgs/data/fonts/profont/default.nix +++ b/pkgs/data/fonts/profont/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ xorg.mkfontscale ]; installPhase = '' + runHook preInstall + mkdir -p "$out/share/fonts/misc" for f in *.pcf; do gzip -n -9 -c "$f" > "$out/share/fonts/misc/$f.gz" @@ -30,6 +32,8 @@ stdenv.mkDerivation { install -D -m 644 LICENSE -t "$out/share/doc/$pname" install -D -m 644 "$srcOtb/profontn.otb" -t $out/share/fonts/misc mkfontdir "$out/share/fonts/misc" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/recursive/default.nix b/pkgs/data/fonts/recursive/default.nix index c01bd294ea374..812d93df0f129 100644 --- a/pkgs/data/fonts/recursive/default.nix +++ b/pkgs/data/fonts/recursive/default.nix @@ -10,8 +10,12 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D -t $out/share/fonts/opentype/ $(find $src -type f -name '*.otf') install -D -t $out/share/fonts/truetype/ $(find $src -type f -name '*.ttf') + + runHook postInstall ''; diff --git a/pkgs/data/fonts/ricty/default.nix b/pkgs/data/fonts/ricty/default.nix index 7c1c6d3587360..f42d023123811 100644 --- a/pkgs/data/fonts/ricty/default.nix +++ b/pkgs/data/fonts/ricty/default.nix @@ -24,7 +24,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -m644 --target $out/share/fonts/truetype/ricty -D Ricty-*.ttf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/roboto-mono/default.nix b/pkgs/data/fonts/roboto-mono/default.nix index 5d7cc57a4b435..cacf632d437db 100644 --- a/pkgs/data/fonts/roboto-mono/default.nix +++ b/pkgs/data/fonts/roboto-mono/default.nix @@ -59,8 +59,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype cp -a *.ttf $out/share/fonts/truetype/ + + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/data/fonts/roboto-slab/default.nix b/pkgs/data/fonts/roboto-slab/default.nix index dc37c8258564c..fc38eb679bb8e 100644 --- a/pkgs/data/fonts/roboto-slab/default.nix +++ b/pkgs/data/fonts/roboto-slab/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype cp -a fonts/static/*.ttf $out/share/fonts/truetype/ + + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/data/fonts/rubik/default.nix b/pkgs/data/fonts/rubik/default.nix index d77753f515de1..ef1e31579245d 100644 --- a/pkgs/data/fonts/rubik/default.nix +++ b/pkgs/data/fonts/rubik/default.nix @@ -74,8 +74,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype cp -a *.ttf $out/share/fonts/truetype/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/tamsyn/default.nix b/pkgs/data/fonts/tamsyn/default.nix index f99624f4a483c..5bcb75dc7ec27 100644 --- a/pkgs/data/fonts/tamsyn/default.nix +++ b/pkgs/data/fonts/tamsyn/default.nix @@ -29,9 +29,13 @@ in stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -m 644 -D *.otb *.pcf.gz -t "$out/share/fonts/misc" install -m 644 -D *.psf.gz -t "$out/share/consolefonts" mkfontdir "$out/share/fonts/misc" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/tamzen/default.nix b/pkgs/data/fonts/tamzen/default.nix index e8706c1971c6a..bfac215d3796f 100644 --- a/pkgs/data/fonts/tamzen/default.nix +++ b/pkgs/data/fonts/tamzen/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ xorg.mkfontscale ]; installPhase = '' + runHook preInstall + install -m 644 -D otb/*.otb pcf/*.pcf -t "$out/share/fonts/misc" install -m 644 -D psf/*.psf -t "$out/share/consolefonts" mkfontdir "$out/share/fonts/misc" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/tempora-lgc/default.nix b/pkgs/data/fonts/tempora-lgc/default.nix index ecafc9572bd16..1c8839a520038 100644 --- a/pkgs/data/fonts/tempora-lgc/default.nix +++ b/pkgs/data/fonts/tempora-lgc/default.nix @@ -26,8 +26,12 @@ stdenv.mkDerivation { inherit nativeBuildInputs; inherit srcs; installPhase = '' + runHook preInstall + mkdir -p "$out/share/fonts/opentype/public" cp ${toString srcs} "$out/share/fonts/opentype/public" + + runHook postInstall ''; outputHashAlgo = "sha256"; outputHashMode = "recursive"; diff --git a/pkgs/data/fonts/termsyn/default.nix b/pkgs/data/fonts/termsyn/default.nix index 50450a04e2d8c..24a6bcae3d1fd 100644 --- a/pkgs/data/fonts/termsyn/default.nix +++ b/pkgs/data/fonts/termsyn/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ mkfontscale ]; installPhase = '' + runHook preInstall + install -m 644 -D *.pcf -t "$out/share/fonts" install -m 644 -D *.psfu -t "$out/share/kbd/consolefonts" mkfontdir "$out/share/fonts" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/tewi/default.nix b/pkgs/data/fonts/tewi/default.nix index d8906a2284dae..a3bbcb432ade2 100644 --- a/pkgs/data/fonts/tewi/default.nix +++ b/pkgs/data/fonts/tewi/default.nix @@ -37,9 +37,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + fontDir="$out/share/fonts/misc" install -m 644 -D *.otb out/* -t "$fontDir" mkfontdir "$fontDir" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/tex-gyre-math/default.nix b/pkgs/data/fonts/tex-gyre-math/default.nix index 95038d3f9cfe6..4f75357e70360 100644 --- a/pkgs/data/fonts/tex-gyre-math/default.nix +++ b/pkgs/data/fonts/tex-gyre-math/default.nix @@ -40,8 +40,12 @@ let }; installPhase = '' + runHook preInstall + install -m444 -Dt $out/share/fonts/opentype opentype/*.otf install -m444 -Dt $out/share/doc/${name} doc/*.txt + + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/data/fonts/tex-gyre/default.nix b/pkgs/data/fonts/tex-gyre/default.nix index a93beaccb0714..908046e0ab358 100644 --- a/pkgs/data/fonts/tex-gyre/default.nix +++ b/pkgs/data/fonts/tex-gyre/default.nix @@ -12,10 +12,14 @@ let }; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/opentype/ # Pagella & Adventor are not flat archives test -d "${abbreviation}${version}otf" && cd "${abbreviation}${version}otf" cp -v *.otf $out/share/fonts/opentype/ + + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/data/fonts/tipa/default.nix b/pkgs/data/fonts/tipa/default.nix index a0cc7106afe67..fe20bd4a0b7dc 100644 --- a/pkgs/data/fonts/tipa/default.nix +++ b/pkgs/data/fonts/tipa/default.nix @@ -10,11 +10,15 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + export PREFIX="$out/texmf-dist" mkdir -p "$PREFIX" "$out/share" make install PREFIX="$PREFIX" ln -s -r $out/texmf* $out/share/ + + runHook postInstall ''; outputHashAlgo = "sha256"; diff --git a/pkgs/data/fonts/twemoji-color-font/default.nix b/pkgs/data/fonts/twemoji-color-font/default.nix index a6e65ce689555..a5b3fe9be5fc5 100644 --- a/pkgs/data/fonts/twemoji-color-font/default.nix +++ b/pkgs/data/fonts/twemoji-color-font/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation (finalAttrs: { dontBuild = true; installPhase = '' + runHook preInstall + install -Dm755 TwitterColorEmoji-SVGinOT.ttf $out/share/fonts/truetype/TwitterColorEmoji-SVGinOT.ttf install -Dm644 fontconfig/46-twemoji-color.conf $out/etc/fonts/conf.d/46-twemoji-color.conf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/twitter-color-emoji/default.nix b/pkgs/data/fonts/twitter-color-emoji/default.nix index 69aae92d966a0..1f2025236637d 100644 --- a/pkgs/data/fonts/twitter-color-emoji/default.nix +++ b/pkgs/data/fonts/twitter-color-emoji/default.nix @@ -88,7 +88,11 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + install -Dm644 TwitterColorEmoji.ttf $out/share/fonts/truetype/TwitterColorEmoji.ttf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/ucs-fonts/default.nix b/pkgs/data/fonts/ucs-fonts/default.nix index e9d78dd03a7c8..e5f9c39d71620 100644 --- a/pkgs/data/fonts/ucs-fonts/default.nix +++ b/pkgs/data/fonts/ucs-fonts/default.nix @@ -42,11 +42,15 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -m 644 -D *.otb *.pcf.gz -t "$out/share/fonts/misc" install -m 644 -D *.bdf -t "$bdf/share/fonts/misc" mkfontdir "$out/share/fonts/misc" mkfontdir "$bdf/share/fonts/misc" + + runHook postInstall ''; outputs = [ "out" "bdf" ]; diff --git a/pkgs/data/fonts/uni-vga/default.nix b/pkgs/data/fonts/uni-vga/default.nix index 1239b12388310..e5ae10115865e 100644 --- a/pkgs/data/fonts/uni-vga/default.nix +++ b/pkgs/data/fonts/uni-vga/default.nix @@ -32,6 +32,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + # install pcf and otb (for X11 and GTK applications) install -m 644 -D *.otb *.pcf.gz -t "$out/share/fonts" mkfontdir "$out/share/fonts" @@ -43,6 +45,8 @@ stdenv.mkDerivation { '' + lib.optionalString stdenv.isLinux '' # install psf (for linux virtual terminal) install -m 644 -D *.psf.gz -t "$out/share/consolefonts" + + runHook postInstall ''; outputs = [ "out" "bdf" ]; diff --git a/pkgs/data/fonts/unifont/default.nix b/pkgs/data/fonts/unifont/default.nix index 811b2b60b7cb5..1f0e3f98d60ec 100644 --- a/pkgs/data/fonts/unifont/default.nix +++ b/pkgs/data/fonts/unifont/default.nix @@ -29,6 +29,8 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + # install otb fonts install -m 644 -D unifont.otb "$out/share/fonts/unifont.otb" mkfontdir "$out/share/fonts" @@ -39,6 +41,8 @@ stdenv.mkDerivation rec { cd "$out/share/fonts" mkfontdir mkfontscale + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/fonts/unscii/default.nix b/pkgs/data/fonts/unscii/default.nix index 1b723cd313da0..1ef4562723c05 100644 --- a/pkgs/data/fonts/unscii/default.nix +++ b/pkgs/data/fonts/unscii/default.nix @@ -44,6 +44,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + # install fonts for use in X11 and GTK applications install -m444 -Dt "$out/share/fonts/misc" *.pcf.gz install -m444 -Dt "$out/share/fonts/opentype" *.otf @@ -56,6 +58,8 @@ stdenv.mkDerivation rec { install -m444 -Dt "$extra/share/fonts/web" *.woff install -m444 -Dt "$extra/share/fonts/misc" *.hex mkfontscale "$extra"/share/fonts/* + + runHook postInstall ''; outputs = [ "out" "extra" ]; diff --git a/pkgs/data/fonts/vista-fonts-chs/default.nix b/pkgs/data/fonts/vista-fonts-chs/default.nix index 66274c667a04b..88e962fe071be 100644 --- a/pkgs/data/fonts/vista-fonts-chs/default.nix +++ b/pkgs/data/fonts/vista-fonts-chs/default.nix @@ -18,6 +18,8 @@ stdenvNoCC.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype cp *.ttf $out/share/fonts/truetype @@ -26,6 +28,8 @@ stdenvNoCC.mkDerivation { mkdir -p $out/etc/fonts/conf.d substitute ${./no-op.conf} $out/etc/fonts/conf.d/30-msyahei.conf \ --subst-var-by fontname "Microsoft YaHei" + + runHook postInstall ''; meta = { diff --git a/pkgs/data/fonts/vista-fonts-cht/default.nix b/pkgs/data/fonts/vista-fonts-cht/default.nix index 78271e2f1e93d..1b68ccbfafe20 100644 --- a/pkgs/data/fonts/vista-fonts-cht/default.nix +++ b/pkgs/data/fonts/vista-fonts-cht/default.nix @@ -16,6 +16,8 @@ stdenvNoCC.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype cp *.ttf $out/share/fonts/truetype @@ -24,6 +26,8 @@ stdenvNoCC.mkDerivation { mkdir -p $out/etc/fonts/conf.d substitute ${./no-op.conf} $out/etc/fonts/conf.d/30-msjhenghei.conf \ --subst-var-by fontname "Microsoft JhengHei" + + runHook postInstall ''; diff --git a/pkgs/data/fonts/vista-fonts/default.nix b/pkgs/data/fonts/vista-fonts/default.nix index fa8308b8c9720..b9ee018f98c55 100644 --- a/pkgs/data/fonts/vista-fonts/default.nix +++ b/pkgs/data/fonts/vista-fonts/default.nix @@ -18,6 +18,8 @@ stdenvNoCC.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype cp *.ttf *.ttc $out/share/fonts/truetype @@ -28,6 +30,8 @@ stdenvNoCC.mkDerivation { substitute ${./no-op.conf} $out/etc/fonts/conf.d/30-''${name,,}.conf \ --subst-var-by fontname $name done + + runHook postInstall ''; meta = { diff --git a/pkgs/data/fonts/xits-math/default.nix b/pkgs/data/fonts/xits-math/default.nix index 9e3c013f44ded..aadf2419a0789 100644 --- a/pkgs/data/fonts/xits-math/default.nix +++ b/pkgs/data/fonts/xits-math/default.nix @@ -18,7 +18,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -m444 -Dt $out/share/fonts/opentype *.otf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/apple-cursor/default.nix b/pkgs/data/icons/apple-cursor/default.nix index 5db50d0fbbe8a..ef90399328fa7 100644 --- a/pkgs/data/icons/apple-cursor/default.nix +++ b/pkgs/data/icons/apple-cursor/default.nix @@ -29,8 +29,12 @@ in stdenv.mkDerivation rec { sourceRoot = "."; installPhase = '' + runHook preInstall + install -dm 0755 $out/share/icons cp -r macOS* $out/share/icons/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/bibata-cursors/translucent.nix b/pkgs/data/icons/bibata-cursors/translucent.nix index 7cae52a3e4de8..18eb815d6df3e 100644 --- a/pkgs/data/icons/bibata-cursors/translucent.nix +++ b/pkgs/data/icons/bibata-cursors/translucent.nix @@ -12,8 +12,12 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -dm 0755 $out/share/icons cp -pr Bibata_* $out/share/icons/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/capitaine-cursors/default.nix b/pkgs/data/icons/capitaine-cursors/default.nix index 1bb855790055d..57feb6afa44f9 100644 --- a/pkgs/data/icons/capitaine-cursors/default.nix +++ b/pkgs/data/icons/capitaine-cursors/default.nix @@ -42,9 +42,13 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -dm 0755 $out/share/icons cp -pr dist/dark $out/share/icons/capitaine-cursors cp -pr dist/light $out/share/icons/capitaine-cursors-white + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/comixcursors/default.nix b/pkgs/data/icons/comixcursors/default.nix index be1fa347535b9..190635ac179d7 100644 --- a/pkgs/data/icons/comixcursors/default.nix +++ b/pkgs/data/icons/comixcursors/default.nix @@ -51,6 +51,8 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + for outputName in $(getAllOutputNames) ; do if [ $outputName != out ]; then local outputDir=''${!outputName}; @@ -66,6 +68,8 @@ stdenvNoCC.mkDerivation rec { # Need this directory (empty) to prevent the builder scripts from breaking. mkdir -p $out + + runHook postInstall ''; outputs = let diff --git a/pkgs/data/icons/flat-remix-icon-theme/default.nix b/pkgs/data/icons/flat-remix-icon-theme/default.nix index d8d36e6a8ee37..eff2feb696824 100644 --- a/pkgs/data/icons/flat-remix-icon-theme/default.nix +++ b/pkgs/data/icons/flat-remix-icon-theme/default.nix @@ -26,6 +26,8 @@ stdenvNoCC.mkDerivation rec { dontDropIconThemeCache = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/icons mv Flat-Remix* $out/share/icons/ @@ -34,6 +36,8 @@ stdenvNoCC.mkDerivation rec { done symlinkParentIconThemes recordPropagatedDependencies + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/graphite-cursors/default.nix b/pkgs/data/icons/graphite-cursors/default.nix index b64e7567b25f1..cdca636c4af63 100644 --- a/pkgs/data/icons/graphite-cursors/default.nix +++ b/pkgs/data/icons/graphite-cursors/default.nix @@ -15,11 +15,15 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -dm 755 $out/share/icons mv dist-dark $out/share/icons/graphite-dark mv dist-light $out/share/icons/graphite-light mv dist-dark-nord $out/share/icons/graphite-dark-nord mv dist-light-nord $out/share/icons/graphite-light-nord + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/gruppled-cursors/default.nix b/pkgs/data/icons/gruppled-cursors/default.nix index 4a223fc67d339..56f0472fd9e7a 100644 --- a/pkgs/data/icons/gruppled-cursors/default.nix +++ b/pkgs/data/icons/gruppled-cursors/default.nix @@ -17,8 +17,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/icons/${theme} cp -r ${theme}/{cursors,index.theme} $out/share/icons/${theme} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/gruppled-lite-cursors/default.nix b/pkgs/data/icons/gruppled-lite-cursors/default.nix index bd564ea565c19..605835d5a2a1c 100644 --- a/pkgs/data/icons/gruppled-lite-cursors/default.nix +++ b/pkgs/data/icons/gruppled-lite-cursors/default.nix @@ -17,8 +17,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/icons/${theme} cp -r ${theme}/{cursors,index.theme} $out/share/icons/${theme} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/gruvbox-dark-icons-gtk/default.nix b/pkgs/data/icons/gruvbox-dark-icons-gtk/default.nix index 972b5dfba5625..d528dfcca4547 100644 --- a/pkgs/data/icons/gruvbox-dark-icons-gtk/default.nix +++ b/pkgs/data/icons/gruvbox-dark-icons-gtk/default.nix @@ -16,10 +16,14 @@ stdenvNoCC.mkDerivation rec { propagatedBuildInputs = [ breeze-icons gnome-icon-theme hicolor-icon-theme ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/icons/oomox-gruvbox-dark rm README.md cp -r * $out/share/icons/oomox-gruvbox-dark gtk-update-icon-cache $out/share/icons/oomox-gruvbox-dark + + runHook postInstall ''; dontDropIconThemeCache = true; diff --git a/pkgs/data/icons/iconpack-jade/default.nix b/pkgs/data/icons/iconpack-jade/default.nix index d68e02b838d6a..43e0eec478b84 100644 --- a/pkgs/data/icons/iconpack-jade/default.nix +++ b/pkgs/data/icons/iconpack-jade/default.nix @@ -18,12 +18,16 @@ stdenvNoCC.mkDerivation rec { dontDropIconThemeCache = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/icons cp -a Jade* $out/share/icons for theme in $out/share/icons/*; do gtk-update-icon-cache $theme done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/iconpack-obsidian/default.nix b/pkgs/data/icons/iconpack-obsidian/default.nix index 40d4d451f3f1d..102723a059726 100644 --- a/pkgs/data/icons/iconpack-obsidian/default.nix +++ b/pkgs/data/icons/iconpack-obsidian/default.nix @@ -19,12 +19,16 @@ stdenvNoCC.mkDerivation rec { dontDropIconThemeCache = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/icons mv Obsidian* $out/share/icons for theme in $out/share/icons/*; do gtk-update-icon-cache $theme done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/iso-flags/default.nix b/pkgs/data/icons/iso-flags/default.nix index 9deff6bcc77ec..2cdc229379d60 100644 --- a/pkgs/data/icons/iso-flags/default.nix +++ b/pkgs/data/icons/iso-flags/default.nix @@ -31,8 +31,12 @@ stdenvNoCC.mkDerivation { buildFlags = targets; installPhase = '' + runHook preInstall + mkdir -p $out/share mv build $out/share/iso-flags + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/nordzy-cursor-theme/default.nix b/pkgs/data/icons/nordzy-cursor-theme/default.nix index 394626cec3371..fffcc53c08e0a 100644 --- a/pkgs/data/icons/nordzy-cursor-theme/default.nix +++ b/pkgs/data/icons/nordzy-cursor-theme/default.nix @@ -15,8 +15,12 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/icons cp -r Nordzy-cursors{,-white,-lefthand} $out/share/icons + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/numix-cursor-theme/default.nix b/pkgs/data/icons/numix-cursor-theme/default.nix index 83961f19caf83..502057c2cd500 100644 --- a/pkgs/data/icons/numix-cursor-theme/default.nix +++ b/pkgs/data/icons/numix-cursor-theme/default.nix @@ -19,8 +19,12 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -dm 755 $out/share/icons cp -dr --no-preserve='ownership' Numix-Cursor{,-Light} $out/share/icons/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/quintom-cursor-theme/default.nix b/pkgs/data/icons/quintom-cursor-theme/default.nix index 3267d619b7a5e..97969e50bef84 100644 --- a/pkgs/data/icons/quintom-cursor-theme/default.nix +++ b/pkgs/data/icons/quintom-cursor-theme/default.nix @@ -12,10 +12,14 @@ stdenvNoCC.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/icons for theme in "Quintom_Ink" "Quintom_Snow"; do cp -r "$theme Cursors/$theme" $out/share/icons/ done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/icons/vimix-cursor-theme/default.nix b/pkgs/data/icons/vimix-cursor-theme/default.nix index a276ae1ea2453..e0fec8cdca9f1 100644 --- a/pkgs/data/icons/vimix-cursor-theme/default.nix +++ b/pkgs/data/icons/vimix-cursor-theme/default.nix @@ -15,12 +15,16 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + sed -i 's/Vimix Cursors$/Vimix-Cursors/g' dist{,-white}/index.theme install -dm 755 $out/share/icons/Vimix-Cursors{,-White} cp -dr --no-preserve='ownership' dist/* $out/share/icons/Vimix-Cursors cp -dr --no-preserve='ownership' dist-white/* $out/share/icons/Vimix-Cursors-White + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/machine-learning/mnist/default.nix b/pkgs/data/machine-learning/mnist/default.nix index 3df5001e70ef1..26b29f983d5ff 100644 --- a/pkgs/data/machine-learning/mnist/default.nix +++ b/pkgs/data/machine-learning/mnist/default.nix @@ -23,11 +23,15 @@ in pname = "mnist"; version = "2018-11-16"; installPhase = '' + runHook preInstall + mkdir -p $out ln -s "${srcs.train-images}" "$out/${srcs.train-images.name}" ln -s "${srcs.train-labels}" "$out/${srcs.train-labels.name}" ln -s "${srcs.test-images}" "$out/${srcs.test-images.name}" ln -s "${srcs.test-labels}" "$out/${srcs.test-labels.name}" + + runHook postInstall ''; dontUnpack = true; meta = with lib; { diff --git a/pkgs/data/misc/combinatorial_designs/default.nix b/pkgs/data/misc/combinatorial_designs/default.nix index 5457b4e54d4bf..53da8a6cab33b 100644 --- a/pkgs/data/misc/combinatorial_designs/default.nix +++ b/pkgs/data/misc/combinatorial_designs/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out/share/combinatorial_designs" mv * "$out/share/combinatorial_designs" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/misc/common-licenses/default.nix b/pkgs/data/misc/common-licenses/default.nix index d3888fde615c0..47eb083e2e4fe 100644 --- a/pkgs/data/misc/common-licenses/default.nix +++ b/pkgs/data/misc/common-licenses/default.nix @@ -13,9 +13,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share cp -r licenses $out/share/common-licenses cat debian/base-files.links | grep common-licenses | sed -e "s|usr|$out|g" -e "s|^|ln -s |g" | bash -x + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/misc/dbip-country-lite/default.nix b/pkgs/data/misc/dbip-country-lite/default.nix index 3f024e0bcafc7..4f4ebf4ba865a 100644 --- a/pkgs/data/misc/dbip-country-lite/default.nix +++ b/pkgs/data/misc/dbip-country-lite/default.nix @@ -15,12 +15,16 @@ stdenvNoCC.mkDerivation (finalAttrs: { dontUnpack = true; installPhase = '' + runHook preInstall + runHook preBuild gzip -c -d "$src" > dbip-country-lite.mmdb install -Dm444 dbip-country-lite.mmdb "$out/share/dbip/dbip-country-lite.mmdb" runHook postBuild + + runHook postInstall ''; passthru.mmdb = "${finalAttrs.finalPackage}/share/dbip/dbip-country-lite.mmdb"; diff --git a/pkgs/data/misc/elliptic_curves/default.nix b/pkgs/data/misc/elliptic_curves/default.nix index 55c03afbc4c20..b7b813eb9a716 100644 --- a/pkgs/data/misc/elliptic_curves/default.nix +++ b/pkgs/data/misc/elliptic_curves/default.nix @@ -20,6 +20,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + # directory layout as spkg-install.py expects dir="$PWD" cd .. @@ -31,6 +33,8 @@ stdenv.mkDerivation rec { export PYTHONPATH=$PWD ${python3.interpreter} ${spkg-install} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/misc/freepats/default.nix b/pkgs/data/misc/freepats/default.nix index bb8dae0cf6a5b..a48f4e3f713d4 100644 --- a/pkgs/data/misc/freepats/default.nix +++ b/pkgs/data/misc/freepats/default.nix @@ -9,7 +9,13 @@ stdenv.mkDerivation rec { sha256 = "12iw36rd94zirll96cd5k0va7p5hxmf2shvjlhzihcmjaw8flq82"; }; - installPhase = ''mkdir "$out"; cp -r . "$out"''; + installPhase = '' + runHook preInstall + + mkdir "$out"; cp -r . "$out" + + runHook postInstall +''; meta = with lib; { description = "Instrument patches, for MIDI synthesizers"; diff --git a/pkgs/data/misc/graphs/default.nix b/pkgs/data/misc/graphs/default.nix index 3244e46d580ea..37385f06dcdd6 100644 --- a/pkgs/data/misc/graphs/default.nix +++ b/pkgs/data/misc/graphs/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out/share/graphs" cp * "$out/share/graphs/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/misc/iana-etc/default.nix b/pkgs/data/misc/iana-etc/default.nix index 2f60c1367f2ce..e32f4a95b3e21 100644 --- a/pkgs/data/misc/iana-etc/default.nix +++ b/pkgs/data/misc/iana-etc/default.nix @@ -10,7 +10,11 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D -m0644 -t $out/etc services protocols + + runHook postInstall ''; setupHook = writeText "setup-hook" '' diff --git a/pkgs/data/misc/osinfo-db/default.nix b/pkgs/data/misc/osinfo-db/default.nix index bfd8f589f9e3d..6e1639138e100 100644 --- a/pkgs/data/misc/osinfo-db/default.nix +++ b/pkgs/data/misc/osinfo-db/default.nix @@ -22,7 +22,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + osinfo-db-import --dir "$out/share/osinfo" "${src}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/misc/pari-galdata/default.nix b/pkgs/data/misc/pari-galdata/default.nix index c767346280506..fdd29901f5c56 100644 --- a/pkgs/data/misc/pari-galdata/default.nix +++ b/pkgs/data/misc/pari-galdata/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p "$out/share/pari" cp -R * "$out/share/pari/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/misc/pari-seadata-small/default.nix b/pkgs/data/misc/pari-seadata-small/default.nix index 86516fe1ddba2..a04623130f742 100644 --- a/pkgs/data/misc/pari-seadata-small/default.nix +++ b/pkgs/data/misc/pari-seadata-small/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p "$out/share/pari" cp -R * "$out/share/pari/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/misc/polytopes_db/default.nix b/pkgs/data/misc/polytopes_db/default.nix index 8e9e7b44a4aac..5f621f03814ec 100644 --- a/pkgs/data/misc/polytopes_db/default.nix +++ b/pkgs/data/misc/polytopes_db/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out/share/reflexive_polytopes" cp -R * "$out/share/reflexive_polytopes/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/sgml+xml/schemas/docbook-5.0/default.nix b/pkgs/data/sgml+xml/schemas/docbook-5.0/default.nix index 68bc6101d03c6..f9d8658c6abb6 100644 --- a/pkgs/data/sgml+xml/schemas/docbook-5.0/default.nix +++ b/pkgs/data/sgml+xml/schemas/docbook-5.0/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + dst=$out/share/xml/docbook-5.0 mkdir -p $dst cp -prv * $dst/ @@ -25,6 +27,8 @@ stdenv.mkDerivation rec { mkdir -p $out/xml/rng $out/xml/dtd ln -s $dst/rng $out/xml/rng/docbook ln -s $dst/dtd $out/xml/dtd/docbook + + runHook postInstall ''; meta = { diff --git a/pkgs/data/sgml+xml/schemas/sgml-dtd/docbook/3.1.nix b/pkgs/data/sgml+xml/schemas/sgml-dtd/docbook/3.1.nix index b1db3638682b6..51917d15433d2 100644 --- a/pkgs/data/sgml+xml/schemas/sgml-dtd/docbook/3.1.nix +++ b/pkgs/data/sgml+xml/schemas/sgml-dtd/docbook/3.1.nix @@ -23,12 +23,16 @@ stdenv.mkDerivation { installPhase = '' + runHook preInstall + o=$out/sgml/dtd/docbook-3.1 mkdir -p $o cd $o unzip ${src} unzip ${isoents} sed -e "s/iso-/ISO/" -e "s/.gml//" -i docbook.cat + + runHook postInstall ''; meta = { diff --git a/pkgs/data/sgml+xml/schemas/sgml-dtd/docbook/4.1.nix b/pkgs/data/sgml+xml/schemas/sgml-dtd/docbook/4.1.nix index 85d7ab167964a..3a34f202fe880 100644 --- a/pkgs/data/sgml+xml/schemas/sgml-dtd/docbook/4.1.nix +++ b/pkgs/data/sgml+xml/schemas/sgml-dtd/docbook/4.1.nix @@ -23,12 +23,16 @@ stdenv.mkDerivation { installPhase = '' + runHook preInstall + o=$out/sgml/dtd/docbook-4.1 mkdir -p $o cd $o unzip ${src} unzip ${isoents} sed -e "s/iso-/ISO/" -e "s/.gml//" -i docbook.cat + + runHook postInstall ''; meta = { diff --git a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook-ebnf/default.nix b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook-ebnf/default.nix index 6be2e89dcd2ef..c7819af3ae421 100644 --- a/pkgs/data/sgml+xml/schemas/xml-dtd/docbook-ebnf/default.nix +++ b/pkgs/data/sgml+xml/schemas/xml-dtd/docbook-ebnf/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cp -p $dtd dbebnf.dtd cp -p $catalog $(stripHash $catalog) + + runHook postInstall ''; meta = { diff --git a/pkgs/data/sgml+xml/schemas/xml-dtd/xhtml1/default.nix b/pkgs/data/sgml+xml/schemas/xml-dtd/xhtml1/default.nix index 9a81fbb6e1b44..0c4d3946b6051 100644 --- a/pkgs/data/sgml+xml/schemas/xml-dtd/xhtml1/default.nix +++ b/pkgs/data/sgml+xml/schemas/xml-dtd/xhtml1/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation { installPhase = '' + runHook preInstall + mkdir -p $out/xml/dtd/xhtml1 cp DTD/*.ent DTD/*.dtd $out/xml/dtd/xhtml1 @@ -23,6 +25,8 @@ stdenv.mkDerivation { eval a=($x) xmlcatalog --noout --add public "''${a[1]}" "''${a[2]}" $cat done + + runHook postInstall ''; # */ meta = { diff --git a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix index 66ebf105ffd0a..aeefbbbb6ca7c 100644 --- a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix +++ b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix @@ -47,6 +47,8 @@ let dontBuild = true; installPhase = '' + runHook preInstall + dst=$out/share/xml/${pname} mkdir -p $dst rm -rf RELEASE* README* INSTALL TODO NEWS* BUGS install.sh tools Makefile tests extensions webhelp @@ -58,6 +60,8 @@ let # More backwards compatibility ln -s $dst $out/share/xml/docbook-xsl${legacySuffix} + + runHook postInstall ''; passthru.dbtoepub = writeScriptBin "dbtoepub" diff --git a/pkgs/data/soundfonts/fluid/default.nix b/pkgs/data/soundfonts/fluid/default.nix index 193c9a60b9fcc..8a9f9523afac7 100644 --- a/pkgs/data/soundfonts/fluid/default.nix +++ b/pkgs/data/soundfonts/fluid/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation { sourceRoot = "."; installPhase = '' + runHook preInstall + install -Dm644 "FluidR3 GM2-2.SF2" $out/share/soundfonts/FluidR3_GM2-2.sf2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/soundfonts/generaluser/default.nix b/pkgs/data/soundfonts/generaluser/default.nix index 446fa606c1bc3..fbe90e08720b4 100644 --- a/pkgs/data/soundfonts/generaluser/default.nix +++ b/pkgs/data/soundfonts/generaluser/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -Dm644 GeneralUser*.sf2 $out/share/soundfonts/GeneralUser-GS.sf2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/soundfonts/ydp-grand/default.nix b/pkgs/data/soundfonts/ydp-grand/default.nix index 79453cfbb4bb7..79a3f78b9a6cd 100644 --- a/pkgs/data/soundfonts/ydp-grand/default.nix +++ b/pkgs/data/soundfonts/ydp-grand/default.nix @@ -10,7 +10,11 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + install -Dm644 YDP-GrandPiano-*.sf2 $out/share/soundfonts/YDP-GrandPiano.sf2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/themes/adementary/default.nix b/pkgs/data/themes/adementary/default.nix index 4b47f6c2d3e36..03f568e486096 100644 --- a/pkgs/data/themes/adementary/default.nix +++ b/pkgs/data/themes/adementary/default.nix @@ -22,8 +22,12 @@ stdenv.mkDerivation rec { postPatch = "patchShebangs ."; installPhase = '' + runHook preInstall + mkdir -p $out/share/themes ./install.sh -d $out/share/themes + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/themes/adi1090x-plymouth-themes/default.nix b/pkgs/data/themes/adi1090x-plymouth-themes/default.nix index d5ff1d0018a9a..3794eff1b6bd5 100644 --- a/pkgs/data/themes/adi1090x-plymouth-themes/default.nix +++ b/pkgs/data/themes/adi1090x-plymouth-themes/default.nix @@ -40,11 +40,15 @@ in unpackCmd = "tar xzf $curSrc"; installPhase = '' + runHook preInstall + mkdir -p $out/share/plymouth/themes for theme in ${toString selectedThemes}; do mv $theme $out/share/plymouth/themes/$theme done find $out/share/plymouth/themes/ -name \*.plymouth -exec sed -i "s@\/usr\/@$out\/@" {} \; + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/themes/albatross/default.nix b/pkgs/data/themes/albatross/default.nix index 04b06ef0684a0..a26af72231260 100644 --- a/pkgs/data/themes/albatross/default.nix +++ b/pkgs/data/themes/albatross/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -dm 755 $out/share/themes/Albatross cp -dr --no-preserve='ownership' {LICENSE.GPL,README,index.theme,gtk-2.0,gtk-3.0,metacity-1,xfwm4} $out/share/themes/Albatross/ + + runHook postInstall ''; meta = { diff --git a/pkgs/data/themes/artim-dark/default.nix b/pkgs/data/themes/artim-dark/default.nix index 9485f46b19a98..e5ef7e256bac0 100644 --- a/pkgs/data/themes/artim-dark/default.nix +++ b/pkgs/data/themes/artim-dark/default.nix @@ -13,6 +13,8 @@ stdenvNoCC.mkDerivation rec{ dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/plasma/desktoptheme cp -R KDE/plasmaTheme/Aritim-Dark* $out/share/plasma/desktoptheme mkdir -p $out/share/aurorae/themes @@ -23,6 +25,8 @@ stdenvNoCC.mkDerivation rec{ cp -R KDE/globalTheme $out/share/plasma/look-and-feel/Aritim-Dark mkdir -p $out/share/themes cp -R GTK $out/share/themes/Aritim-Dark + + runHook postInstall ''; meta = { diff --git a/pkgs/data/themes/canta/default.nix b/pkgs/data/themes/canta/default.nix index 8f06327b9706c..ce10d252391ee 100644 --- a/pkgs/data/themes/canta/default.nix +++ b/pkgs/data/themes/canta/default.nix @@ -45,6 +45,8 @@ stdenv.mkDerivation rec { dontDropIconThemeCache = true; installPhase = '' + runHook preInstall + patchShebangs . mkdir -p $out/share/themes name= ./install.sh --dest $out/share/themes @@ -53,6 +55,8 @@ stdenv.mkDerivation rec { mkdir -p $out/share/icons cp -a icons/Canta $out/share/icons gtk-update-icon-cache $out/share/icons/Canta + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/themes/clearlooks-phenix/default.nix b/pkgs/data/themes/clearlooks-phenix/default.nix index 0157914d8fcc4..8233c1e2383ef 100644 --- a/pkgs/data/themes/clearlooks-phenix/default.nix +++ b/pkgs/data/themes/clearlooks-phenix/default.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/themes/Clearlooks-Phenix cp -r . $out/share/themes/Clearlooks-Phenix/ + + runHook postInstall ''; preferLocalBuild = true; diff --git a/pkgs/data/themes/e17gtk/default.nix b/pkgs/data/themes/e17gtk/default.nix index 46a1f926402f0..29244f7610482 100644 --- a/pkgs/data/themes/e17gtk/default.nix +++ b/pkgs/data/themes/e17gtk/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/{doc,themes}/E17gtk cp -va index.theme gtk-2.0 gtk-3.0 metacity-1 $out/share/themes/E17gtk/ cp -va README.md WORKAROUNDS screenshot.jpg $out/share/doc/E17gtk/ + + runHook postInstall ''; meta = { diff --git a/pkgs/data/themes/equilux-theme/default.nix b/pkgs/data/themes/equilux-theme/default.nix index 3b3af2431dd38..65e820dd566e4 100644 --- a/pkgs/data/themes/equilux-theme/default.nix +++ b/pkgs/data/themes/equilux-theme/default.nix @@ -20,6 +20,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + patchShebangs install.sh sed -i install.sh \ -e "s|if .*which gnome-shell.*;|if true;|" \ @@ -27,6 +29,8 @@ stdenv.mkDerivation rec { mkdir -p $out/share/themes ./install.sh --dest $out/share/themes rm $out/share/themes/*/COPYING + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/themes/gruvbox-dark-gtk/default.nix b/pkgs/data/themes/gruvbox-dark-gtk/default.nix index 28b55074afbb3..be3457b31aa52 100644 --- a/pkgs/data/themes/gruvbox-dark-gtk/default.nix +++ b/pkgs/data/themes/gruvbox-dark-gtk/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/themes/gruvbox-dark rm -rf README.md LICENSE .github cp -r * $out/share/themes/gruvbox-dark + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/themes/numix-sx/default.nix b/pkgs/data/themes/numix-sx/default.nix index ee887cbadee16..06a68ec5fc166 100644 --- a/pkgs/data/themes/numix-sx/default.nix +++ b/pkgs/data/themes/numix-sx/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation { sourceRoot = "."; installPhase = '' + runHook preInstall + install -dm 755 "$out/share/themes/" cp -dr --no-preserve='ownership' Numix-SX-{Dark,FullDark,Light} "$out/share/themes/" + + runHook postInstall ''; meta = { diff --git a/pkgs/data/themes/orion/default.nix b/pkgs/data/themes/orion/default.nix index 93ea3633fb5aa..75b96434aa853 100644 --- a/pkgs/data/themes/orion/default.nix +++ b/pkgs/data/themes/orion/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { propagatedUserEnvPkgs = [ gtk-engine-murrine ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/themes/orion cp -r gtk-2.0 gtk-3.0 metacity-1 openbox-3 xfwm4 $out/share/themes/orion + + runHook postInstall ''; meta = { diff --git a/pkgs/data/themes/pitch-black/default.nix b/pkgs/data/themes/pitch-black/default.nix index 092208f4f417d..120dbc5c3774c 100644 --- a/pkgs/data/themes/pitch-black/default.nix +++ b/pkgs/data/themes/pitch-black/default.nix @@ -14,10 +14,14 @@ stdenvNoCC.mkDerivation rec{ dontBuild = true; installPhase = '' + runHook preInstall + rm LICENSE README.md mkdir -p $out/share mv GTK $out/share/themes mv * $out/share + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/themes/sddm-astronaut/default.nix b/pkgs/data/themes/sddm-astronaut/default.nix index ef8071f1e858e..ffde51301e986 100644 --- a/pkgs/data/themes/sddm-astronaut/default.nix +++ b/pkgs/data/themes/sddm-astronaut/default.nix @@ -21,10 +21,14 @@ stdenvNoCC.mkDerivation rec { basePath = "$out/share/sddm/themes/sddm-astronaut-theme"; in '' + runHook preInstall + mkdir -p ${basePath} cp -r $src/* ${basePath} '' + lib.optionalString (themeConfig != null) '' ln -sf ${configFile} ${basePath}/theme.conf.user + + runHook postInstall ''; meta = { diff --git a/pkgs/data/themes/sddm-sugar-dark/default.nix b/pkgs/data/themes/sddm-sugar-dark/default.nix index 7cbc1c121e3d7..14979b723f79a 100644 --- a/pkgs/data/themes/sddm-sugar-dark/default.nix +++ b/pkgs/data/themes/sddm-sugar-dark/default.nix @@ -23,10 +23,14 @@ stdenvNoCC.mkDerivation rec { basePath = "$out/share/sddm/themes/sugar-dark"; in '' + runHook preInstall + mkdir -p ${basePath} cp -r $src/* ${basePath} '' + lib.optionalString (themeConfig != null) '' ln -sf ${configFile} ${basePath}/theme.conf.user + + runHook postInstall ''; meta = { diff --git a/pkgs/data/themes/shades-of-gray/default.nix b/pkgs/data/themes/shades-of-gray/default.nix index e4c4cfb3ba51e..a967d9b73ea27 100644 --- a/pkgs/data/themes/shades-of-gray/default.nix +++ b/pkgs/data/themes/shades-of-gray/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { propagatedUserEnvPkgs = [ gtk-engine-murrine ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/themes cp -a Shades-of-gray* $out/share/themes/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/data/themes/snowblind/default.nix b/pkgs/data/themes/snowblind/default.nix index d36fe23244216..2a6746e61cfc6 100644 --- a/pkgs/data/themes/snowblind/default.nix +++ b/pkgs/data/themes/snowblind/default.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation rec { propagatedUserEnvPkgs = [ gtk-engine-murrine ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/themes cp -a Snowblind* $out/share/themes rm $out/share/themes/*/{COPYING,CREDITS} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/desktops/gnome/extensions/argos/default.nix b/pkgs/desktops/gnome/extensions/argos/default.nix index 66c979bd54af4..f91d1b2491d56 100644 --- a/pkgs/desktops/gnome/extensions/argos/default.nix +++ b/pkgs/desktops/gnome/extensions/argos/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out/share/gnome-shell/extensions" cp -a argos@pew.worldwidemann.com "$out/share/gnome-shell/extensions" + + runHook postInstall ''; passthru = { diff --git a/pkgs/desktops/mate/mate-settings-daemon/wrapped.nix b/pkgs/desktops/mate/mate-settings-daemon/wrapped.nix index 6031b7f7341f6..b3dee1782244b 100644 --- a/pkgs/desktops/mate/mate-settings-daemon/wrapped.nix +++ b/pkgs/desktops/mate/mate-settings-daemon/wrapped.nix @@ -22,8 +22,12 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/etc/xdg/autostart cp ${mate.mate-settings-daemon}/etc/xdg/autostart/mate-settings-daemon.desktop $out/etc/xdg/autostart + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix index 2702b438f0ec2..7f13c40355f01 100644 --- a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix +++ b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix @@ -46,10 +46,14 @@ stdenv.mkDerivation rec { allowSubstitutes = false; installPhase = '' + runHook preInstall + mkdir -p $out for i in $(cat $pathsPath); do ${xorg.lndir}/bin/lndir -silent $i $out done + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/desktops/pantheon/artwork/elementary-redacted-script/default.nix b/pkgs/desktops/pantheon/artwork/elementary-redacted-script/default.nix index 66c02d73f71d4..e37044c1958ed 100644 --- a/pkgs/desktops/pantheon/artwork/elementary-redacted-script/default.nix +++ b/pkgs/desktops/pantheon/artwork/elementary-redacted-script/default.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/fonts/truetype/redacted-elementary cp -a redacted/*.ttf $out/share/fonts/truetype/redacted-elementary + + runHook postInstall ''; passthru = { diff --git a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix index da6d61cd1337f..d72add6264e7f 100644 --- a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix +++ b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix @@ -44,10 +44,14 @@ stdenv.mkDerivation rec { allowSubstitutes = false; installPhase = '' + runHook preInstall + mkdir -p $out for i in $(cat $pathsPath); do ${xorg.lndir}/bin/lndir -silent $i $out done + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/desktops/rox/rox-filer/default.nix b/pkgs/desktops/rox/rox-filer/default.nix index 0d7b0acaff578..1bb54b12d312a 100644 --- a/pkgs/desktops/rox/rox-filer/default.nix +++ b/pkgs/desktops/rox/rox-filer/default.nix @@ -57,6 +57,8 @@ stdenv.mkDerivation rec { configureScript = "../src/configure"; installPhase = '' + runHook preInstall + mkdir -p "$out" cd .. cp -av Help Messages Options.xml ROX images style.css .DirIcon "$out" @@ -85,6 +87,8 @@ stdenv.mkDerivation rec { ln -sv application-x-{bzip,xz}.png ln -sv application-x-{gzip,lzma}.png ln -sv application-{msword,rtf}.png + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/ada-modules/gnatprove/default.nix b/pkgs/development/ada-modules/gnatprove/default.nix index d50baba1391fb..ff4604e833ffb 100644 --- a/pkgs/development/ada-modules/gnatprove/default.nix +++ b/pkgs/development/ada-modules/gnatprove/default.nix @@ -79,10 +79,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + make install-all cp -a ./install/. $out mkdir $out/share/gpr ln -s $out/lib/gnat/* $out/share/gpr/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix b/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix index 1355323d93fd1..9fb858a294945 100644 --- a/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix +++ b/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix @@ -72,6 +72,8 @@ rec { dontPatch = true; autoPatchelfIgnoreMissingDeps = true; installPhase = '' + runHook preInstall + # https://developer.android.com/ndk/guides/other_build_systems mkdir -p $out cp -r ${androidndk}/libexec/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/${buildInfo.double} $out/toolchain @@ -114,6 +116,8 @@ rec { ln -sf $out/bin/${targetInfo.triple}-as $out/bin/as patchShebangs $out/bin + + runHook postInstall ''; }; diff --git a/pkgs/development/chez-modules/chez-matchable/default.nix b/pkgs/development/chez-modules/chez-matchable/default.nix index 738d4b06aeee7..e972bef5868ea 100644 --- a/pkgs/development/chez-modules/chez-matchable/default.nix +++ b/pkgs/development/chez-modules/chez-matchable/default.nix @@ -18,7 +18,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + make install PREFIX=$out CHEZ=${chez}/bin/scheme + + runHook postInstall ''; doCheck = false; diff --git a/pkgs/development/chez-modules/chez-scmutils/default.nix b/pkgs/development/chez-modules/chez-scmutils/default.nix index 59aedd29f0ec5..e6940519cfaaa 100644 --- a/pkgs/development/chez-modules/chez-scmutils/default.nix +++ b/pkgs/development/chez-modules/chez-scmutils/default.nix @@ -18,7 +18,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + make install PREFIX=$out CHEZ=${chez}/bin/scheme + + runHook postInstall ''; doCheck = false; diff --git a/pkgs/development/chez-modules/chez-srfi/default.nix b/pkgs/development/chez-modules/chez-srfi/default.nix index d821e6d015564..6534a936c1af9 100644 --- a/pkgs/development/chez-modules/chez-srfi/default.nix +++ b/pkgs/development/chez-modules/chez-srfi/default.nix @@ -18,7 +18,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + make install PREFIX=$out CHEZ=${chez}/bin/scheme + + runHook postInstall ''; doCheck = false; diff --git a/pkgs/development/compilers/alan/2.nix b/pkgs/development/compilers/alan/2.nix index ce175dba687a3..61010fe539a0e 100644 --- a/pkgs/development/compilers/alan/2.nix +++ b/pkgs/development/compilers/alan/2.nix @@ -19,10 +19,14 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = "-fcommon"; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/alan2 cp compiler/alan $out/bin/alan2 cp interpreter/arun $out/bin/arun2 cp alan.readme ChangeLog $out/share/alan2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/alan/default.nix b/pkgs/development/compilers/alan/default.nix index 296f9331c8152..2d70bd3c79eb1 100644 --- a/pkgs/development/compilers/alan/default.nix +++ b/pkgs/development/compilers/alan/default.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/alan/examples # Build the release tarball make package @@ -31,6 +33,8 @@ stdenv.mkDerivation rec { mv $out/share/alan/{alan,arun} $out/bin # a2a3 isn't included in the release tarball cp bin/a2a3 $out/bin + + runHook postInstall ''; nativeBuildInputs = [ diff --git a/pkgs/development/compilers/apache-flex-sdk/default.nix b/pkgs/development/compilers/apache-flex-sdk/default.nix index 527b800551eb8..fc0bf97587557 100644 --- a/pkgs/development/compilers/apache-flex-sdk/default.nix +++ b/pkgs/development/compilers/apache-flex-sdk/default.nix @@ -29,6 +29,8 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + t=$out/opt/apache-flex-sdk mkdir -p $t $out/bin mv * $t @@ -43,6 +45,8 @@ in stdenv.mkDerivation rec { mkdir -p $t/frameworks/libs/player/${playerglobal_ver}/ cp ${playerglobal} $t/frameworks/libs/player/${playerglobal_ver}/playerglobal.swc + + runHook postInstall ''; dontFixup = true; diff --git a/pkgs/development/compilers/bluespec/default.nix b/pkgs/development/compilers/bluespec/default.nix index e761c8609e8bf..8d1b027af59af 100644 --- a/pkgs/development/compilers/bluespec/default.nix +++ b/pkgs/development/compilers/bluespec/default.nix @@ -114,6 +114,8 @@ in stdenv.mkDerivation rec { checkTarget = "check-smoke"; # this is the shortest check but "check-suite" tests much more installPhase = '' + runHook preInstall + mkdir -p $out mv inst/bin $out mv inst/lib $out @@ -123,6 +125,8 @@ in stdenv.mkDerivation rec { mv inst/README $doc/share/doc/bsc mv inst/ReleaseNotes.* $doc/share/doc/bsc mv inst/doc/*.pdf $doc/share/doc/bsc + + runHook postInstall ''; meta = { diff --git a/pkgs/development/compilers/ccl/default.nix b/pkgs/development/compilers/ccl/default.nix index 9fe1a8aa8e564..2860c975af7d4 100644 --- a/pkgs/development/compilers/ccl/default.nix +++ b/pkgs/development/compilers/ccl/default.nix @@ -71,6 +71,8 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/share" cp -r . "$out/share/ccl-installation" @@ -78,6 +80,8 @@ in stdenv.mkDerivation rec { echo -e '#!${runtimeShell}\n'"$out/share/ccl-installation/${CCL_RUNTIME}"' "$@"\n' > "$out"/bin/"${CCL_RUNTIME}" chmod a+x "$out"/bin/"${CCL_RUNTIME}" ln -s "$out"/bin/"${CCL_RUNTIME}" "$out"/bin/ccl + + runHook postInstall ''; hardeningDisable = [ "format" ]; diff --git a/pkgs/development/compilers/ciao/default.nix b/pkgs/development/compilers/ciao/default.nix index 29e1032260224..4453b5b0a16fe 100644 --- a/pkgs/development/compilers/ciao/default.nix +++ b/pkgs/development/compilers/ciao/default.nix @@ -19,7 +19,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + ./ciao-boot.sh install + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/closure/default.nix b/pkgs/development/compilers/closure/default.nix index 2bb2340261c21..005b731bfede9 100644 --- a/pkgs/development/compilers/closure/default.nix +++ b/pkgs/development/compilers/closure/default.nix @@ -15,10 +15,14 @@ stdenv.mkDerivation rec { buildInputs = [ jre ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/java $out/bin cp ${src} $out/share/java/closure-compiler-v${version}.jar makeWrapper ${jre}/bin/java $out/bin/closure-compiler \ --add-flags "-jar $out/share/java/closure-compiler-v${version}.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/codon/default.nix b/pkgs/development/compilers/codon/default.nix index 520c6386490bf..03ee039704fa5 100644 --- a/pkgs/development/compilers/codon/default.nix +++ b/pkgs/development/compilers/codon/default.nix @@ -75,6 +75,8 @@ let ]; installPhase = '' + runHook preInstall + # Prune the `.git` directories find ${depsDir} -name .git -type d -prune -exec rm -rf {} \;; # Build a reproducible tar, per instructions at https://reproducible-builds.org/docs/archives/ @@ -84,6 +86,8 @@ let ${depsDir} \ cmake \ _deps/googletest-subbuild/googletest-populate-prefix/src/*.zip + + runHook postInstall ''; outputHash = diff --git a/pkgs/development/compilers/cone/default.nix b/pkgs/development/compilers/cone/default.nix index b13ac8de868e9..027b45a44d9dd 100644 --- a/pkgs/development/compilers/cone/default.nix +++ b/pkgs/development/compilers/cone/default.nix @@ -28,8 +28,12 @@ llvmPackages.stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 conec $out/bin/conec install -Dm644 libconestd.a $out/lib/libconestd.a + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/copper/default.nix b/pkgs/development/compilers/copper/default.nix index f202932743f1f..6d2115be62f00 100644 --- a/pkgs/development/compilers/copper/default.nix +++ b/pkgs/development/compilers/copper/default.nix @@ -21,7 +21,11 @@ stdenv.mkDerivation rec { make BACKEND=elf64 COPPER=stage3/copper-elf64 copper-elf64 ''; installPhase = '' + runHook preInstall + make BACKEND=elf64 install prefix=$out + + runHook postInstall ''; meta = with lib; { description = "Simple imperative language, statically typed with type inference and genericity"; diff --git a/pkgs/development/compilers/dart/default.nix b/pkgs/development/compilers/dart/default.nix index 0b21122b035e3..40dc5b01ad6b0 100644 --- a/pkgs/development/compilers/dart/default.nix +++ b/pkgs/development/compilers/dart/default.nix @@ -19,11 +19,15 @@ stdenv.mkDerivation (finalAttrs: { src = sources."${version}-${stdenv.hostPlatform.system}" or (throw "unsupported version/system: ${version}/${stdenv.hostPlatform.system}"); installPhase = '' + runHook preInstall + mkdir -p $out cp -R * $out/ echo $libPath '' + lib.optionalString (stdenv.isLinux) '' find $out/bin -executable -type f -exec patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) {} \; + + runHook postInstall ''; libPath = lib.makeLibraryPath [ stdenv.cc.cc ]; diff --git a/pkgs/development/compilers/dasm/default.nix b/pkgs/development/compilers/dasm/default.nix index 7f57f47f2ed6a..989a930017b9e 100644 --- a/pkgs/development/compilers/dasm/default.nix +++ b/pkgs/development/compilers/dasm/default.nix @@ -13,8 +13,12 @@ stdenv.mkDerivation rec { configurePhase = false; installPhase = '' + runHook preInstall + mkdir -p $out/bin install bin/* $out/bin + + runHook postInstall ''; preCheck = '' diff --git a/pkgs/development/compilers/dotnet/dotnet.nix b/pkgs/development/compilers/dotnet/dotnet.nix index 7e629383ab372..7c763f6df1e60 100644 --- a/pkgs/development/compilers/dotnet/dotnet.nix +++ b/pkgs/development/compilers/dotnet/dotnet.nix @@ -30,8 +30,12 @@ let sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out/ + + runHook postInstall ''; }; }; diff --git a/pkgs/development/compilers/elm/lib/makeDotElm.nix b/pkgs/development/compilers/elm/lib/makeDotElm.nix index ab62eb88e2202..ea77974cadd75 100644 --- a/pkgs/development/compilers/elm/lib/makeDotElm.nix +++ b/pkgs/development/compilers/elm/lib/makeDotElm.nix @@ -18,8 +18,12 @@ let dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out + + runHook postInstall ''; }; in diff --git a/pkgs/development/compilers/elm/packages/lamdera/default.nix b/pkgs/development/compilers/elm/packages/lamdera/default.nix index 79101092e7885..e62cae663e178 100644 --- a/pkgs/development/compilers/elm/packages/lamdera/default.nix +++ b/pkgs/development/compilers/elm/packages/lamdera/default.nix @@ -27,7 +27,11 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + install -m755 -D $src $out/bin/lamdera + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/fasm/default.nix b/pkgs/development/compilers/fasm/default.nix index f17d18bf92a62..4076245261784 100644 --- a/pkgs/development/compilers/fasm/default.nix +++ b/pkgs/development/compilers/fasm/default.nix @@ -18,11 +18,15 @@ stdenv.mkDerivation { outputs = [ "out" "doc" ]; installPhase = '' + runHook preInstall + install -Dt $out/bin fasm tools/libc/fasm-* docs=$doc/share/doc/fasm mkdir -p $docs cp -r examples/ *.txt tools/fas.txt $docs cp tools/readme.txt $docs/tools.txt + + runHook postInstall ''; } diff --git a/pkgs/development/compilers/fasmg/default.nix b/pkgs/development/compilers/fasmg/default.nix index b62c114c77e42..55fdbb7f0a8a1 100644 --- a/pkgs/development/compilers/fasmg/default.nix +++ b/pkgs/development/compilers/fasmg/default.nix @@ -42,10 +42,14 @@ stdenv.mkDerivation rec { outputs = [ "out" "doc" ]; installPhase = '' + runHook preInstall + install -Dm755 fasmg $out/bin/fasmg mkdir -p $doc/share/doc/fasmg cp docs/*.txt $doc/share/doc/fasmg + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/flasm/default.nix b/pkgs/development/compilers/flasm/default.nix index e1da977b0039c..c5d2a599b1342 100644 --- a/pkgs/development/compilers/flasm/default.nix +++ b/pkgs/development/compilers/flasm/default.nix @@ -27,7 +27,11 @@ stdenv.mkDerivation rec { buildInputs = [ zlib ]; installPhase = '' + runHook preInstall + install -Dm755 flasm -t $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/flutter/update/get-pubspec-lock.nix.in b/pkgs/development/compilers/flutter/update/get-pubspec-lock.nix.in index ff72046bcecb1..158210b81b75d 100644 --- a/pkgs/development/compilers/flutter/update/get-pubspec-lock.nix.in +++ b/pkgs/development/compilers/flutter/update/get-pubspec-lock.nix.in @@ -25,6 +25,10 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + cp -r ./pubspec.lock $out + + runHook postInstall ''; } diff --git a/pkgs/development/compilers/fstar/default.nix b/pkgs/development/compilers/fstar/default.nix index 3b3ad0ff55699..7185f6576dc4c 100644 --- a/pkgs/development/compilers/fstar/default.nix +++ b/pkgs/development/compilers/fstar/default.nix @@ -42,6 +42,8 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir $out CP="cp -r --no-preserve=mode" @@ -60,6 +62,8 @@ stdenv.mkDerivation { installShellCompletion --bash .completion/bash/fstar.exe.bash installShellCompletion --fish .completion/fish/fstar.exe.fish installShellCompletion --zsh --name _fstar.exe .completion/zsh/__fstar.exe + + runHook postInstall ''; passthru.updateScript = writeScript "update-fstar" '' diff --git a/pkgs/development/compilers/gambit/bootstrap.nix b/pkgs/development/compilers/gambit/bootstrap.nix index 708640c8719c4..f1064a8786281 100644 --- a/pkgs/development/compilers/gambit/bootstrap.nix +++ b/pkgs/development/compilers/gambit/bootstrap.nix @@ -33,7 +33,11 @@ gccStdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + cp -fa ./gsc-boot $out/gambit/ + + runHook postInstall ''; forceShare = [ "info" ]; diff --git a/pkgs/development/compilers/gcc-arm-embedded/10/default.nix b/pkgs/development/compilers/gcc-arm-embedded/10/default.nix index ad690cb26fa26..7e050db79890a 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/10/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/10/default.nix @@ -30,9 +30,13 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/gcc-arm-embedded/11/default.nix b/pkgs/development/compilers/gcc-arm-embedded/11/default.nix index 4ed1ac9b99b01..0b5bc3a150edc 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/11/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/11/default.nix @@ -32,8 +32,12 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/gcc-arm-embedded/12/default.nix b/pkgs/development/compilers/gcc-arm-embedded/12/default.nix index 0407cfa71e09c..68f4f0c422971 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/12/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/12/default.nix @@ -34,8 +34,12 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/gcc-arm-embedded/13/default.nix b/pkgs/development/compilers/gcc-arm-embedded/13/default.nix index a16348dad02c7..560afb2f7a53f 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/13/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/13/default.nix @@ -34,8 +34,12 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/gcc-arm-embedded/6/default.nix b/pkgs/development/compilers/gcc-arm-embedded/6/default.nix index d805c24e002c2..63428b9975745 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/6/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/6/default.nix @@ -29,9 +29,13 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/gcc-arm-embedded/7/default.nix b/pkgs/development/compilers/gcc-arm-embedded/7/default.nix index 13d8c12f52ce3..7086efe4a5d7d 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/7/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/7/default.nix @@ -29,9 +29,13 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/gcc-arm-embedded/8/default.nix b/pkgs/development/compilers/gcc-arm-embedded/8/default.nix index a6448baa7919f..623942915ff6c 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/8/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/8/default.nix @@ -29,9 +29,13 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/gcc-arm-embedded/9/default.nix b/pkgs/development/compilers/gcc-arm-embedded/9/default.nix index 4c2b34b0c5b71..ec678bcc78f3f 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/9/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/9/default.nix @@ -31,9 +31,13 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/gnat-bootstrap/default.nix b/pkgs/development/compilers/gnat-bootstrap/default.nix index d59a6b4f51fbd..86007d7516fd0 100644 --- a/pkgs/development/compilers/gnat-bootstrap/default.nix +++ b/pkgs/development/compilers/gnat-bootstrap/default.nix @@ -87,6 +87,8 @@ in { ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -ar * $out/ '' @@ -129,6 +131,8 @@ in { "$out"/libexec/gcc/${upstreamTriplet}/${gccVersion}/install-tools/mkheaders -v -v \ "$out" "${stdenv.cc.libc}" + + runHook postInstall ''; passthru = { diff --git a/pkgs/development/compilers/gwt/2.4.0.nix b/pkgs/development/compilers/gwt/2.4.0.nix index b769eb30463a9..383c655a673b5 100644 --- a/pkgs/development/compilers/gwt/2.4.0.nix +++ b/pkgs/development/compilers/gwt/2.4.0.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out unzip $src mv gwt-2.4.0 $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/development/compilers/haxe/default.nix b/pkgs/development/compilers/haxe/default.nix index 78e5770cc68ed..4b5c92605d661 100644 --- a/pkgs/development/compilers/haxe/default.nix +++ b/pkgs/development/compilers/haxe/default.nix @@ -84,6 +84,8 @@ let ]; installPhase = '' + runHook preInstall + install -vd "$out/bin" "$out/lib/haxe/std" cp -vr haxe haxelib std "$out/lib/haxe" @@ -112,6 +114,8 @@ let EOF chmod +x $out/bin/$name done + + runHook postInstall ''; setupHook = ./setup-hook.sh; diff --git a/pkgs/development/compilers/inform7/default.nix b/pkgs/development/compilers/inform7/default.nix index cb464e3484c2c..c06a7d3f5d644 100644 --- a/pkgs/development/compilers/inform7/default.nix +++ b/pkgs/development/compilers/inform7/default.nix @@ -12,6 +12,8 @@ in stdenv.mkDerivation { preConfigure = "touch Makefile.PL"; buildPhase = ""; installPhase = '' + runHook preInstall + mkdir -p $out pushd $src ./install-inform7.sh --prefix $out @@ -19,6 +21,8 @@ in stdenv.mkDerivation { substituteInPlace "$out/bin/i7" \ --replace "/usr/bin/perl" "${perl}/bin/perl" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/javacard-devkit/default.nix b/pkgs/development/compilers/javacard-devkit/default.nix index c9e9b34e6ee0f..eb88c0e60c80b 100644 --- a/pkgs/development/compilers/javacard-devkit/default.nix +++ b/pkgs/development/compilers/javacard-devkit/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/share/$pname" cp -rt "$out/share/$pname" api_export_files cp -rt "$out" lib @@ -44,6 +46,8 @@ stdenv.mkDerivation rec { makeWrapper "$JAVA_HOME/bin/javac" "$out/bin/javacardc" \ --prefix CLASSPATH : "$out/lib/api.jar" + + runHook postInstall ''; meta = { diff --git a/pkgs/development/compilers/kaitai-struct-compiler/default.nix b/pkgs/development/compilers/kaitai-struct-compiler/default.nix index 2fd4fba11e3b0..f0993fd9bad0b 100644 --- a/pkgs/development/compilers/kaitai-struct-compiler/default.nix +++ b/pkgs/development/compilers/kaitai-struct-compiler/default.nix @@ -18,10 +18,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -D $src/bin/kaitai-struct-compiler $out/bin/kaitai-struct-compiler ln -s $out/bin/kaitai-struct-compiler $out/bin/ksc cp -R $src/lib $out/lib wrapProgram $out/bin/kaitai-struct-compiler --prefix PATH : ${lib.makeBinPath [ openjdk8 ] } + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/kotlin/default.nix b/pkgs/development/compilers/kotlin/default.nix index b8967d64794f4..c7d4e3c304147 100644 --- a/pkgs/development/compilers/kotlin/default.nix +++ b/pkgs/development/compilers/kotlin/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out rm "bin/"*.bat mv * $out @@ -25,6 +27,8 @@ stdenv.mkDerivation rec { install -D $out/LICENSE $out/share/kotlin/LICENSE rm $out/LICENSE fi + + runHook postInstall ''; meta = { diff --git a/pkgs/development/compilers/lingua-franca/default.nix b/pkgs/development/compilers/lingua-franca/default.nix index f989a5e9d6be1..7c0130c64510b 100644 --- a/pkgs/development/compilers/lingua-franca/default.nix +++ b/pkgs/development/compilers/lingua-franca/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cp -r ./ $out/ chmod +x $out/bin/lfc + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/llvm/common/clang/default.nix b/pkgs/development/compilers/llvm/common/clang/default.nix index 5a6d775804b64..c73b6ae212507 100644 --- a/pkgs/development/compilers/llvm/common/clang/default.nix +++ b/pkgs/development/compilers/llvm/common/clang/default.nix @@ -187,9 +187,13 @@ let pname = "clang-manpages"; installPhase = '' + runHook preInstall + mkdir -p $out/share/man/man1 # Manually install clang manpage cp docs/man/*.1 $out/share/man/man1/ + + runHook postInstall ''; outputs = [ "out" ]; diff --git a/pkgs/development/compilers/llvm/common/lldb.nix b/pkgs/development/compilers/llvm/common/lldb.nix index 2b2ffb009a6f7..92e5ab8177153 100644 --- a/pkgs/development/compilers/llvm/common/lldb.nix +++ b/pkgs/development/compilers/llvm/common/lldb.nix @@ -203,8 +203,12 @@ stdenv.mkDerivation (rec { # manually install lldb man page installPhase = '' + runHook preInstall + mkdir -p $out/share/man/man1 install docs/man/lldb.1 -t $out/share/man/man1/ + + runHook postInstall ''; postPatch = null; diff --git a/pkgs/development/compilers/llvm/common/llvm/default.nix b/pkgs/development/compilers/llvm/common/llvm/default.nix index fdcd40201c0bb..4e0451d1d53a4 100644 --- a/pkgs/development/compilers/llvm/common/llvm/default.nix +++ b/pkgs/development/compilers/llvm/common/llvm/default.nix @@ -475,7 +475,11 @@ stdenv.mkDerivation (rec { ''; installPhase = '' + runHook preInstall + make -C docs install + + runHook postInstall ''; } else { ninjaFlags = [ "docs-llvm-man" ]; diff --git a/pkgs/development/compilers/mlton/20180207-binary.nix b/pkgs/development/compilers/mlton/20180207-binary.nix index 4846b58bf26be..394156f520552 100644 --- a/pkgs/development/compilers/mlton/20180207-binary.nix +++ b/pkgs/development/compilers/mlton/20180207-binary.nix @@ -28,7 +28,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + make install PREFIX=$out + + runHook postInstall ''; postFixup = lib.optionalString stdenv.isLinux '' diff --git a/pkgs/development/compilers/mlton/20210117-binary.nix b/pkgs/development/compilers/mlton/20210117-binary.nix index d4e55d47b94cf..173c6f57b16b0 100644 --- a/pkgs/development/compilers/mlton/20210117-binary.nix +++ b/pkgs/development/compilers/mlton/20210117-binary.nix @@ -31,7 +31,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + make install PREFIX=$out + + runHook postInstall ''; postFixup = lib.optionalString stdenv.isLinux '' diff --git a/pkgs/development/compilers/mruby/default.nix b/pkgs/development/compilers/mruby/default.nix index 0fc1af2d6676d..c7bf7e2269393 100644 --- a/pkgs/development/compilers/mruby/default.nix +++ b/pkgs/development/compilers/mruby/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation (finalAttrs: { preBuild = "unset LD"; installPhase = '' + runHook preInstall + mkdir $out cp -R include build/host/{bin,lib} $out + + runHook postInstall ''; doCheck = true; diff --git a/pkgs/development/compilers/muonlang/default.nix b/pkgs/development/compilers/muonlang/default.nix index aef02bca970de..da3d9f2f719e1 100644 --- a/pkgs/development/compilers/muonlang/default.nix +++ b/pkgs/development/compilers/muonlang/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + makeWrapper $out/bin/mu-unwrapped $out/bin/mu \ --add-flags $out/share/mu/lib/core.mu + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/nvidia-cg-toolkit/default.nix b/pkgs/development/compilers/nvidia-cg-toolkit/default.nix index d6d4fdd448107..e24da12175bf9 100644 --- a/pkgs/development/compilers/nvidia-cg-toolkit/default.nix +++ b/pkgs/development/compilers/nvidia-cg-toolkit/default.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation rec { else throw "nvidia-cg-toolkit does not support platform ${stdenv.hostPlatform.system}"; installPhase = '' + runHook preInstall + for b in cgc cgfxcat cginfo do patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux*.so.? "bin/$b" @@ -35,6 +37,8 @@ stdenv.mkDerivation rec { [ "$system" == "i686-linux" ] && cp -v lib/* "$out/lib/" mkdir -p "$out/share/doc/$name/" cp -v -r local/Cg/* "$out/share/doc/$name/" + + runHook postInstall ''; meta = { diff --git a/pkgs/development/compilers/ocaml/ber-metaocaml.nix b/pkgs/development/compilers/ocaml/ber-metaocaml.nix index 5279fc7481b6e..e740f03f9aa68 100644 --- a/pkgs/development/compilers/ocaml/ber-metaocaml.nix +++ b/pkgs/development/compilers/ocaml/ber-metaocaml.nix @@ -58,8 +58,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + make install make install.opt + + runHook postInstall ''; checkPhase = '' diff --git a/pkgs/development/compilers/open-watcom/bin.nix b/pkgs/development/compilers/open-watcom/bin.nix index 1f80799089992..7c1db243a7b4f 100644 --- a/pkgs/development/compilers/open-watcom/bin.nix +++ b/pkgs/development/compilers/open-watcom/bin.nix @@ -104,12 +104,16 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + performInstall ./install-bin-unwrapped for e in $(find $out/binl -type f -executable); do echo "Wrapping $e" wrapInPlace "$e" done + + runHook postInstall ''; passthru.prettyName = "open-watcom-bin"; diff --git a/pkgs/development/compilers/openjdk/11.nix b/pkgs/development/compilers/openjdk/11.nix index 089e8411210c2..b2a16c441d4d6 100644 --- a/pkgs/development/compilers/openjdk/11.nix +++ b/pkgs/development/compilers/openjdk/11.nix @@ -110,6 +110,8 @@ let buildFlags = [ "all" ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib mv build/*/images/jdk $out/lib/openjdk @@ -133,6 +135,8 @@ let ''} ln -s $out/lib/openjdk/bin $out/bin + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/openjdk/17.nix b/pkgs/development/compilers/openjdk/17.nix index d0c954d1b023f..8e4328077dafe 100644 --- a/pkgs/development/compilers/openjdk/17.nix +++ b/pkgs/development/compilers/openjdk/17.nix @@ -135,6 +135,8 @@ let buildFlags = [ "images" ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib mv build/*/images/jdk $out/lib/openjdk @@ -160,6 +162,8 @@ let ''} ln -s $out/lib/openjdk/bin $out/bin + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/openjdk/21.nix b/pkgs/development/compilers/openjdk/21.nix index 9c403fb2755dc..c536235f54e3e 100644 --- a/pkgs/development/compilers/openjdk/21.nix +++ b/pkgs/development/compilers/openjdk/21.nix @@ -121,6 +121,8 @@ let buildFlags = [ "images" ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib mv build/*/images/jdk $out/lib/openjdk @@ -146,6 +148,8 @@ let ''} ln -s $out/lib/openjdk/bin $out/bin + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/openjdk/22.nix b/pkgs/development/compilers/openjdk/22.nix index 18ab52f089d33..954bd44157f74 100644 --- a/pkgs/development/compilers/openjdk/22.nix +++ b/pkgs/development/compilers/openjdk/22.nix @@ -189,6 +189,8 @@ stdenv.mkDerivation (finalAttrs: { buildFlags = [ "images" ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib mv build/*/images/jdk $out/lib/openjdk @@ -214,6 +216,8 @@ stdenv.mkDerivation (finalAttrs: { ''} ln -s $out/lib/openjdk/bin $out/bin + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/openjdk/8.nix b/pkgs/development/compilers/openjdk/8.nix index b77b058e2cac2..c05789fe0ac8d 100644 --- a/pkgs/development/compilers/openjdk/8.nix +++ b/pkgs/development/compilers/openjdk/8.nix @@ -111,6 +111,8 @@ let doCheck = false; # fails with "No rule to make target 'y'." installPhase = '' + runHook preInstall + mkdir -p $out/lib mv build/*/images/j2sdk-image $out/lib/openjdk @@ -169,6 +171,8 @@ let ln -s $out/lib/openjdk/bin $out/bin ln -s $jre/lib/openjdk/jre/bin $jre/bin ln -s $jre/lib/openjdk/jre $out/jre + + runHook postInstall ''; propagatedBuildInputs = [ setJavaClassPath ]; diff --git a/pkgs/development/compilers/openjdk/openjfx/11/default.nix b/pkgs/development/compilers/openjdk/openjfx/11/default.nix index 79df8c0da3649..1681542460cc2 100644 --- a/pkgs/development/compilers/openjdk/openjfx/11/default.nix +++ b/pkgs/development/compilers/openjdk/openjfx/11/default.nix @@ -71,7 +71,11 @@ in stdenv.mkDerivation { gradleBuildTask = "sdk"; installPhase = '' + runHook preInstall + cp -r build/modular-sdk $out + + runHook postInstall ''; stripDebugList = [ "." ]; diff --git a/pkgs/development/compilers/openjdk/openjfx/17/default.nix b/pkgs/development/compilers/openjdk/openjfx/17/default.nix index 1b19ee30eca69..0cc8763e9c1ce 100644 --- a/pkgs/development/compilers/openjdk/openjfx/17/default.nix +++ b/pkgs/development/compilers/openjdk/openjfx/17/default.nix @@ -68,7 +68,11 @@ in stdenv.mkDerivation { gradleBuildTask = "sdk"; installPhase = '' + runHook preInstall + cp -r build/modular-sdk $out + + runHook postInstall ''; stripDebugList = [ "." ]; diff --git a/pkgs/development/compilers/openjdk/openjfx/21/default.nix b/pkgs/development/compilers/openjdk/openjfx/21/default.nix index 85fe036fe767e..4b03be13c6185 100644 --- a/pkgs/development/compilers/openjdk/openjfx/21/default.nix +++ b/pkgs/development/compilers/openjdk/openjfx/21/default.nix @@ -64,7 +64,11 @@ in stdenv.mkDerivation { gradleBuildTask = "sdk"; installPhase = '' + runHook preInstall + cp -r build/modular-sdk $out + + runHook postInstall ''; stripDebugList = [ "." ]; diff --git a/pkgs/development/compilers/openjdk/openjfx/22/default.nix b/pkgs/development/compilers/openjdk/openjfx/22/default.nix index 4359a880ec04a..6533c6a863f58 100644 --- a/pkgs/development/compilers/openjdk/openjfx/22/default.nix +++ b/pkgs/development/compilers/openjdk/openjfx/22/default.nix @@ -75,7 +75,11 @@ in stdenv.mkDerivation { gradleBuildTask = "sdk"; installPhase = '' + runHook preInstall + cp -r build/modular-sdk $out + + runHook postInstall ''; stripDebugList = [ "." ]; diff --git a/pkgs/development/compilers/openspin/default.nix b/pkgs/development/compilers/openspin/default.nix index 5bf0ff64d354a..8950eff83564d 100644 --- a/pkgs/development/compilers/openspin/default.nix +++ b/pkgs/development/compilers/openspin/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv build/openspin $out/bin/openspin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix b/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix index d03419e96570e..dc4fb9413470d 100644 --- a/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix +++ b/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix @@ -90,6 +90,8 @@ let result = stdenv.mkDerivation rec { dontStrip = 1; installPhase = '' + runHook preInstall + cd .. if test -z "$installjdk"; then @@ -143,6 +145,8 @@ let result = stdenv.mkDerivation rec { cat <> $out/nix-support/setup-hook if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi EOF + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/development/compilers/oraclejdk/jdk11-linux.nix b/pkgs/development/compilers/oraclejdk/jdk11-linux.nix index a232b796a0682..f1235fb3fe4ed 100644 --- a/pkgs/development/compilers/oraclejdk/jdk11-linux.nix +++ b/pkgs/development/compilers/oraclejdk/jdk11-linux.nix @@ -18,6 +18,8 @@ let result = stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mv ../$sourceRoot $out mkdir -p $out/nix-support @@ -27,6 +29,8 @@ let result = stdenv.mkDerivation rec { cat <> $out/nix-support/setup-hook if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi EOF + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/development/compilers/picat/default.nix b/pkgs/development/compilers/picat/default.nix index 04c80884670dd..38e2caad9b1df 100644 --- a/pkgs/development/compilers/picat/default.nix +++ b/pkgs/development/compilers/picat/default.nix @@ -30,10 +30,14 @@ stdenv.mkDerivation { make -j $NIX_BUILD_CORES -f Makefile.$ARCH ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share cp picat $out/bin/ cp -r ../doc $out/share/doc cp -r ../exs $out/share/examples + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/purescript/psc-package/default.nix b/pkgs/development/compilers/purescript/psc-package/default.nix index f0664df84dfe8..1b2ded8416e5c 100644 --- a/pkgs/development/compilers/purescript/psc-package/default.nix +++ b/pkgs/development/compilers/purescript/psc-package/default.nix @@ -28,6 +28,8 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin PSC_PACKAGE=$out/bin/psc-package @@ -48,6 +50,8 @@ stdenv.mkDerivation rec { --bash <($PSC_PACKAGE --bash-completion-script $PSC_PACKAGE) \ --fish <($PSC_PACKAGE --fish-completion-script $PSC_PACKAGE) \ --zsh <($PSC_PACKAGE --zsh-completion-script $PSC_PACKAGE) + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/purescript/purescript/default.nix b/pkgs/development/compilers/purescript/purescript/default.nix index 61a8c3a5c5bd8..671e432e6af93 100644 --- a/pkgs/development/compilers/purescript/purescript/default.nix +++ b/pkgs/development/compilers/purescript/purescript/default.nix @@ -47,6 +47,8 @@ in stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin PURS="$out/bin/purs" @@ -55,6 +57,8 @@ in stdenv.mkDerivation rec { '' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' mkdir -p $out/share/bash-completion/completions $PURS --bash-completion-script $PURS > $out/share/bash-completion/completions/purs-completion.bash + + runHook postInstall ''; passthru = { diff --git a/pkgs/development/compilers/roslyn/default.nix b/pkgs/development/compilers/roslyn/default.nix index 6ab2799f46c46..81d5b743bd7c9 100644 --- a/pkgs/development/compilers/roslyn/default.nix +++ b/pkgs/development/compilers/roslyn/default.nix @@ -44,6 +44,8 @@ buildDotnetModule rec { ''; installPhase = '' + runHook preInstall + pkg="$out/lib/dotnet/microsoft.net.compilers.toolset/${version}" mkdir -p "$out/bin" "$pkg" @@ -56,6 +58,8 @@ buildDotnetModule rec { --add-flags "$pkg/tasks/net472/csc.exe" makeWrapper ${mono}/bin/mono $out/bin/vbc \ --add-flags "$pkg/tasks/net472/vbc.exe" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/rust/binary.nix b/pkgs/development/compilers/rust/binary.nix index 10e944515df76..b396b81c00236 100644 --- a/pkgs/development/compilers/rust/binary.nix +++ b/pkgs/development/compilers/rust/binary.nix @@ -44,6 +44,8 @@ rec { ''; installPhase = '' + runHook preInstall + ./install.sh --prefix=$out \ --components=${installComponents} @@ -52,6 +54,8 @@ rec { # the wrong libraries in a bootstrap-build causing failures that # are very hard to track down. For details, see # https://github.com/rust-lang/rust/issues/34722#issuecomment-232164943 + + runHook postInstall ''; # The strip tool in cctools 973.0.1 and up appears to break rlibs in the @@ -90,12 +94,16 @@ rec { ''; installPhase = '' + runHook preInstall + patchShebangs ./install.sh ./install.sh --prefix=$out \ --components=cargo wrapProgram "$out/bin/cargo" \ --suffix PATH : "${rustc}/bin" + + runHook postInstall ''; }; } diff --git a/pkgs/development/compilers/sbcl/bootstrap.nix b/pkgs/development/compilers/sbcl/bootstrap.nix index d796b24e1d7e3..cb960da3f7c39 100644 --- a/pkgs/development/compilers/sbcl/bootstrap.nix +++ b/pkgs/development/compilers/sbcl/bootstrap.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -p src/runtime/sbcl $out/bin @@ -21,6 +23,8 @@ stdenv.mkDerivation rec { mkdir -p $out/bin makeWrapper $out/share/sbcl/sbcl $out/bin/sbcl \ --add-flags "--core $out/share/sbcl/sbcl.core" + + runHook postInstall ''; postFixup = lib.optionalString (!stdenv.isAarch32 && stdenv.isLinux) '' diff --git a/pkgs/development/compilers/scala-runners/default.nix b/pkgs/development/compilers/scala-runners/default.nix index bc0756e0c11ce..fe192fa9b9f27 100644 --- a/pkgs/development/compilers/scala-runners/default.nix +++ b/pkgs/development/compilers/scala-runners/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib sed -ie "s| cs | ${coursier}/bin/cs |" scala-runner cp scala-runner $out/lib @@ -20,6 +22,8 @@ stdenv.mkDerivation rec { ln -s $out/lib/scala-runner $out/bin/scalac ln -s $out/lib/scala-runner $out/bin/scalap ln -s $out/lib/scala-runner $out/bin/scaladoc + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/scala/bare.nix b/pkgs/development/compilers/scala/bare.nix index bbbb573f2f5ac..2d8924526c14d 100644 --- a/pkgs/development/compilers/scala/bare.nix +++ b/pkgs/development/compilers/scala/bare.nix @@ -13,8 +13,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out mv * $out + + runHook postInstall ''; # Use preFixup instead of fixupPhase diff --git a/pkgs/development/compilers/scala/default.nix b/pkgs/development/compilers/scala/default.nix index 2ad68ffec3b36..d2bed4f218bc5 100644 --- a/pkgs/development/compilers/scala/default.nix +++ b/pkgs/development/compilers/scala/default.nix @@ -13,11 +13,15 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin ln -s ${bare}/bin/scalac $out/bin/scalac ln -s ${bare}/bin/scaladoc $out/bin/scaladoc ln -s ${bare}/bin/scala $out/bin/scala ln -s ${bare}/bin/common $out/bin/common + + runHook postInstall ''; inherit (bare) meta; diff --git a/pkgs/development/compilers/serpent/default.nix b/pkgs/development/compilers/serpent/default.nix index 670986b3ffc5c..5935e8f560ff7 100644 --- a/pkgs/development/compilers/serpent/default.nix +++ b/pkgs/development/compilers/serpent/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv serpent $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/smlnj/bootstrap.nix b/pkgs/development/compilers/smlnj/bootstrap.nix index 6aba529a8fce0..2b56bdd17eb3c 100644 --- a/pkgs/development/compilers/smlnj/bootstrap.nix +++ b/pkgs/development/compilers/smlnj/bootstrap.nix @@ -27,11 +27,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin rsync -av bin/ $out/bin/ mkdir -p $out/lib rsync -av lib/ $out/lib/ + + runHook postInstall ''; postInstall = '' diff --git a/pkgs/development/compilers/smlnj/default.nix b/pkgs/development/compilers/smlnj/default.nix index 26efb81e16869..a4f12d3322466 100644 --- a/pkgs/development/compilers/smlnj/default.nix +++ b/pkgs/development/compilers/smlnj/default.nix @@ -72,6 +72,8 @@ in stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -pv $out cp -rv bin lib $out @@ -79,6 +81,8 @@ in stdenv.mkDerivation { for i in *; do sed -i "2iSMLNJ_HOME=$out/" $i done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/spasm-ng/default.nix b/pkgs/development/compilers/spasm-ng/default.nix index 9045710dc7706..446c6b6a36d7c 100644 --- a/pkgs/development/compilers/spasm-ng/default.nix +++ b/pkgs/development/compilers/spasm-ng/default.nix @@ -19,7 +19,11 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + install -Dm755 spasm -t $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/stalin/default.nix b/pkgs/development/compilers/stalin/default.nix index 245ebdb0c6cb9..720d462840721 100644 --- a/pkgs/development/compilers/stalin/default.nix +++ b/pkgs/development/compilers/stalin/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { buildPhase = "./build "; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp stalin "$out/bin" @@ -33,6 +35,8 @@ stdenv.mkDerivation rec { --replace "$PWD/include/stalin" "$out/share/stalin-${version}/include/stalin" substituteInPlace "$out/bin/stalin" \ --replace "$PWD/include" "$out/share/stalin-${version}/include" + + runHook postInstall ''; meta = { diff --git a/pkgs/development/compilers/swift/compiler/default.nix b/pkgs/development/compilers/swift/compiler/default.nix index 31cbd298603a4..0ffa46051d66c 100644 --- a/pkgs/development/compilers/swift/compiler/default.nix +++ b/pkgs/development/compilers/swift/compiler/default.nix @@ -179,11 +179,15 @@ let dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib/swift cp -r \ "${MacOSX-SDK}/usr/lib/swift/Swift.swiftmodule" \ "${MacOSX-SDK}/usr/lib/swift/libswiftCore.tbd" \ $out/lib/swift/ + + runHook postInstall ''; }; @@ -592,6 +596,8 @@ in stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + # Undo the clang and swift wrapping we did for the build. # (This happened via patches to cmake files.) cd $SWIFT_BUILD_ROOT @@ -647,6 +653,8 @@ in stdenv.mkDerivation { # TODO: Is there no source code for this available? cp -r ${CLTools_Executables}/usr/lib/arc $out/lib/arc ''} + + runHook postInstall ''; preFixup = lib.optionalString stdenv.isLinux '' diff --git a/pkgs/development/compilers/swift/sourcekit-lsp/default.nix b/pkgs/development/compilers/swift/sourcekit-lsp/default.nix index f0c08a41e43e3..cdaa76be804a8 100644 --- a/pkgs/development/compilers/swift/sourcekit-lsp/default.nix +++ b/pkgs/development/compilers/swift/sourcekit-lsp/default.nix @@ -61,9 +61,13 @@ stdenv.mkDerivation { #doCheck = true; installPhase = '' + runHook preInstall + binPath="$(swiftpmBinPath)" mkdir -p $out/bin cp $binPath/sourcekit-lsp $out/bin/ + + runHook postInstall ''; # Canary to verify output of our Swift toolchain does not depend on the Swift diff --git a/pkgs/development/compilers/swift/swift-docc/default.nix b/pkgs/development/compilers/swift/swift-docc/default.nix index 2645f07aa4ec8..33dafea04c301 100644 --- a/pkgs/development/compilers/swift/swift-docc/default.nix +++ b/pkgs/development/compilers/swift/swift-docc/default.nix @@ -39,10 +39,14 @@ stdenv.mkDerivation { #doCheck = true; installPhase = '' + runHook preInstall + binPath="$(swiftpmBinPath)" mkdir -p $out/bin $out/share/docc cp $binPath/docc $out/bin/ ln -s $renderArtifact/dist $out/share/docc/render + + runHook postInstall ''; # Canary to verify output of our Swift toolchain does not depend on the Swift diff --git a/pkgs/development/compilers/swift/swift-driver/default.nix b/pkgs/development/compilers/swift/swift-driver/default.nix index ca2b88046c86e..7907a693eaf05 100644 --- a/pkgs/development/compilers/swift/swift-driver/default.nix +++ b/pkgs/development/compilers/swift/swift-driver/default.nix @@ -67,11 +67,15 @@ stdenv.mkDerivation { # TODO: Darwin-specific installation includes more, but not sure why. installPhase = '' + runHook preInstall + binPath="$(swiftpmBinPath)" mkdir -p $out/bin for executable in swift-driver swift-help swift-build-sdk-interfaces; do cp $binPath/$executable $out/bin/ done + + runHook postInstall ''; meta = { diff --git a/pkgs/development/compilers/swift/swift-format/default.nix b/pkgs/development/compilers/swift/swift-format/default.nix index 3ce4c22b69700..cfa7f7009dfbe 100644 --- a/pkgs/development/compilers/swift/swift-format/default.nix +++ b/pkgs/development/compilers/swift/swift-format/default.nix @@ -33,9 +33,13 @@ stdenv.mkDerivation { swiftpmFlags = [ "--product swift-format" ]; installPhase = '' + runHook preInstall + binPath="$(swiftpmBinPath)" mkdir -p $out/bin cp $binPath/swift-format $out/bin/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/compilers/swift/swiftpm/default.nix b/pkgs/development/compilers/swift/swiftpm/default.nix index 712bc01777a5e..39e3cd2d1b68e 100644 --- a/pkgs/development/compilers/swift/swiftpm/default.nix +++ b/pkgs/development/compilers/swift/swiftpm/default.nix @@ -426,6 +426,8 @@ in stdenv.mkDerivation (commonAttrs // { # The following is dervied from Utilities/bootstrap, see install_swiftpm. installPhase = '' + runHook preInstall + binPath="$(swift-build --show-bin-path -c release)" mkdir -p $out/bin $out/lib/swift @@ -450,6 +452,8 @@ in stdenv.mkDerivation (commonAttrs // { } installSwiftpmModule PackageDescription ManifestAPI installSwiftpmModule PackagePlugin PluginAPI + + runHook postInstall ''; setupHook = ./setup-hook.sh; diff --git a/pkgs/development/compilers/swift/swiftpm2nix/default.nix b/pkgs/development/compilers/swift/swiftpm2nix/default.nix index 26713860e1989..b030d516aa877 100644 --- a/pkgs/development/compilers/swift/swiftpm2nix/default.nix +++ b/pkgs/development/compilers/swift/swiftpm2nix/default.nix @@ -8,9 +8,13 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + install -vD ${./swiftpm2nix.sh} $out/bin/swiftpm2nix wrapProgram $out/bin/$name \ --prefix PATH : ${lib.makeBinPath [ jq nix-prefetch-git ]} \ + + runHook postInstall ''; preferLocalBuild = true; diff --git a/pkgs/development/compilers/temurin-bin/jdk-darwin-base.nix b/pkgs/development/compilers/temurin-bin/jdk-darwin-base.nix index 886c92ba2e382..251f3523012ba 100644 --- a/pkgs/development/compilers/temurin-bin/jdk-darwin-base.nix +++ b/pkgs/development/compilers/temurin-bin/jdk-darwin-base.nix @@ -33,6 +33,8 @@ let dontStrip = 1; installPhase = '' + runHook preInstall + cd .. mv $sourceRoot $out @@ -56,6 +58,8 @@ let cat <> $out/nix-support/setup-hook if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi EOF + + runHook postInstall ''; # FIXME: use multiple outputs or return actual JRE package diff --git a/pkgs/development/compilers/temurin-bin/jdk-linux-base.nix b/pkgs/development/compilers/temurin-bin/jdk-linux-base.nix index 9da96aee8d5aa..938889413cc61 100644 --- a/pkgs/development/compilers/temurin-bin/jdk-linux-base.nix +++ b/pkgs/development/compilers/temurin-bin/jdk-linux-base.nix @@ -74,6 +74,8 @@ let dontStrip = 1; installPhase = '' + runHook preInstall + cd .. mv $sourceRoot $out @@ -109,6 +111,8 @@ let wrapProgram "$bin" --prefix LD_LIBRARY_PATH : "${runtimeLibraryPath}" fi done + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/compilers/terra/default.nix b/pkgs/development/compilers/terra/default.nix index 1d50d6e23ddbe..e15a70e57dfaf 100644 --- a/pkgs/development/compilers/terra/default.nix +++ b/pkgs/development/compilers/terra/default.nix @@ -83,12 +83,16 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 -t $bin/bin bin/terra install -Dm755 -t $out/lib lib/terra${stdenv.hostPlatform.extensions.sharedLibrary} install -Dm644 -t $static/lib lib/libterra_s.a mkdir -pv $dev/include cp -rv include/terra $dev/include + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/unison/default.nix b/pkgs/development/compilers/unison/default.nix index f6d544aef96a4..f5d677945dd1c 100644 --- a/pkgs/development/compilers/unison/default.nix +++ b/pkgs/development/compilers/unison/default.nix @@ -36,6 +36,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = lib.optionals (!stdenv.isDarwin) [ gmp ncurses6 zlib ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib} mv runtime $out/lib/runtime mv ui $out/ui @@ -45,6 +47,8 @@ stdenv.mkDerivation (finalAttrs: { --prefix PATH ":" "${lib.makeBinPath [ less ]}" \ --add-flags "--runtime-path $out/lib/runtime/bin/unison-runtime" \ --set UCM_WEB_UI "$out/ui" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/urn/default.nix b/pkgs/development/compilers/urn/default.nix index 87e28d9672dae..78127ba54b30a 100644 --- a/pkgs/development/compilers/urn/default.nix +++ b/pkgs/development/compilers/urn/default.nix @@ -39,6 +39,8 @@ stdenv.mkDerivation { makeFlags = ["-B"]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib install -m 0755 bin/urn.lua $out/bin/urn cp -r lib $out/lib/urn @@ -47,6 +49,8 @@ stdenv.mkDerivation { --add-flags "${concatMapStringsSep " " (x: "-i ${x.libraryPath}") extraLibraries}" \ --prefix PATH : ${urn-rt}/bin/ \ --prefix LD_LIBRARY_PATH : ${urn-rt}/lib/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/wla-dx/default.nix b/pkgs/development/compilers/wla-dx/default.nix index b80b460d4def2..97811c1be0565 100644 --- a/pkgs/development/compilers/wla-dx/default.nix +++ b/pkgs/development/compilers/wla-dx/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin install binaries/* $out/bin + + runHook postInstall ''; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/compilers/yosys/plugins/ghdl.nix b/pkgs/development/compilers/yosys/plugins/ghdl.nix index 2ec17f391a99e..eaac00022bba3 100644 --- a/pkgs/development/compilers/yosys/plugins/ghdl.nix +++ b/pkgs/development/compilers/yosys/plugins/ghdl.nix @@ -33,8 +33,12 @@ stdenv.mkDerivation { doCheck = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/yosys/plugins cp ghdl.so $out/share/yosys/plugins/ghdl.so + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/zasm/default.nix b/pkgs/development/compilers/zasm/default.nix index bd98622edf3fd..76befaa74cac1 100644 --- a/pkgs/development/compilers/zasm/default.nix +++ b/pkgs/development/compilers/zasm/default.nix @@ -37,7 +37,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin zasm + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/compilers/zulu/common.nix b/pkgs/development/compilers/zulu/common.nix index c9056236ea6ad..bcef68aeb7a9a 100644 --- a/pkgs/development/compilers/zulu/common.nix +++ b/pkgs/development/compilers/zulu/common.nix @@ -100,6 +100,8 @@ let ] else null; installPhase = '' + runHook preInstall + mkdir -p $out mv * $out @@ -113,6 +115,8 @@ let install -D $out/LICENSE $out/share/zulu/LICENSE rm $out/LICENSE fi + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/coq-modules/Velisarios/default.nix b/pkgs/development/coq-modules/Velisarios/default.nix index 62eb9c389abbc..b772a95de1416 100644 --- a/pkgs/development/coq-modules/Velisarios/default.nix +++ b/pkgs/development/coq-modules/Velisarios/default.nix @@ -13,7 +13,11 @@ mkCoqDerivation { buildPhase = "make -j$NIX_BUILD_CORES"; preBuild = "./create-makefile.sh"; installPhase = '' + runHook preInstall + mkdir -p $out/lib/coq/${coq.coq-version}/Velisarios cp -pR model/*.vo $out/lib/coq/${coq.coq-version}/Velisarios + + runHook postInstall ''; } diff --git a/pkgs/development/coq-modules/fiat/HEAD.nix b/pkgs/development/coq-modules/fiat/HEAD.nix index 63cc17fbbdd2f..78c42cbcefc8c 100644 --- a/pkgs/development/coq-modules/fiat/HEAD.nix +++ b/pkgs/development/coq-modules/fiat/HEAD.nix @@ -21,9 +21,13 @@ mkCoqDerivation rec { buildPhase = "make -j$NIX_BUILD_CORES"; installPhase = '' + runHook preInstall + COQLIB=$out/lib/coq/${coq.coq-version}/ mkdir -p $COQLIB/user-contrib/Fiat cp -pR src/* $COQLIB/user-contrib/Fiat + + runHook postInstall ''; meta = { diff --git a/pkgs/development/coq-modules/itauto/test.nix b/pkgs/development/coq-modules/itauto/test.nix index ef3a85954e61e..938e954764f85 100644 --- a/pkgs/development/coq-modules/itauto/test.nix +++ b/pkgs/development/coq-modules/itauto/test.nix @@ -23,5 +23,5 @@ stdenv.mkDerivation { done ''; - installPhase = "touch $out"; + installPhase = "runHook preInstall; touch $out; runHook postInstall"; } diff --git a/pkgs/development/coq-modules/mathcomp-analysis/default.nix b/pkgs/development/coq-modules/mathcomp-analysis/default.nix index afbd3bd8046ba..4b9d3d04657c8 100644 --- a/pkgs/development/coq-modules/mathcomp-analysis/default.nix +++ b/pkgs/development/coq-modules/mathcomp-analysis/default.nix @@ -84,7 +84,7 @@ let patched-derivation1 = derivation.overrideAttrs (o: lib.optionalAttrs (o.pname != null && o.pname != "mathcomp-analysis" && o.version != null && o.version != "dev" && lib.versions.isLt "0.6" o.version) - { preBuild = ""; buildPhase = "echo doing nothing"; installPhase = "echo doing nothing"; } + { preBuild = ""; buildPhase = "echo doing nothing"; installPhase = "runHook preInstall; echo doing nothing; runHook postInstall"; } ); patched-derivation2 = patched-derivation1.overrideAttrs (o: lib.optionalAttrs (o.pname != null && o.pname == "mathcomp-analysis" && diff --git a/pkgs/development/coq-modules/mathcomp/default.nix b/pkgs/development/coq-modules/mathcomp/default.nix index f3f20adc72885..c9534bb34fa27 100644 --- a/pkgs/development/coq-modules/mathcomp/default.nix +++ b/pkgs/development/coq-modules/mathcomp/default.nix @@ -123,7 +123,7 @@ let patched-derivation1 = derivation.overrideAttrs (o: lib.optionalAttrs (o.pname != null && o.pname == "mathcomp-all" && o.version != null && o.version != "dev" && lib.versions.isLt "1.7" o.version) - { preBuild = ""; buildPhase = ""; installPhase = "echo doing nothing"; } + { preBuild = ""; buildPhase = ""; installPhase = "runHook preInstall; echo doing nothing; runHook postInstall"; } ); patched-derivation2 = patched-derivation1.overrideAttrs (o: lib.optionalAttrs (lib.versions.isLe "8.7" coq.coq-version || diff --git a/pkgs/development/coq-modules/paco/default.nix b/pkgs/development/coq-modules/paco/default.nix index 80432fa1494ca..32723ee73c3d7 100644 --- a/pkgs/development/coq-modules/paco/default.nix +++ b/pkgs/development/coq-modules/paco/default.nix @@ -21,9 +21,13 @@ mkCoqDerivation { preBuild = "cd src"; installPhase = '' + runHook preInstall + COQLIB=$out/lib/coq/${coq.coq-version}/ mkdir -p $COQLIB/user-contrib/Paco cp -pR *.vo $COQLIB/user-contrib/Paco + + runHook postInstall ''; meta = { diff --git a/pkgs/development/coq-modules/simple-io/test.nix b/pkgs/development/coq-modules/simple-io/test.nix index cd8a29b3f1f77..e085466fa47d5 100644 --- a/pkgs/development/coq-modules/simple-io/test.nix +++ b/pkgs/development/coq-modules/simple-io/test.nix @@ -16,6 +16,6 @@ stdenv.mkDerivation { done ''; - installPhase = "touch $out"; + installPhase = "runHook preInstall; touch $out; runHook postInstall"; } diff --git a/pkgs/development/cuda-modules/nccl-tests/default.nix b/pkgs/development/cuda-modules/nccl-tests/default.nix index 10dd488abbaf1..66fdbe0cc2a1a 100644 --- a/pkgs/development/cuda-modules/nccl-tests/default.nix +++ b/pkgs/development/cuda-modules/nccl-tests/default.nix @@ -62,8 +62,12 @@ backendStdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r build/* $out/bin/ + + runHook postInstall ''; passthru.updateScript = gitUpdater { diff --git a/pkgs/development/embedded/arduino/arduino-core/default.nix b/pkgs/development/embedded/arduino/arduino-core/default.nix index 43e6292143a4a..5a03289a19a4f 100644 --- a/pkgs/development/embedded/arduino/arduino-core/default.nix +++ b/pkgs/development/embedded/arduino/arduino-core/default.nix @@ -158,6 +158,8 @@ stdenv.mkDerivation rec { rpath = lib.makeLibraryPath [ zlib libusb-compat-0_1 libusb1 readline ncurses5 stdenv.cc.cc ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/arduino cp -r ./build/linux/work/* "$out/share/arduino/" echo -n ${version} > $out/share/arduino/lib/version.txt @@ -205,6 +207,8 @@ stdenv.mkDerivation rec { mv $out/share/arduino/lib/arduino-core.jar.bak $out/share/arduino/lib/arduino-core.jar mv $out/share/arduino/lib/pde.jar.bak $out/share/arduino/lib/pde.jar ''} + + runHook postInstall ''; # So we don't accidentally mess with firmware files diff --git a/pkgs/development/embedded/arduino/arduino-mk/default.nix b/pkgs/development/embedded/arduino/arduino-mk/default.nix index d5f506038ca6c..755d25b8ab710 100644 --- a/pkgs/development/embedded/arduino/arduino-mk/default.nix +++ b/pkgs/development/embedded/arduino/arduino-mk/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ python3Packages.wrapPython installShellFiles ]; propagatedBuildInputs = with python3Packages; [ pyserial ]; installPhase = '' + runHook preInstall + mkdir $out cp -rT $src $out installManPage *.1 + + runHook postInstall ''; postFixupPhase = '' wrapPythonPrograms diff --git a/pkgs/development/embedded/bossa/default.nix b/pkgs/development/embedded/bossa/default.nix index 3f55ccdd2e8b2..5b8b8ba0edde1 100644 --- a/pkgs/development/embedded/bossa/default.nix +++ b/pkgs/development/embedded/bossa/default.nix @@ -17,7 +17,7 @@ let src = ./bin2c.c; dontUnpack = true; buildPhase = "cc $src -o bin2c"; - installPhase = "mkdir -p $out/bin; cp bin2c $out/bin/"; + installPhase = "runHook preInstall; mkdir -p $out/bin; cp bin2c $out/bin/; runHook postInstall"; }; in @@ -65,8 +65,12 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bin/bossa{c,sh,} $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/embedded/easypdkprog/default.nix b/pkgs/development/embedded/easypdkprog/default.nix index 28f06db9f35d5..7e7e9198e0a3a 100644 --- a/pkgs/development/embedded/easypdkprog/default.nix +++ b/pkgs/development/embedded/easypdkprog/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin easypdkprog '' + lib.optionalString stdenv.isLinux '' install -Dm644 -t $out/etc/udev/rules.d Linux_udevrules/70-stm32vcp.rules + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/embedded/stm32/stm32flash/default.nix b/pkgs/development/embedded/stm32/stm32flash/default.nix index fd9703fed4cf8..d54ebe3965154 100644 --- a/pkgs/development/embedded/stm32/stm32flash/default.nix +++ b/pkgs/development/embedded/stm32/stm32flash/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { buildFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; installPhase = '' + runHook preInstall + # Manually copy, make install copies to /usr/local/bin mkdir -pv $out/bin/ cp stm32flash $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/interpreters/acl2/default.nix b/pkgs/development/interpreters/acl2/default.nix index 12fc8f228b7ff..fc1bb07424fce 100644 --- a/pkgs/development/interpreters/acl2/default.nix +++ b/pkgs/development/interpreters/acl2/default.nix @@ -83,11 +83,15 @@ in stdenv.mkDerivation rec { checkTarget = "mini-proveall"; installPhase = '' + runHook preInstall + mkdir -p $out/bin ln -s $out/share/${pname}/saved_acl2 $out/bin/${pname} '' + lib.optionalString certifyBooks '' ln -s $out/share/${pname}/books/build/cert.pl $out/bin/${pname}-cert ln -s $out/share/${pname}/books/build/clean.pl $out/bin/${pname}-clean + + runHook postInstall ''; preDistPhases = [ (if certifyBooks then "certifyBooksPhase" else "removeBooksPhase") ]; diff --git a/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix b/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix index e59d2ed7c176a..a2b6e6287d458 100644 --- a/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix +++ b/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix @@ -29,7 +29,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D ${libname} $out/lib/${libname} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/interpreters/alda/default.nix b/pkgs/development/interpreters/alda/default.nix index f9711c16a5731..7b39ad61612a1 100644 --- a/pkgs/development/interpreters/alda/default.nix +++ b/pkgs/development/interpreters/alda/default.nix @@ -23,11 +23,15 @@ stdenv.mkDerivation rec { binPath = lib.makeBinPath [ jre ]; in '' + runHook preInstall + install -D $src_alda $out/bin/alda install -D $src_player $out/bin/alda-player wrapProgram $out/bin/alda --prefix PATH : $out/bin:${binPath} wrapProgram $out/bin/alda-player --prefix PATH : $out/bin:${binPath} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/interpreters/babashka/wrapped.nix b/pkgs/development/interpreters/babashka/wrapped.nix index 04be9bfd477af..70c287c36da68 100644 --- a/pkgs/development/interpreters/babashka/wrapped.nix +++ b/pkgs/development/interpreters/babashka/wrapped.nix @@ -29,6 +29,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { installPhase = let unwrapped-bin = "${babashka-unwrapped}/bin/bb"; in '' + runHook preInstall + mkdir -p $out/clojure_tools ln -s -t $out/clojure_tools ${clojureToolsBabashka}/*.edn ln -s -t $out/clojure_tools ${clojureToolsBabashka}/libexec/* @@ -45,6 +47,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { lib.optionalString withRlwrap '' substituteInPlace $out/bin/bb \ --replace '"${unwrapped-bin}"' '"${rlwrap}/bin/rlwrap" "${unwrapped-bin}"' + + runHook postInstall ''; installCheckPhase = '' diff --git a/pkgs/development/interpreters/bats/default.nix b/pkgs/development/interpreters/bats/default.nix index 17d22a14cae56..46644fc6de2fc 100644 --- a/pkgs/development/interpreters/bats/default.nix +++ b/pkgs/development/interpreters/bats/default.nix @@ -41,7 +41,11 @@ resholve.mkDerivation rec { ''; installPhase = '' + runHook preInstall + ./install.sh $out + + runHook postInstall ''; solutions = { diff --git a/pkgs/development/interpreters/ceptre/default.nix b/pkgs/development/interpreters/ceptre/default.nix index f73631ff8d3b7..90a3ef46793a8 100644 --- a/pkgs/development/interpreters/ceptre/default.nix +++ b/pkgs/development/interpreters/ceptre/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation { nativeBuildInputs = [ mlton ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ceptre $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/interpreters/chibi/default.nix b/pkgs/development/interpreters/chibi/default.nix index b220ed834029e..90f9e79b66826 100644 --- a/pkgs/development/interpreters/chibi/default.nix +++ b/pkgs/development/interpreters/chibi/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + make install PREFIX="$out" + + runHook postInstall ''; fixupPhase = '' diff --git a/pkgs/development/interpreters/clojure/clooj.nix b/pkgs/development/interpreters/clojure/clooj.nix index 45659d5633691..389321b4adc18 100644 --- a/pkgs/development/interpreters/clojure/clooj.nix +++ b/pkgs/development/interpreters/clojure/clooj.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/java ln -s $jar $out/share/java/clooj.jar makeWrapper ${jre}/bin/java $out/bin/clooj --add-flags "-jar $out/share/java/clooj.jar" + + runHook postInstall ''; meta = { diff --git a/pkgs/development/interpreters/duktape/default.nix b/pkgs/development/interpreters/duktape/default.nix index 8e33a5013ff54..aeb9657b7f334 100644 --- a/pkgs/development/interpreters/duktape/default.nix +++ b/pkgs/development/interpreters/duktape/default.nix @@ -20,12 +20,16 @@ stdenv.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + install -d $out/bin install -m755 duk $out/bin/ install -d $out/lib/pkgconfig install -d $out/include make -f Makefile.sharedlibrary install INSTALL_PREFIX=$out substituteAll ${./duktape.pc.in} $out/lib/pkgconfig/duktape.pc + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/development/interpreters/groovy/default.nix b/pkgs/development/interpreters/groovy/default.nix index 8ed9bfe117366..fa704eef0d7d1 100644 --- a/pkgs/development/interpreters/groovy/default.nix +++ b/pkgs/development/interpreters/groovy/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out mkdir -p $out/share/doc/groovy rm bin/*.bat @@ -27,6 +29,8 @@ stdenv.mkDerivation rec { --set JAVA_HOME "${jdk}" \ --prefix PATH ":" "${jdk}/bin" done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/interpreters/icon-lang/default.nix b/pkgs/development/interpreters/icon-lang/default.nix index e5c486ed8de20..576bceb4c0c17 100644 --- a/pkgs/development/interpreters/icon-lang/default.nix +++ b/pkgs/development/interpreters/icon-lang/default.nix @@ -31,10 +31,14 @@ stdenv.mkDerivation rec { "make ${target} name=${platform}"; installPhase = '' + runHook preInstall + make Install dest=$out rm $out/README mkdir -p $out/share/doc mv $out/doc $out/share/doc/icon + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/interpreters/jruby/default.nix b/pkgs/development/interpreters/jruby/default.nix index b681109e0bc32..82aea3d500298 100644 --- a/pkgs/development/interpreters/jruby/default.nix +++ b/pkgs/development/interpreters/jruby/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ makeBinaryWrapper ]; installPhase = '' + runHook preInstall + mkdir -pv $out/share/jruby/docs mv * $out rm $out/bin/*.{bat,dll,exe,sh} @@ -39,6 +41,8 @@ stdenv.mkDerivation (finalAttrs: { addEnvHooks "$hostOffset" addGemPath EOF + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/development/interpreters/jython/default.nix b/pkgs/development/interpreters/jython/default.nix index 157ad76e6f8a5..c2ab51e4546a8 100644 --- a/pkgs/development/interpreters/jython/default.nix +++ b/pkgs/development/interpreters/jython/default.nix @@ -15,10 +15,14 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -pv $out/bin cp $src $out/jython.jar makeWrapper ${jre}/bin/java $out/bin/jython --add-flags "-jar $out/jython.jar" - ''; + + runHook postInstall + ''; meta = { description = "Python interpreter written in Java"; diff --git a/pkgs/development/interpreters/kamilalisp/default.nix b/pkgs/development/interpreters/kamilalisp/default.nix index 5b4d392d62f75..f677beae71f9b 100644 --- a/pkgs/development/interpreters/kamilalisp/default.nix +++ b/pkgs/development/interpreters/kamilalisp/default.nix @@ -19,12 +19,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -pv $out/share/java $out/bin cp ${src} $out/share/java/kamilalisp-${version}.jar makeWrapper ${jre}/bin/java $out/bin/kamilalisp \ --add-flags "-jar $out/share/java/kamilalisp-${version}.jar" \ --set _JAVA_OPTIONS '-Dawt.useSystemAAFontSettings=on' \ --set _JAVA_AWT_WM_NONREPARENTING 1 + + runHook postInstall ''; meta = { diff --git a/pkgs/development/interpreters/kerf/default.nix b/pkgs/development/interpreters/kerf/default.nix index d019743bfb4d0..8b4d5fd852180 100644 --- a/pkgs/development/interpreters/kerf/default.nix +++ b/pkgs/development/interpreters/kerf/default.nix @@ -70,7 +70,7 @@ stdenv.mkDerivation rec { EOD ''; - installPhase = "install -D kerf $out/bin/kerf"; + installPhase = "runHook preInstall; install -D kerf $out/bin/kerf; runHook postInstall"; meta = with lib; { description = "Columnar tick database and time-series language"; diff --git a/pkgs/development/interpreters/picolisp/default.nix b/pkgs/development/interpreters/picolisp/default.nix index c751746ec645f..f37bf20c9311c 100644 --- a/pkgs/development/interpreters/picolisp/default.nix +++ b/pkgs/development/interpreters/picolisp/default.nix @@ -28,6 +28,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + cd .. mkdir -p "$out/lib" "$out/bin" "$out/man" cp -r . "$out/lib/picolisp/" @@ -36,6 +38,8 @@ stdenv.mkDerivation { ln -s "$out/lib/picolisp/man/man1/pil.1" "$out/man/pil.1" ln -s "$out/lib/picolisp/man/man1/picolisp.1" "$out/man/picolisp.1" substituteInPlace $out/bin/pil --replace /usr $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/interpreters/python/cpython/docs/2.7-html.nix b/pkgs/development/interpreters/python/cpython/docs/2.7-html.nix index ab712cb734ea5..f82220a22cca2 100644 --- a/pkgs/development/interpreters/python/cpython/docs/2.7-html.nix +++ b/pkgs/development/interpreters/python/cpython/docs/2.7-html.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { sha256 = "03igxwpqc2lvzspnj78zz1prnmfwwj00jbvh1wsxvb0wayd5wi10"; }; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc/python27 cp -R ./ $out/share/doc/python27/html + + runHook postInstall ''; meta = { maintainers = [ ]; diff --git a/pkgs/development/interpreters/python/cpython/docs/2.7-pdf-a4.nix b/pkgs/development/interpreters/python/cpython/docs/2.7-pdf-a4.nix index 0ae044db37c93..0499f175b0e7e 100644 --- a/pkgs/development/interpreters/python/cpython/docs/2.7-pdf-a4.nix +++ b/pkgs/development/interpreters/python/cpython/docs/2.7-pdf-a4.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { sha256 = "0rxb2fpxwivjpk5wi2pl1fqibr4khf9s0yq6a49k9b4awi9nkb6v"; }; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc/python27 cp -R ./ $out/share/doc/python27/pdf-a4 + + runHook postInstall ''; meta = { maintainers = [ ]; diff --git a/pkgs/development/interpreters/python/cpython/docs/2.7-pdf-letter.nix b/pkgs/development/interpreters/python/cpython/docs/2.7-pdf-letter.nix index 85593000d421e..e72c09107d286 100644 --- a/pkgs/development/interpreters/python/cpython/docs/2.7-pdf-letter.nix +++ b/pkgs/development/interpreters/python/cpython/docs/2.7-pdf-letter.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { sha256 = "07hbqvrdlq01cb95r1574bxqqhiqbkj4f92wzlq4d6dq1l272nan"; }; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc/python27 cp -R ./ $out/share/doc/python27/pdf-letter + + runHook postInstall ''; meta = { maintainers = [ ]; diff --git a/pkgs/development/interpreters/python/cpython/docs/2.7-text.nix b/pkgs/development/interpreters/python/cpython/docs/2.7-text.nix index 24a22dd146752..f542a564f1c95 100644 --- a/pkgs/development/interpreters/python/cpython/docs/2.7-text.nix +++ b/pkgs/development/interpreters/python/cpython/docs/2.7-text.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { sha256 = "1wj7mxs52kp5lmn5mvv574sygkfnk00kbz9ya9c03yfq5dd5nvy8"; }; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc/python27 cp -R ./ $out/share/doc/python27/text + + runHook postInstall ''; meta = { maintainers = [ ]; diff --git a/pkgs/development/interpreters/python/cpython/docs/3.10-html.nix b/pkgs/development/interpreters/python/cpython/docs/3.10-html.nix index 0cbe633c63b10..9137b39c70550 100644 --- a/pkgs/development/interpreters/python/cpython/docs/3.10-html.nix +++ b/pkgs/development/interpreters/python/cpython/docs/3.10-html.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { sha256 = "0j86z1vmaghzj5i4frvzyfb9qwsmm09g4f4ssx5w27cm30b8k0v1"; }; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc/python310 cp -R ./ $out/share/doc/python310/html + + runHook postInstall ''; meta = { maintainers = [ ]; diff --git a/pkgs/development/interpreters/python/cpython/docs/3.10-pdf-a4.nix b/pkgs/development/interpreters/python/cpython/docs/3.10-pdf-a4.nix index bb98fdffb0056..6b39a5d3e3560 100644 --- a/pkgs/development/interpreters/python/cpython/docs/3.10-pdf-a4.nix +++ b/pkgs/development/interpreters/python/cpython/docs/3.10-pdf-a4.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { sha256 = "1gvi457dsj3ywwvxysp7idkk9ndngnby1dnfh1q8f5gv3kg4093r"; }; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc/python310 cp -R ./ $out/share/doc/python310/pdf-a4 + + runHook postInstall ''; meta = { maintainers = [ ]; diff --git a/pkgs/development/interpreters/python/cpython/docs/3.10-pdf-letter.nix b/pkgs/development/interpreters/python/cpython/docs/3.10-pdf-letter.nix index 8bd6298fe1512..5b482038f0b69 100644 --- a/pkgs/development/interpreters/python/cpython/docs/3.10-pdf-letter.nix +++ b/pkgs/development/interpreters/python/cpython/docs/3.10-pdf-letter.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { sha256 = "0hzq5n6absqsh21jp6j5iaim9a1wq69d8lc2assldzb2zg4i75hr"; }; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc/python310 cp -R ./ $out/share/doc/python310/pdf-letter + + runHook postInstall ''; meta = { maintainers = [ ]; diff --git a/pkgs/development/interpreters/python/cpython/docs/3.10-texinfo.nix b/pkgs/development/interpreters/python/cpython/docs/3.10-texinfo.nix index 35664e17cd685..749817a32f5f7 100644 --- a/pkgs/development/interpreters/python/cpython/docs/3.10-texinfo.nix +++ b/pkgs/development/interpreters/python/cpython/docs/3.10-texinfo.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { sha256 = "0p0fifi84ijz4ng6krw7c1x965jhgysprkijblmlnax7x9rmqrdf"; }; installPhase = '' + runHook preInstall + mkdir -p $out/share/info cp ./python.info $out/share/info + + runHook postInstall ''; meta = { maintainers = [ ]; diff --git a/pkgs/development/interpreters/python/cpython/docs/3.10-text.nix b/pkgs/development/interpreters/python/cpython/docs/3.10-text.nix index eec0bf140961a..26d7b3fad3566 100644 --- a/pkgs/development/interpreters/python/cpython/docs/3.10-text.nix +++ b/pkgs/development/interpreters/python/cpython/docs/3.10-text.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { sha256 = "1zbmm2fvdjnl214y41yffyqw3ywfai5r5npc00n1wkfxsdp7gcc3"; }; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc/python310 cp -R ./ $out/share/doc/python310/text + + runHook postInstall ''; meta = { maintainers = [ ]; diff --git a/pkgs/development/interpreters/python/cpython/docs/template-info.nix b/pkgs/development/interpreters/python/cpython/docs/template-info.nix index f1551e1f61eff..c8f2acbab3eb7 100644 --- a/pkgs/development/interpreters/python/cpython/docs/template-info.nix +++ b/pkgs/development/interpreters/python/cpython/docs/template-info.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { sha256 = "SHA"; }; installPhase = '' + runHook preInstall + mkdir -p $out/share/info cp ./python.info $out/share/info + + runHook postInstall ''; meta = { maintainers = [ ]; diff --git a/pkgs/development/interpreters/python/cpython/docs/template.nix b/pkgs/development/interpreters/python/cpython/docs/template.nix index adf64ddd62244..20d44fa3bbed2 100644 --- a/pkgs/development/interpreters/python/cpython/docs/template.nix +++ b/pkgs/development/interpreters/python/cpython/docs/template.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { sha256 = "SHA"; }; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc/pythonMAJORMINOR cp -R ./ $out/share/doc/pythonMAJORMINOR/TYPE + + runHook postInstall ''; meta = { maintainers = [ ]; diff --git a/pkgs/development/interpreters/rascal/default.nix b/pkgs/development/interpreters/rascal/default.nix index 50bfb7e54d63c..68e5c2fd7e5f6 100644 --- a/pkgs/development/interpreters/rascal/default.nix +++ b/pkgs/development/interpreters/rascal/default.nix @@ -16,9 +16,13 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + mkdir -p $out/bin makeWrapper ${jdk}/bin/java $out/bin/rascal \ --add-flags "-jar ${src}" \ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/interpreters/red/default.nix b/pkgs/development/interpreters/red/default.nix index 676ecb721cc41..2d3ebf2553883 100644 --- a/pkgs/development/interpreters/red/default.nix +++ b/pkgs/development/interpreters/red/default.nix @@ -46,6 +46,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir $out # Install @@ -75,6 +77,7 @@ stdenv.mkDerivation rec { patchelf --set-rpath ${pkgsi686Linux.curl.out}/lib \ $out/bin/red + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/interpreters/shen-sbcl/default.nix b/pkgs/development/interpreters/shen-sbcl/default.nix index 538f5e7f13565..baa09da303719 100644 --- a/pkgs/development/interpreters/shen-sbcl/default.nix +++ b/pkgs/development/interpreters/shen-sbcl/default.nix @@ -27,7 +27,11 @@ stdenv.mkDerivation rec { doCheck = true; installPhase = '' + runHook preInstall + install -m755 -D bin/sbcl/shen $out/bin/shen-sbcl + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/interpreters/shen-sources/default.nix b/pkgs/development/interpreters/shen-sources/default.nix index 99e72fbea1128..bfa7066566c37 100644 --- a/pkgs/development/interpreters/shen-sources/default.nix +++ b/pkgs/development/interpreters/shen-sources/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out cp . $out -R + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/interpreters/tinyscheme/default.nix b/pkgs/development/interpreters/tinyscheme/default.nix index e22f74c405992..3040ede12e692 100644 --- a/pkgs/development/interpreters/tinyscheme/default.nix +++ b/pkgs/development/interpreters/tinyscheme/default.nix @@ -38,10 +38,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib cp init.scm $out/lib cp libtinyscheme* $out/lib cp scheme $out/bin/tinyscheme + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/development/interpreters/unicon-lang/default.nix b/pkgs/development/interpreters/unicon-lang/default.nix index f0a45495d70dc..b60cdfcb776c7 100644 --- a/pkgs/development/interpreters/unicon-lang/default.nix +++ b/pkgs/development/interpreters/unicon-lang/default.nix @@ -37,8 +37,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/ cp -r bin $out/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/julia-modules/python/extract_artifacts.py b/pkgs/development/julia-modules/python/extract_artifacts.py index 4ac450d88a106..e971b3bbb995c 100755 --- a/pkgs/development/julia-modules/python/extract_artifacts.py +++ b/pkgs/development/julia-modules/python/extract_artifacts.py @@ -86,7 +86,7 @@ def get_archive_derivation(uuid, artifact_name, url, sha256): sourceRoot = "."; dontConfigure = true; dontBuild = true; - installPhase = "cp -r . $out"; + installPhase = "runHook preInstall; cp -r . $out; runHook postInstall"; {fixup}; }}""" diff --git a/pkgs/development/libraries/AntTweakBar/default.nix b/pkgs/development/libraries/AntTweakBar/default.nix index 6c1eeff941189..95232a7656cd9 100644 --- a/pkgs/development/libraries/AntTweakBar/default.nix +++ b/pkgs/development/libraries/AntTweakBar/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { postPatch = "cd src"; installPhase = '' + runHook preInstall + mkdir -p $out/lib/ cp ../lib/{libAntTweakBar.so,libAntTweakBar.so.1,libAntTweakBar.a} $out/lib/ cp -r ../include $out/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/adslib/default.nix b/pkgs/development/libraries/adslib/default.nix index 49b54960b7e68..0299d8c1ab6e3 100644 --- a/pkgs/development/libraries/adslib/default.nix +++ b/pkgs/development/libraries/adslib/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/lib cp adslib.so $out/lib/adslib.so + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/amf-headers/default.nix b/pkgs/development/libraries/amf-headers/default.nix index 04f2e6c1385b7..f6055de33a16b 100644 --- a/pkgs/development/libraries/amf-headers/default.nix +++ b/pkgs/development/libraries/amf-headers/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/include/AMF cp -r amf/public/include/* $out/include/AMF + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/apache-activemq/default.nix b/pkgs/development/libraries/apache-activemq/default.nix index 5543c12ac9ede..bc9f64e7a429c 100644 --- a/pkgs/development/libraries/apache-activemq/default.nix +++ b/pkgs/development/libraries/apache-activemq/default.nix @@ -10,12 +10,16 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out mv * $out/ for j in `find $out/lib -name "*.jar"`; do cp="''${cp:+"$cp:"}$j"; done echo "CLASSPATH=$cp" > $out/lib/classpath.env + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/aspell/dictionaries.nix b/pkgs/development/libraries/aspell/dictionaries.nix index 60f11fd23d84c..d23132e4ab8fc 100644 --- a/pkgs/development/libraries/aspell/dictionaries.nix +++ b/pkgs/development/libraries/aspell/dictionaries.nix @@ -1054,7 +1054,7 @@ in rec { cat $src | aspell-affix en-computers --dont-validate-words --lang=en runHook postBuild ''; - installPhase = "aspell-install en-computers"; + installPhase = "runHook preInstall; aspell-install en-computers; runHook postInstall"; meta = { homepage = "https://mrsatterly.com/spelling.html"; @@ -1084,7 +1084,7 @@ in rec { cat $src2 | aspell-plain en_GB-science --dont-validate-words --lang=en runHook postBuild ''; - installPhase = "aspell-install en_US-science en_GB-science"; + installPhase = "runHook preInstall; aspell-install en_US-science en_GB-science; runHook postInstall"; meta = { homepage = "https://web.archive.org/web/20210425104207/http://www.jpetrie.net/scientific-word-list-for-spell-checkersspelling-dictionaries/"; diff --git a/pkgs/development/libraries/audio/libbass/default.nix b/pkgs/development/libraries/audio/libbass/default.nix index a8648a1a1c7bb..1e2985d14695b 100644 --- a/pkgs/development/libraries/audio/libbass/default.nix +++ b/pkgs/development/libraries/audio/libbass/default.nix @@ -50,9 +50,13 @@ let if bass.so ? ${stdenv.hostPlatform.system} then bass.so.${stdenv.hostPlatform.system} else throw "${name} not packaged for ${stdenv.hostPlatform.system} (yet)."; in '' + runHook preInstall + mkdir -p $out/{lib,include} install -m644 -t $out/lib/ ${so} install -m644 -t $out/include/ ${bass.h} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix b/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix index 64113993f1eaa..b6e237357da85 100644 --- a/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix +++ b/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir "$out" mkdir "$out/lib" mkdir "$out/include" @@ -51,6 +53,8 @@ stdenv.mkDerivation rec { "$out/bin/alsa_delay" install -Dm755 ../apps/alsa_loopback \ "$out/bin/alsa_loopback" + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/bash/bash-preexec/default.nix b/pkgs/development/libraries/bash/bash-preexec/default.nix index 166b73b1daf6c..1b6f07a51d90d 100644 --- a/pkgs/development/libraries/bash/bash-preexec/default.nix +++ b/pkgs/development/libraries/bash/bash-preexec/default.nix @@ -32,7 +32,11 @@ in stdenvNoCC.mkDerivation { ''; installPhase = '' + runHook preInstall + install -Dm755 $src/bash-preexec.sh $out/share/bash/bash-preexec.sh + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/bootil/default.nix b/pkgs/development/libraries/bootil/default.nix index dab559afdace4..a6769817601ea 100644 --- a/pkgs/development/libraries/bootil/default.nix +++ b/pkgs/development/libraries/bootil/default.nix @@ -28,8 +28,12 @@ stdenv.mkDerivation { premakefile = "projects/premake4.lua"; installPhase = '' + runHook preInstall + install -D libbootil_static.a $out/lib/libbootil_static.a cp -r include $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/boringssl/default.nix b/pkgs/development/libraries/boringssl/default.nix index 9bb0967bd5c6e..44bf457c55d51 100644 --- a/pkgs/development/libraries/boringssl/default.nix +++ b/pkgs/development/libraries/boringssl/default.nix @@ -44,6 +44,8 @@ buildGoModule { cmakeFlags = [ "-GNinja" ] ++ lib.optionals (stdenv.isLinux) [ "-DCMAKE_OSX_ARCHITECTURES=" ]; installPhase = '' + runHook preInstall + mkdir -p $bin/bin $dev $out/lib mv tool/bssl $bin/bin @@ -53,6 +55,8 @@ buildGoModule { mv decrepit/libdecrepit.a $out/lib mv ../include $dev + + runHook postInstall ''; outputs = [ "out" "bin" "dev" ]; diff --git a/pkgs/development/libraries/bulletml/default.nix b/pkgs/development/libraries/bulletml/default.nix index 8d562b58e24af..bd72f05d97640 100644 --- a/pkgs/development/libraries/bulletml/default.nix +++ b/pkgs/development/libraries/bulletml/default.nix @@ -45,6 +45,8 @@ stdenv.mkDerivation { hardeningDisable = [ "format" ]; installPhase = '' + runHook preInstall + install -D -m 644 src/bulletml.d "$out"/include/d/bulletml.d install -d "$out"/include/bulletml/tinyxml install -m 644 src/*.h "$out"/include/bulletml @@ -59,6 +61,8 @@ stdenv.mkDerivation { install -m 644 README.bulletml "$out"/share/doc/libbulletml install -D -m 644 README "$out"/share/licenses/libbulletml/README.jp install -m 644 README.en "$out"/share/licenses/libbulletml + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/bwidget/default.nix b/pkgs/development/libraries/bwidget/default.nix index 9c1b8ac81cf08..5494ebe524b8d 100644 --- a/pkgs/development/libraries/bwidget/default.nix +++ b/pkgs/development/libraries/bwidget/default.nix @@ -13,8 +13,12 @@ tcl.mkTclDerivation rec { propagatedBuildInputs = [ tk ]; installPhase = '' + runHook preInstall + mkdir -p "$out/lib/bwidget${version}" cp -R *.tcl lang images "$out/lib/bwidget${version}" + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/cl/default.nix b/pkgs/development/libraries/cl/default.nix index 1f98635f15ddc..cc30beec51624 100644 --- a/pkgs/development/libraries/cl/default.nix +++ b/pkgs/development/libraries/cl/default.nix @@ -26,9 +26,13 @@ stdenv.mkDerivation rec { # 'cp' line taken from Arch recipe # https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/erlang-sdl installPhase = '' + runHook preInstall + DIR=$out/lib/erlang/lib/${pname}-${version} mkdir -p $DIR cp -ruv c_src doc ebin include priv src $DIR + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/clipp/default.nix b/pkgs/development/libraries/clipp/default.nix index 12b393e597d40..fe453818b82a0 100644 --- a/pkgs/development/libraries/clipp/default.nix +++ b/pkgs/development/libraries/clipp/default.nix @@ -12,12 +12,16 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/pkgconfig cp -r include $out/ substitute ${./clipp.pc} $out/share/pkgconfig/clipp.pc \ --subst-var out \ --subst-var pname \ --subst-var version + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/cutee/default.nix b/pkgs/development/libraries/cutee/default.nix index eb5f51cbcfeb4..3112db2e32710 100644 --- a/pkgs/development/libraries/cutee/default.nix +++ b/pkgs/development/libraries/cutee/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { buildFlags = [ "cutee" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp cutee $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/cxx-prettyprint/default.nix b/pkgs/development/libraries/cxx-prettyprint/default.nix index f632fca714cf5..b74767e48f6cc 100644 --- a/pkgs/development/libraries/cxx-prettyprint/default.nix +++ b/pkgs/development/libraries/cxx-prettyprint/default.nix @@ -13,8 +13,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out/include" cp prettyprint.hpp "$out/include" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/dclxvi/default.nix b/pkgs/development/libraries/dclxvi/default.nix index ac2664a1c9f99..3eddfc3e069d4 100644 --- a/pkgs/development/libraries/dclxvi/default.nix +++ b/pkgs/development/libraries/dclxvi/default.nix @@ -22,9 +22,13 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/{include,lib} find . -name \*.h -exec cp {} $out/include \; find . -name \*.so -exec cp {} $out/lib \; + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/dxflib/default.nix b/pkgs/development/libraries/dxflib/default.nix index a90820c02cb9f..4bdabec03be7f 100644 --- a/pkgs/development/libraries/dxflib/default.nix +++ b/pkgs/development/libraries/dxflib/default.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation rec { sed -i 's/CONFIG += staticlib/CONFIG += shared/' dxflib.pro ''; installPhase = '' + runHook preInstall + install -d -m 0755 $out/lib cp -pr *${stdenv.hostPlatform.extensions.sharedLibrary}* $out/lib install -d -m 0755 $out/include/dxflib @@ -35,6 +37,8 @@ stdenv.mkDerivation rec { Libs: -L${placeholder "out"}/lib -ldxflib Cflags: -I${placeholder "out"}/include/dxflib EOF + + runHook postInstall ''; doCheck = true; diff --git a/pkgs/development/libraries/elf-header/default.nix b/pkgs/development/libraries/elf-header/default.nix index 4953251d4af6d..1b92d0df32fec 100644 --- a/pkgs/development/libraries/elf-header/default.nix +++ b/pkgs/development/libraries/elf-header/default.nix @@ -22,6 +22,8 @@ stdenvNoCC.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p "$out/include"; tar -xf \ ${lib.escapeShellArg libc.src} \ @@ -29,6 +31,8 @@ stdenvNoCC.mkDerivation { --to-stdout \ | sed -e '/features\.h/d' \ > "$out/include/elf.h" + + runHook postInstall ''; meta = libc.meta // { diff --git a/pkgs/development/libraries/fast-cpp-csv-parser/default.nix b/pkgs/development/libraries/fast-cpp-csv-parser/default.nix index a30aacee26e5d..853df03ef150f 100644 --- a/pkgs/development/libraries/fast-cpp-csv-parser/default.nix +++ b/pkgs/development/libraries/fast-cpp-csv-parser/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/lib/pkgconfig $out/include cp -r *.h $out/include/ substituteAll ${./fast-cpp-csv-parser.pc.in} $out/lib/pkgconfig/fast-cpp-csv-parser.pc + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/fastpbkdf2/default.nix b/pkgs/development/libraries/fastpbkdf2/default.nix index 226d4d1a9e11a..0f185360dc355 100644 --- a/pkgs/development/libraries/fastpbkdf2/default.nix +++ b/pkgs/development/libraries/fastpbkdf2/default.nix @@ -18,9 +18,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/{lib,include/fastpbkdf2} cp *.a $out/lib cp fastpbkdf2.h $out/include/fastpbkdf2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/genann/default.nix b/pkgs/development/libraries/genann/default.nix index 3f79b7ecfc2b0..64937effbd072 100644 --- a/pkgs/development/libraries/genann/default.nix +++ b/pkgs/development/libraries/genann/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/include cp ./genann.{h,c} $out/include + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/glfw/2.x.nix b/pkgs/development/libraries/glfw/2.x.nix index 545e7a418a5f5..efa9e3b21393c 100644 --- a/pkgs/development/libraries/glfw/2.x.nix +++ b/pkgs/development/libraries/glfw/2.x.nix @@ -16,10 +16,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out make x11-dist-install PREFIX=$out mv $out/lib/libglfw.so $out/lib/libglfw.so.2 ln -s libglfw.so.2 $out/lib/libglfw.so + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/glibc/info.nix b/pkgs/development/libraries/glibc/info.nix index d643d8a6ba09f..e503fb8ec466b 100644 --- a/pkgs/development/libraries/glibc/info.nix +++ b/pkgs/development/libraries/glibc/info.nix @@ -15,8 +15,12 @@ callPackage ./common.nix {} { # Somehow building the info still does not work, because the final # libc.info hasn't a Top node. installPhase = '' + runHook preInstall + mkdir -p "$out/share/info" cp -v "manual/"*.info* "$out/share/info" + + runHook postInstall ''; meta.description = "GNU Info manual of the GNU C Library"; diff --git a/pkgs/development/libraries/glibc/mtrace.nix b/pkgs/development/libraries/glibc/mtrace.nix index c9d5369e13c2f..27effac498837 100644 --- a/pkgs/development/libraries/glibc/mtrace.nix +++ b/pkgs/development/libraries/glibc/mtrace.nix @@ -21,8 +21,12 @@ glibc.overrideAttrs (oldAttrs: { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv malloc/mtrace $out/bin/ + + runHook postInstall ''; # Perl checked during configure diff --git a/pkgs/development/libraries/glui/default.nix b/pkgs/development/libraries/glui/default.nix index f3999bfb439b7..af9c04a110637 100644 --- a/pkgs/development/libraries/glui/default.nix +++ b/pkgs/development/libraries/glui/default.nix @@ -23,12 +23,16 @@ stdenv.mkDerivation rec { buildInputs = [ libglut libGLU libGL libXmu libXext libX11 libXi ]; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,lib,share/glui/doc,include} cp -rT bin "$out/bin" cp -rT lib "$out/lib" cp -rT include "$out/include" cp -rT doc "$out/share/glui/doc" cp LICENSE.txt "$out/share/glui/doc" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/hspell/dicts.nix b/pkgs/development/libraries/hspell/dicts.nix index 8b629d9b61946..c5af5f8a76f10 100644 --- a/pkgs/development/libraries/hspell/dicts.nix +++ b/pkgs/development/libraries/hspell/dicts.nix @@ -18,23 +18,38 @@ in pname = "aspell-dict-he"; installPhase = '' + runHook preInstall + mkdir -p $out/lib/aspell - cp -v he_affix.dat he.wl $out/lib/aspell''; + cp -v he_affix.dat he.wl $out/lib/aspell + + runHook postInstall + ''; }; myspell = dict "myspell" { pname = "myspell-dict-he"; installPhase = '' + runHook preInstall + mkdir -p $out/lib/myspell - cp -v he.dic he.aff $out/lib/myspell''; + cp -v he.dic he.aff $out/lib/myspell + + runHook postInstall + ''; }; hunspell = dict "hunspell" { pname = "hunspell-dict-he"; installPhase = '' + runHook preInstall + mkdir -p $out/lib - cp -rv hunspell $out/lib''; + cp -rv hunspell $out/lib + + runHook postInstall + ''; }; } diff --git a/pkgs/development/libraries/hunspell/dictionaries-chromium.nix b/pkgs/development/libraries/hunspell/dictionaries-chromium.nix index e22c8c0a52c51..efcd508d6acd4 100644 --- a/pkgs/development/libraries/hunspell/dictionaries-chromium.nix +++ b/pkgs/development/libraries/hunspell/dictionaries-chromium.nix @@ -15,7 +15,11 @@ let dontBuild = true; installPhase = '' + runHook preInstall + cp ${dictFileName} $out + + runHook postInstall ''; passthru = { diff --git a/pkgs/development/libraries/jama/default.nix b/pkgs/development/libraries/jama/default.nix index 30044eb2cc050..43d5baee666f6 100644 --- a/pkgs/development/libraries/jama/default.nix +++ b/pkgs/development/libraries/jama/default.nix @@ -17,9 +17,13 @@ stdenv.mkDerivation rec { unzip "$src" ''; installPhase = '' + runHook preInstall + mkdir -p $out/include cp *.h $out/include - ''; + + runHook postInstall + ''; meta = with lib; { homepage = "https://math.nist.gov/tnt/"; diff --git a/pkgs/development/libraries/java/commons/bcel/default.nix b/pkgs/development/libraries/java/commons/bcel/default.nix index 0387b5dd9e306..aed27f9235436 100644 --- a/pkgs/development/libraries/java/commons/bcel/default.nix +++ b/pkgs/development/libraries/java/commons/bcel/default.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + tar xf ${src} mkdir -p $out/share/java cp bcel-${version}.jar $out/share/java/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/java/commons/bsf/default.nix b/pkgs/development/libraries/java/commons/bsf/default.nix index f55029335e588..ece75fc001744 100644 --- a/pkgs/development/libraries/java/commons/bsf/default.nix +++ b/pkgs/development/libraries/java/commons/bsf/default.nix @@ -10,8 +10,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/java cp lib/bsf.jar $out/share/java/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/java/commons/compress/default.nix b/pkgs/development/libraries/java/commons/compress/default.nix index f5c5922e800ad..a6e4818576bf5 100644 --- a/pkgs/development/libraries/java/commons/compress/default.nix +++ b/pkgs/development/libraries/java/commons/compress/default.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + tar xf ${src} mkdir -p $out/share/java cp *.jar $out/share/java/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/java/commons/daemon/default.nix b/pkgs/development/libraries/java/commons/daemon/default.nix index 63cc3d41a0c39..dbb0b62cad3bb 100644 --- a/pkgs/development/libraries/java/commons/daemon/default.nix +++ b/pkgs/development/libraries/java/commons/daemon/default.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + tar xf ${src} mkdir -p $out/share/java cp *.jar $out/share/java/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/java/commons/fileupload/default.nix b/pkgs/development/libraries/java/commons/fileupload/default.nix index 6c9235117355a..5b687cf6c43aa 100644 --- a/pkgs/development/libraries/java/commons/fileupload/default.nix +++ b/pkgs/development/libraries/java/commons/fileupload/default.nix @@ -9,9 +9,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-r7EGiih4qOCbjaL7Wg+plbe0m3CuFWXs/RmbfGLmj1g="; }; installPhase = '' + runHook preInstall + tar xf ${src} mkdir -p $out/share/java cp commons-fileupload-*-bin/*.jar $out/share/java/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/java/commons/io/default.nix b/pkgs/development/libraries/java/commons/io/default.nix index 160388f97b518..ff97787620d76 100644 --- a/pkgs/development/libraries/java/commons/io/default.nix +++ b/pkgs/development/libraries/java/commons/io/default.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + tar xf ${src} mkdir -p $out/share/java cp *.jar $out/share/java/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/java/commons/logging/default.nix b/pkgs/development/libraries/java/commons/logging/default.nix index f7debe8a7bdc7..c18258defe9e8 100644 --- a/pkgs/development/libraries/java/commons/logging/default.nix +++ b/pkgs/development/libraries/java/commons/logging/default.nix @@ -10,8 +10,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/java cp commons-logging-*.jar $out/share/java/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/java/commons/math/default.nix b/pkgs/development/libraries/java/commons/math/default.nix index ddb3b17c1dae2..98f7264b3e9f7 100644 --- a/pkgs/development/libraries/java/commons/math/default.nix +++ b/pkgs/development/libraries/java/commons/math/default.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + tar xf ${src} mkdir -p $out/share/java cp *.jar $out/share/java/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/java/geoipjava/default.nix b/pkgs/development/libraries/java/geoipjava/default.nix index cbb6b35a65c92..a166bece08bcb 100644 --- a/pkgs/development/libraries/java/geoipjava/default.nix +++ b/pkgs/development/libraries/java/geoipjava/default.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/java cp maxmindgeoip.jar $out/share/java + + runHook postInstall ''; meta = { description = "GeoIP Java API"; diff --git a/pkgs/development/libraries/java/hydra-ant-logger/default.nix b/pkgs/development/libraries/java/hydra-ant-logger/default.nix index 8f7282df0bb24..cd2f41fd31dbb 100644 --- a/pkgs/development/libraries/java/hydra-ant-logger/default.nix +++ b/pkgs/development/libraries/java/hydra-ant-logger/default.nix @@ -31,9 +31,13 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + runHook preBuild install -Dm644 *.jar -t $out/share/java runHook postBuild + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/java/rhino/default.nix b/pkgs/development/libraries/java/rhino/default.nix index 6fb5f8a14c676..30b3518906e77 100644 --- a/pkgs/development/libraries/java/rhino/default.nix +++ b/pkgs/development/libraries/java/rhino/default.nix @@ -37,8 +37,12 @@ stdenv.mkDerivation rec { # FIXME: Install javadoc as well. installPhase = '' + runHook preInstall + mkdir -p "$out/share/java" cp -v *.jar "$out/share/java" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/levmar/default.nix b/pkgs/development/libraries/levmar/default.nix index f1ba199fc8e0b..401c7fa4e73b5 100644 --- a/pkgs/development/libraries/levmar/default.nix +++ b/pkgs/development/libraries/levmar/default.nix @@ -16,9 +16,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/include $out/lib cp lm.h $out/include cp liblevmar.a $out/lib + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/libb64/default.nix b/pkgs/development/libraries/libb64/default.nix index 3b24089e53c63..c3d6c700b0c57 100644 --- a/pkgs/development/libraries/libb64/default.nix +++ b/pkgs/development/libraries/libb64/default.nix @@ -46,10 +46,14 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + mkdir -p $out $out/lib $out/bin $out/include cp -r include/* $out/include/ cp base64/base64 $out/bin/ cp src/libb64.a src/cencode.o src/cdecode.o $out/lib/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/libblocksruntime/default.nix b/pkgs/development/libraries/libblocksruntime/default.nix index 0ab3800644293..b14c612e88d87 100644 --- a/pkgs/development/libraries/libblocksruntime/default.nix +++ b/pkgs/development/libraries/libblocksruntime/default.nix @@ -24,7 +24,13 @@ stdenv.mkDerivation { doCheck = false; # hasdescriptor.c test fails, hrm. - installPhase = ''prefix="/" DESTDIR=$out ./installlib''; + installPhase = '' + runHook preInstall + + prefix="/" DESTDIR=$out ./installlib + + runHook postInstall +''; meta = with lib; { description = "Installs the BlocksRuntime library from the compiler-rt"; diff --git a/pkgs/development/libraries/libcef/default.nix b/pkgs/development/libraries/libcef/default.nix index ce83c3c22cd4b..942ad1e8986bc 100644 --- a/pkgs/development/libraries/libcef/default.nix +++ b/pkgs/development/libraries/libcef/default.nix @@ -93,6 +93,8 @@ stdenv.mkDerivation rec { dontPatchELF = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib/ $out/share/cef/ cp libcef_dll_wrapper/libcef_dll_wrapper.a $out/lib/ cp ../Release/libcef.so $out/lib/ @@ -104,6 +106,8 @@ stdenv.mkDerivation rec { cp ../Release/*.bin $out/share/cef/ cp -r ../Resources/* $out/share/cef/ cp -r ../include $out/ + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/development/libraries/libcredis/default.nix b/pkgs/development/libraries/libcredis/default.nix index 3515bce2da207..1c903551c3324 100644 --- a/pkgs/development/libraries/libcredis/default.nix +++ b/pkgs/development/libraries/libcredis/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { # credis build system has no install actions, provide our own. installPhase = '' + runHook preInstall + mkdir -p "$out/bin" mkdir -p "$out/lib" mkdir -p "$out/include" @@ -18,6 +20,8 @@ stdenv.mkDerivation rec { cp -v credis-test "$out/bin/" cp -v *.a *.so "$out/lib/" cp -v *.h "$out/include/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/libcrossguid/default.nix b/pkgs/development/libraries/libcrossguid/default.nix index c81dbb86f6a05..0474472c9cf14 100644 --- a/pkgs/development/libraries/libcrossguid/default.nix +++ b/pkgs/development/libraries/libcrossguid/default.nix @@ -19,9 +19,13 @@ stdenv.mkDerivation rec { $AR rvs libcrossguid.a guid.o ''; installPhase = '' + runHook preInstall + mkdir -p $out/{lib,include} install -D -m644 libcrossguid.a "$out/lib/libcrossguid.a" install -D -m644 guid.h "$out/include/guid.h" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/libcxxrt/default.nix b/pkgs/development/libraries/libcxxrt/default.nix index b1ad3d40eb31c..a65a611e13be4 100644 --- a/pkgs/development/libraries/libcxxrt/default.nix +++ b/pkgs/development/libraries/libcxxrt/default.nix @@ -16,9 +16,13 @@ stdenv.mkDerivation { outputs = [ "out" "dev" ]; installPhase = '' + runHook preInstall + mkdir -p $dev/include $out/lib cp ../src/cxxabi.h $dev/include cp lib/libcxxrt${stdenv.hostPlatform.extensions.library} $out/lib + + runHook postInstall ''; passthru = { diff --git a/pkgs/development/libraries/libde265/test-corpus-decode.nix b/pkgs/development/libraries/libde265/test-corpus-decode.nix index 9c184362d10bb..1793bd4df576e 100644 --- a/pkgs/development/libraries/libde265/test-corpus-decode.nix +++ b/pkgs/development/libraries/libde265/test-corpus-decode.nix @@ -42,6 +42,10 @@ stdenv.mkDerivation { # but it is *much* larger installPhase = '' + runHook preInstall + touch $out + + runHook postInstall ''; } diff --git a/pkgs/development/libraries/libexecinfo/default.nix b/pkgs/development/libraries/libexecinfo/default.nix index 24fc1e6dc74ec..478ae6d376e59 100644 --- a/pkgs/development/libraries/libexecinfo/default.nix +++ b/pkgs/development/libraries/libexecinfo/default.nix @@ -36,12 +36,16 @@ stdenv.mkDerivation rec { patchFlags = [ "-p0" ]; installPhase = '' + runHook preInstall + install -Dm644 execinfo.h stacktraverse.h -t $out/include '' + lib.optionalString enableShared '' install -Dm755 libexecinfo.so.1 -t $out/lib ln -s $out/lib/libexecinfo.so{.1,} '' + lib.optionalString enableStatic '' install -Dm755 libexecinfo.a -t $out/lib + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/libf2c/default.nix b/pkgs/development/libraries/libf2c/default.nix index a2cb4d2bd2460..f7854f4e68486 100644 --- a/pkgs/development/libraries/libf2c/default.nix +++ b/pkgs/development/libraries/libf2c/default.nix @@ -18,9 +18,13 @@ stdenv.mkDerivation rec { makeFlags = [ "-f" "makefile.u" ]; installPhase = '' + runHook preInstall + mkdir -p $out/include $out/lib cp libf2c.a $out/lib cp f2c.h $out/include + + runHook postInstall ''; nativeBuildInputs = [ unzip ]; diff --git a/pkgs/development/libraries/libfprint-2-tod1-goodix-550a/default.nix b/pkgs/development/libraries/libfprint-2-tod1-goodix-550a/default.nix index 16626fe0e227f..337c6250a46f1 100644 --- a/pkgs/development/libraries/libfprint-2-tod1-goodix-550a/default.nix +++ b/pkgs/development/libraries/libfprint-2-tod1-goodix-550a/default.nix @@ -25,11 +25,15 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/lib/libfprint-2/tod-1/" mkdir -p "$out/lib/udev/rules.d/" cp usr/lib/x86_64-linux-gnu/libfprint-2/tod-1/libfprint-tod-goodix-550a-$version.so "$out/lib/libfprint-2/tod-1/" cp lib/udev/rules.d/60-libfprint-2-tod1-goodix.rules "$out/lib/udev/rules.d/" + + runHook postInstall ''; passthru.driverPath = "/lib/libfprint-2/tod-1"; diff --git a/pkgs/development/libraries/libfprint-2-tod1-goodix/default.nix b/pkgs/development/libraries/libfprint-2-tod1-goodix/default.nix index c7710ce1d1991..96a22908d7c90 100644 --- a/pkgs/development/libraries/libfprint-2-tod1-goodix/default.nix +++ b/pkgs/development/libraries/libfprint-2-tod1-goodix/default.nix @@ -17,11 +17,15 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/lib/libfprint-2/tod-1/" mkdir -p "$out/lib/udev/rules.d/" cp usr/lib/x86_64-linux-gnu/libfprint-2/tod-1/libfprint-tod-goodix-53xc-$version.so "$out/lib/libfprint-2/tod-1/" cp lib/udev/rules.d/60-libfprint-2-tod1-goodix.rules "$out/lib/udev/rules.d/" + + runHook postInstall ''; passthru.driverPath = "/lib/libfprint-2/tod-1"; diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix index 9920a54e04139..e6770295732f5 100644 --- a/pkgs/development/libraries/libgpg-error/default.nix +++ b/pkgs/development/libraries/libgpg-error/default.nix @@ -8,8 +8,12 @@ ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -m755 gen-posix-lock-obj $out/bin + + runHook postInstall ''; outputs = [ "out" ]; diff --git a/pkgs/development/libraries/libint/default.nix b/pkgs/development/libraries/libint/default.nix index a6ad9498afa3c..a70558c6554db 100644 --- a/pkgs/development/libraries/libint/default.nix +++ b/pkgs/development/libraries/libint/default.nix @@ -189,8 +189,12 @@ let makeFlags = [ "export" ]; installPhase = '' + runHook preInstall + mkdir -p $out cp ${pname}-${version}.tgz $out/. + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/liblinear/default.nix b/pkgs/development/libraries/liblinear/default.nix index 449792a07e826..c681bb7f1c349 100644 --- a/pkgs/development/libraries/liblinear/default.nix +++ b/pkgs/development/libraries/liblinear/default.nix @@ -20,6 +20,8 @@ in stdenv.mkDerivation rec { buildFlags = [ "lib" "predict" "train" ]; installPhase = '' + runHook preInstall + ${if stdenv.isDarwin then '' install -D liblinear.so.${soVersion} $out/lib/liblinear.${soVersion}.dylib ln -s $out/lib/liblinear.${soVersion}.dylib $out/lib/liblinear.dylib @@ -30,6 +32,8 @@ in stdenv.mkDerivation rec { install -D train $bin/bin/liblinear-train install -D predict $bin/bin/liblinear-predict install -Dm444 -t $dev/include linear.h + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/libpg_query/default.nix b/pkgs/development/libraries/libpg_query/default.nix index 46920c977cbc5..f173729691120 100644 --- a/pkgs/development/libraries/libpg_query/default.nix +++ b/pkgs/development/libraries/libpg_query/default.nix @@ -16,9 +16,13 @@ stdenv.mkDerivation rec { makeFlags = [ "build" "build_shared" ]; installPhase = '' + runHook preInstall + install -Dm644 -t $out/lib libpg_query.a install -Dm644 -t $out/include pg_query.h install -Dm644 -t $out/lib libpg_query${stdenv.hostPlatform.extensions.sharedLibrary} + + runHook postInstall ''; doCheck = true; diff --git a/pkgs/development/libraries/libsystemtap/default.nix b/pkgs/development/libraries/libsystemtap/default.nix index 8290cee53a470..6b084de9f6c0e 100644 --- a/pkgs/development/libraries/libsystemtap/default.nix +++ b/pkgs/development/libraries/libsystemtap/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation { nativeBuildInputs = [ gettext python3 elfutils ]; installPhase = '' + runHook preInstall + mkdir -p $out/include cp -r includes/* $out/include/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/libui/default.nix b/pkgs/development/libraries/libui/default.nix index a798977b1f413..9b5a78d46961e 100644 --- a/pkgs/development/libraries/libui/default.nix +++ b/pkgs/development/libraries/libui/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/{include,lib} mkdir -p $out/lib/pkgconfig '' + lib.optionalString stdenv.isLinux '' @@ -39,6 +41,8 @@ stdenv.mkDerivation rec { substituteInPlace $out/lib/pkgconfig/libui.pc \ --subst-var-by out $out \ --subst-var-by version "${version}" + + runHook postInstall ''; postInstall = lib.optionalString stdenv.isDarwin '' install_name_tool -id $out/lib/libui.A.dylib $out/lib/libui.A.dylib diff --git a/pkgs/development/libraries/libxl/default.nix b/pkgs/development/libraries/libxl/default.nix index 3a6c0ca18edd4..036ced38c3087 100644 --- a/pkgs/development/libraries/libxl/default.nix +++ b/pkgs/development/libraries/libxl/default.nix @@ -13,9 +13,13 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir $out cp -rva include_c include_cpp license.txt $out/ cp -rva lib64 $out/lib + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/mailcore2/default.nix b/pkgs/development/libraries/mailcore2/default.nix index ed7406cc52b72..9406dda51d9d4 100644 --- a/pkgs/development/libraries/mailcore2/default.nix +++ b/pkgs/development/libraries/mailcore2/default.nix @@ -47,11 +47,15 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir $out cp -r src/include $out mkdir $out/lib cp src/libMailCore.* $out/lib + + runHook postInstall ''; doCheck = !stdenv.isDarwin; diff --git a/pkgs/development/libraries/mediastreamer/msopenh264.nix b/pkgs/development/libraries/mediastreamer/msopenh264.nix index 7c987f6422691..47583228ad726 100644 --- a/pkgs/development/libraries/mediastreamer/msopenh264.nix +++ b/pkgs/development/libraries/mediastreamer/msopenh264.nix @@ -31,8 +31,12 @@ stdenv.mkDerivation rec { # CMAKE_INSTALL_PREFIX has no effect so let's install manually. See: # https://gitlab.linphone.org/BC/public/msopenh264/issues/1 installPhase = '' + runHook preInstall + mkdir -p $out/lib/mediastreamer/plugins cp src/libmsopenh264.so $out/lib/mediastreamer/plugins/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/miniaudio/default.nix b/pkgs/development/libraries/miniaudio/default.nix index d8567177be61e..abf83030b2982 100644 --- a/pkgs/development/libraries/miniaudio/default.nix +++ b/pkgs/development/libraries/miniaudio/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out cp -r $src/* $out/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/miniball/default.nix b/pkgs/development/libraries/miniball/default.nix index 13a814684a424..d09ce1f9f8641 100644 --- a/pkgs/development/libraries/miniball/default.nix +++ b/pkgs/development/libraries/miniball/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/include cp $src $out/include/miniball.hpp + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/multipart-parser-c/default.nix b/pkgs/development/libraries/multipart-parser-c/default.nix index ef4834b8c0058..2cab72f483d66 100644 --- a/pkgs/development/libraries/multipart-parser-c/default.nix +++ b/pkgs/development/libraries/multipart-parser-c/default.nix @@ -18,11 +18,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib mv lib*${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/ mkdir -p $out/include mv *.h $out/include/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/mustache-hpp/default.nix b/pkgs/development/libraries/mustache-hpp/default.nix index ce6dd1d21a9b3..8d8a8b36ef59f 100644 --- a/pkgs/development/libraries/mustache-hpp/default.nix +++ b/pkgs/development/libraries/mustache-hpp/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/include cp mustache.hpp $out/include + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/ndi/default.nix b/pkgs/development/libraries/ndi/default.nix index b691f2b10afa4..59d16534ca26e 100644 --- a/pkgs/development/libraries/ndi/default.nix +++ b/pkgs/development/libraries/ndi/default.nix @@ -30,6 +30,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir $out mv bin/${ndiPlatform} $out/bin for i in $out/bin/*; do @@ -48,6 +50,8 @@ stdenv.mkDerivation rec { mkdir -p $out/share/doc/${pname}-${version} mv licenses $out/share/doc/${pname}-${version}/licenses mv documentation/* $out/share/doc/${pname}-${version}/ + + runHook postInstall ''; # Stripping breaks ndi-record. diff --git a/pkgs/development/libraries/networking-ts-cxx/default.nix b/pkgs/development/libraries/networking-ts-cxx/default.nix index 7dc6d4b11fee2..5282a0d34628f 100644 --- a/pkgs/development/libraries/networking-ts-cxx/default.nix +++ b/pkgs/development/libraries/networking-ts-cxx/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/{include,lib/pkgconfig} cp -r include $out/ substituteAll ${./networking_ts.pc.in} $out/lib/pkgconfig/networking_ts.pc + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/nvidia-optical-flow-sdk/default.nix b/pkgs/development/libraries/nvidia-optical-flow-sdk/default.nix index 813821bfb71c2..4331aa00b211a 100644 --- a/pkgs/development/libraries/nvidia-optical-flow-sdk/default.nix +++ b/pkgs/development/libraries/nvidia-optical-flow-sdk/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation { # # We only need the header files. The library files are # # in the nvidia_x11 driver. installPhase = '' + runHook preInstall + mkdir -p $out/include cp -R * $out/include + + runHook postInstall ''; # Makes setupCudaHook propagate nvidia-optical-flow-sdk together with cuda diff --git a/pkgs/development/libraries/opencl-clang/default.nix b/pkgs/development/libraries/opencl-clang/default.nix index b906be979f572..657fc45a02ad0 100644 --- a/pkgs/development/libraries/opencl-clang/default.nix +++ b/pkgs/development/libraries/opencl-clang/default.nix @@ -47,8 +47,12 @@ let ''; installPhase = '' + runHook preInstall + [ -d patches ] && cp -r patches/ $out || mkdir $out mkdir -p $out/clang $out/llvm + + runHook postInstall ''; }; }; diff --git a/pkgs/development/libraries/openexrid-unstable/default.nix b/pkgs/development/libraries/openexrid-unstable/default.nix index c961dfd069a6b..bdc0f28130308 100644 --- a/pkgs/development/libraries/openexrid-unstable/default.nix +++ b/pkgs/development/libraries/openexrid-unstable/default.nix @@ -39,10 +39,14 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + find $out mv $out/include $dev/ mv $out/lib $lib/ - ''; + + runHook postInstall + ''; meta = with lib; { description = "OpenEXR files able to isolate any object of a CG image with a perfect antialiazing"; diff --git a/pkgs/development/libraries/openfec/default.nix b/pkgs/development/libraries/openfec/default.nix index 964f5d86f6724..1c6fbeb5b081b 100644 --- a/pkgs/development/libraries/openfec/default.nix +++ b/pkgs/development/libraries/openfec/default.nix @@ -28,6 +28,8 @@ stdenv.mkDerivation rec { installPhase = let so = stdenv.hostPlatform.extensions.library; in '' + runHook preInstall + # This is pretty horrible but sadly there is not installation procedure # provided. mkdir -p $dev/include @@ -39,6 +41,8 @@ stdenv.mkDerivation rec { install_name_tool -id $out/lib/libopenfec${so} $out/lib/libopenfec${so} '' + '' ln -s libopenfec${so} $out/lib/libopenfec${so}.1 + + runHook postInstall ''; passthru.updateScript = gitUpdater { diff --git a/pkgs/development/libraries/openfx/default.nix b/pkgs/development/libraries/openfx/default.nix index 2bfb087085882..caa494dde5c12 100644 --- a/pkgs/development/libraries/openfx/default.nix +++ b/pkgs/development/libraries/openfx/default.nix @@ -21,9 +21,13 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $dev/include/OpenFX/ cp -r include/* $dev/include/OpenFX/ - ''; + + runHook postInstall + ''; meta = with lib; { description = "Image processing plug-in standard"; diff --git a/pkgs/development/libraries/oracle-instantclient/default.nix b/pkgs/development/libraries/oracle-instantclient/default.nix index 87381141d98f0..31a076ecb4942 100644 --- a/pkgs/development/libraries/oracle-instantclient/default.nix +++ b/pkgs/development/libraries/oracle-instantclient/default.nix @@ -111,6 +111,8 @@ stdenv.mkDerivation { unpackCmd = "unzip $curSrc"; installPhase = '' + runHook preInstall + mkdir -p "$out/"{bin,include,lib,"share/java","share/${pname}-${version}/demo/"} $lib/lib install -Dm755 {adrci,genezi,uidrvci,sqlplus,exp,expdp,imp,impdp} $out/bin @@ -123,6 +125,8 @@ stdenv.mkDerivation { # provide alias ln -sfn $out/bin/sqlplus $out/bin/sqlplus64 + + runHook postInstall ''; postFixup = optionalString stdenv.isDarwin '' diff --git a/pkgs/development/libraries/physics/geant4/datasets.nix b/pkgs/development/libraries/physics/geant4/datasets.nix index 66714ba16c786..e03598a18a55f 100644 --- a/pkgs/development/libraries/physics/geant4/datasets.nix +++ b/pkgs/development/libraries/physics/geant4/datasets.nix @@ -17,8 +17,12 @@ let datadir = "${placeholder "out"}/share/Geant4-${geant4.version}/data/${pname}${version}"; installPhase = '' + runHook preInstall + mkdir -p $datadir mv ./* $datadir + + runHook postInstall ''; inherit envvar; diff --git a/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix b/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix index 286cf8355b64c..23d4818c6545e 100644 --- a/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix +++ b/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix @@ -13,8 +13,12 @@ let preferLocalBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/${name}/ cp * $out/${name}/ + + runHook postInstall ''; setupHook = ./pdfset-hook.sh; diff --git a/pkgs/development/libraries/portaudio/default.nix b/pkgs/development/libraries/portaudio/default.nix index a109aad97b9d4..3695ac3b4a878 100644 --- a/pkgs/development/libraries/portaudio/default.nix +++ b/pkgs/development/libraries/portaudio/default.nix @@ -44,12 +44,16 @@ stdenv.mkDerivation rec { # not sure why, but all the headers seem to be installed by the make install installPhase = '' + runHook preInstall + make install '' + lib.optionalString (!stdenv.isDarwin) '' # fixup .pc file to find alsa library sed -i "s|-lasound|-L${alsa-lib.out}/lib -lasound|" "$out/lib/pkgconfig/"*.pc '' + lib.optionalString stdenv.isDarwin '' cp include/pa_mac_core.h $out/include/pa_mac_core.h + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/proj-datumgrid/default.nix b/pkgs/development/libraries/proj-datumgrid/default.nix index cfc75ce0c51aa..22dc28d011fcc 100644 --- a/pkgs/development/libraries/proj-datumgrid/default.nix +++ b/pkgs/development/libraries/proj-datumgrid/default.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp nad2bin $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/pslib/default.nix b/pkgs/development/libraries/pslib/default.nix index 02a8fcde91efc..fc5bcbc008876 100644 --- a/pkgs/development/libraries/pslib/default.nix +++ b/pkgs/development/libraries/pslib/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" "doc" ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib for path in *.dylib *.so *.so.* *.o *.o.*; do mv $path $out/lib/ @@ -34,6 +36,8 @@ stdenv.mkDerivation rec { fi mkdir -p $doc/share/doc/${pname} cp -r ../doc/. $doc/share/doc/${pname} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/python-qt/default.nix b/pkgs/development/libraries/python-qt/default.nix index 10db26a039849..3da849c5df4e9 100644 --- a/pkgs/development/libraries/python-qt/default.nix +++ b/pkgs/development/libraries/python-qt/default.nix @@ -37,11 +37,15 @@ stdenv.mkDerivation (finalAttrs: { dontWrapQtApps = true; installPhase = '' + runHook preInstall + mkdir -p $out/include/PythonQt cp -r ./lib $out cp -r ./src/* $out/include/PythonQt cp -r ./build $out/include/PythonQt cp -r ./extensions $out/include/PythonQt + + runHook postInstall ''; preFixup = lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index 68f3772a9976c..8b22fdfb33a6b 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -48,8 +48,12 @@ let dontUnpack = true; dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin ln -s '${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config' $out/bin/pkg-config + + runHook postInstall ''; }; diff --git a/pkgs/development/libraries/qtinstaller/default.nix b/pkgs/development/libraries/qtinstaller/default.nix index 0fd21a1a29680..75cbcf546588c 100644 --- a/pkgs/development/libraries/qtinstaller/default.nix +++ b/pkgs/development/libraries/qtinstaller/default.nix @@ -20,10 +20,14 @@ stdenv.mkDerivation rec { dontWrapQtApps = true; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib,share/qt-installer-framework} cp -a bin/{archivegen,binarycreator,devtool,installerbase,repogen} $out/bin cp -a lib/{libinstaller.so*,lib7z.a} $out/lib cp -a examples $out/share/qt-installer-framework/ + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/development/libraries/rabbitmq-java-client/default.nix b/pkgs/development/libraries/rabbitmq-java-client/default.nix index 92aee32c38d1c..01a776a4345e3 100644 --- a/pkgs/development/libraries/rabbitmq-java-client/default.nix +++ b/pkgs/development/libraries/rabbitmq-java-client/default.nix @@ -15,12 +15,16 @@ stdenv.mkDerivation rec { buildPhase = "ant dist"; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/java cp build/lib/*.jar lib/*.jar $out/share/java # There is a script in the source archive, but ours is cleaner makeWrapper ${jre}/bin/java $out/bin/PerfTest \ --add-flags "-Djava.awt.headless=true -cp $out/share/java/\* com.rabbitmq.examples.PerfTest" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/rapidxml/default.nix b/pkgs/development/libraries/rapidxml/default.nix index c433f32728e1c..fd33769225783 100644 --- a/pkgs/development/libraries/rapidxml/default.nix +++ b/pkgs/development/libraries/rapidxml/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out/include/${pname} cp * $out/include/${pname} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/relibc/default.nix b/pkgs/development/libraries/relibc/default.nix index 437da86e8c21e..f7a45334ab52c 100644 --- a/pkgs/development/libraries/relibc/default.nix +++ b/pkgs/development/libraries/relibc/default.nix @@ -18,6 +18,8 @@ let dontPatchELF = true; dontStrip = true; installPhase = '' + runHook preInstall + mkdir $out/ cp -r * $out/ @@ -28,6 +30,8 @@ let find $out/ -name "*.so" -type f -exec patchelf \ --set-rpath "${rpath}" \ "{}" \; + + runHook postInstall ''; meta.platforms = with lib; platforms.redox ++ platforms.linux; diff --git a/pkgs/development/libraries/science/math/ecos/default.nix b/pkgs/development/libraries/science/math/ecos/default.nix index 73874641e477e..7036ca5893fa3 100644 --- a/pkgs/development/libraries/science/math/ecos/default.nix +++ b/pkgs/development/libraries/science/math/ecos/default.nix @@ -22,9 +22,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib cp lib*.a lib*.so $out/lib cp -r include $out/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/science/math/libtorch/bin.nix b/pkgs/development/libraries/science/math/libtorch/bin.nix index 92050cd172834..66cc3fcbba722 100644 --- a/pkgs/development/libraries/science/math/libtorch/bin.nix +++ b/pkgs/development/libraries/science/math/libtorch/bin.nix @@ -39,6 +39,8 @@ in stdenv.mkDerivation { dontStrip = true; installPhase = '' + runHook preInstall + # Copy headers and CMake files. mkdir -p $dev cp -r include $dev @@ -56,6 +58,8 @@ in stdenv.mkDerivation { substituteInPlace \ $dev/share/cmake/Caffe2/Caffe2Targets-release.cmake \ --replace \''${_IMPORT_PREFIX}/lib "$out/lib" \ + + runHook postInstall ''; postFixup = let diff --git a/pkgs/development/libraries/science/math/libtorch/test/default.nix b/pkgs/development/libraries/science/math/libtorch/test/default.nix index a4b8c2f79140d..cc3f755f1fe96 100644 --- a/pkgs/development/libraries/science/math/libtorch/test/default.nix +++ b/pkgs/development/libraries/science/math/libtorch/test/default.nix @@ -46,7 +46,11 @@ in stdenv.mkDerivation { doCheck = true; installPhase = '' + runHook preInstall + touch $out + + runHook postInstall ''; checkPhase = lib.optionalString cudaSupport '' diff --git a/pkgs/development/libraries/science/math/mkl/default.nix b/pkgs/development/libraries/science/math/mkl/default.nix index 607b6c89e40d1..cee564eb3fb1b 100644 --- a/pkgs/development/libraries/science/math/mkl/default.nix +++ b/pkgs/development/libraries/science/math/mkl/default.nix @@ -92,6 +92,8 @@ in stdenvNoCC.mkDerivation ({ ''; installPhase = '' + runHook preInstall + for f in $(find . -name 'mkl*.pc') ; do bn=$(basename $f) substituteInPlace $f \ @@ -137,6 +139,8 @@ in stdenvNoCC.mkDerivation ({ ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libcblas${shlibExt}".3" ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapack${shlibExt}".3" ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapacke${shlibExt}".3" + + runHook postInstall ''; # fixDarwinDylibName fails for libmkl_cdft_core.dylib because the diff --git a/pkgs/development/libraries/science/math/mkl/test/default.nix b/pkgs/development/libraries/science/math/mkl/test/default.nix index 1717e11e43d86..eba6783f251cb 100644 --- a/pkgs/development/libraries/science/math/mkl/test/default.nix +++ b/pkgs/development/libraries/science/math/mkl/test/default.nix @@ -34,7 +34,11 @@ in stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + touch $out + + runHook postInstall ''; checkPhase = '' diff --git a/pkgs/development/libraries/science/math/or-tools/default.nix b/pkgs/development/libraries/science/math/or-tools/default.nix index cb4670204d112..1c3b331b8f52b 100644 --- a/pkgs/development/libraries/science/math/or-tools/default.nix +++ b/pkgs/development/libraries/science/math/or-tools/default.nix @@ -130,9 +130,13 @@ stdenv.mkDerivation rec { # and disables the upstream installation of a zipped Python egg that # can’t be imported with our Python setup. installPhase = '' + runHook preInstall + cmake . -DBUILD_EXAMPLES=OFF -DBUILD_PYTHON=OFF -DBUILD_SAMPLES=OFF cmake --install . pip install --prefix="$python" python/ + + runHook postInstall ''; outputs = [ "out" "python" ]; diff --git a/pkgs/development/libraries/science/math/spooles/default.nix b/pkgs/development/libraries/science/math/spooles/default.nix index 47738008b02d9..0a19df249ec45 100644 --- a/pkgs/development/libraries/science/math/spooles/default.nix +++ b/pkgs/development/libraries/science/math/spooles/default.nix @@ -28,6 +28,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib $out/include/spooles cp libspooles.a libspooles.so.2.2 $out/lib/ ln -s libspooles.so.2.2 $out/lib/libspooles.so.2 @@ -42,6 +44,8 @@ stdenv.mkDerivation rec { fi fi done + + runHook postInstall ''; nativeBuildInputs = [ perl ]; diff --git a/pkgs/development/libraries/science/math/tensorflow-lite/default.nix b/pkgs/development/libraries/science/math/tensorflow-lite/default.nix index 9f9405dec3180..e040f59d2004e 100644 --- a/pkgs/development/libraries/science/math/tensorflow-lite/default.nix +++ b/pkgs/development/libraries/science/math/tensorflow-lite/default.nix @@ -56,6 +56,8 @@ buildBazelPackage rec { buildAttrs = { installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib} # copy the libs and binaries into the output dir @@ -71,6 +73,8 @@ buildBazelPackage rec { # remove executable bit from headers chmod -x "$path" done + + runHook postInstall ''; }; diff --git a/pkgs/development/libraries/science/math/zn_poly/default.nix b/pkgs/development/libraries/science/math/zn_poly/default.nix index 1c61bb07471be..046b47821181a 100644 --- a/pkgs/development/libraries/science/math/zn_poly/default.nix +++ b/pkgs/development/libraries/science/math/zn_poly/default.nix @@ -45,10 +45,14 @@ stdenv.mkDerivation rec { # `make install` fails to install some header files and the lib file. installPhase = '' + runHook preInstall + mkdir -p "$out/include/zn_poly" mkdir -p "$out/lib" cp "${libbasename}"*"${libext}" "$out/lib" cp include/*.h "$out/include/zn_poly" + + runHook postInstall ''; doCheck = true; diff --git a/pkgs/development/libraries/scmccid/default.nix b/pkgs/development/libraries/scmccid/default.nix index 73fb6a6dcf6e4..b813c3eb3daa1 100644 --- a/pkgs/development/libraries/scmccid/default.nix +++ b/pkgs/development/libraries/scmccid/default.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ patchelf ]; installPhase = '' + runHook preInstall + RPATH=${libusb-compat-0_1.out}/lib:${stdenv.cc.libc.out}/lib for a in proprietary/*/Contents/Linux/*.so*; do @@ -29,6 +31,8 @@ stdenv.mkDerivation rec { mkdir -p $out/pcsc/drivers cp -R proprietary/* $out/pcsc/drivers + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/scriptaculous/default.nix b/pkgs/development/libraries/scriptaculous/default.nix index 50171324b386e..79193e8cc23ad 100644 --- a/pkgs/development/libraries/scriptaculous/default.nix +++ b/pkgs/development/libraries/scriptaculous/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir $out cp src/*.js $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/smarty3-i18n/default.nix b/pkgs/development/libraries/smarty3-i18n/default.nix index e617ba58e8b44..27168e671069d 100644 --- a/pkgs/development/libraries/smarty3-i18n/default.nix +++ b/pkgs/development/libraries/smarty3-i18n/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir $out cp block.t.php $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/smarty3/default.nix b/pkgs/development/libraries/smarty3/default.nix index 6059bed339e63..475e6062cfe62 100644 --- a/pkgs/development/libraries/smarty3/default.nix +++ b/pkgs/development/libraries/smarty3/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir $out cp -r libs/* $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/soil/default.nix b/pkgs/development/libraries/soil/default.nix index 39a64c84ddcdc..bb651a16d0f54 100644 --- a/pkgs/development/libraries/soil/default.nix +++ b/pkgs/development/libraries/soil/default.nix @@ -27,9 +27,13 @@ stdenv.mkDerivation { $AR rcs libSOIL.a *.o ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib $out/include/SOIL cp libSOIL.a $out/lib/ cp SOIL.h $out/include/SOIL/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/speech-tools/default.nix b/pkgs/development/libraries/speech-tools/default.nix index 8bee16fef7539..e6bf8e4b67434 100644 --- a/pkgs/development/libraries/speech-tools/default.nix +++ b/pkgs/development/libraries/speech-tools/default.nix @@ -53,6 +53,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,lib} for d in bin lib; do for i in ./$d/*; do @@ -60,6 +62,8 @@ stdenv.mkDerivation rec { cp -r "$(readlink -f $i)" "$out/$d" done done + + runHook postInstall ''; doCheck = true; diff --git a/pkgs/development/libraries/sqlite/sqlar.nix b/pkgs/development/libraries/sqlite/sqlar.nix index 9063879b7e379..f0c7e36a005f2 100644 --- a/pkgs/development/libraries/sqlite/sqlar.nix +++ b/pkgs/development/libraries/sqlite/sqlar.nix @@ -22,9 +22,13 @@ stdenv.mkDerivation { ++ lib.optional withFuse "sqlarfs"; installPhase = '' + runHook preInstall + install -D -t $out/bin sqlar '' + lib.optionalString withFuse '' install -D -t $out/bin sqlarfs + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/sqlite/tools.nix b/pkgs/development/libraries/sqlite/tools.nix index 2b843c0b22e0b..f7a23e2ca1b3e 100644 --- a/pkgs/development/libraries/sqlite/tools.nix +++ b/pkgs/development/libraries/sqlite/tools.nix @@ -17,7 +17,7 @@ let makeFlags = [ makeTarget ]; - installPhase = "install -Dt $out/bin ${makeTarget}"; + installPhase = "runHook preInstall; install -Dt $out/bin ${makeTarget}; runHook postInstall"; meta = with lib; { inherit description homepage mainProgram; diff --git a/pkgs/development/libraries/stfl/default.nix b/pkgs/development/libraries/stfl/default.nix index b79020e3ba712..b9fe7c1572c5e 100644 --- a/pkgs/development/libraries/stfl/default.nix +++ b/pkgs/development/libraries/stfl/default.nix @@ -39,11 +39,15 @@ stdenv.mkDerivation rec { '' ; installPhase = '' + runHook preInstall + DESTDIR=$out prefix=\"\" make install '' # some programs rely on libstfl.so.0 to be present, so link it + lib.optionalString (!stdenv.hostPlatform.isStatic) '' ln -s $out/lib/libstfl.so.0.24 $out/lib/libstfl.so.0 + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/tachyon/default.nix b/pkgs/development/libraries/tachyon/default.nix index 0446d2cac6e7d..41b0c96bc5783 100644 --- a/pkgs/development/libraries/tachyon/default.nix +++ b/pkgs/development/libraries/tachyon/default.nix @@ -59,6 +59,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cd ../compile/${arch} mkdir -p "$out"/{bin,lib,include,share/doc/tachyon,share/tachyon} cp tachyon "$out"/bin @@ -67,6 +69,8 @@ stdenv.mkDerivation rec { cp src/*.h "$out/include/" cp Changes Copyright README "$out/share/doc/tachyon" cp -r scenes "$out/share/tachyon/scenes" + + runHook postInstall ''; meta = { description = "Parallel / Multiprocessor Ray Tracing System"; diff --git a/pkgs/development/libraries/ticpp/default.nix b/pkgs/development/libraries/ticpp/default.nix index 20de3d7f2b892..d6904e6c37e8f 100644 --- a/pkgs/development/libraries/ticpp/default.nix +++ b/pkgs/development/libraries/ticpp/default.nix @@ -19,11 +19,15 @@ stdenv.mkDerivation { cmakeFlags = [ "-DBUILD_TICPP_DLL=1" ]; installPhase = '' + runHook preInstall + cd .. mkdir -p $out/lib install build/*.{a,so} $out/lib mkdir -p $out/include install *.h $out/include + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/tinyxml/2.6.2.nix b/pkgs/development/libraries/tinyxml/2.6.2.nix index ded5013cca99a..f839ad2362674 100644 --- a/pkgs/development/libraries/tinyxml/2.6.2.nix +++ b/pkgs/development/libraries/tinyxml/2.6.2.nix @@ -66,6 +66,8 @@ in stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -pv $out/include/ mkdir -pv $out/lib/pkgconfig/ mkdir -pv $out/share/doc/tinyxml/ @@ -80,6 +82,8 @@ in stdenv.mkDerivation { cp -v docs/* $out/share/doc/tinyxml/ '' + lib.optionalString stdenv.isDarwin '' install_name_tool -id $out/lib/libtinyxml.dylib $out/lib/libtinyxml.dylib + + runHook postInstall ''; meta = { diff --git a/pkgs/development/libraries/tnt/default.nix b/pkgs/development/libraries/tnt/default.nix index f4787271c039c..9e03b90ffa9dd 100644 --- a/pkgs/development/libraries/tnt/default.nix +++ b/pkgs/development/libraries/tnt/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out/include cp *.h $out/include - ''; + + runHook postInstall + ''; meta = { homepage = "https://math.nist.gov/tnt/"; diff --git a/pkgs/development/libraries/unixODBCDrivers/default.nix b/pkgs/development/libraries/unixODBCDrivers/default.nix index fe181d37f6bf6..220519fa024a4 100644 --- a/pkgs/development/libraries/unixODBCDrivers/default.nix +++ b/pkgs/development/libraries/unixODBCDrivers/default.nix @@ -153,9 +153,13 @@ buildPhase = ""; installPhase = '' + runHook preInstall + mkdir -p $out mkdir -p $out/lib cp -r opt/microsoft/msodbcsql${versionMajor}/lib64 opt/microsoft/msodbcsql${versionMajor}/share $out/ + + runHook postInstall ''; postFixup = '' @@ -284,9 +288,13 @@ # - Manually patchelf with `unixODCB` libraries # - Disable automatic `patchELF` phase installPhase = '' + runHook preInstall + mkdir -p $out/lib cp opt/amazon/redshiftodbc/lib/64/* $out/lib patchelf --set-rpath ${unixODBC}/lib/ $out/lib/libamazonredshiftodbc64.so + + runHook postInstall ''; dontPatchELF = true; diff --git a/pkgs/development/libraries/uthash/default.nix b/pkgs/development/libraries/uthash/default.nix index 98c5200fcc2c6..4cf5b2adfc67c 100644 --- a/pkgs/development/libraries/uthash/default.nix +++ b/pkgs/development/libraries/uthash/default.nix @@ -17,7 +17,11 @@ stdenv.mkDerivation rec { preCheck = "cd tests"; installPhase = '' + runHook preInstall + install -Dm644 $src/include/*.h -t $out/include + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/v8/default.nix b/pkgs/development/libraries/v8/default.nix index 3ea2d075602a0..77c310eaa02b4 100644 --- a/pkgs/development/libraries/v8/default.nix +++ b/pkgs/development/libraries/v8/default.nix @@ -167,6 +167,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + install -D d8 $out/bin/d8 install -D -m644 obj/libv8_monolith.a $out/lib/libv8.a install -D -m644 icudtl.dat $out/share/v8/icudtl.dat @@ -181,6 +183,8 @@ stdenv.mkDerivation rec { Libs: -L$out/lib -lv8 -pthread Cflags: -I$out/include EOF + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/libraries/vcg/default.nix b/pkgs/development/libraries/vcg/default.nix index 62b39c05395e7..b3223b8026f54 100644 --- a/pkgs/development/libraries/vcg/default.nix +++ b/pkgs/development/libraries/vcg/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ eigen ]; installPhase = '' + runHook preInstall + mkdir -p $out/include cp -r vcg wrap $out/include find $out -name \*.h -exec sed -i 's,> $out/bin/avr8-burn-omat << EOF @@ -21,6 +23,8 @@ stdenv.mkDerivation rec { cd $out/nix-support; exec java -jar AVR8_Burn_O_Mat.jar EOF chmod +x $out/bin/avr8-burn-omat + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/misc/msp430/mspds/binary.nix b/pkgs/development/misc/msp430/mspds/binary.nix index 3558599c2de04..8a7c983ff2890 100644 --- a/pkgs/development/misc/msp430/mspds/binary.nix +++ b/pkgs/development/misc/msp430/mspds/binary.nix @@ -20,8 +20,12 @@ in stdenv.mkDerivation rec { buildInputs = [ stdenv.cc.cc ]; installPhase = '' + runHook preInstall + install -Dm0755 $libname $out/lib/''${libname//_64/} install -Dm0644 -t $out/include Inc/*.h + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/misc/msp430/mspds/default.nix b/pkgs/development/misc/msp430/mspds/default.nix index 75dd08805f3f7..8be6bd0d1569f 100644 --- a/pkgs/development/misc/msp430/mspds/default.nix +++ b/pkgs/development/misc/msp430/mspds/default.nix @@ -37,8 +37,12 @@ in stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -Dm0755 -t $out/lib $libName install -Dm0644 -t $out/include DLL430_v3/include/*.h + + runHook postInstall ''; nativeBuildInputs = [ unzip ]; diff --git a/pkgs/development/misc/resholve/README.md b/pkgs/development/misc/resholve/README.md index 3d8ae6d966f32..e43011b7a9d24 100644 --- a/pkgs/development/misc/resholve/README.md +++ b/pkgs/development/misc/resholve/README.md @@ -65,8 +65,12 @@ resholve.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + sed -i '2i GOSS_PATH=${goss}/bin/goss' extras/dgoss/dgoss install -D extras/dgoss/dgoss $out/bin/dgoss + + runHook postInstall ''; solutions = { @@ -133,6 +137,8 @@ stdenv.mkDerivation { # src = ...; installPhase = '' + runHook preInstall + mkdir -p $out/bin install conjure.sh $out/bin/conjure.sh ${resholve.phraseSolution "conjure" { @@ -143,6 +149,8 @@ stdenv.mkDerivation { external = [ "jq" "openssl" ]; }; }} + + runHook postInstall ''; } ``` diff --git a/pkgs/development/misc/resholve/resholve-utils.nix b/pkgs/development/misc/resholve/resholve-utils.nix index a903b674eb339..0e0a2696dbedf 100644 --- a/pkgs/development/misc/resholve/resholve-utils.nix +++ b/pkgs/development/misc/resholve/resholve-utils.nix @@ -197,7 +197,11 @@ rec { dontBuild = true; installPhase = '' + runHook preInstall + cp -R $src $out + + runHook postInstall ''; # enable below for verbose debug info if needed diff --git a/pkgs/development/misc/resholve/test.nix b/pkgs/development/misc/resholve/test.nix index ab61884963aa3..62857900072d0 100644 --- a/pkgs/development/misc/resholve/test.nix +++ b/pkgs/development/misc/resholve/test.nix @@ -72,9 +72,13 @@ rec { setSourceRoot = "sourceRoot=$(echo */tests/nix/libressl)"; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,submodule} install libressl.sh $out/bin/libressl.sh install submodule/helper.sh $out/submodule/helper.sh + + runHook postInstall ''; solutions = { @@ -96,10 +100,14 @@ rec { setSourceRoot = "sourceRoot=$(echo */tests/nix/openssl)"; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/libexec install openssl.sh $out/bin/openssl.sh install libexec.sh $out/libexec/invokeme install profile $out/profile + + runHook postInstall ''; # LOGLEVEL="DEBUG"; solutions = { @@ -137,6 +145,8 @@ rec { setSourceRoot = "sourceRoot=$(echo */tests/nix/future_perfect_tense)"; installPhase = '' + runHook preInstall + mkdir -p $out/bin install conjure.sh $out/bin/conjure.sh ${resholve.phraseSolution "conjure" { @@ -147,6 +157,8 @@ rec { external = [ "jq" "openssl" ]; }; }} + + runHook postInstall ''; }; @@ -157,8 +169,12 @@ rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir $out cp *.ansi $out/ + + runHook postInstall ''; doCheck = true; diff --git a/pkgs/development/misc/rpiboot/default.nix b/pkgs/development/misc/rpiboot/default.nix index 69ea80db109fb..b1a4f3564105b 100644 --- a/pkgs/development/misc/rpiboot/default.nix +++ b/pkgs/development/misc/rpiboot/default.nix @@ -19,10 +19,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/rpiboot cp rpiboot $out/bin cp -r msd $out/share/rpiboot + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/mobile/abootimg/default.nix b/pkgs/development/mobile/abootimg/default.nix index 85181cdf459f0..3251f64d128f5 100644 --- a/pkgs/development/mobile/abootimg/default.nix +++ b/pkgs/development/mobile/abootimg/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -D -m 755 abootimg $out/bin install -D -m444 ./debian/abootimg.1 $out/share/man/man1/abootimg.1; @@ -31,6 +33,8 @@ stdenv.mkDerivation rec { install -D -m 755 abootimg-unpack-initrd $out/bin wrapProgram $out/bin/abootimg-unpack-initrd --prefix PATH : ${lib.makeBinPath [ cpio gzip ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/mobile/androidenv/build-app.nix b/pkgs/development/mobile/androidenv/build-app.nix index 18e59f0bd0d60..f51f75a92c442 100644 --- a/pkgs/development/mobile/androidenv/build-app.nix +++ b/pkgs/development/mobile/androidenv/build-app.nix @@ -39,10 +39,14 @@ stdenv.mkDerivation ({ ant ${antFlags} ${if release then "release" else "debug"} ''; installPhase = '' + runHook preInstall + mkdir -p $out mv bin/*-${if release then "release" else "debug"}.apk $out mkdir -p $out/nix-support echo "file binary-dist \"$(echo $out/*.apk)\"" > $out/nix-support/hydra-build-products + + runHook postInstall ''; } // extraArgs) diff --git a/pkgs/development/mobile/androidenv/compose-android-packages.nix b/pkgs/development/mobile/androidenv/compose-android-packages.nix index 72dc64a7e0c22..8e0b37eaa7283 100644 --- a/pkgs/development/mobile/androidenv/compose-android-packages.nix +++ b/pkgs/development/mobile/androidenv/compose-android-packages.nix @@ -49,7 +49,11 @@ let ruby ${./mkrepo.rb} ${lib.escapeShellArgs mkRepoRubyArguments} > repo.json ''; installPhase = '' + runHook preInstall + mv repo.json $out + + runHook postInstall ''; }; diff --git a/pkgs/development/mobile/checkra1n/default.nix b/pkgs/development/mobile/checkra1n/default.nix index a44a6d8b2b8d2..170a898bd3e19 100644 --- a/pkgs/development/mobile/checkra1n/default.nix +++ b/pkgs/development/mobile/checkra1n/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + install -dm755 "$out/bin" install -m755 $src $out/bin/${pname} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/mobile/genymotion/default.nix b/pkgs/development/mobile/genymotion/default.nix index 63000e5a1ce43..da663dce678d7 100644 --- a/pkgs/development/mobile/genymotion/default.nix +++ b/pkgs/development/mobile/genymotion/default.nix @@ -51,9 +51,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/libexec mv genymotion $out/libexec/ ln -s $out/libexec/genymotion/{genymotion,player} $out/bin + + runHook postInstall ''; fixupPhase = '' diff --git a/pkgs/development/mobile/imgpatchtools/default.nix b/pkgs/development/mobile/imgpatchtools/default.nix index 737457a646508..fc24a41fecd87 100644 --- a/pkgs/development/mobile/imgpatchtools/default.nix +++ b/pkgs/development/mobile/imgpatchtools/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ bzip2 openssl zlib ]; - installPhase = "install -Dt $out/bin bin/*"; + installPhase = "runHook preInstall; install -Dt $out/bin bin/*; runHook postInstall"; meta = with lib; { description = "Tools to manipulate Android OTA archives"; diff --git a/pkgs/development/mobile/maestro/default.nix b/pkgs/development/mobile/maestro/default.nix index 2b7e22255e191..198fdce40af5d 100644 --- a/pkgs/development/mobile/maestro/default.nix +++ b/pkgs/development/mobile/maestro/default.nix @@ -13,10 +13,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip makeWrapper ]; installPhase = '' + runHook preInstall + mkdir $out unzip $src -d $out mv $out/maestro/* $out rm -rf $out/maestro + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/development/mobile/titaniumenv/build-app.nix b/pkgs/development/mobile/titaniumenv/build-app.nix index 42b70c64abe9b..c9c71f1051e18 100644 --- a/pkgs/development/mobile/titaniumenv/build-app.nix +++ b/pkgs/development/mobile/titaniumenv/build-app.nix @@ -157,6 +157,8 @@ stdenv.mkDerivation ({ ''; installPhase = '' + runHook preInstall + ${if target == "android" then '' ${lib.optionalString (!release) '' cp "$(ls build/android/bin/*.apk | grep -v '\-unsigned.apk')" $out @@ -180,6 +182,8 @@ stdenv.mkDerivation ({ ''} '' else throw "Target: ${target} is not supported!"} + + runHook postInstall ''; failureHook = lib.optionalString (release && target == "iphone") deleteKeychain; diff --git a/pkgs/development/mobile/xcodeenv/build-app.nix b/pkgs/development/mobile/xcodeenv/build-app.nix index 6120025d5e3e9..fc5ead3d3600c 100644 --- a/pkgs/development/mobile/xcodeenv/build-app.nix +++ b/pkgs/development/mobile/xcodeenv/build-app.nix @@ -146,5 +146,5 @@ stdenv.mkDerivation ({ failureHook = lib.optionalString release deleteKeychain; - installPhase = "true"; + installPhase = "runHook preInstall; true; runHook postInstall"; } // extraArgs) diff --git a/pkgs/development/node-packages/node-env.nix b/pkgs/development/node-packages/node-env.nix index bc1e36628ac8a..3c480e2f610eb 100644 --- a/pkgs/development/node-packages/node-env.nix +++ b/pkgs/development/node-packages/node-env.nix @@ -33,10 +33,14 @@ let tgzFile=$(npm pack | tail -n 1) # Hooks to the pack command will add output (https://docs.npmjs.com/misc/scripts) ''; installPhase = '' + runHook preInstall + mkdir -p $out/tarballs mv $tgzFile $out/tarballs mkdir -p $out/nix-support echo "file source-dist $out/tarballs/$tgzFile" >> $out/nix-support/hydra-build-products + + runHook postInstall ''; }; @@ -604,6 +608,8 @@ let passAsFile = [ "includeScript" "pinpointDependenciesScript" ]; installPhase = '' + runHook preInstall + source ${installPackage} mkdir -p $out/${packageName} @@ -634,6 +640,8 @@ let mv ${packageName} lib ln -s $out/lib/node_modules/.bin $out/bin + + runHook postInstall ''; } // extraArgs); diff --git a/pkgs/development/ocaml-modules/afl-persistent/default.nix b/pkgs/development/ocaml-modules/afl-persistent/default.nix index 04d31c881561c..92282172f0a25 100644 --- a/pkgs/development/ocaml-modules/afl-persistent/default.nix +++ b/pkgs/development/ocaml-modules/afl-persistent/default.nix @@ -26,7 +26,11 @@ stdenv.mkDerivation rec { buildPhase = "./build.sh"; installPhase = '' + runHook preInstall + ${opaline}/bin/opaline -prefix $out -libdir $out/lib/ocaml/${ocaml.version}/site-lib/ ${pname}.install + + runHook postInstall ''; doCheck = true; diff --git a/pkgs/development/ocaml-modules/lua-ml/default.nix b/pkgs/development/ocaml-modules/lua-ml/default.nix index bec9b9a998dc4..0e2750f21e054 100644 --- a/pkgs/development/ocaml-modules/lua-ml/default.nix +++ b/pkgs/development/ocaml-modules/lua-ml/default.nix @@ -23,7 +23,11 @@ stdenv.mkDerivation rec { buildFlags = [ "lib" ]; installPhase = '' + runHook preInstall + opaline -prefix $out -libdir $OCAMLFIND_DESTDIR + + runHook postInstall ''; meta = { diff --git a/pkgs/development/ocaml-modules/ocamlmake/default.nix b/pkgs/development/ocaml-modules/ocamlmake/default.nix index a2071a9dfaad9..edb0dc9ebf249 100644 --- a/pkgs/development/ocaml-modules/ocamlmake/default.nix +++ b/pkgs/development/ocaml-modules/ocamlmake/default.nix @@ -15,8 +15,12 @@ in stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p "$out/include/" cp OCamlMakefile "$out/include/" + + runHook postInstall ''; setupHook = ./setup-hook.sh; diff --git a/pkgs/development/ocaml-modules/seq/default.nix b/pkgs/development/ocaml-modules/seq/default.nix index 6131585e34b15..3f32cee22dbba 100644 --- a/pkgs/development/ocaml-modules/seq/default.nix +++ b/pkgs/development/ocaml-modules/seq/default.nix @@ -34,8 +34,12 @@ stdenv.mkDerivation ({ dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/seq cp META $out/lib/ocaml/${ocaml.version}/site-lib/seq + + runHook postInstall ''; meta.description = "dummy backward-compatibility package for iterators"; diff --git a/pkgs/development/ocaml-modules/topkg/default.nix b/pkgs/development/ocaml-modules/topkg/default.nix index e0dbc77eafd99..5ca85f68592d4 100644 --- a/pkgs/development/ocaml-modules/topkg/default.nix +++ b/pkgs/development/ocaml-modules/topkg/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation rec { buildPhase = "${run} build"; createFindlibDestdir = true; - installPhase = "${opaline}/bin/opaline -prefix $out -libdir $OCAMLFIND_DESTDIR"; + installPhase = "runHook preInstall; ${opaline}/bin/opaline -prefix $out -libdir $OCAMLFIND_DESTDIR; runHook postInstall"; passthru = { inherit run; }; diff --git a/pkgs/development/ocaml-modules/uchar/default.nix b/pkgs/development/ocaml-modules/uchar/default.nix index 09004e8a94388..bd05072c5e90c 100644 --- a/pkgs/development/ocaml-modules/uchar/default.nix +++ b/pkgs/development/ocaml-modules/uchar/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { strictDeps = true; buildPhase = "ocaml pkg/build.ml native=true native-dynlink=${lib.boolToString withShared}"; - installPhase = "${opaline}/bin/opaline -libdir $OCAMLFIND_DESTDIR"; + installPhase = "runHook preInstall; ${opaline}/bin/opaline -libdir $OCAMLFIND_DESTDIR; runHook postInstall"; configurePlatforms = [ ]; meta = { diff --git a/pkgs/development/perl-modules/Po4a/default.nix b/pkgs/development/perl-modules/Po4a/default.nix index f15697fbf3792..cca635b30d6a8 100644 --- a/pkgs/development/perl-modules/Po4a/default.nix +++ b/pkgs/development/perl-modules/Po4a/default.nix @@ -98,11 +98,15 @@ buildPerlPackage rec { ''; installPhase = '' + runHook preInstall + ./Build install for f in $out/bin/*; do substituteInPlace $f --replace "#! /usr/bin/env perl" "#!${perl}/bin/perl" substituteInPlace $f --replace "exec perl" "exec ${perl}/bin/perl" done + + runHook postInstall ''; meta = { diff --git a/pkgs/development/perl-modules/Tirex/default.nix b/pkgs/development/perl-modules/Tirex/default.nix index 48e63bb5932c4..251ade4eeb64d 100644 --- a/pkgs/development/perl-modules/Tirex/default.nix +++ b/pkgs/development/perl-modules/Tirex/default.nix @@ -47,10 +47,14 @@ buildPerlPackage rec { ] ++ mapnik.buildInputs; installPhase = '' + runHook preInstall + install -m 755 -d $out/usr/libexec make install DESTDIR=$out INSTALLOPTS="" mv $out/$out/lib $out/$out/share $out rmdir $out/$out $out/nix/store $out/nix + + runHook postInstall ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/development/perl-modules/ham/default.nix b/pkgs/development/perl-modules/ham/default.nix index b25adff4c800d..d268de1e861e5 100644 --- a/pkgs/development/perl-modules/ham/default.nix +++ b/pkgs/development/perl-modules/ham/default.nix @@ -31,11 +31,15 @@ buildPerlPackage { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib $out/bin cp -r . $out/lib/ham makeWrapper $out/lib/ham/ham $out/bin/ham --argv0 ham \ --prefix PATH : ${openssh}/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/php-packages/ioncube-loader/default.nix b/pkgs/development/php-packages/ioncube-loader/default.nix index 4c691a913ddd6..2925dcc6a6c4c 100644 --- a/pkgs/development/php-packages/ioncube-loader/default.nix +++ b/pkgs/development/php-packages/ioncube-loader/default.nix @@ -42,10 +42,14 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/lib/php/extensions cp $src/ioncube_loader_${ variant.${stdenv.hostPlatform.system}.prefix }_${phpVersion}.so $out/lib/php/extensions/ioncube-loader.so + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/python-modules/distutils-cfg/default.nix b/pkgs/development/python-modules/distutils-cfg/default.nix index 89bd841560604..357b242e4d952 100644 --- a/pkgs/development/python-modules/distutils-cfg/default.nix +++ b/pkgs/development/python-modules/distutils-cfg/default.nix @@ -34,9 +34,13 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + dest="$out/${python.sitePackages}/distutils" mkdir -p $dest ln -s ${python}/lib/${python.libPrefix}/distutils/* $dest ln -s ${distutilsCfg} $dest/distutils.cfg + + runHook postInstall ''; } diff --git a/pkgs/development/python-modules/hg-commitsigs/default.nix b/pkgs/development/python-modules/hg-commitsigs/default.nix index be96f45368ac2..52536d2c65515 100644 --- a/pkgs/development/python-modules/hg-commitsigs/default.nix +++ b/pkgs/development/python-modules/hg-commitsigs/default.nix @@ -21,9 +21,13 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/${python.sitePackages}/hgext3rd/ install -D $src/commitsigs.py \ $out/${python.sitePackages}/hgext3rd/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/python-modules/jaxlib/default.nix b/pkgs/development/python-modules/jaxlib/default.nix index 0fc50fa9243f0..c77a13144cd3d 100644 --- a/pkgs/development/python-modules/jaxlib/default.nix +++ b/pkgs/development/python-modules/jaxlib/default.nix @@ -214,7 +214,11 @@ let ''; installPhase = '' + runHook preInstall + cp -r . $out + + runHook postInstall ''; }; diff --git a/pkgs/development/python-modules/kaldi-active-grammar/fork.nix b/pkgs/development/python-modules/kaldi-active-grammar/fork.nix index 00d2e2802f09d..e5da4dee6f7c0 100644 --- a/pkgs/development/python-modules/kaldi-active-grammar/fork.nix +++ b/pkgs/development/python-modules/kaldi-active-grammar/fork.nix @@ -93,6 +93,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + # Fixes "patchelf: wrong ELF type" find . -type f -name "*.o" -print0 | xargs -0 rm -f mkdir -p $out/{bin,lib} @@ -100,6 +102,8 @@ stdenv.mkDerivation rec { patchelf \ --set-rpath "${lib.makeLibraryPath buildInputs}:$out/lib" \ $out/lib/* + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/python-modules/llm/default.nix b/pkgs/development/python-modules/llm/default.nix index 388077b389445..1d8a3f35a153e 100644 --- a/pkgs/development/python-modules/llm/default.nix +++ b/pkgs/development/python-modules/llm/default.nix @@ -100,9 +100,13 @@ let nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + makeWrapper ${llm}/bin/llm $out/bin/llm \ --prefix PYTHONPATH : "${llm}/${python.sitePackages}:$PYTHONPATH" ln -sfv ${llm}/lib $out/lib + + runHook postInstall ''; propagatedBuildInputs = llm.propagatedBuildInputs ++ plugins; diff --git a/pkgs/development/python-modules/pycuda/compyte.nix b/pkgs/development/python-modules/pycuda/compyte.nix index b25844738acae..cb00b122ad634 100644 --- a/pkgs/development/python-modules/pycuda/compyte.nix +++ b/pkgs/development/python-modules/pycuda/compyte.nix @@ -12,7 +12,11 @@ mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out + + runHook postInstall ''; } diff --git a/pkgs/development/python-modules/pysvn/default.nix b/pkgs/development/python-modules/pysvn/default.nix index 3df9edb39f9c7..3fdfe3c9f64b5 100644 --- a/pkgs/development/python-modules/pysvn/default.nix +++ b/pkgs/development/python-modules/pysvn/default.nix @@ -69,6 +69,8 @@ buildPythonPackage rec { pythonImportsCheck = [ "pysvn" ]; installPhase = '' + runHook preInstall + dest=$(toPythonPath $out)/pysvn mkdir -p $dest cp pysvn/__init__.py $dest/ @@ -76,6 +78,8 @@ buildPythonPackage rec { mkdir -p $out/share/doc mv -v ../Docs $out/share/doc/pysvn-${version} rm -v $out/share/doc/pysvn-${version}/generate_cpp_docs_from_html_docs.py + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/python-modules/python-efl/default.nix b/pkgs/development/python-modules/python-efl/default.nix index 63c1043729fe7..8b8d5530e3018 100644 --- a/pkgs/development/python-modules/python-efl/default.nix +++ b/pkgs/development/python-modules/python-efl/default.nix @@ -40,7 +40,11 @@ buildPythonPackage rec { ''; installPhase = '' + runHook preInstall + ${python.pythonOnBuildForHost.interpreter} setup.py install --prefix=$out --single-version-externally-managed + + runHook postInstall ''; doCheck = false; diff --git a/pkgs/development/python-modules/recursive-pth-loader/default.nix b/pkgs/development/python-modules/recursive-pth-loader/default.nix index c5a21d488fcfe..940159504308c 100644 --- a/pkgs/development/python-modules/recursive-pth-loader/default.nix +++ b/pkgs/development/python-modules/recursive-pth-loader/default.nix @@ -13,9 +13,13 @@ stdenv.mkDerivation { buildPhase = "${python.pythonOnBuildForHost}/bin/${python.pythonOnBuildForHost.executable} -m compileall ."; installPhase = '' + runHook preInstall + dst=$out/${python.sitePackages} mkdir -p $dst cp sitecustomize.* $dst/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/python-modules/skein/skeinjar.nix b/pkgs/development/python-modules/skein/skeinjar.nix index 74df5ea12b8c8..e2e2d95a5e560 100644 --- a/pkgs/development/python-modules/skein/skeinjar.nix +++ b/pkgs/development/python-modules/skein/skeinjar.nix @@ -23,7 +23,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + unzip ${src} install -D ./skein/java/skein.jar $out + + runHook postInstall ''; } diff --git a/pkgs/development/python-modules/spacy-transformers/annotation-test/default.nix b/pkgs/development/python-modules/spacy-transformers/annotation-test/default.nix index d6d1094447d24..025c5a062c068 100644 --- a/pkgs/development/python-modules/spacy-transformers/annotation-test/default.nix +++ b/pkgs/development/python-modules/spacy-transformers/annotation-test/default.nix @@ -29,7 +29,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + touch $out + + runHook postInstall ''; meta.timeout = 60; diff --git a/pkgs/development/python-modules/spacy/annotation-test/default.nix b/pkgs/development/python-modules/spacy/annotation-test/default.nix index cb8a97aa568fc..e14317fe1a242 100644 --- a/pkgs/development/python-modules/spacy/annotation-test/default.nix +++ b/pkgs/development/python-modules/spacy/annotation-test/default.nix @@ -29,7 +29,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + touch $out + + runHook postInstall ''; meta.timeout = 60; diff --git a/pkgs/development/python-modules/tensorflow-probability/default.nix b/pkgs/development/python-modules/tensorflow-probability/default.nix index 587f6b683a7da..172afd546e7ed 100644 --- a/pkgs/development/python-modules/tensorflow-probability/default.nix +++ b/pkgs/development/python-modules/tensorflow-probability/default.nix @@ -64,6 +64,8 @@ let ''; installPhase = '' + runHook preInstall + # work around timestamp issues # https://github.com/NixOS/nixpkgs/issues/270#issuecomment-467583872 export SOURCE_DATE_EPOCH=315532800 @@ -73,6 +75,8 @@ let # point directly to the wheel file. ./bazel-bin/pip_pkg . --release mv *.whl "$out" + + runHook postInstall ''; }; }; diff --git a/pkgs/development/python-modules/tkinter/default.nix b/pkgs/development/python-modules/tkinter/default.nix index beba9834e703c..f4b9dc88263c2 100644 --- a/pkgs/development/python-modules/tkinter/default.nix +++ b/pkgs/development/python-modules/tkinter/default.nix @@ -17,6 +17,8 @@ buildPythonPackage { installPhase = '' + runHook preInstall + # Move the tkinter module mkdir -p $out/${py.sitePackages} mv lib/${py.libPrefix}/lib-dynload/_tkinter* $out/${py.sitePackages}/ @@ -26,6 +28,8 @@ buildPythonPackage { old_rpath=$(patchelf --print-rpath $out/${py.sitePackages}/_tkinter*) new_rpath=$(sed "s#${py}#${python}#g" <<< "$old_rpath" ) patchelf --set-rpath $new_rpath $out/${py.sitePackages}/_tkinter* + + runHook postInstall ''; meta = py.meta // { diff --git a/pkgs/development/python2-modules/pygtk/default.nix b/pkgs/development/python2-modules/pygtk/default.nix index 003474ee85827..3788780dc586a 100644 --- a/pkgs/development/python2-modules/pygtk/default.nix +++ b/pkgs/development/python2-modules/pygtk/default.nix @@ -40,7 +40,7 @@ buildPythonPackage rec { env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-ObjC" + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) " -lpython2.7"; - installPhase = "installPhase"; + installPhase = "runHook preInstall; installPhase; runHook postInstall"; checkPhase = '' diff --git a/pkgs/development/python2-modules/setuptools/default.nix b/pkgs/development/python2-modules/setuptools/default.nix index faddafc9f9d37..c5dd0eef6c718 100644 --- a/pkgs/development/python2-modules/setuptools/default.nix +++ b/pkgs/development/python2-modules/setuptools/default.nix @@ -39,8 +39,12 @@ let ''; installPhase = '' + runHook preInstall + echo "Moving sdist..." mv dist/${name} $out + + runHook postInstall ''; }; in buildPythonPackage rec { diff --git a/pkgs/development/rocm-modules/6/rocgdb/default.nix b/pkgs/development/rocm-modules/6/rocgdb/default.nix index 2112c6cf02105..ec355e67c0b86 100644 --- a/pkgs/development/rocm-modules/6/rocgdb/default.nix +++ b/pkgs/development/rocm-modules/6/rocgdb/default.nix @@ -82,7 +82,11 @@ stdenv.mkDerivation (finalAttrs: { # The source directory for ROCgdb (based on upstream GDB) contains multiple project # of GNU’s toolchain (binutils and onther), we only need to install the GDB part. installPhase = '' + runHook preInstall + make install-gdb + + runHook postInstall ''; # `-Wno-format-nonliteral` doesn't work diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix index a541a8ee34bde..5925be159ac1a 100644 --- a/pkgs/development/ruby-modules/gem-config/default.nix +++ b/pkgs/development/ruby-modules/gem-config/default.nix @@ -318,7 +318,11 @@ in ; dontBuilt = true; installPhase = '' + runHook preInstall + cp -R ext/fast_mmaped_file_rs $out + + runHook postInstall ''; }; hash = if lib.versionAtLeast attrs.version "1.1.1" diff --git a/pkgs/development/ruby-modules/rbenv/default.nix b/pkgs/development/ruby-modules/rbenv/default.nix index 6c080f4f21818..c1dcd4b4303d0 100644 --- a/pkgs/development/ruby-modules/rbenv/default.nix +++ b/pkgs/development/ruby-modules/rbenv/default.nix @@ -19,12 +19,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + popd mkdir -p $out/bin mv libexec $out ln -s $out/libexec/rbenv $out/bin/rbenv installShellCompletion completions/rbenv.{bash,zsh} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/ruby-modules/with-packages/default.nix b/pkgs/development/ruby-modules/with-packages/default.nix index 31573bce499fc..ca23eac3aa4b8 100644 --- a/pkgs/development/ruby-modules/with-packages/default.nix +++ b/pkgs/development/ruby-modules/with-packages/default.nix @@ -60,12 +60,16 @@ let dontUnpack = true; installPhase = '' + runHook preInstall + for i in ${ruby}/bin/* ${gemEnv}/bin/*; do rm -f $out/bin/$(basename "$i") makeWrapper "$i" $out/bin/$(basename "$i") --set GEM_PATH ${gemEnv}/${ruby.gemPath} done ln -s ${ruby}/nix-support $out/nix-support + + runHook postInstall ''; passthru = { diff --git a/pkgs/development/tools/analysis/clang-analyzer/default.nix b/pkgs/development/tools/analysis/clang-analyzer/default.nix index 67a38a526be2f..1c0b2c6555055 100644 --- a/pkgs/development/tools/analysis/clang-analyzer/default.nix +++ b/pkgs/development/tools/analysis/clang-analyzer/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/scan-view $out/bin cp -R clang/tools/scan-view/share/* $out/share/scan-view cp -R clang/tools/scan-view/bin/* $out/bin/scan-view @@ -22,6 +24,8 @@ stdenv.mkDerivation rec { --add-flags "--use-cc=${clang}/bin/clang" \ --add-flags "--use-c++=${clang}/bin/clang++" \ --add-flags "--use-analyzer='${llvmPackages.clang}/bin/clang'" + + runHook postInstall ''; meta = { diff --git a/pkgs/development/tools/analysis/codeql/default.nix b/pkgs/development/tools/analysis/codeql/default.nix index 47ca566551d59..3d8b0bbb45843 100644 --- a/pkgs/development/tools/analysis/codeql/default.nix +++ b/pkgs/development/tools/analysis/codeql/default.nix @@ -27,6 +27,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + # codeql directory should not be top-level, otherwise, # it'll include /nix/store to resolve extractors. mkdir -p $out/{codeql,bin} @@ -43,6 +45,8 @@ stdenv.mkDerivation rec { ln -s ${jdk17} $out/codeql/tools/linux64/java ln -s $out/codeql/codeql $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/analysis/cov-build/default.nix b/pkgs/development/tools/analysis/cov-build/default.nix index 61c8dda2e6da6..db61f1c5adada 100644 --- a/pkgs/development/tools/analysis/cov-build/default.nix +++ b/pkgs/development/tools/analysis/cov-build/default.nix @@ -45,6 +45,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/libexec mv * $out/libexec for x in cov-build cov-capture cov-configure cov-emit cov-emit-java \ @@ -55,6 +57,8 @@ stdenv.mkDerivation rec { cov-manage-history; do ln -s $out/libexec/bin/$x $out/bin/$x; done + + runHook postInstall ''; dontStrip = true; diff --git a/pkgs/development/tools/analysis/emma/default.nix b/pkgs/development/tools/analysis/emma/default.nix index 4a284ac0d6032..5f09632d3793b 100644 --- a/pkgs/development/tools/analysis/emma/default.nix +++ b/pkgs/development/tools/analysis/emma/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/jars cp lib/*.jar $out/lib/jars/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/tools/analysis/findbugs/default.nix b/pkgs/development/tools/analysis/findbugs/default.nix index a3f52f8da092e..4ef5e4f984bc0 100644 --- a/pkgs/development/tools/analysis/findbugs/default.nix +++ b/pkgs/development/tools/analysis/findbugs/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + d=$out/libexec/findbugs mkdir -p $d $out/bin $out/nix-support @@ -33,6 +35,8 @@ stdenv.mkDerivation rec { cat < $out/nix-support/setup-hook export FINDBUGS_HOME=$d EOF + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/analysis/flow/default.nix b/pkgs/development/tools/analysis/flow/default.nix index 956e460deca39..b4773b9f253ec 100644 --- a/pkgs/development/tools/analysis/flow/default.nix +++ b/pkgs/development/tools/analysis/flow/default.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation rec { makeFlags = [ "FLOW_RELEASE=1" ]; installPhase = '' + runHook preInstall + install -Dm755 bin/flow $out/bin/flow install -Dm644 resources/shell/bash-completion $out/share/bash-completion/completions/flow + + runHook postInstall ''; strictDeps = true; diff --git a/pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix b/pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix index 4623c42e81919..4108770875090 100644 --- a/pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix +++ b/pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix @@ -17,9 +17,13 @@ stdenv.mkDerivation rec { patches = [ ./gcc7.patch ]; installPhase = '' + runHook preInstall + install -Dm755 TraceFileGen $out/bin/TraceFileGen mkdir -p $out/share/doc/${pname}-${version}/ cp -ar $src/Documentation/html $out/share/doc/${pname}-${version}/. + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/analysis/garcosim/tracefilesim/default.nix b/pkgs/development/tools/analysis/garcosim/tracefilesim/default.nix index cd1682a1f5e71..13ccaed269686 100644 --- a/pkgs/development/tools/analysis/garcosim/tracefilesim/default.nix +++ b/pkgs/development/tools/analysis/garcosim/tracefilesim/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation { hardeningDisable = [ "fortify" ]; installPhase = '' + runHook preInstall + mkdir --parents "$out/bin" cp ./traceFileSim "$out/bin" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/analysis/randoop/default.nix b/pkgs/development/tools/analysis/randoop/default.nix index 552f5fef7cae3..ba8bbf9f88ef9 100644 --- a/pkgs/development/tools/analysis/randoop/default.nix +++ b/pkgs/development/tools/analysis/randoop/default.nix @@ -12,10 +12,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib $out/doc cp -R *.jar $out/lib cp README.txt $out/doc + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/analysis/rizin/sigdb.nix b/pkgs/development/tools/analysis/rizin/sigdb.nix index 40d0fe62f259e..4a80953c6809e 100644 --- a/pkgs/development/tools/analysis/rizin/sigdb.nix +++ b/pkgs/development/tools/analysis/rizin/sigdb.nix @@ -23,8 +23,12 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/rizin mv installdir $out/share/rizin/sigdb + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/analysis/swarm/default.nix b/pkgs/development/tools/analysis/swarm/default.nix index 18ecc912915f9..011a4d70cb545 100644 --- a/pkgs/development/tools/analysis/swarm/default.nix +++ b/pkgs/development/tools/analysis/swarm/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -Dm755 Src/swarm $out/bin/swarm install -Dm644 Doc/swarm.1 $out/share/man/man1/swarm.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/analysis/yallback/default.nix b/pkgs/development/tools/analysis/yallback/default.nix index 19ad53d038df6..8bc39d45a27af 100644 --- a/pkgs/development/tools/analysis/yallback/default.nix +++ b/pkgs/development/tools/analysis/yallback/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dv yallback $out/bin/yallback wrapProgram $out/bin/yallback --prefix PATH : ${lib.makeBinPath [ coreutils ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/apksigner/default.nix b/pkgs/development/tools/apksigner/default.nix index 0a918df061a75..888773df04791 100644 --- a/pkgs/development/tools/apksigner/default.nix +++ b/pkgs/development/tools/apksigner/default.nix @@ -50,9 +50,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ gradle makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm444 build/libs/apksigner.jar -t $out/lib makeWrapper "${jdk_headless}/bin/java" "$out/bin/apksigner" \ --add-flags "-jar $out/lib/apksigner.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/apktool/default.nix b/pkgs/development/tools/apktool/default.nix index 460d0686ff60e..63c1391185ed5 100644 --- a/pkgs/development/tools/apktool/default.nix +++ b/pkgs/development/tools/apktool/default.nix @@ -26,11 +26,15 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + install -D ${src} "$out/libexec/apktool/apktool.jar" mkdir -p "$out/bin" makeWrapper "${jdk_headless}/bin/java" "$out/bin/apktool" \ --add-flags "-jar $out/libexec/apktool/apktool.jar" \ --prefix PATH : ${lib.getBin aapt} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/avro-tools/default.nix b/pkgs/development/tools/avro-tools/default.nix index 9615d4574cdb2..7d2f79e22b00f 100644 --- a/pkgs/development/tools/avro-tools/default.nix +++ b/pkgs/development/tools/avro-tools/default.nix @@ -17,12 +17,16 @@ stdenv.mkDerivation rec { sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/libexec/avro-tools cp $src $out/libexec/avro-tools/${pname}.jar makeWrapper ${jre}/bin/java $out/bin/avro-tools \ --add-flags "-jar $out/libexec/avro-tools/${pname}.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/bazel-watcher/default.nix b/pkgs/development/tools/bazel-watcher/default.nix index ae152a3782ab1..9a9313d138893 100644 --- a/pkgs/development/tools/bazel-watcher/default.nix +++ b/pkgs/development/tools/bazel-watcher/default.nix @@ -95,7 +95,11 @@ buildBazelPackage rec { ''; installPhase = '' + runHook preInstall + install -Dm755 bazel-bin/cmd/ibazel/ibazel_/ibazel $out/bin/ibazel + + runHook postInstall ''; }; diff --git a/pkgs/development/tools/bloaty/default.nix b/pkgs/development/tools/bloaty/default.nix index 1393a7ca54e99..b025b55e29756 100644 --- a/pkgs/development/tools/bloaty/default.nix +++ b/pkgs/development/tools/bloaty/default.nix @@ -51,7 +51,11 @@ stdenv.mkDerivation rec { cmake --build . --target check-bloaty ''; installPhase = '' + runHook preInstall + install -Dm755 {.,$out/bin}/bloaty + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/build-managers/apache-ant/default.nix b/pkgs/development/tools/build-managers/apache-ant/default.nix index 17f750a9450c7..58b5712a23161 100644 --- a/pkgs/development/tools/build-managers/apache-ant/default.nix +++ b/pkgs/development/tools/build-managers/apache-ant/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib/ant mv * $out/lib/ant/ @@ -76,6 +78,8 @@ stdenv.mkDerivation rec { EOF chmod +x $out/bin/ant + + runHook postInstall ''; # */ meta = { diff --git a/pkgs/development/tools/build-managers/bam/default.nix b/pkgs/development/tools/build-managers/bam/default.nix index c435e2fa16ec2..85d06f90bd1c3 100644 --- a/pkgs/development/tools/build-managers/bam/default.nix +++ b/pkgs/development/tools/build-managers/bam/default.nix @@ -20,10 +20,14 @@ stdenv.mkDerivation rec { strictDeps = true; installPhase = '' + runHook preInstall + mkdir -p "$out/share/bam" cp -r docs examples tests "$out/share/bam" mkdir -p "$out/bin" cp bam "$out/bin" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/build-managers/buck/default.nix b/pkgs/development/tools/build-managers/buck/default.nix index f494e4053525c..44cbd9a3799fa 100644 --- a/pkgs/development/tools/build-managers/buck/default.nix +++ b/pkgs/development/tools/build-managers/buck/default.nix @@ -29,9 +29,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D -m755 buck-out/gen/*/programs/buck.pex $out/bin/buck wrapProgram $out/bin/buck \ --prefix PATH : "${lib.makeBinPath [ jdk8 watchman python3 ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/build-managers/buck2/default.nix b/pkgs/development/tools/build-managers/buck2/default.nix index c1e504a2da5db..a4b84a6f0a6e9 100644 --- a/pkgs/development/tools/build-managers/buck2/default.nix +++ b/pkgs/development/tools/build-managers/buck2/default.nix @@ -84,8 +84,12 @@ in stdenv.mkDerivation { buildPhase = "chmod +x ./buck2"; checkPhase = "./buck2 --version"; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -D buck2 $out/bin/buck2 + + runHook postInstall ''; passthru = { diff --git a/pkgs/development/tools/build-managers/colormake/default.nix b/pkgs/development/tools/build-managers/colormake/default.nix index 251268a449d41..be4366a3ab4a9 100644 --- a/pkgs/development/tools/build-managers/colormake/default.nix +++ b/pkgs/development/tools/build-managers/colormake/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -fa colormake.pl colormake colormake-short clmake clmake-short $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/build-managers/ekam/default.nix b/pkgs/development/tools/build-managers/ekam/default.nix index 09e43f7ef8a69..1975db4b7f4a1 100644 --- a/pkgs/development/tools/build-managers/ekam/default.nix +++ b/pkgs/development/tools/build-managers/ekam/default.nix @@ -43,6 +43,8 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir $out cp -r bin $out @@ -50,6 +52,8 @@ stdenv.mkDerivation { rm $out/bin/capnp* # Don't distribute ekam-bootstrap, which is not needed outside this build. rm $out/bin/ekam-bootstrap + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/build-managers/gn/generic.nix b/pkgs/development/tools/build-managers/gn/generic.nix index fe74486ccfaad..49a008d59e8d9 100644 --- a/pkgs/development/tools/build-managers/gn/generic.nix +++ b/pkgs/development/tools/build-managers/gn/generic.nix @@ -47,7 +47,11 @@ in stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -vD out/gn "$out/bin/gn" + + runHook postInstall ''; setupHook = ./setup-hook.sh; diff --git a/pkgs/development/tools/build-managers/gup/default.nix b/pkgs/development/tools/build-managers/gup/default.nix index 3576b67208c37..125e9c70894e9 100644 --- a/pkgs/development/tools/build-managers/gup/default.nix +++ b/pkgs/development/tools/build-managers/gup/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { strictDeps = true; buildPhase = "make python"; installPhase = '' + runHook preInstall + mkdir $out cp -r python/bin $out/bin + + runHook postInstall ''; passthru.updateScript = [ runtimeShell diff --git a/pkgs/development/tools/build-managers/icmake/default.nix b/pkgs/development/tools/build-managers/icmake/default.nix index 039d4ee6970c1..8deb436077e9f 100644 --- a/pkgs/development/tools/build-managers/icmake/default.nix +++ b/pkgs/development/tools/build-managers/icmake/default.nix @@ -30,10 +30,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + ./icm_install all / wrapProgram $out/bin/icmbuild \ --prefix PATH : ${ncurses}/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/build-managers/kati/default.nix b/pkgs/development/tools/build-managers/kati/default.nix index 9ceeb2f8c490c..2e7ebb5f294f5 100644 --- a/pkgs/development/tools/build-managers/kati/default.nix +++ b/pkgs/development/tools/build-managers/kati/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation { patches = [ ./version.patch ]; installPhase = '' + runHook preInstall + install -D ckati $out/bin/ckati + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/build-managers/msbuild/default.nix b/pkgs/development/tools/build-managers/msbuild/default.nix index bf62dec69310e..5beb49cfe41b3 100644 --- a/pkgs/development/tools/build-managers/msbuild/default.nix +++ b/pkgs/development/tools/build-managers/msbuild/default.nix @@ -103,6 +103,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + stage1/mono-msbuild/msbuild mono/build/install.proj /p:MonoInstallPrefix="$out" /p:Configuration=Release-MONO ln -s ${roslyn}/lib/dotnet/microsoft.net.compilers.toolset/*/tasks/net472 $out/lib/mono/msbuild/Current/bin/Roslyn @@ -112,6 +114,8 @@ stdenv.mkDerivation rec { --add-flags "$out/lib/mono/msbuild/15.0/bin/MSBuild.dll" ln -s $(find ${dotnet-sdk} -name libhostfxr${sharedLibrary}) $out/lib/mono/msbuild/Current/bin/SdkResolvers/Microsoft.DotNet.MSBuildSdkResolver/ + + runHook postInstall ''; doInstallCheck = true; diff --git a/pkgs/development/tools/build-managers/rebar/default.nix b/pkgs/development/tools/build-managers/rebar/default.nix index b73553466cbb8..16c4e7e4e96f1 100644 --- a/pkgs/development/tools/build-managers/rebar/default.nix +++ b/pkgs/development/tools/build-managers/rebar/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { buildPhase = "escript bootstrap"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp rebar $out/bin/rebar + + runHook postInstall ''; meta = { diff --git a/pkgs/development/tools/build-managers/rebar3/default.nix b/pkgs/development/tools/build-managers/rebar3/default.nix index ca64753cedbff..ecce6882a06d7 100644 --- a/pkgs/development/tools/build-managers/rebar3/default.nix +++ b/pkgs/development/tools/build-managers/rebar3/default.nix @@ -46,8 +46,12 @@ let doCheck = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp rebar3 $out/bin/rebar3 + + runHook postInstall ''; meta = { @@ -126,6 +130,8 @@ let # add plugins to the code path. installPhase = '' + runHook preInstall + erl -noshell -eval ' {ok, Escript} = escript:extract("${rebar3Patched}/bin/rebar3", []), {archive, Archive} = lists:keyfind(archive, 1, Escript), @@ -139,6 +145,8 @@ let --set REBAR_GLOBAL_PLUGINS "${toString globalPluginNames} rebar_ignore_deps" \ --suffix-each ERL_LIBS ":" "$out/lib ${toString pluginLibDirs}" \ --add-flags "+sbtu +A1 -noshell -boot start_clean -s rebar3 main -extra" + + runHook postInstall ''; }; in { inherit rebar3 rebar3WithPlugins; } diff --git a/pkgs/development/tools/build-managers/redo-sh/default.nix b/pkgs/development/tools/build-managers/redo-sh/default.nix index 67dd66d8eeee1..f1f9c1ebc4bfd 100644 --- a/pkgs/development/tools/build-managers/redo-sh/default.nix +++ b/pkgs/development/tools/build-managers/redo-sh/default.nix @@ -13,12 +13,16 @@ stdenv.mkDerivation { sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p "$out/share" mv man "$out/share" mv bin "$out" for p in $out/bin/*; do wrapProgram "$p" --prefix PATH : "$out/bin:${coreutils}/bin" done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/build-managers/redo/default.nix b/pkgs/development/tools/build-managers/redo/default.nix index e6a68c4215c37..3db974bd4c785 100644 --- a/pkgs/development/tools/build-managers/redo/default.nix +++ b/pkgs/development/tools/build-managers/redo/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation rec { package/compile ''; installPhase = '' + runHook preInstall + package/export $out/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/tools/cdecrypt/default.nix b/pkgs/development/tools/cdecrypt/default.nix index 4965eb31e98cc..84e45bc66c343 100644 --- a/pkgs/development/tools/cdecrypt/default.nix +++ b/pkgs/development/tools/cdecrypt/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -Dm755 cdecrypt $out/bin/cdecrypt + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/confluent-cli/default.nix b/pkgs/development/tools/confluent-cli/default.nix index e614fe7d947d3..015ca4bd82bd1 100644 --- a/pkgs/development/tools/confluent-cli/default.nix +++ b/pkgs/development/tools/confluent-cli/default.nix @@ -30,10 +30,14 @@ stdenv.mkDerivation rec { dontStrip = stdenv.isDarwin; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/doc/confluent-cli} cp confluent $out/bin/ cp LICENSE $out/share/doc/confluent-cli/ cp -r legal $out/share/doc/confluent-cli/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/continuous-integration/buildbot/master.nix b/pkgs/development/tools/continuous-integration/buildbot/master.nix index d0a2efb32b57a..497f017f94911 100644 --- a/pkgs/development/tools/continuous-integration/buildbot/master.nix +++ b/pkgs/development/tools/continuous-integration/buildbot/master.nix @@ -59,9 +59,13 @@ let propagatedBuildInputs = plugins ++ buildbot.propagatedBuildInputs; installPhase = '' + runHook preInstall + makeWrapper ${buildbot}/bin/buildbot $out/bin/buildbot \ --prefix PYTHONPATH : "${buildbot}/${python.sitePackages}:$PYTHONPATH" ln -sfv ${buildbot}/lib $out/lib + + runHook postInstall ''; passthru = buildbot.passthru // { diff --git a/pkgs/development/tools/database/apgdiff/default.nix b/pkgs/development/tools/database/apgdiff/default.nix index 8ce720efd6819..fea381db89e50 100644 --- a/pkgs/development/tools/database/apgdiff/default.nix +++ b/pkgs/development/tools/database/apgdiff/default.nix @@ -27,12 +27,16 @@ maven.buildMavenPackage rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm644 target/apgdiff-${version}.jar $out/lib/apgdiff.jar mkdir -p $out/bin makeWrapper ${jre}/bin/java $out/bin/apgdiff \ --argv0 apgdiff \ --add-flags "-jar $out/lib/apgdiff.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/database/ephemeralpg/default.nix b/pkgs/development/tools/database/ephemeralpg/default.nix index b50d22d76e78f..6cb3129d7c9de 100644 --- a/pkgs/development/tools/database/ephemeralpg/default.nix +++ b/pkgs/development/tools/database/ephemeralpg/default.nix @@ -8,9 +8,13 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out PREFIX=$out make install wrapProgram $out/bin/pg_tmp --prefix PATH : ${lib.makeBinPath [ postgresql getopt ]} + + runHook postInstall ''; meta = with lib; { description = "Run tests on an isolated, temporary PostgreSQL database"; diff --git a/pkgs/development/tools/database/pg_checksums/default.nix b/pkgs/development/tools/database/pg_checksums/default.nix index 0aac2409c07b1..8f1bfdee5125b 100644 --- a/pkgs/development/tools/database/pg_checksums/default.nix +++ b/pkgs/development/tools/database/pg_checksums/default.nix @@ -23,8 +23,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin pg_checksums_ext install -Dm644 -t $out/share/man/man1 doc/man1/pg_checksums_ext.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/database/schemaspy/default.nix b/pkgs/development/tools/database/schemaspy/default.nix index 5e07beaff6f7d..ca81823358ab6 100644 --- a/pkgs/development/tools/database/schemaspy/default.nix +++ b/pkgs/development/tools/database/schemaspy/default.nix @@ -49,11 +49,15 @@ maven.buildMavenPackage rec { ''; installPhase = '' + runHook preInstall + install -D target/${pname}-${version}.jar $out/share/java/${pname}-${version}.jar makeWrapper ${jre}/bin/java $out/bin/schemaspy \ --add-flags "-jar $out/share/java/${pname}-${version}.jar" \ --prefix PATH : "$wrappedPath" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/database/sqlcl/default.nix b/pkgs/development/tools/database/sqlcl/default.nix index 9bd1cca620e91..e3666b9fed4ab 100644 --- a/pkgs/development/tools/database/sqlcl/default.nix +++ b/pkgs/development/tools/database/sqlcl/default.nix @@ -14,12 +14,16 @@ stdenv.mkDerivation (finalAttrs: { unpackCmd = "unzip $curSrc"; installPhase = '' + runHook preInstall + mkdir -p $out/libexec mv * $out/libexec/ makeWrapper $out/libexec/bin/sql $out/bin/sqlcl \ --set JAVA_HOME ${jdk.home} \ --chdir "$out/libexec/bin" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/database/sqldeveloper/default.nix b/pkgs/development/tools/database/sqldeveloper/default.nix index 655156c176c6b..7855ed87f8197 100644 --- a/pkgs/development/tools/database/sqldeveloper/default.nix +++ b/pkgs/development/tools/database/sqldeveloper/default.nix @@ -54,6 +54,8 @@ in unpackCmd = "unzip $curSrc"; installPhase = '' + runHook preInstall + mkdir -p $out/libexec $out/share/{applications,pixmaps} mv * $out/libexec/ @@ -63,6 +65,8 @@ in makeWrapper $out/libexec/sqldeveloper/bin/sqldeveloper $out/bin/sqldeveloper \ --set JAVA_HOME ${jdk.home} \ --chdir "$out/libexec/sqldeveloper/bin" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/dcadec/default.nix b/pkgs/development/tools/dcadec/default.nix index bf531476566e7..ed7d594eea0da 100644 --- a/pkgs/development/tools/dcadec/default.nix +++ b/pkgs/development/tools/dcadec/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "07nd0ajizrp1w02bsyfcv18431r8m8rq8gjfmz9wmckpg7cxj2hs"; }; - installPhase = "make PREFIX=/ DESTDIR=$out install"; + installPhase = "runHook preInstall; make PREFIX=/ DESTDIR=$out install; runHook postInstall"; doCheck = false; # fails with "ERROR: Run 'git submodule update --init test/samples' first." diff --git a/pkgs/development/tools/electron-fiddle/default.nix b/pkgs/development/tools/electron-fiddle/default.nix index 4add8cadb7d39..76d2f45aae356 100644 --- a/pkgs/development/tools/electron-fiddle/default.nix +++ b/pkgs/development/tools/electron-fiddle/default.nix @@ -77,10 +77,14 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p "$out/lib/electron-fiddle/resources" cp "out/Electron Fiddle-"*/resources/app.asar "$out/lib/electron-fiddle/resources/" mkdir -p "$out/share/icons/hicolor/scalable/apps" cp assets/icons/fiddle.svg "$out/share/icons/hicolor/scalable/apps/electron-fiddle.svg" + + runHook postInstall ''; }; diff --git a/pkgs/development/tools/electron/binary/generic.nix b/pkgs/development/tools/electron/binary/generic.nix index a11baed163da2..7c3e379bd54d6 100644 --- a/pkgs/development/tools/electron/binary/generic.nix +++ b/pkgs/development/tools/electron/binary/generic.nix @@ -119,10 +119,14 @@ let dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/libexec/electron $out/bin unzip -d $out/libexec/electron $src ln -s $out/libexec/electron/electron $out/bin chmod u-x $out/libexec/electron/*.so* + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/development/tools/flyway/default.nix b/pkgs/development/tools/flyway/default.nix index cd42388f0f829..63a0ffd659f9b 100644 --- a/pkgs/development/tools/flyway/default.nix +++ b/pkgs/development/tools/flyway/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation (finalAttrs: { dontBuild = true; dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/flyway cp -r sql jars drivers conf $out/share/flyway install -Dt $out/share/flyway/lib lib/community/*.jar lib/*.jar lib/aad/*.jar lib/oracle_wallet/*.jar @@ -19,6 +21,8 @@ stdenv.mkDerivation (finalAttrs: { --add-flags "-classpath '$out/share/flyway/lib/*:$out/share/flyway/drivers/*'" \ --add-flags "org.flywaydb.commandline.Main" \ --add-flags "-jarDirs='$out/share/flyway/jars'" + + runHook postInstall ''; passthru.tests = { version = testers.testVersion { package = finalAttrs.finalPackage; }; diff --git a/pkgs/development/tools/fusee-launcher/default.nix b/pkgs/development/tools/fusee-launcher/default.nix index 776f5c064aefb..375ea76d80d7b 100644 --- a/pkgs/development/tools/fusee-launcher/default.nix +++ b/pkgs/development/tools/fusee-launcher/default.nix @@ -26,6 +26,8 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share cp fusee-launcher.py $out/bin/fusee-launcher cp intermezzo.bin $out/share/intermezzo.bin @@ -34,6 +36,8 @@ stdenv.mkDerivation { wrapProgram $out/bin/fusee-launcher \ --add-flags "--relocator $out/share/intermezzo.bin" \ --prefix PYTHONPATH : "$PYTHONPATH:$(toPythonPath $out)" + + runHook postInstall ''; nativeBuildInputs = [ arm-embedded-cc makeWrapper python3Packages.wrapPython ]; diff --git a/pkgs/development/tools/galen/default.nix b/pkgs/development/tools/galen/default.nix index 581a6f99374e0..73043c9771de5 100644 --- a/pkgs/development/tools/galen/default.nix +++ b/pkgs/development/tools/galen/default.nix @@ -18,10 +18,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cat galen | sed -e "s,java,$jre8/bin/java," > $out/bin/galen chmod +x $out/bin/galen cp galen.jar $out/bin - ''; + + runHook postInstall +''; meta = with lib; { homepage = "http://galenframework.com"; diff --git a/pkgs/development/tools/gauge/plugins/js/default.nix b/pkgs/development/tools/gauge/plugins/js/default.nix index 20af0ab0f8f97..69cc1895be1fb 100644 --- a/pkgs/development/tools/gauge/plugins/js/default.nix +++ b/pkgs/development/tools/gauge/plugins/js/default.nix @@ -28,8 +28,12 @@ buildNpmPackage rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/gauge-plugins/js/${version} unzip deploy/gauge-js-${version}.zip -d $out/share/gauge-plugins/js/${version} + + runHook postInstall ''; meta = { diff --git a/pkgs/development/tools/gauge/plugins/make-gauge-plugin.nix b/pkgs/development/tools/gauge/plugins/make-gauge-plugin.nix index 81fbff823802d..8e34dab4549a0 100644 --- a/pkgs/development/tools/gauge/plugins/make-gauge-plugin.nix +++ b/pkgs/development/tools/gauge/plugins/make-gauge-plugin.nix @@ -37,8 +37,12 @@ stdenvNoCC.mkDerivation (finalAttrs: (lib.recursiveUpdate { nativeBuildInputs = [ autoPatchelfHook ]; installPhase = '' + runHook preInstall + mkdir -p "$out/share/gauge-plugins/${pname}/${finalAttrs.version}" cp -r . "$out/share/gauge-plugins/${pname}/${finalAttrs.version}" + + runHook postInstall ''; passthru.updateScript = writeScript "update-${finalAttrs.pname}" '' diff --git a/pkgs/development/tools/gauge/wrapper.nix b/pkgs/development/tools/gauge/wrapper.nix index 67b1a8ddc52b1..607d702b4244e 100644 --- a/pkgs/development/tools/gauge/wrapper.nix +++ b/pkgs/development/tools/gauge/wrapper.nix @@ -15,6 +15,8 @@ stdenvNoCC.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out{bin,/share/gauge/{plugins,config}} export NIX_GAUGE_IN_SANDBOX=true export GAUGE_HOME=$(mktemp -d) @@ -41,6 +43,8 @@ stdenvNoCC.mkDerivation { makeWrapper ${gauge-unwrapped}/bin/gauge $out/bin/gauge \ --set GAUGE_HOME "$GAUGE_HOME" + + runHook postInstall ''; nativeBuildInputs = [ gauge-unwrapped makeWrapper xorg.lndir ]; diff --git a/pkgs/development/tools/global-platform-pro/default.nix b/pkgs/development/tools/global-platform-pro/default.nix index b35cc4998f67c..c3b378bdcc647 100644 --- a/pkgs/development/tools/global-platform-pro/default.nix +++ b/pkgs/development/tools/global-platform-pro/default.nix @@ -40,11 +40,15 @@ maven.buildMavenPackage rec { preConfigure = defineMvnWrapper; installPhase = '' + runHook preInstall + mkdir -p "$out/lib/java" "$out/share/java" cp tool/target/gp.jar "$out/share/java" makeWrapper "${jre8_headless}/bin/java" "$out/bin/gp" \ --add-flags "-jar '$out/share/java/gp.jar'" \ --prefix LD_LIBRARY_PATH : "${lib.getLib pcsclite}/lib" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/gnulib/default.nix b/pkgs/development/tools/gnulib/default.nix index 1a5f173317d11..43f8582ee23a0 100644 --- a/pkgs/development/tools/gnulib/default.nix +++ b/pkgs/development/tools/gnulib/default.nix @@ -19,10 +19,14 @@ stdenv.mkDerivation rec { buildInputs = [ python3 ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r * $out/ ln -s $out/lib $out/include ln -s $out/gnulib-tool $out/bin/ + + runHook postInstall ''; # do not change headers to not update all vendored build files diff --git a/pkgs/development/tools/godot/3/mono/make-deps.nix b/pkgs/development/tools/godot/3/mono/make-deps.nix index 553b125dc6356..e047884d1dfe0 100644 --- a/pkgs/development/tools/godot/3/mono/make-deps.nix +++ b/pkgs/development/tools/godot/3/mono/make-deps.nix @@ -13,7 +13,13 @@ godot3-mono.overrideAttrs (self: base: { outputs = [ "out" ]; buildPhase = " "; - installPhase = ''echo "No output intended. Run make-deps.sh instead." > $out''; + installPhase = '' + runHook preInstall + + echo "No output intended. Run make-deps.sh instead." > $out + + runHook postInstall +''; # This script is used to update the accompanying deps.nix file, a nix expression listing the # nuget packages that the godot-mono code depends on, along with their sha256 hashes. This diff --git a/pkgs/development/tools/google-app-engine-go-sdk/default.nix b/pkgs/development/tools/google-app-engine-go-sdk/default.nix index 1230ac606ecf6..22fb6ed06c45b 100644 --- a/pkgs/development/tools/google-app-engine-go-sdk/default.nix +++ b/pkgs/development/tools/google-app-engine-go-sdk/default.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation rec { buildInputs = [ python ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/ cp -r "$src" "$out/share/go_appengine" @@ -30,6 +32,8 @@ stdenv.mkDerivation rec { --prefix PATH : "${python}/bin" \ --prefix PYTHONPATH : "$(toPythonPath ${cffi}):$(toPythonPath ${cryptography}):$(toPythonPath ${pyopenssl})" done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/gtk-mac-bundler/default.nix b/pkgs/development/tools/gtk-mac-bundler/default.nix index a94534a9cb32f..a2d664fbe2d97 100644 --- a/pkgs/development/tools/gtk-mac-bundler/default.nix +++ b/pkgs/development/tools/gtk-mac-bundler/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin substitute gtk-mac-bundler.in $out/bin/gtk-mac-bundler \ --subst-var-by PATH $out/share @@ -19,6 +21,8 @@ stdenv.mkDerivation rec { mkdir -p $out/share cp -r bundler $out/share + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/halfempty/default.nix b/pkgs/development/tools/halfempty/default.nix index 62b0d161b4123..205acc3998673 100644 --- a/pkgs/development/tools/halfempty/default.nix +++ b/pkgs/development/tools/halfempty/default.nix @@ -32,7 +32,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -vDt $out/bin halfempty + + runHook postInstall ''; doCheck = true; diff --git a/pkgs/development/tools/heroku/default.nix b/pkgs/development/tools/heroku/default.nix index 5535b49a383cc..d790f2f36e21e 100644 --- a/pkgs/development/tools/heroku/default.nix +++ b/pkgs/development/tools/heroku/default.nix @@ -14,12 +14,16 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/heroku $out/bin cp -pr * $out/share/heroku substituteInPlace $out/share/heroku/bin/run \ --replace "/usr/bin/env node" "${nodejs}/bin/node" makeWrapper $out/share/heroku/bin/run $out/bin/heroku \ --set HEROKU_DISABLE_AUTOUPDATE 1 + + runHook postInstall ''; passthru.updateScript = writeScript "update-heroku" '' diff --git a/pkgs/development/tools/hexio/default.nix b/pkgs/development/tools/hexio/default.nix index 0b4e474515ab7..3c535f9d66dd8 100644 --- a/pkgs/development/tools/hexio/default.nix +++ b/pkgs/development/tools/hexio/default.nix @@ -22,10 +22,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib $out/sbin $out/man make DESTDIR=$out PREFIX=/ all make DESTDIR=$out PREFIX=/ install - ''; + + runHook postInstall + ''; meta = with lib; { description = "Low-level I/O helpers for hexadecimal, tty/serial devices and so on"; diff --git a/pkgs/development/tools/iaca/2.1.nix b/pkgs/development/tools/iaca/2.1.nix index 584b8856e89fc..c78969eeb192c 100644 --- a/pkgs/development/tools/iaca/2.1.nix +++ b/pkgs/development/tools/iaca/2.1.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { unpackCmd = ''${unzip}/bin/unzip "$src" -x __MACOSX/ __MACOSX/iaca-lin64/ __MACOSX/iaca-lin64/._.DS_Store''; nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib cp bin/iaca $out/bin/ cp lib/* $out/lib + + runHook postInstall ''; preFixup = let libPath = lib.makeLibraryPath [ stdenv.cc.cc.lib gcc ]; in '' patchelf \ diff --git a/pkgs/development/tools/iaca/3.0.nix b/pkgs/development/tools/iaca/3.0.nix index 1c0a4f5460fd5..6965bc1869486 100644 --- a/pkgs/development/tools/iaca/3.0.nix +++ b/pkgs/development/tools/iaca/3.0.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { }; unpackCmd = ''${unzip}/bin/unzip "$src"''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp iaca $out/bin patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 $out/bin/iaca + + runHook postInstall ''; meta = with lib; { description = "Intel Architecture Code Analyzer"; diff --git a/pkgs/development/tools/infisical/default.nix b/pkgs/development/tools/infisical/default.nix index e5520cfa58247..344ee5d0faa84 100644 --- a/pkgs/development/tools/infisical/default.nix +++ b/pkgs/development/tools/infisical/default.nix @@ -51,10 +51,14 @@ stdenv.mkDerivation { buildPhase = "chmod +x ./infisical"; checkPhase = "./infisical --version"; installPhase = '' + runHook preInstall + mkdir -p $out/bin/ $out/share/completions/ $out/share/man/ cp infisical $out/bin cp completions/* $out/share/completions/ cp manpages/* $out/share/man/ + + runHook postInstall ''; postInstall = '' installManPage share/man/infisical.1.gz diff --git a/pkgs/development/tools/java/dex2jar/default.nix b/pkgs/development/tools/java/dex2jar/default.nix index e0ce19dc8d2f8..3bbd1764b1102 100644 --- a/pkgs/development/tools/java/dex2jar/default.nix +++ b/pkgs/development/tools/java/dex2jar/default.nix @@ -23,6 +23,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + f=$out/share/dex2jar/ mkdir -p $f $out/bin @@ -32,6 +34,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { n=$(basename ''${i%.sh}) makeWrapper $i $out/bin/$n --prefix PATH : ${lib.makeBinPath [ jre ] } done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/java/jhiccup/default.nix b/pkgs/development/tools/java/jhiccup/default.nix index 453455dcd118c..eb86375eebe0a 100644 --- a/pkgs/development/tools/java/jhiccup/default.nix +++ b/pkgs/development/tools/java/jhiccup/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { dontConfigure = true; buildPhase = ":"; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/java cp *.jar $out/share/java @@ -24,6 +26,8 @@ stdenv.mkDerivation rec { done mv jHiccup jHiccupLogProcessor $out/bin/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/tools/java/visualvm/default.nix b/pkgs/development/tools/java/visualvm/default.nix index 5ec81ec7040d8..49c3b23a408bb 100644 --- a/pkgs/development/tools/java/visualvm/default.nix +++ b/pkgs/development/tools/java/visualvm/default.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + find . -type f -name "*.dll" -o -name "*.exe" -delete; substituteInPlace etc/visualvm.conf \ @@ -28,6 +30,8 @@ stdenv.mkDerivation rec { --replace "/path/to/jdk" "${jdk.home}" \ cp -r . $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/jbake/default.nix b/pkgs/development/tools/jbake/default.nix index 48737ed668f77..c84f07810b248 100644 --- a/pkgs/development/tools/jbake/default.nix +++ b/pkgs/development/tools/jbake/default.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation rec { postPatch = "patchShebangs ."; installPhase = '' + runHook preInstall + mkdir -p $out cp -vr * $out wrapProgram $out/bin/jbake --set JAVA_HOME "${jre}" + + runHook postInstall ''; checkPhase = '' diff --git a/pkgs/development/tools/jsduck/default.nix b/pkgs/development/tools/jsduck/default.nix index debd33c807457..c8c163c07c700 100644 --- a/pkgs/development/tools/jsduck/default.nix +++ b/pkgs/development/tools/jsduck/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { buildInputs = [ env ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin makeWrapper ${env}/bin/jsduck $out/bin/jsduck + + runHook postInstall ''; passthru.updateScript = bundlerUpdateScript "jsduck"; diff --git a/pkgs/development/tools/ktlint/default.nix b/pkgs/development/tools/ktlint/default.nix index 1dc7b205e0d96..ad71916302d3b 100644 --- a/pkgs/development/tools/ktlint/default.nix +++ b/pkgs/development/tools/ktlint/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + install -Dm755 $src $out/bin/ktlint + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/development/tools/kustomize/kustomize-sops.nix b/pkgs/development/tools/kustomize/kustomize-sops.nix index b12d583d6a860..e3d820fa263d7 100644 --- a/pkgs/development/tools/kustomize/kustomize-sops.nix +++ b/pkgs/development/tools/kustomize/kustomize-sops.nix @@ -14,8 +14,12 @@ buildGoModule rec { vendorHash = "sha256-1qnNJltam04uLMhH8YftAl2jjEZP2UhVIMp9Vcy3jeg="; installPhase = '' + runHook preInstall + mkdir -p $out/lib/viaduct.ai/v1/ksops-exec/ mv $GOPATH/bin/kustomize-sops $out/lib/viaduct.ai/v1/ksops-exec/ksops-exec + + runHook postInstall ''; # Tests are broken in a nix environment diff --git a/pkgs/development/tools/kythe/default.nix b/pkgs/development/tools/kythe/default.nix index 4129e220ac024..08ccfdb3b3553 100644 --- a/pkgs/development/tools/kythe/default.nix +++ b/pkgs/development/tools/kythe/default.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + cd tools for exe in http_server \ kythe read_entries triples verifier \ @@ -28,6 +30,8 @@ stdenv.mkDerivation rec { cd ../ cp -R ./ $out ln -s $out/tools $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/language-servers/kotlin-language-server/default.nix b/pkgs/development/tools/language-servers/kotlin-language-server/default.nix index 19ff79c332aba..08f42822e2a88 100644 --- a/pkgs/development/tools/language-servers/kotlin-language-server/default.nix +++ b/pkgs/development/tools/language-servers/kotlin-language-server/default.nix @@ -11,10 +11,14 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib mkdir -p $out/bin cp -r lib/* $out/lib cp -r bin/* $out/bin + + runHook postInstall ''; nativeBuildInputs = [ gradle makeWrapper ]; diff --git a/pkgs/development/tools/language-servers/metals/default.nix b/pkgs/development/tools/language-servers/metals/default.nix index 708d62d2ec7bb..e562f7107e415 100644 --- a/pkgs/development/tools/language-servers/metals/default.nix +++ b/pkgs/development/tools/language-servers/metals/default.nix @@ -27,10 +27,14 @@ stdenv.mkDerivation rec { extraJavaOpts = "-XX:+UseG1GC -XX:+UseStringDeduplication -Xss4m -Xms100m"; installPhase = '' + runHook preInstall + mkdir -p $out/bin makeWrapper ${jre}/bin/java $out/bin/metals \ --add-flags "${extraJavaOpts} -cp $CLASSPATH scala.meta.metals.Main" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/language-servers/perlnavigator/default.nix b/pkgs/development/tools/language-servers/perlnavigator/default.nix index a7d243888587c..ae91b2ce3769d 100644 --- a/pkgs/development/tools/language-servers/perlnavigator/default.nix +++ b/pkgs/development/tools/language-servers/perlnavigator/default.nix @@ -18,7 +18,11 @@ let npmDepsHash = "sha256-PJKW+ni2wKw1ivkgQsL6g0jaxoYboa3XpVEEwgT4jWo="; dontNpmBuild = true; installPhase = '' + runHook preInstall + cp -r . "$out" + + runHook postInstall ''; }; client = buildNpmPackage { @@ -28,7 +32,11 @@ let npmDepsHash = "sha256-CM0l+D1VNkXBrZQHQGDiB/vAxMvpbHYoYlIugoLxSfA="; dontNpmBuild = true; installPhase = '' + runHook preInstall + cp -r . "$out" + + runHook postInstall ''; }; server = buildNpmPackage { @@ -38,7 +46,11 @@ let npmDepsHash = "sha256-TxK3ba9T97p8TBlULHUov6YX7WRl2QMq6TiNHxBoQeY="; dontNpmBuild = true; installPhase = '' + runHook preInstall + cp -r . "$out" + + runHook postInstall ''; }; in buildNpmPackage rec { diff --git a/pkgs/development/tools/literate-programming/eweb/default.nix b/pkgs/development/tools/literate-programming/eweb/default.nix index 1a885af12187d..ee583b46b0ce6 100644 --- a/pkgs/development/tools/literate-programming/eweb/default.nix +++ b/pkgs/development/tools/literate-programming/eweb/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { buildInputs = [ python3 asciidoc ]; installPhase = '' + runHook preInstall + install -d $out/bin $out/share/doc/${pname}-${version} cp etangle.py $out/bin cp etangle.w etangle.html $out/share/doc/${pname}-${version} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/literate-programming/funnelweb/default.nix b/pkgs/development/tools/literate-programming/funnelweb/default.nix index 10b4880df7cd2..bc5458c83b260 100644 --- a/pkgs/development/tools/literate-programming/funnelweb/default.nix +++ b/pkgs/development/tools/literate-programming/funnelweb/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -d $out/bin install fw $out/bin/fw + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/literate-programming/nuweb/default.nix b/pkgs/development/tools/literate-programming/nuweb/default.nix index bc7841843a8d0..58b37c5dc7584 100644 --- a/pkgs/development/tools/literate-programming/nuweb/default.nix +++ b/pkgs/development/tools/literate-programming/nuweb/default.nix @@ -27,11 +27,15 @@ stdenv.mkDerivation rec { make nuweb.pdf nuwebdoc.pdf all ''; installPhase = '' + runHook preInstall + install -d $out/bin $out/share/man/man1 $out/share/doc/${pname}-${version} $out/share/emacs/site-lisp cp nuweb $out/bin cp nuweb.el $out/share/emacs/site-lisp gzip -c nuweb.1 > $out/share/man/man1/nuweb.1.gz cp htdocs/index.html nuweb.w nuweb.pdf nuwebdoc.pdf README $out/share/doc/${pname}-${version} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/makerpm/default.nix b/pkgs/development/tools/makerpm/default.nix index a00d4a4d66630..993994c01d1e9 100644 --- a/pkgs/development/tools/makerpm/default.nix +++ b/pkgs/development/tools/makerpm/default.nix @@ -5,8 +5,12 @@ stdenv.mkDerivation rec { pname = "makerpm"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp makerpm $out/bin + + runHook postInstall ''; buildInputs = [ zlib libarchive openssl ]; diff --git a/pkgs/development/tools/mblock-mlink/default.nix b/pkgs/development/tools/mblock-mlink/default.nix index 0b6ec3252ef5e..acc6a2feef95e 100644 --- a/pkgs/development/tools/mblock-mlink/default.nix +++ b/pkgs/development/tools/mblock-mlink/default.nix @@ -22,11 +22,15 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mv $out/usr/local/makeblock $out/usr/makeblock rmdir $out/usr/local mkdir -p $out/bin echo $out/usr/makeblock/mLink/mnode $out/usr/makeblock/mLink/app.js > $out/bin/mlink chmod +x $out/bin/mlink + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/misc/automaticcomponenttoolkit/default.nix b/pkgs/development/tools/misc/automaticcomponenttoolkit/default.nix index 59a9914891d7e..224f2b02b928f 100644 --- a/pkgs/development/tools/misc/automaticcomponenttoolkit/default.nix +++ b/pkgs/development/tools/misc/automaticcomponenttoolkit/default.nix @@ -20,7 +20,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm0755 act $out/bin/act + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/misc/cbrowser/default.nix b/pkgs/development/tools/misc/cbrowser/default.nix index 72a177a17f934..de40a9d61f4ae 100644 --- a/pkgs/development/tools/misc/cbrowser/default.nix +++ b/pkgs/development/tools/misc/cbrowser/default.nix @@ -15,11 +15,15 @@ stdenv.mkDerivation rec { buildInputs = [ tk ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/${pname}-${version} cp -R * $out/share/${pname}-${version}/ makeWrapper $out/share/${pname}-${version}/cbrowser $out/bin/cbrowser \ --prefix PATH : ${tk}/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/development/tools/misc/chruby/default.nix b/pkgs/development/tools/misc/chruby/default.nix index 10d6d2e7d020c..4527ab36676d5 100644 --- a/pkgs/development/tools/misc/chruby/default.nix +++ b/pkgs/development/tools/misc/chruby/default.nix @@ -28,9 +28,13 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir $out cp -r bin $out cp -r share $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/misc/distcc/masq.nix b/pkgs/development/tools/misc/distcc/masq.nix index 27840481a1091..79898149ec996 100644 --- a/pkgs/development/tools/misc/distcc/masq.nix +++ b/pkgs/development/tools/misc/distcc/masq.nix @@ -6,6 +6,8 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin bin=${gccRaw}/bin @@ -37,6 +39,8 @@ stdenv.mkDerivation { ln -sf $bbin/*-as $out/bin/as done fi + + runHook postInstall ''; meta = { diff --git a/pkgs/development/tools/misc/gede/default.nix b/pkgs/development/tools/misc/gede/default.nix index 6ae512657666c..16b821a1e3f1e 100644 --- a/pkgs/development/tools/misc/gede/default.nix +++ b/pkgs/development/tools/misc/gede/default.nix @@ -20,9 +20,13 @@ mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + python build.py install --verbose --prefix="$out" wrapProgram $out/bin/gede \ --prefix PATH : ${lib.makeBinPath [ ctags gdb ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/misc/gef/default.nix b/pkgs/development/tools/misc/gef/default.nix index fd3071a081759..bf7b96cdff792 100644 --- a/pkgs/development/tools/misc/gef/default.nix +++ b/pkgs/development/tools/misc/gef/default.nix @@ -35,6 +35,8 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/gef cp gef.py $out/share/gef makeWrapper ${gdb}/bin/gdb $out/bin/gef \ @@ -46,6 +48,8 @@ in stdenv.mkDerivation rec { file ps ]} + + runHook postInstall ''; nativeCheckInputs = [ diff --git a/pkgs/development/tools/misc/grpc-tools/default.nix b/pkgs/development/tools/misc/grpc-tools/default.nix index 5c21f8a0f415d..a4ad594701474 100644 --- a/pkgs/development/tools/misc/grpc-tools/default.nix +++ b/pkgs/development/tools/misc/grpc-tools/default.nix @@ -22,8 +22,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin grpc_node_plugin install -Dm755 -t $out/bin deps/protobuf/protoc + + runHook postInstall ''; passthru.updateScript = gitUpdater { diff --git a/pkgs/development/tools/misc/iozone/default.nix b/pkgs/development/tools/misc/iozone/default.nix index a724d67a1a047..0b4c38c3b0e0d 100644 --- a/pkgs/development/tools/misc/iozone/default.nix +++ b/pkgs/development/tools/misc/iozone/default.nix @@ -34,6 +34,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/doc,libexec,share/man/man1} install docs/iozone.1 $out/share/man/man1/ install docs/Iozone_ps.gz $out/share/doc/ @@ -42,6 +44,8 @@ stdenv.mkDerivation rec { ln -s $out/libexec/Generate_Graphs $out/bin/iozone_generate_graphs # License copy is mandated by the license, but it's not in the tarball. install ${license} $out/share/doc/Iozone_License.txt + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/development/tools/misc/libwhich/default.nix b/pkgs/development/tools/misc/libwhich/default.nix index e8d919cfabe02..98d5a01d8d270 100644 --- a/pkgs/development/tools/misc/libwhich/default.nix +++ b/pkgs/development/tools/misc/libwhich/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin libwhich + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/misc/lsof/default.nix b/pkgs/development/tools/misc/lsof/default.nix index b43030594d3d1..d9e4d580ace77 100644 --- a/pkgs/development/tools/misc/lsof/default.nix +++ b/pkgs/development/tools/misc/lsof/default.nix @@ -44,6 +44,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + # Fix references from man page https://github.com/lsof-org/lsof/issues/66 substituteInPlace Lsof.8 \ --replace ".so ./00DIALECTS" "" \ @@ -51,6 +53,8 @@ stdenv.mkDerivation rec { mkdir -p $out/bin $out/man/man8 cp Lsof.8 $out/man/man8/lsof.8 cp lsof $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/misc/micronucleus/default.nix b/pkgs/development/tools/misc/micronucleus/default.nix index d7141324dc971..322bdd086a8b1 100644 --- a/pkgs/development/tools/misc/micronucleus/default.nix +++ b/pkgs/development/tools/misc/micronucleus/default.nix @@ -20,10 +20,14 @@ stdenv.mkDerivation rec { makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/lib/udev cp micronucleus $out/bin cp 49-micronucleus.rules $out/lib/udev + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/misc/netcoredbg/default.nix b/pkgs/development/tools/misc/netcoredbg/default.nix index d3c08025108e4..e9369584cd52c 100644 --- a/pkgs/development/tools/misc/netcoredbg/default.nix +++ b/pkgs/development/tools/misc/netcoredbg/default.nix @@ -65,11 +65,15 @@ stdenv.mkDerivation { nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ]; buildInputs = lib.optionals stdenv.isLinux [ stdenv.cc.cc.lib ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/netcoredbg $out/bin cp ${unmanaged}/* $out/share/netcoredbg cp ./lib/netcoredbg/* $out/share/netcoredbg # darwin won't work unless we link all files ln -s $out/share/netcoredbg/* "$out/bin/" + + runHook postInstall ''; passthru = { diff --git a/pkgs/development/tools/misc/objconv/default.nix b/pkgs/development/tools/misc/objconv/default.nix index c811925fbe633..afd6d8201f7b1 100644 --- a/pkgs/development/tools/misc/objconv/default.nix +++ b/pkgs/development/tools/misc/objconv/default.nix @@ -24,9 +24,13 @@ stdenv.mkDerivation rec { buildPhase = "c++ -o objconv -O2 *.cpp"; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/doc/objconv mv objconv $out/bin mv objconv-instructions.pdf $out/doc/objconv + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/misc/premake/3.nix b/pkgs/development/tools/misc/premake/3.nix index 9e9775dcf71eb..8390a30550a8e 100644 --- a/pkgs/development/tools/misc/premake/3.nix +++ b/pkgs/development/tools/misc/premake/3.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + install -Dm755 bin/premake $out/bin/premake + + runHook postInstall ''; premake_cmd = "premake"; diff --git a/pkgs/development/tools/misc/premake/5.nix b/pkgs/development/tools/misc/premake/5.nix index 64ee0c37317d6..0f7107c5799ab 100644 --- a/pkgs/development/tools/misc/premake/5.nix +++ b/pkgs/development/tools/misc/premake/5.nix @@ -41,7 +41,11 @@ stdenv.mkDerivation rec { ]); installPhase = '' + runHook preInstall + install -Dm755 bin/release/premake5 $out/bin/premake5 + + runHook postInstall ''; premake_cmd = "premake5"; diff --git a/pkgs/development/tools/misc/premake/default.nix b/pkgs/development/tools/misc/premake/default.nix index 9987cb2d0b9b2..8925d4664e9c8 100644 --- a/pkgs/development/tools/misc/premake/default.nix +++ b/pkgs/development/tools/misc/premake/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 bin/release/premake4 $out/bin/premake4 + + runHook postInstall ''; premake_cmd = "premake4"; diff --git a/pkgs/development/tools/misc/remarkable/remarkable-toolchain/default.nix b/pkgs/development/tools/misc/remarkable/remarkable-toolchain/default.nix index 1ff4e5c62459b..e47ef389d312d 100644 --- a/pkgs/development/tools/misc/remarkable/remarkable-toolchain/default.nix +++ b/pkgs/development/tools/misc/remarkable/remarkable-toolchain/default.nix @@ -21,8 +21,12 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out ENVCLEANED=1 $src -y -d $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/misc/remarkable/remarkable2-toolchain/default.nix b/pkgs/development/tools/misc/remarkable/remarkable2-toolchain/default.nix index 6e6b79e8f2e92..7bb7a2cc1b6ba 100644 --- a/pkgs/development/tools/misc/remarkable/remarkable2-toolchain/default.nix +++ b/pkgs/development/tools/misc/remarkable/remarkable2-toolchain/default.nix @@ -21,8 +21,12 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out ENVCLEANED=1 $src -y -d $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/misc/rolespec/default.nix b/pkgs/development/tools/misc/rolespec/default.nix index e5870d582e982..9dfcc82a8e853 100644 --- a/pkgs/development/tools/misc/rolespec/default.nix +++ b/pkgs/development/tools/misc/rolespec/default.nix @@ -22,8 +22,12 @@ stdenv.mkDerivation rec { # Wrap the program because `ROLESPEC_LIB` defaults to # `/usr/local/lib/rolespec`. installPhase = '' + runHook preInstall + make install PREFIX=$out wrapProgram $out/bin/rolespec --set ROLESPEC_LIB $out/lib/rolespec + + runHook postInstall ''; # Since RoleSpec installs the shell script files in `lib` directory, the diff --git a/pkgs/development/tools/misc/saleae-logic/default.nix b/pkgs/development/tools/misc/saleae-logic/default.nix index d4f17fb595d07..7269828ddd706 100644 --- a/pkgs/development/tools/misc/saleae-logic/default.nix +++ b/pkgs/development/tools/misc/saleae-logic/default.nix @@ -47,6 +47,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + # Copy prebuilt app to $out mkdir "$out" cp -r * "$out" @@ -85,6 +87,8 @@ stdenv.mkDerivation rec { # Install provided udev rules mkdir -p "$out/etc/udev/rules.d" cp Drivers/99-SaleaeLogic.rules "$out/etc/udev/rules.d/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/misc/sqitch/default.nix b/pkgs/development/tools/misc/sqitch/default.nix index 612ef223e67be..2146cb9fe3af2 100644 --- a/pkgs/development/tools/misc/sqitch/default.nix +++ b/pkgs/development/tools/misc/sqitch/default.nix @@ -26,6 +26,8 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin for d in bin/sqitch etc lib share ; do # make sure dest alreay exists before symlink @@ -36,6 +38,8 @@ stdenv.mkDerivation { done '' + lib.optionalString stdenv.isDarwin '' shortenPerlShebang $out/bin/sqitch + + runHook postInstall ''; dontStrip = true; postFixup = '' diff --git a/pkgs/development/tools/misc/tet/default.nix b/pkgs/development/tools/misc/tet/default.nix index a3f5942a6bfdf..d64f3d8c831fe 100644 --- a/pkgs/development/tools/misc/tet/default.nix +++ b/pkgs/development/tools/misc/tet/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation ({ buildPhase = "cd src; make; cd -"; - installPhase = "cd src; make install; cd -; cp -vr $PWD $out"; + installPhase = "runHook preInstall; cd src; make install; cd -; cp -vr $PWD $out; runHook postInstall"; meta = { description = "Test Environment Toolkit is used in test applications like The Open Group's UNIX Certification program and the Free Standards Group's LSB Certification program"; diff --git a/pkgs/development/tools/misc/tie/default.nix b/pkgs/development/tools/misc/tie/default.nix index 5a50600d47c89..17248d9bf3bdf 100644 --- a/pkgs/development/tools/misc/tie/default.nix +++ b/pkgs/development/tools/misc/tie/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp tie $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/misc/yodl/default.nix b/pkgs/development/tools/misc/yodl/default.nix index d8e5bd26b39da..25040bbf2e706 100644 --- a/pkgs/development/tools/misc/yodl/default.nix +++ b/pkgs/development/tools/misc/yodl/default.nix @@ -37,9 +37,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + ./build install programs ./build install macros ./build install man + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/mix2nix/default.nix b/pkgs/development/tools/mix2nix/default.nix index b0d3a8c8107c9..12fcb49826f3b 100644 --- a/pkgs/development/tools/mix2nix/default.nix +++ b/pkgs/development/tools/mix2nix/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ erlang ]; buildPhase = "mix escript.build"; - installPhase = "install -Dt $out/bin mix2nix"; + installPhase = "runHook preInstall; install -Dt $out/bin mix2nix; runHook postInstall"; meta = with lib; { description = "Generate nix expressions from mix.lock file"; diff --git a/pkgs/development/tools/nagelfar/default.nix b/pkgs/development/tools/nagelfar/default.nix index a40861e0988d4..bca6c0ab15365 100644 --- a/pkgs/development/tools/nagelfar/default.nix +++ b/pkgs/development/tools/nagelfar/default.nix @@ -16,7 +16,11 @@ tcl.mkTclDerivation { ]; installPhase = '' + runHook preInstall + install -Dm 755 $src/nagelfar.tcl $out/bin/nagelfar + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/neil/default.nix b/pkgs/development/tools/neil/default.nix index 6249685b503ba..e9d44b9860106 100644 --- a/pkgs/development/tools/neil/default.nix +++ b/pkgs/development/tools/neil/default.nix @@ -21,9 +21,13 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -D neil $out/bin/neil wrapProgram $out/bin/neil \ --prefix PATH : "${lib.makeBinPath [ babashka ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/ocaml/crunch/default.nix b/pkgs/development/tools/ocaml/crunch/default.nix index 8a9e91b554325..7fb1521321375 100644 --- a/pkgs/development/tools/ocaml/crunch/default.nix +++ b/pkgs/development/tools/ocaml/crunch/default.nix @@ -19,7 +19,11 @@ buildDunePackage rec { outputs = [ "lib" "bin" "out" ]; installPhase = '' + runHook preInstall + dune install --prefix=$bin --libdir=$lib/lib/ocaml/${ocaml.version}/site-lib/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/tools/ocaml/obuild/default.nix b/pkgs/development/tools/ocaml/obuild/default.nix index 4575226afdec7..9c1b8fa9930ba 100644 --- a/pkgs/development/tools/ocaml/obuild/default.nix +++ b/pkgs/development/tools/ocaml/obuild/default.nix @@ -21,8 +21,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp dist/build/obuild/obuild dist/build/obuild-from-oasis/obuild-from-oasis dist/build/obuild-simple/obuild-simple $out/bin/ + + runHook postInstall ''; meta = { diff --git a/pkgs/development/tools/ocaml/ocamlify/default.nix b/pkgs/development/tools/ocaml/ocamlify/default.nix index 7dd6843d52f9a..af2dcabf1774a 100644 --- a/pkgs/development/tools/ocaml/ocamlify/default.nix +++ b/pkgs/development/tools/ocaml/ocamlify/default.nix @@ -23,8 +23,12 @@ stdenv.mkDerivation rec { buildPhase = "ocamlbuild src/ocamlify.native"; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv _build/src/ocamlify.native $out/bin/ocamlify + + runHook postInstall ''; dontStrip = true; diff --git a/pkgs/development/tools/ocaml/utop/default.nix b/pkgs/development/tools/ocaml/utop/default.nix index 7c92c1acdd224..8df0810302495 100644 --- a/pkgs/development/tools/ocaml/utop/default.nix +++ b/pkgs/development/tools/ocaml/utop/default.nix @@ -33,11 +33,15 @@ buildDunePackage rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p "$out"/${path} for e in OCAMLPATH CAML_LD_LIBRARY_PATH; do [[ -v "$e" ]] || continue printf %s "''${!e}" > "$out"/${path}/$e done + + runHook postInstall ''; }; diff --git a/pkgs/development/tools/parse-cli-bin/default.nix b/pkgs/development/tools/parse-cli-bin/default.nix index 0ece2bb4afb0d..f380d2619af8f 100644 --- a/pkgs/development/tools/parse-cli-bin/default.nix +++ b/pkgs/development/tools/parse-cli-bin/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp "$src" "$out/bin/parse" chmod +x "$out/bin/parse" + + runHook postInstall ''; } diff --git a/pkgs/development/tools/parsing/antlr/3.4.nix b/pkgs/development/tools/parsing/antlr/3.4.nix index 38493dedab10c..6a1325255ba0c 100644 --- a/pkgs/development/tools/parsing/antlr/3.4.nix +++ b/pkgs/development/tools/parsing/antlr/3.4.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p "$out"/{lib/antlr,bin} cp "$src" "$out/lib/antlr/antlr-${version}-complete.jar" @@ -19,6 +21,8 @@ stdenv.mkDerivation rec { chmod a+x "$out/bin/antlr" ln -s "$out/bin/antlr"{,3} + + runHook postInstall ''; inherit jre; diff --git a/pkgs/development/tools/parsing/antlr/3.5.nix b/pkgs/development/tools/parsing/antlr/3.5.nix index 132da31fee351..e056258f62f77 100644 --- a/pkgs/development/tools/parsing/antlr/3.5.nix +++ b/pkgs/development/tools/parsing/antlr/3.5.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p "$out"/{lib/antlr,bin,include} cp "$jar" "$out/lib/antlr/antlr-${version}-complete.jar" cp runtime/Cpp/include/* $out/include/ @@ -31,6 +33,8 @@ stdenv.mkDerivation rec { chmod a+x "$out/bin/antlr" ln -s "$out/bin/antlr"{,3} + + runHook postInstall ''; inherit jre; diff --git a/pkgs/development/tools/parsing/antlr/4.nix b/pkgs/development/tools/parsing/antlr/4.nix index 79db5301add9c..a074ac0de1fb5 100644 --- a/pkgs/development/tools/parsing/antlr/4.nix +++ b/pkgs/development/tools/parsing/antlr/4.nix @@ -37,6 +37,8 @@ let dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p "$out"/{share/java,bin} ln -s "$src" "$out/share/java/antlr-${version}-complete.jar" @@ -52,6 +54,8 @@ let chmod a+x "$out/bin/antlr" "$out/bin/antlr-parse" "$out/bin/grun" ln -s "$out/bin/antlr"{,4} ln -s "$out/bin/antlr"{,4}-parse + + runHook postInstall ''; inherit jre; diff --git a/pkgs/development/tools/parsing/bisonc++/default.nix b/pkgs/development/tools/parsing/bisonc++/default.nix index 16d8e13cdfda7..5a7e2c03fa820 100644 --- a/pkgs/development/tools/parsing/bisonc++/default.nix +++ b/pkgs/development/tools/parsing/bisonc++/default.nix @@ -42,7 +42,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + ./build install x + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/parsing/flexc++/default.nix b/pkgs/development/tools/parsing/flexc++/default.nix index 1a56818b4d65b..047b362fc2bbf 100644 --- a/pkgs/development/tools/parsing/flexc++/default.nix +++ b/pkgs/development/tools/parsing/flexc++/default.nix @@ -30,7 +30,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + ./build install x + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/parsing/jikespg/default.nix b/pkgs/development/tools/parsing/jikespg/default.nix index 03814d3cfbe78..f77f94a14f673 100644 --- a/pkgs/development/tools/parsing/jikespg/default.nix +++ b/pkgs/development/tools/parsing/jikespg/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation rec { sourceRoot = "jikespg/src"; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin jikespg + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/parsing/lemon/default.nix b/pkgs/development/tools/parsing/lemon/default.nix index 512d3bccc9733..4e87ca3411224 100644 --- a/pkgs/development/tools/parsing/lemon/default.nix +++ b/pkgs/development/tools/parsing/lemon/default.nix @@ -26,8 +26,12 @@ in stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -Dvm755 lemon $out/bin/lemon install -Dvm644 ${srcs.lempar} $out/bin/lempar.c + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/pgloader/default.nix b/pkgs/development/tools/pgloader/default.nix index 59f3eeeaeaa93..e4b4b0afa0aba 100644 --- a/pkgs/development/tools/pgloader/default.nix +++ b/pkgs/development/tools/pgloader/default.nix @@ -24,8 +24,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = false; installPhase = '' + runHook preInstall + install -Dm755 bin/pgloader "$out/bin/pgloader" wrapProgram $out/bin/pgloader --prefix LD_LIBRARY_PATH : "${LD_LIBRARY_PATH}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/postiats-utilities/default.nix b/pkgs/development/tools/postiats-utilities/default.nix index 6ac021e1ba092..c2b26ce408e4a 100644 --- a/pkgs/development/tools/postiats-utilities/default.nix +++ b/pkgs/development/tools/postiats-utilities/default.nix @@ -26,6 +26,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + libdir="$out/${python3.sitePackages}" mkdir -p "$libdir" cp -r postiats "$libdir" @@ -34,5 +36,7 @@ stdenv.mkDerivation rec { install pats-* "$out/bin" wrapPythonPrograms + + runHook postInstall ''; } diff --git a/pkgs/development/tools/rdocker/default.nix b/pkgs/development/tools/rdocker/default.nix index fa823ec4d4c94..fcce5d36a3a89 100644 --- a/pkgs/development/tools/rdocker/default.nix +++ b/pkgs/development/tools/rdocker/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm755 rdocker.sh $out/bin/rdocker + + runHook postInstall ''; postInstall = '' diff --git a/pkgs/development/tools/rgp/default.nix b/pkgs/development/tools/rgp/default.nix index 96d938ad20401..72b624a4dfbb4 100644 --- a/pkgs/development/tools/rgp/default.nix +++ b/pkgs/development/tools/rgp/default.nix @@ -55,6 +55,8 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir -p $out/opt/rgp $out/bin cp -r . $out/opt/rgp/ @@ -74,6 +76,8 @@ stdenv.mkDerivation { --set QT_QPA_PLATFORM xcb \ --prefix LD_LIBRARY_PATH : $out/opt/rgp/lib done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/rund/default.nix b/pkgs/development/tools/rund/default.nix index ef0701d9343ed..2e2cede1e582d 100644 --- a/pkgs/development/tools/rund/default.nix +++ b/pkgs/development/tools/rund/default.nix @@ -35,8 +35,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv $NIX_BUILD_TOP/rund $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/sauce-connect/default.nix b/pkgs/development/tools/sauce-connect/default.nix index 562125acf0681..238a1ff8826c7 100644 --- a/pkgs/development/tools/sauce-connect/default.nix +++ b/pkgs/development/tools/sauce-connect/default.nix @@ -31,8 +31,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out + + runHook postInstall ''; dontStrip = true; diff --git a/pkgs/development/tools/scalafix/default.nix b/pkgs/development/tools/scalafix/default.nix index aa02fa8f405b1..fc1912b09db8d 100644 --- a/pkgs/development/tools/scalafix/default.nix +++ b/pkgs/development/tools/scalafix/default.nix @@ -30,12 +30,16 @@ stdenv.mkDerivation ( dontUnpack = true; installPhase = '' + runHook preInstall + makeWrapper ${jre}/bin/java $out/bin/${finalAttrs.pname} \ --add-flags "-cp $CLASSPATH scalafix.cli.Cli" installShellCompletion --cmd ${finalAttrs.pname} \ --bash <($out/bin/${finalAttrs.pname} --bash) \ --zsh <($out/bin/${finalAttrs.pname} --zsh) + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/development/tools/selenium/chromedriver/binary.nix b/pkgs/development/tools/selenium/chromedriver/binary.nix index ace1f1e8f2700..67c20d37e6eb2 100644 --- a/pkgs/development/tools/selenium/chromedriver/binary.nix +++ b/pkgs/development/tools/selenium/chromedriver/binary.nix @@ -43,7 +43,11 @@ stdenv.mkDerivation { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + install -m555 -D "chromedriver" $out/bin/chromedriver + + runHook postInstall ''; passthru.tests.version = testers.testVersion { package = chromedriver; }; diff --git a/pkgs/development/tools/selenium/chromedriver/source.nix b/pkgs/development/tools/selenium/chromedriver/source.nix index fcb22c4066448..88d9892ec09f0 100644 --- a/pkgs/development/tools/selenium/chromedriver/source.nix +++ b/pkgs/development/tools/selenium/chromedriver/source.nix @@ -8,7 +8,11 @@ chromium.mkDerivation (_: { buildTargets = [ "chromedriver.unstripped" ]; installPhase = '' + runHook preInstall + install -Dm555 $buildPath/chromedriver.unstripped $out/bin/chromedriver + + runHook postInstall ''; # Kill existing postFixup that tries to patchelf things diff --git a/pkgs/development/tools/selenium/htmlunit-driver/default.nix b/pkgs/development/tools/selenium/htmlunit-driver/default.nix index 788a28a87f22b..95d159a0396a5 100644 --- a/pkgs/development/tools/selenium/htmlunit-driver/default.nix +++ b/pkgs/development/tools/selenium/htmlunit-driver/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { dontUnpack = true; - installPhase = "install -D $src $out/share/lib/${pname}-${version}/${pname}-${version}.jar"; + installPhase = "runHook preInstall; install -D $src $out/share/lib/${pname}-${version}/${pname}-${version}.jar; runHook postInstall"; meta = with lib; { homepage = "https://github.com/SeleniumHQ/htmlunit-driver"; diff --git a/pkgs/development/tools/selenium/selendroid/default.nix b/pkgs/development/tools/selenium/selendroid/default.nix index 66a9b97d0db90..caa4f8162f9ae 100644 --- a/pkgs/development/tools/selenium/selendroid/default.nix +++ b/pkgs/development/tools/selenium/selendroid/default.nix @@ -24,6 +24,8 @@ stdenv.mkDerivation { buildInputs = [ jdk ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/lib/selendroid cp ${srcs.jar} $out/share/lib/selendroid/selendroid-standalone-${version}.jar cp ${srcs.gridPlugin} $out/share/lib/selendroid/${pluginName}.jar @@ -36,6 +38,8 @@ stdenv.mkDerivation { --add-flags "org.openqa.grid.selenium.GridLauncherV3" \ --add-flags "-role hub" \ --add-flags "-capabilityMatcher io.selendroid.grid.SelendroidCapabilityMatcher" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/selenium/server/default.nix b/pkgs/development/tools/selenium/server/default.nix index b1cc26bec519c..20eedac66593e 100644 --- a/pkgs/development/tools/selenium/server/default.nix +++ b/pkgs/development/tools/selenium/server/default.nix @@ -20,12 +20,16 @@ in stdenv.mkDerivation rec { buildInputs = [ jre ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/lib/${pname}-${version} cp $src $out/share/lib/${pname}-${version}/${pname}-${version}.jar makeWrapper ${jre}/bin/java $out/bin/selenium-server \ --add-flags "-cp $out/share/lib/${pname}-${version}/${pname}-${version}.jar:${htmlunit-driver}/share/lib/${htmlunit-driver.name}/${htmlunit-driver.name}.jar" \ ${lib.optionalString chromeSupport "--add-flags -Dwebdriver.chrome.driver=${chromedriver}/bin/chromedriver"} \ --add-flags "org.openqa.grid.selenium.GridLauncherV3" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/shellcheck/default.nix b/pkgs/development/tools/shellcheck/default.nix index 8d04c357ce508..0d28c13633ebc 100644 --- a/pkgs/development/tools/shellcheck/default.nix +++ b/pkgs/development/tools/shellcheck/default.nix @@ -33,10 +33,14 @@ let ''; installPhase = '' + runHook preInstall + install -Dm755 ${bin}/bin/shellcheck $bin/bin/shellcheck install -Dm644 README.md $doc/share/shellcheck/README.md install -Dm644 shellcheck.1 $man/share/man/man1/shellcheck.1 mkdir $out + + runHook postInstall ''; passthru = ShellCheck.passthru or { } // { diff --git a/pkgs/development/tools/slimerjs/default.nix b/pkgs/development/tools/slimerjs/default.nix index dd3c5fd6d09b5..1d99e865d8e4b 100644 --- a/pkgs/development/tools/slimerjs/default.nix +++ b/pkgs/development/tools/slimerjs/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + strip-nondeterminism --type zip omni.ja mkdir -p "$out"/{bin,share/doc/slimerjs,lib/slimerjs} cp LICENSE README* "$out/share/doc/slimerjs" @@ -40,6 +42,8 @@ stdenv.mkDerivation rec { echo "'$out/lib/slimerjs/slimerjs' \"\$@\"" >> "$out/bin/slimerjs" chmod a+x "$out/bin/slimerjs" sed -e 's@MaxVersion=[3456][0-9][.]@MaxVersion=99.@' -i "$out/lib/slimerjs/application.ini" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/swiftformat/default.nix b/pkgs/development/tools/swiftformat/default.nix index 317f0ee416171..eaebb25806993 100644 --- a/pkgs/development/tools/swiftformat/default.nix +++ b/pkgs/development/tools/swiftformat/default.nix @@ -25,7 +25,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D -m 0555 build/Release/swiftformat $out/bin/swiftformat + + runHook postInstall ''; sandboxProfile = '' diff --git a/pkgs/development/tools/tailwindcss/default.nix b/pkgs/development/tools/tailwindcss/default.nix index 40956b0851cc8..b2fb79828cad6 100644 --- a/pkgs/development/tools/tailwindcss/default.nix +++ b/pkgs/development/tools/tailwindcss/default.nix @@ -40,9 +40,13 @@ stdenv.mkDerivation rec { dontFixup = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${src} $out/bin/tailwindcss chmod 755 $out/bin/tailwindcss + + runHook postInstall ''; passthru.tests.helptext = runCommand "tailwindcss-test-helptext" { } '' diff --git a/pkgs/development/tools/thrust/default.nix b/pkgs/development/tools/thrust/default.nix index 889d3bc3af365..8d8bf5c41c78c 100644 --- a/pkgs/development/tools/thrust/default.nix +++ b/pkgs/development/tools/thrust/default.nix @@ -26,6 +26,8 @@ in stdenv.mkDerivation rec { buildInputs = [ thrustEnv ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/libexec/thrust unzip -d $out/libexec/thrust/ $src @@ -34,6 +36,8 @@ in stdenv.mkDerivation rec { wrapProgram $out/libexec/thrust/thrust_shell \ --prefix "LD_LIBRARY_PATH" : "${thrustEnv}/lib:${thrustEnv}/lib64" ln -s $out/libexec/thrust/thrust_shell $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/tools/trunk-io/default.nix b/pkgs/development/tools/trunk-io/default.nix index 8990dc9341136..f086ad981d986 100644 --- a/pkgs/development/tools/trunk-io/default.nix +++ b/pkgs/development/tools/trunk-io/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation (finalAttrs: { dontBuild = true; installPhase = '' + runHook preInstall + install -D $src $out/bin/trunk + + runHook postInstall ''; passthru.updateScript = ./update.sh; diff --git a/pkgs/development/tools/yarn/default.nix b/pkgs/development/tools/yarn/default.nix index e8bf911a70811..73767ff8742f9 100644 --- a/pkgs/development/tools/yarn/default.nix +++ b/pkgs/development/tools/yarn/default.nix @@ -28,11 +28,15 @@ stdenvNoCC.mkDerivation (finalAttrs: { buildInputs = lib.optionals withNode [ nodejs ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,libexec/yarn/,share/bash-completion/completions/} cp -R . $out/libexec/yarn ln -s $out/libexec/yarn/bin/yarn.js $out/bin/yarn ln -s $out/libexec/yarn/bin/yarn.js $out/bin/yarnpkg ln -s ${completion}/yarn-completion.bash $out/share/bash-completion/completions/yarn.bash + + runHook postInstall ''; passthru = { diff --git a/pkgs/development/tools/zld/default.nix b/pkgs/development/tools/zld/default.nix index af8509103067f..92d8283a6137c 100644 --- a/pkgs/development/tools/zld/default.nix +++ b/pkgs/development/tools/zld/default.nix @@ -9,8 +9,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp zld $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/web/grails/default.nix b/pkgs/development/web/grails/default.nix index 3daeaa7d41b47..edc06ce3c74ea 100644 --- a/pkgs/development/web/grails/default.nix +++ b/pkgs/development/web/grails/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -vr . "$out" # Remove (for now) uneeded Windows .bat files @@ -32,6 +34,8 @@ stdenv.mkDerivation rec { '' + lib.optionalString (jdk != null) '' # Inject JDK path into grails sed -i -e '2iJAVA_HOME=${jdk.home}' "$out"/bin/grails + + runHook postInstall ''; preferLocalBuild = true; diff --git a/pkgs/development/web/ihp-new/default.nix b/pkgs/development/web/ihp-new/default.nix index 76e66a7ae4543..19f00a79ecf3c 100644 --- a/pkgs/development/web/ihp-new/default.nix +++ b/pkgs/development/web/ihp-new/default.nix @@ -17,9 +17,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm755 bin/ihp-new -t $out/bin wrapProgram $out/bin/ihp-new \ --suffix PATH ":" "${lib.makeBinPath [ git ]}"; + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/web/netlify-cli/node-env.nix b/pkgs/development/web/netlify-cli/node-env.nix index bc1e36628ac8a..3c480e2f610eb 100644 --- a/pkgs/development/web/netlify-cli/node-env.nix +++ b/pkgs/development/web/netlify-cli/node-env.nix @@ -33,10 +33,14 @@ let tgzFile=$(npm pack | tail -n 1) # Hooks to the pack command will add output (https://docs.npmjs.com/misc/scripts) ''; installPhase = '' + runHook preInstall + mkdir -p $out/tarballs mv $tgzFile $out/tarballs mkdir -p $out/nix-support echo "file source-dist $out/tarballs/$tgzFile" >> $out/nix-support/hydra-build-products + + runHook postInstall ''; }; @@ -604,6 +608,8 @@ let passAsFile = [ "includeScript" "pinpointDependenciesScript" ]; installPhase = '' + runHook preInstall + source ${installPackage} mkdir -p $out/${packageName} @@ -634,6 +640,8 @@ let mv ${packageName} lib ln -s $out/lib/node_modules/.bin $out/bin + + runHook postInstall ''; } // extraArgs); diff --git a/pkgs/development/web/netlify-cli/node-packages.nix b/pkgs/development/web/netlify-cli/node-packages.nix index dd6461526c0fc..f5b6f29e638e2 100644 --- a/pkgs/development/web/netlify-cli/node-packages.nix +++ b/pkgs/development/web/netlify-cli/node-packages.nix @@ -11925,7 +11925,7 @@ in "!package-lock.json" ] args.src; dontBuild = true; - installPhase = "mkdir -p $out; cp -r ./* $out;"; + installPhase = "runHook preInstall; mkdir -p $out; cp -r ./* $out;; runHook postInstall"; }; }); } diff --git a/pkgs/development/web/nodejs/corepack.nix b/pkgs/development/web/nodejs/corepack.nix index c83d3f1645fcc..0e85ad4617ba8 100644 --- a/pkgs/development/web/nodejs/corepack.nix +++ b/pkgs/development/web/nodejs/corepack.nix @@ -9,10 +9,14 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin corepack enable --install-directory $out/bin # Enabling npm caused some crashes - leaving out for now # corepack enable --install-directory $out/bin npm + + runHook postInstall ''; meta = { diff --git a/pkgs/development/web/playwright-test/node-env.nix b/pkgs/development/web/playwright-test/node-env.nix index bc1e36628ac8a..3c480e2f610eb 100644 --- a/pkgs/development/web/playwright-test/node-env.nix +++ b/pkgs/development/web/playwright-test/node-env.nix @@ -33,10 +33,14 @@ let tgzFile=$(npm pack | tail -n 1) # Hooks to the pack command will add output (https://docs.npmjs.com/misc/scripts) ''; installPhase = '' + runHook preInstall + mkdir -p $out/tarballs mv $tgzFile $out/tarballs mkdir -p $out/nix-support echo "file source-dist $out/tarballs/$tgzFile" >> $out/nix-support/hydra-build-products + + runHook postInstall ''; }; @@ -604,6 +608,8 @@ let passAsFile = [ "includeScript" "pinpointDependenciesScript" ]; installPhase = '' + runHook preInstall + source ${installPackage} mkdir -p $out/${packageName} @@ -634,6 +640,8 @@ let mv ${packageName} lib ln -s $out/lib/node_modules/.bin $out/bin + + runHook postInstall ''; } // extraArgs); diff --git a/pkgs/games/0ad/data.nix b/pkgs/games/0ad/data.nix index 92ebf57486468..e91bb6eb9aa37 100644 --- a/pkgs/games/0ad/data.nix +++ b/pkgs/games/0ad/data.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + rm binaries/data/tools/fontbuilder/fonts/*.txt mkdir -p $out/share/0ad cp -r binaries/data $out/share/0ad/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/0ad/game.nix b/pkgs/games/0ad/game.nix index 676c14fd1fc91..623aaf4b489f6 100644 --- a/pkgs/games/0ad/game.nix +++ b/pkgs/games/0ad/game.nix @@ -103,6 +103,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + popd # Copy executables. @@ -120,6 +122,8 @@ stdenv.mkDerivation rec { # Copy icon. install -D build/resources/0ad.png $out/share/icons/hicolor/128x128/apps/0ad.png install -D build/resources/0ad.desktop $out/share/applications/0ad.desktop + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/20kly/default.nix b/pkgs/games/20kly/default.nix index 661feea1730db..2daa52f7930e1 100644 --- a/pkgs/games/20kly/default.nix +++ b/pkgs/games/20kly/default.nix @@ -32,9 +32,13 @@ python3Packages.buildPythonApplication rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/share" cp -r data lib20k lightyears "$out/share" install -Dm755 lightyears "$out/bin/lightyears" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/7kaa/default.nix b/pkgs/games/7kaa/default.nix index 972e959c1ec37..1d3bda49542e6 100644 --- a/pkgs/games/7kaa/default.nix +++ b/pkgs/games/7kaa/default.nix @@ -29,8 +29,12 @@ let }; installPhase = '' + runHook preInstall + mkdir -p $out cp -r * $out/ + + runHook postInstall ''; meta.license = lib.licenses.unfree; diff --git a/pkgs/games/airstrike/default.nix b/pkgs/games/airstrike/default.nix index 5772b3d0036f4..d3f4e9e4a3ae5 100644 --- a/pkgs/games/airstrike/default.nix +++ b/pkgs/games/airstrike/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = "-lm"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp airstrike $out/bin @@ -23,6 +25,8 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/airstrike \ --chdir "$out/share" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/amoeba/data.nix b/pkgs/games/amoeba/data.nix index 193c710b31a10..6b85911808caf 100644 --- a/pkgs/games/amoeba/data.nix +++ b/pkgs/games/amoeba/data.nix @@ -10,8 +10,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/amoeba cp demo.dat $out/share/amoeba/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/amoeba/default.nix b/pkgs/games/amoeba/default.nix index 63fa8a62365bf..de3237777813f 100644 --- a/pkgs/games/amoeba/default.nix +++ b/pkgs/games/amoeba/default.nix @@ -30,9 +30,13 @@ stdenv.mkDerivation rec { buildInputs = [ alsa-lib expat freetype gtk3 libvorbis libGLU xorg.libXxf86vm ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp amoeba $out/bin/ installManPage ../debian/amoeba.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/among-sus/default.nix b/pkgs/games/among-sus/default.nix index d53d98f5e7afa..9c454c906aefa 100644 --- a/pkgs/games/among-sus/default.nix +++ b/pkgs/games/among-sus/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -Dm755 among-sus $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/andyetitmoves/default.nix b/pkgs/games/andyetitmoves/default.nix index ecd1dfc9b3cd6..d0fca47efb5f0 100644 --- a/pkgs/games/andyetitmoves/default.nix +++ b/pkgs/games/andyetitmoves/default.nix @@ -40,6 +40,8 @@ stdenv.mkDerivation rec { throw "And Yet It Moves nix package only supports linux and intel cpu's."; installPhase = '' + runHook preInstall + mkdir -p $out/{opt/andyetitmoves,bin} cp -r * $out/opt/andyetitmoves/ @@ -57,6 +59,8 @@ stdenv.mkDerivation rec { exec ./lib/$binName EOF chmod +x $out/bin/$binName + + runHook postInstall ''; buildInputs = [ libvorbis libogg libtheora SDL libXft SDL_image zlib libX11 libpng openal ]; diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix index 6abe8ea7c9e1e..0efce12474172 100644 --- a/pkgs/games/anki/default.nix +++ b/pkgs/games/anki/default.nix @@ -114,7 +114,11 @@ let ''; installPhase = '' + runHook preInstall + mv node_modules $out + + runHook postInstall ''; }; in diff --git a/pkgs/games/antsimulator/default.nix b/pkgs/games/antsimulator/default.nix index 204b1c50f268b..5ab8a7ae71a5e 100644 --- a/pkgs/games/antsimulator/default.nix +++ b/pkgs/games/antsimulator/default.nix @@ -26,8 +26,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm644 -t $out/opt/antsimulator res/* install -Dm755 ./AntSimulator $out/bin/antsimulator + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/arena/default.nix b/pkgs/games/arena/default.nix index 9b31c41ea68ad..b6184ea6e23c8 100644 --- a/pkgs/games/arena/default.nix +++ b/pkgs/games/arena/default.nix @@ -52,8 +52,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin ln -s $out/lib/${pname}-${version}/Arena_x86_64_linux $out/bin/arena + + runHook postInstall ''; dontStrip = true; diff --git a/pkgs/games/bastet/default.nix b/pkgs/games/bastet/default.nix index 5fde8064d7553..cc8baf225994a 100644 --- a/pkgs/games/bastet/default.nix +++ b/pkgs/games/bastet/default.nix @@ -29,10 +29,14 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p "$out"/bin cp bastet "$out"/bin/ mkdir -p "$out"/share/man/man6 cp bastet.6 "$out"/share/man/man6 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/braincurses/default.nix b/pkgs/games/braincurses/default.nix index bf346b44816ea..ee7ad9f57246c 100644 --- a/pkgs/games/braincurses/default.nix +++ b/pkgs/games/braincurses/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation rec { # There is no install target in the Makefile installPhase = '' + runHook preInstall + install -Dt $out/bin braincurses + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/brogue/default.nix b/pkgs/games/brogue/default.nix index bf19e6c4225b6..1a07eacd10fc9 100644 --- a/pkgs/games/brogue/default.nix +++ b/pkgs/games/brogue/default.nix @@ -39,11 +39,15 @@ stdenv.mkDerivation (finalAttrs: { }; installPhase = '' + runHook preInstall + install -m 555 -D bin/brogue $out/bin/brogue install -m 444 -D ${finalAttrs.desktopItem}/share/applications/brogue.desktop $out/share/applications/brogue.desktop install -m 444 -D bin/brogue-icon.png $out/share/icons/hicolor/256x256/apps/brogue.png mkdir -p $out/share/brogue cp -r bin/fonts $out/share/brogue/ + + runHook postInstall ''; # fix crash; shouldn’t be a security risk because it’s an offline game diff --git a/pkgs/games/ckan/default.nix b/pkgs/games/ckan/default.nix index ed025ecee5d6c..bbec136d9ab92 100644 --- a/pkgs/games/ckan/default.nix +++ b/pkgs/games/ckan/default.nix @@ -19,10 +19,14 @@ stdenv.mkDerivation rec { buildPhase = "true"; installPhase = '' + runHook preInstall + install -m 644 -D $src $out/bin/ckan.exe makeWrapper ${mono}/bin/mono $out/bin/ckan \ --add-flags $out/bin/ckan.exe \ --set LD_LIBRARY_PATH $libraries + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/crossfire/crossfire-arch.nix b/pkgs/games/crossfire/crossfire-arch.nix index c09f474e70c79..70b1e4207458f 100644 --- a/pkgs/games/crossfire/crossfire-arch.nix +++ b/pkgs/games/crossfire/crossfire-arch.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -a . "$out/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/crossfire/crossfire-maps.nix b/pkgs/games/crossfire/crossfire-maps.nix index cb514a90d1699..d6ac32c99ed74 100644 --- a/pkgs/games/crossfire/crossfire-maps.nix +++ b/pkgs/games/crossfire/crossfire-maps.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -a . "$out/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/deliantra/arch.nix b/pkgs/games/deliantra/arch.nix index 2201ca2d1f5fb..24d913db8d1a6 100644 --- a/pkgs/games/deliantra/arch.nix +++ b/pkgs/games/deliantra/arch.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out" export DELIANTRA_DATADIR="$out" ${deliantra-server}/bin/cfutil --install-arch . + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/deliantra/maps.nix b/pkgs/games/deliantra/maps.nix index 1f87178102a0c..19d7ff8345b0a 100644 --- a/pkgs/games/deliantra/maps.nix +++ b/pkgs/games/deliantra/maps.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out/maps" export DELIANTRA_DATADIR="$out" ${deliantra-server}/bin/cfutil --install-maps . + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/doom-ports/eternity-engine/default.nix b/pkgs/games/doom-ports/eternity-engine/default.nix index 92ae7ea0c9e9f..7eb2f2d6ef273 100644 --- a/pkgs/games/doom-ports/eternity-engine/default.nix +++ b/pkgs/games/doom-ports/eternity-engine/default.nix @@ -15,10 +15,14 @@ stdenv.mkDerivation rec { buildInputs = [ libGL SDL2 SDL2_mixer SDL2_net ]; installPhase = '' + runHook preInstall + install -Dm755 eternity/eternity $out/lib/eternity/eternity cp -r $src/base $out/lib/eternity/base mkdir $out/bin makeWrapper $out/lib/eternity/eternity $out/bin/eternity + + runHook postInstall ''; meta = { diff --git a/pkgs/games/doom-ports/zandronum/alpha/default.nix b/pkgs/games/doom-ports/zandronum/alpha/default.nix index 665bef3bd4a19..9f421e8ebfdf2 100644 --- a/pkgs/games/doom-ports/zandronum/alpha/default.nix +++ b/pkgs/games/doom-ports/zandronum/alpha/default.nix @@ -73,6 +73,8 @@ stdenv.mkDerivation rec { # Won't work well without C or en_US. Setting LANG might not be enough if the user is making use of LC_* so wrap with LC_ALL instead installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/lib/zandronum cp zandronum${suffix} \ @@ -82,6 +84,8 @@ stdenv.mkDerivation rec { makeWrapper $out/lib/zandronum/zandronum${suffix} $out/bin/zandronum-alpha${suffix} wrapProgram $out/bin/zandronum-alpha${suffix} \ --set LC_ALL="C" + + runHook postInstall ''; postFixup = lib.optionalString (!serverOnly) '' diff --git a/pkgs/games/doom-ports/zandronum/default.nix b/pkgs/games/doom-ports/zandronum/default.nix index 17c9b473870a6..2004a668d1f11 100644 --- a/pkgs/games/doom-ports/zandronum/default.nix +++ b/pkgs/games/doom-ports/zandronum/default.nix @@ -73,6 +73,8 @@ stdenv.mkDerivation rec { # Won't work well without C or en_US. Setting LANG might not be enough if the user is making use of LC_* so wrap with LC_ALL instead installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/lib/zandronum cp zandronum${suffix} \ @@ -82,6 +84,8 @@ stdenv.mkDerivation rec { makeWrapper $out/lib/zandronum/zandronum${suffix} $out/bin/zandronum${suffix} wrapProgram $out/bin/zandronum${suffix} \ --set LC_ALL="C" + + runHook postInstall ''; postFixup = lib.optionalString (!serverOnly) '' diff --git a/pkgs/games/doom-ports/zdoom/bcc-git.nix b/pkgs/games/doom-ports/zdoom/bcc-git.nix index 5263ef9bac32d..8cab5d8aba62b 100644 --- a/pkgs/games/doom-ports/zdoom/bcc-git.nix +++ b/pkgs/games/doom-ports/zdoom/bcc-git.nix @@ -17,10 +17,14 @@ stdenv.mkDerivation { patches = [ ./bcc-warning-fix.patch ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib,share/doc} install -m755 bcc $out/bin/bcc cp -av doc $out/share/doc/bcc cp -av lib $out/lib/bcc + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/doom-ports/zdoom/default.nix b/pkgs/games/doom-ports/zdoom/default.nix index 3a31f8fdfb5f6..9687b41d61a51 100644 --- a/pkgs/games/doom-ports/zdoom/default.nix +++ b/pkgs/games/doom-ports/zdoom/default.nix @@ -35,12 +35,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 zdoom "$out/lib/zdoom/zdoom" for i in *.pk3; do install -Dm644 "$i" "$out/lib/zdoom/$i" done mkdir -p $out/bin ln -s $out/lib/zdoom/zdoom $out/bin/zdoom + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/doom-ports/zdoom/zdbsp.nix b/pkgs/games/doom-ports/zdoom/zdbsp.nix index 8949febdefea3..38fcd92dc3ee2 100644 --- a/pkgs/games/doom-ports/zdoom/zdbsp.nix +++ b/pkgs/games/doom-ports/zdoom/zdbsp.nix @@ -24,7 +24,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -Dm755 zdbsp $out/bin/zdbsp + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/duckmarines/default.nix b/pkgs/games/duckmarines/default.nix index a4e37081ab0ea..1776a24bae076 100644 --- a/pkgs/games/duckmarines/default.nix +++ b/pkgs/games/duckmarines/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/games/lovegames @@ -41,6 +43,8 @@ stdenv.mkDerivation rec { chmod +x $out/bin/${pname} mkdir -p $out/share/applications ln -s ${desktopItem}/share/applications/* $out/share/applications/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/dwarf-fortress/soundsense.nix b/pkgs/games/dwarf-fortress/soundsense.nix index 8ed1e7be1b202..c673ebf2c20ae 100644 --- a/pkgs/games/dwarf-fortress/soundsense.nix +++ b/pkgs/games/dwarf-fortress/soundsense.nix @@ -8,7 +8,11 @@ sha256 = "0qz0mjkp7wp0gxk3ws2x760awv8c9lkacj2fn9bz3gqqnq262ffa"; }; installPhase = '' + runHook preInstall + cp -r . $out + + runHook postInstall ''; } }: @@ -28,10 +32,14 @@ stdenv.mkDerivation rec { chmod +x soundSense.sh ''; installPhase = '' + runHook preInstall + mkdir $out cp -R . $out/soundsense ln -s $out/soundsense/dfhack $out/hack ln -s $soundPack $out/soundsense/packs + + runHook postInstall ''; passthru = { inherit version dfVersion; }; } diff --git a/pkgs/games/dwarf-fortress/twbt/default.nix b/pkgs/games/dwarf-fortress/twbt/default.nix index 82b03dd1e0d72..3a4e86b3efbca 100644 --- a/pkgs/games/dwarf-fortress/twbt/default.nix +++ b/pkgs/games/dwarf-fortress/twbt/default.nix @@ -75,10 +75,14 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir -p $lib/hack/{plugins,lua} $art/data/art cp -a */twbt.plug.so $lib/hack/plugins/ cp -a *.lua $lib/hack/lua/ cp -a *.png $art/data/art/ + + runHook postInstall ''; passthru = { diff --git a/pkgs/games/dwarf-fortress/unfuck.nix b/pkgs/games/dwarf-fortress/unfuck.nix index a1baa2d83f757..81e8b666924f7 100644 --- a/pkgs/games/dwarf-fortress/unfuck.nix +++ b/pkgs/games/dwarf-fortress/unfuck.nix @@ -132,7 +132,11 @@ stdenv.mkDerivation { dontStrip = true; installPhase = '' + runHook preInstall + install -D -m755 ../build/libgraphics.so $out/lib/libgraphics.so + + runHook postInstall ''; # Breaks dfhack because of inlining. diff --git a/pkgs/games/dwarf-fortress/wrapper/default.nix b/pkgs/games/dwarf-fortress/wrapper/default.nix index daa27ce5dc00a..29c6e2d5dc0d5 100644 --- a/pkgs/games/dwarf-fortress/wrapper/default.nix +++ b/pkgs/games/dwarf-fortress/wrapper/default.nix @@ -176,6 +176,8 @@ stdenv.mkDerivation rec { dontBuild = true; preferLocalBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin substitute $runDF $out/bin/dwarf-fortress \ @@ -195,6 +197,8 @@ stdenv.mkDerivation rec { --subst-var-by jre ${jdk.jre} \ --subst-var dfInit chmod 755 $out/bin/soundsense + + runHook postInstall ''; doInstallCheck = stdenv.isLinux; diff --git a/pkgs/games/egoboo/default.nix b/pkgs/games/egoboo/default.nix index ba89e4ca7afde..b67df8bab6f5b 100644 --- a/pkgs/games/egoboo/default.nix +++ b/pkgs/games/egoboo/default.nix @@ -23,10 +23,14 @@ stdenv.mkDerivation rec { # The user will need to have all the files in '.' to run egoboo, with # writeable controls.txt and setup.txt installPhase = '' + runHook preInstall + mkdir -p $out/share/egoboo-${version} cp -v game/egoboo $out/share/egoboo-${version} cd .. cp -v -Rd controls.txt setup.txt players modules basicdat $out/share/egoboo-${version} + + runHook postInstall ''; buildInputs = [ libGLU libGL SDL SDL_mixer SDL_image SDL_ttf ]; diff --git a/pkgs/games/factorio/default.nix b/pkgs/games/factorio/default.nix index aff5d11b3021b..69e6f0fc78057 100644 --- a/pkgs/games/factorio/default.nix +++ b/pkgs/games/factorio/default.nix @@ -165,12 +165,16 @@ let dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/factorio} cp -a data $out/share/factorio cp -a bin/${tarDirectory}/factorio $out/bin/factorio patchelf \ --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ $out/bin/factorio + + runHook postInstall ''; passthru.updateScript = diff --git a/pkgs/games/fairymax/default.nix b/pkgs/games/fairymax/default.nix index 9ea9d7df974dd..2de8456834ee7 100644 --- a/pkgs/games/fairymax/default.nix +++ b/pkgs/games/fairymax/default.nix @@ -29,9 +29,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,share/fairymax} cp fairymax "$out/bin" cp fmax.ini "$out/share/fairymax" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/flightgear/default.nix b/pkgs/games/flightgear/default.nix index d81b2774b4ae5..101423fc855ad 100644 --- a/pkgs/games/flightgear/default.nix +++ b/pkgs/games/flightgear/default.nix @@ -20,8 +20,12 @@ let dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p "$out/share/FlightGear" tar xf "${src}" -C "$out/share/FlightGear/" --strip-components=1 + + runHook postInstall ''; }; in diff --git a/pkgs/games/frogatto/data.nix b/pkgs/games/frogatto/data.nix index a61bddf94bfb5..0594a5c87d75c 100644 --- a/pkgs/games/frogatto/data.nix +++ b/pkgs/games/frogatto/data.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/frogatto/modules cp -ar . $out/share/frogatto/modules/frogatto4 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/frogatto/engine.nix b/pkgs/games/frogatto/engine.nix index d5e380588176c..cf4a9d8e7fc30 100644 --- a/pkgs/games/frogatto/engine.nix +++ b/pkgs/games/frogatto/engine.nix @@ -38,9 +38,13 @@ stdenv.mkDerivation { enableParallelBuilding = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/frogatto cp -ar data images modules $out/share/frogatto/ cp -a anura $out/bin/frogatto + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/fsg/default.nix b/pkgs/games/fsg/default.nix index d5680669df9e9..7a30ad129048d 100644 --- a/pkgs/games/fsg/default.nix +++ b/pkgs/games/fsg/default.nix @@ -26,10 +26,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/libexec cp sand $out/libexec echo -e '#!${runtimeShell}\nLC_ALL=C '$out'/libexec/sand "$@"' >$out/bin/fsg chmod a+x $out/bin/fsg + + runHook postInstall ''; meta = { diff --git a/pkgs/games/gmad/default.nix b/pkgs/games/gmad/default.nix index 97538679ee597..ce6cb616f668f 100644 --- a/pkgs/games/gmad/default.nix +++ b/pkgs/games/gmad/default.nix @@ -29,7 +29,11 @@ stdenv.mkDerivation rec { premakeFlags = [ "--bootil_lib=${bootil}/lib" "--bootil_inc=${bootil}/include" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${targetName} $out/bin/gmad + + runHook postInstall ''; } diff --git a/pkgs/games/hexgui/default.nix b/pkgs/games/hexgui/default.nix index 6fc66b8704390..6e74707880ed6 100644 --- a/pkgs/games/hexgui/default.nix +++ b/pkgs/games/hexgui/default.nix @@ -22,9 +22,13 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir $out mv bin lib $out wrapProgram $out/bin/hexgui --prefix PATH : ${lib.makeBinPath [ jdk ]} + + runHook postInstall ''; meta = { diff --git a/pkgs/games/hyperrogue/default.nix b/pkgs/games/hyperrogue/default.nix index ac68cd443eafc..05ce106730823 100644 --- a/pkgs/games/hyperrogue/default.nix +++ b/pkgs/games/hyperrogue/default.nix @@ -34,6 +34,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -d $out/share/hyperrogue/{sounds,music} install -m 555 -D hyperrogue $out/bin/hyperrogue @@ -55,6 +57,8 @@ stdenv.mkDerivation rec { $out/share/icons/hicolor/144x144/apps/hyperrogue.png install -m 444 -D hyperroid/app/src/main/res/drawable-xxxhdpi/icon.png \ $out/share/icons/hicolor/192x192/apps/hyperrogue.png + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/games/icbm3d/default.nix b/pkgs/games/icbm3d/default.nix index 6f531f4242281..51b1917273f5c 100644 --- a/pkgs/games/icbm3d/default.nix +++ b/pkgs/games/icbm3d/default.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp icbm3d $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/games/keen4/default.nix b/pkgs/games/keen4/default.nix index 5e2468a8f9ea0..63e8329dd6b82 100644 --- a/pkgs/games/keen4/default.nix +++ b/pkgs/games/keen4/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/keen4 mv * $out/share/keen4 @@ -40,6 +42,8 @@ stdenv.mkDerivation { done EOF chmod +x $out/bin/keen4 + + runHook postInstall ''; meta = { diff --git a/pkgs/games/keeperrl/default.nix b/pkgs/games/keeperrl/default.nix index 616432596a4db..a3ad8cd0be372 100644 --- a/pkgs/games/keeperrl/default.nix +++ b/pkgs/games/keeperrl/default.nix @@ -72,12 +72,16 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + install -Dm755 keeper $out/bin/keeper install -Dm755 appconfig.txt $out/share/appconfig.txt cp -r data_free $out/share cp -r data_contrib $out/share ${lib.optionalString unfree_assets "cp -r data $out/share"} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/left4gore/default.nix b/pkgs/games/left4gore/default.nix index c203d03ab13e8..0e5c8c0f307e9 100644 --- a/pkgs/games/left4gore/default.nix +++ b/pkgs/games/left4gore/default.nix @@ -14,8 +14,12 @@ let }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp left4gore $out/bin + + runHook postInstall ''; }; @@ -35,8 +39,12 @@ in stdenvNoCC.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin ln -s ${env}/bin/* $out/bin/left4gore + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/lzwolf/default.nix b/pkgs/games/lzwolf/default.nix index 7e3e932ba5cf0..6fdd8b10f40b5 100644 --- a/pkgs/games/lzwolf/default.nix +++ b/pkgs/games/lzwolf/default.nix @@ -55,12 +55,16 @@ stdenv.mkDerivation rec { doCheck = true; installPhase = '' + runHook preInstall + install -Dm755 lzwolf "$out/lib/lzwolf/lzwolf" for i in *.pk3; do install -Dm644 "$i" "$out/lib/lzwolf/$i" done mkdir -p $out/bin ln -s $out/lib/lzwolf/lzwolf $out/bin/lzwolf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/mars/default.nix b/pkgs/games/mars/default.nix index c63152fb5445d..e785261f1ff53 100644 --- a/pkgs/games/mars/default.nix +++ b/pkgs/games/mars/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ libGLU libGL sfml fribidi taglib ]; installPhase = '' + runHook preInstall + cd .. mkdir -p "$out/share/mars/" mkdir -p "$out/bin/" @@ -23,6 +25,8 @@ stdenv.mkDerivation rec { exec "$out/bin/mars.bin" "\$@" EOF chmod +x "$out/bin/mars" + + runHook postInstall ''; meta = with lib; { homepage = "https://mars-game.sourceforge.net/"; diff --git a/pkgs/games/mrrescue/default.nix b/pkgs/games/mrrescue/default.nix index 60650015a393e..5dfcd1a6099b8 100644 --- a/pkgs/games/mrrescue/default.nix +++ b/pkgs/games/mrrescue/default.nix @@ -35,6 +35,8 @@ stdenv.mkDerivation { installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/games/lovegames @@ -45,6 +47,8 @@ stdenv.mkDerivation { chmod +x $out/bin/${pname} mkdir -p $out/share/applications ln -s ${desktopItem}/share/applications/* $out/share/applications/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/netris/default.nix b/pkgs/games/netris/default.nix index 583d6efa58fe0..2858ebfe169eb 100644 --- a/pkgs/games/netris/default.nix +++ b/pkgs/games/netris/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation { dontAddPrefix = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ./netris $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/neverball/default.nix b/pkgs/games/neverball/default.nix index e0555ded7bee0..82d17d10a2e19 100644 --- a/pkgs/games/neverball/default.nix +++ b/pkgs/games/neverball/default.nix @@ -32,11 +32,15 @@ stdenv.mkDerivation rec { preConfigure = "export HOME=$TMPDIR"; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/neverball cp -R data locale $out/share/neverball cp neverball $out/bin cp neverputt $out/bin cp mapc $out/bin + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/games/newtonwars/default.nix b/pkgs/games/newtonwars/default.nix index 62d553f402f61..a1bd4dcb5c78f 100644 --- a/pkgs/games/newtonwars/default.nix +++ b/pkgs/games/newtonwars/default.nix @@ -28,6 +28,8 @@ stdenv.mkDerivation { buildPhase = "sh build-linux.sh"; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share cp nw $out/bin cp font24.raw $out/share @@ -36,6 +38,8 @@ stdenv.mkDerivation { --prefix LD_LIBRARY_PATH ":" ${libglut}/lib \ --prefix LD_LIBRARY_PATH ":" ${libGLU}/lib \ --prefix LD_LIBRARY_PATH ":" ${libGL}/lib + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/oilrush/default.nix b/pkgs/games/oilrush/default.nix index 5715c5e029b9e..adf82a2253097 100644 --- a/pkgs/games/oilrush/default.nix +++ b/pkgs/games/oilrush/default.nix @@ -48,6 +48,8 @@ stdenv.mkDerivation { OilRush_$arch ''; installPhase = '' + runHook preInstall + cd .. mkdir -p "$out/opt/oilrush" cp -r * "$out/opt/oilrush" @@ -59,6 +61,8 @@ stdenv.mkDerivation { exec ./launcher_$arch.sh "\$@" EOF chmod +x "$out/bin/oilrush" + + runHook postInstall ''; meta = { description = "Naval strategy game"; diff --git a/pkgs/games/openmw/tes3mp.nix b/pkgs/games/openmw/tes3mp.nix index 318c28aff9220..a50db43bdfaf2 100644 --- a/pkgs/games/openmw/tes3mp.nix +++ b/pkgs/games/openmw/tes3mp.nix @@ -43,7 +43,11 @@ let nativeBuildInputs = [ cmake ]; installPhase = '' + runHook preInstall + install -Dm555 lib/libRakNetLibStatic.a $out/lib/libRakNetLibStatic.a + + runHook postInstall ''; }; diff --git a/pkgs/games/opensoldat/default.nix b/pkgs/games/opensoldat/default.nix index 625fc0dce5ae4..ee9b7ca8839f1 100644 --- a/pkgs/games/opensoldat/default.nix +++ b/pkgs/games/opensoldat/default.nix @@ -23,8 +23,12 @@ let ''; installPhase = '' + runHook preInstall + install -Dm644 soldat.smod -t $out/share/soldat install -Dm644 client/play-regular.ttf -t $out/share/soldat + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/openttd/grfcodec.nix b/pkgs/games/openttd/grfcodec.nix index af4e315374637..405ed648bc980 100644 --- a/pkgs/games/openttd/grfcodec.nix +++ b/pkgs/games/openttd/grfcodec.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [cmake git]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a grfcodec grfid grfstrip nforenum $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/planetaryannihilation/default.nix b/pkgs/games/planetaryannihilation/default.nix index e99f5541f2847..2ecdab539d78f 100644 --- a/pkgs/games/planetaryannihilation/default.nix +++ b/pkgs/games/planetaryannihilation/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ patchelf makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib} cp -R * $out/ @@ -30,6 +32,8 @@ stdenv.mkDerivation rec { for f in $out/lib/*; do patchelf --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib curl xorg.libX11 stdenv.cc.libc xorg.libXcursor "$out" ]}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" $f done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/pokete/default.nix b/pkgs/games/pokete/default.nix index beb262edee704..815f6dc85aefb 100644 --- a/pkgs/games/pokete/default.nix +++ b/pkgs/games/pokete/default.nix @@ -29,10 +29,14 @@ python3.pkgs.buildPythonApplication rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/pokete cp -r assets pokete_classes pokete_data mods *.py $out/share/pokete/ mkdir -p $out/bin ln -s $out/share/pokete/pokete.py $out/bin/pokete + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/games/purpur/default.nix b/pkgs/games/purpur/default.nix index 7246c689c9bf9..39cd33ce601bc 100644 --- a/pkgs/games/purpur/default.nix +++ b/pkgs/games/purpur/default.nix @@ -14,11 +14,15 @@ stdenv.mkDerivation rec { preferLocalBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib/minecraft cp -v $src $out/lib/minecraft/server.jar makeWrapper ${jre_headless}/bin/java $out/bin/minecraft-server \ --add-flags "-jar $out/lib/minecraft/server.jar nogui" + + runHook postInstall ''; dontUnpack = true; diff --git a/pkgs/games/quakespasm/vulkan.nix b/pkgs/games/quakespasm/vulkan.nix index 458927bfcc88f..b3fe96d587e2e 100644 --- a/pkgs/games/quakespasm/vulkan.nix +++ b/pkgs/games/quakespasm/vulkan.nix @@ -55,8 +55,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp vkquake "$out/bin" + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/games/quantumminigolf/default.nix b/pkgs/games/quantumminigolf/default.nix index c91fb8b28c538..4e7ef45b0bc06 100644 --- a/pkgs/games/quantumminigolf/default.nix +++ b/pkgs/games/quantumminigolf/default.nix @@ -23,10 +23,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out"/{share/doc,share/quantumminigolf,bin} cp README THANKS LICENSE "$out/share/doc" cp -r fonts gfx tracks "$out/share/quantumminigolf" cp quantumminigolf "$out/bin" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/raylib-games/default.nix b/pkgs/games/raylib-games/default.nix index 7a0d80a4c5e67..33357449f3948 100644 --- a/pkgs/games/raylib-games/default.nix +++ b/pkgs/games/raylib-games/default.nix @@ -40,6 +40,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + runHook preBuild mkdir -p $out/bin $out/resources find . -type f -executable -exec cp {} $out/bin \; @@ -49,6 +51,8 @@ stdenv.mkDerivation rec { fi done runHook postBuild + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/riko4/default.nix b/pkgs/games/riko4/default.nix index b3721f7f78f43..c52a93bb05eba 100644 --- a/pkgs/games/riko4/default.nix +++ b/pkgs/games/riko4/default.nix @@ -43,6 +43,8 @@ stdenv.mkDerivation rec { # Riko4 needs the data/ and scripts/ directories to be in its PWD. installPhase = '' + runHook preInstall + install -Dm0755 riko4 $out/bin/.riko4-unwrapped mkdir -p $out/lib/riko4 cp -r ../data $out/lib/riko4 @@ -54,6 +56,8 @@ stdenv.mkDerivation rec { popd > /dev/null EOF chmod +x $out/bin/riko4 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/rocksndiamonds/default.nix b/pkgs/games/rocksndiamonds/default.nix index 4aa70ffa5334f..6ffc0b3e49825 100644 --- a/pkgs/games/rocksndiamonds/default.nix +++ b/pkgs/games/rocksndiamonds/default.nix @@ -36,6 +36,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + appDir=$out/share/applications iconDir=$out/share/icons/hicolor/32x32/apps mkdir -p $out/bin $appDir $iconDir $dataDir @@ -43,6 +45,8 @@ stdenv.mkDerivation rec { ln -s ${desktopItem}/share/applications/* $appDir/ ln -s $dataDir/graphics/gfx_classic/RocksIcon32x32.png $iconDir/rocksndiamonds.png cp -r conf docs graphics levels music sounds $dataDir + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/games/rrootage/default.nix b/pkgs/games/rrootage/default.nix index f1ad7b7e978d3..701deb4e9779a 100644 --- a/pkgs/games/rrootage/default.nix +++ b/pkgs/games/rrootage/default.nix @@ -60,6 +60,8 @@ in stdenv.mkDerivation { hardeningDisable = [ "stackprotector" "fortify" ]; # buffer overflow without this installPhase = '' + runHook preInstall + install -d "$out"/share/games cp -r rr_share "$out"/share/games/rrootage install -D src/rrootage "$out"/bin/rrootage @@ -70,6 +72,8 @@ in stdenv.mkDerivation { install -D -m 644 readme.txt "$out"/share/doc/rrootage/README.jp install -m 644 readme_e.txt "$out"/share/doc/rrootage/README.en install -m 644 readme_linux "$out"/share/doc/rrootage/README + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/runelite/default.nix b/pkgs/games/runelite/default.nix index 20fb99f82b7d1..f2b7f2939ceb0 100644 --- a/pkgs/games/runelite/default.nix +++ b/pkgs/games/runelite/default.nix @@ -40,6 +40,8 @@ maven.buildMavenPackage rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/icons mkdir -p $out/share/applications @@ -51,6 +53,8 @@ maven.buildMavenPackage rec { makeWrapper ${jre}/bin/java $out/bin/runelite \ --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ xorg.libXxf86vm libGL ]}" \ --add-flags "-jar $out/share/RuneLite.jar" + + runHook postInstall ''; passthru.updateScript = gitUpdater { }; diff --git a/pkgs/games/runescape-launcher/default.nix b/pkgs/games/runescape-launcher/default.nix index 6bed4908f471f..54e881221bbb4 100644 --- a/pkgs/games/runescape-launcher/default.nix +++ b/pkgs/games/runescape-launcher/default.nix @@ -80,6 +80,8 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share dpkg -x $src $out @@ -92,6 +94,8 @@ let cp -r $out/usr/share $out/ rm -r $out/usr + + runHook postInstall ''; diff --git a/pkgs/games/scrolls/default.nix b/pkgs/games/scrolls/default.nix index 7478df20e9930..d684148fdd15b 100644 --- a/pkgs/games/scrolls/default.nix +++ b/pkgs/games/scrolls/default.nix @@ -30,6 +30,8 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir -p "$out/opt/Scrolls" cp -r ../Scrolls "$out/opt/Scrolls/" cp -r ../Scrolls_Data "$out/opt/Scrolls/" @@ -40,6 +42,8 @@ stdenv.mkDerivation { mkdir "$out/bin" ln -s "$out/opt/Scrolls/Scrolls" "$out/bin/Scrolls" + + runHook postInstall ''; } diff --git a/pkgs/games/simutrans/default.nix b/pkgs/games/simutrans/default.nix index 0a4ec4f326eb2..3e20c704f06ae 100644 --- a/pkgs/games/simutrans/default.nix +++ b/pkgs/games/simutrans/default.nix @@ -74,6 +74,8 @@ let preferLocalBuild = true; installPhase = let src = fetchurl { inherit url sha256; }; in '' + runHook preInstall + mkdir -p "$out/share/simutrans/${pakName}" cd "$out/share/simutrans/${pakName}" "${unzip}/bin/unzip" "${src}" @@ -85,6 +87,8 @@ let mv ./"$toStrip"/* . rm -f "$toStrip/.directory" #pak128.german had this rmdir -p "$toStrip" + + runHook postInstall ''; }; @@ -145,11 +149,15 @@ let enableParallelBuilding = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/ mv simutrans $out/share/ mkdir -p $out/bin/ mv build/default/sim $out/bin/simutrans + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/solicurses/default.nix b/pkgs/games/solicurses/default.nix index 5ed776f9f1c6f..b6846118f9feb 100644 --- a/pkgs/games/solicurses/default.nix +++ b/pkgs/games/solicurses/default.nix @@ -28,7 +28,11 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + install -D SoliCurses.out $out/bin/solicurses + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/games/space-orbit/default.nix b/pkgs/games/space-orbit/default.nix index 74db273bb879e..f8f9c7f5c0b14 100644 --- a/pkgs/games/space-orbit/default.nix +++ b/pkgs/games/space-orbit/default.nix @@ -28,6 +28,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r .. $out/dump cat >$out/bin/space-orbit < $out/lib/cups/filter/brlpdwrappermfc465cn sed -i "/#! \/bin\/sh/a PATH=${lib.makeBinPath [ coreutils gnused gnugrep ]}:\$PATH" $out/lib/cups/filter/brlpdwrappermfc465cn chmod 755 $out/lib/cups/filter/brlpdwrappermfc465cn - ''; + + runHook postInstall + ''; meta = with lib; { description = "Brother MFC-465CN CUPS wrapper driver"; diff --git a/pkgs/misc/cups/drivers/brother/mfc465cnlpr/default.nix b/pkgs/misc/cups/drivers/brother/mfc465cnlpr/default.nix index dc0be00a69328..ace7a4c728d4b 100644 --- a/pkgs/misc/cups/drivers/brother/mfc465cnlpr/default.nix +++ b/pkgs/misc/cups/drivers/brother/mfc465cnlpr/default.nix @@ -32,6 +32,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + dir=$out/usr/local/Brother/Printer/mfc465cn patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $dir/lpd/brmfc465cnfilter wrapProgram $dir/inf/setupPrintcapij \ @@ -55,6 +57,8 @@ stdenv.mkDerivation rec { gawk ]} chmod -R a+w $dir/inf/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/cups/drivers/brother/mfcl3770cdw/default.nix b/pkgs/misc/cups/drivers/brother/mfcl3770cdw/default.nix index de1d397f7b581..d93f498b5c99e 100644 --- a/pkgs/misc/cups/drivers/brother/mfcl3770cdw/default.nix +++ b/pkgs/misc/cups/drivers/brother/mfcl3770cdw/default.nix @@ -31,6 +31,8 @@ in rec { unpackPhase = "dpkg-deb -x $src $out"; installPhase = '' + runHook preInstall + dir="$out/${reldir}" substituteInPlace $dir/lpd/filter_${model} \ --replace /usr/bin/perl ${perl}/bin/perl \ @@ -43,6 +45,8 @@ in rec { # need to use i686 glibc here, these are 32bit proprietary binaries patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ $dir/lpd/brmfcl3770cdwfilter + + runHook postInstall ''; meta = { @@ -64,6 +68,8 @@ in rec { unpackPhase = "dpkg-deb -x $src $out"; installPhase = '' + runHook preInstall + basedir=${driver}/${reldir} dir=$out/${reldir} substituteInPlace $dir/cupswrapper/brother_lpdwrapper_${model} \ @@ -76,6 +82,8 @@ in rec { mkdir -p $out/share/cups/model ln $dir/cupswrapper/brother_lpdwrapper_${model} $out/lib/cups/filter ln $dir/cupswrapper/brother_${model}_printer_en.ppd $out/share/cups/model + + runHook postInstall ''; meta = { diff --git a/pkgs/misc/cups/drivers/carps-cups/default.nix b/pkgs/misc/cups/drivers/carps-cups/default.nix index 32e92da160847..36bfded014dcf 100644 --- a/pkgs/misc/cups/drivers/carps-cups/default.nix +++ b/pkgs/misc/cups/drivers/carps-cups/default.nix @@ -20,6 +20,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + CUPSDIR="$out/lib/cups" CUPSDATADIR="$out/share/cups" @@ -28,6 +30,8 @@ stdenv.mkDerivation { install -s rastertocarps $CUPSDIR/filter install -m 644 carps.drv $CUPSDATADIR/drv/ install -m 644 carps.usb-quirks $CUPSDATADIR/usb/ + + runHook postInstall ''; buildInputs = [ cups ]; diff --git a/pkgs/misc/cups/drivers/cnijfilter2/default.nix b/pkgs/misc/cups/drivers/cnijfilter2/default.nix index 5be4e17581b6e..42463d17559b5 100644 --- a/pkgs/misc/cups/drivers/cnijfilter2/default.nix +++ b/pkgs/misc/cups/drivers/cnijfilter2/default.nix @@ -90,6 +90,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + ( cd lgmon3 make install @@ -127,6 +129,8 @@ stdenv.mkDerivation { mkdir -p $out/share/cups/model cp ppd/*.ppd $out/share/cups/model + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/cups/drivers/estudio/default.nix b/pkgs/misc/cups/drivers/estudio/default.nix index 1af8d1f575b86..d0b71adc83c7a 100644 --- a/pkgs/misc/cups/drivers/estudio/default.nix +++ b/pkgs/misc/cups/drivers/estudio/default.nix @@ -19,12 +19,16 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib/cups/filter mkdir -p $out/share/cups/model/Toshiba cp {.,$out}/lib/cups/filter/est6550_Authentication chmod 755 $out/lib/cups/filter/est6550_Authentication cp {.,$out}/share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS.gz chmod 755 $out/share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS.gz + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/cups/drivers/fxlinuxprint/default.nix b/pkgs/misc/cups/drivers/fxlinuxprint/default.nix index 4c64152e6c929..4599320514a7f 100644 --- a/pkgs/misc/cups/drivers/fxlinuxprint/default.nix +++ b/pkgs/misc/cups/drivers/fxlinuxprint/default.nix @@ -25,12 +25,16 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out mv etc $out mv usr/lib $out mkdir -p $out/share/cups/model mv usr/share/ppd/FujiXerox/* $out/share/cups/model + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/cups/drivers/hl1110/default.nix b/pkgs/misc/cups/drivers/hl1110/default.nix index 07143b0991fb1..f6ce2571dd1a2 100644 --- a/pkgs/misc/cups/drivers/hl1110/default.nix +++ b/pkgs/misc/cups/drivers/hl1110/default.nix @@ -30,6 +30,8 @@ stdenv.mkDerivation { gcc -Wall ${srcdir}/brcupsconfig/brcupsconfig.c -o brcupsconfig4 ''; installPhase = '' + runHook preInstall + # install lpr dpkg-deb -x ${lprdeb} $out @@ -62,7 +64,8 @@ stdenv.mkDerivation { wrapProgram $out/opt/brother/Printers/HL1110/cupswrapper/brother_lpdwrapper_HL1110 \ --prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] } - ''; + runHook postInstall + ''; meta = { homepage = "http://www.brother.com/"; diff --git a/pkgs/misc/cups/drivers/hl1210w/default.nix b/pkgs/misc/cups/drivers/hl1210w/default.nix index b4bf573d68e57..e8e72e8f58b0d 100644 --- a/pkgs/misc/cups/drivers/hl1210w/default.nix +++ b/pkgs/misc/cups/drivers/hl1210w/default.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + # install lpr dpkg-deb -x ${lprdeb} $out @@ -51,7 +53,9 @@ stdenv.mkDerivation { wrapProgram $out/opt/brother/Printers/HL1210W/cupswrapper/brother_lpdwrapper_HL1210W \ --prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] } - ''; + + runHook postInstall + ''; meta = { homepage = "http://www.brother.com/"; diff --git a/pkgs/misc/cups/drivers/hl2260d/default.nix b/pkgs/misc/cups/drivers/hl2260d/default.nix index 9883bd99a314e..a58b5c6abb954 100644 --- a/pkgs/misc/cups/drivers/hl2260d/default.nix +++ b/pkgs/misc/cups/drivers/hl2260d/default.nix @@ -64,6 +64,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/cups/model ln -s $out/opt/brother/Printers/HL2260D/cupswrapper/brother-HL2260D-cups-en.ppd $out/share/cups/model @@ -75,7 +77,9 @@ stdenv.mkDerivation { wrapProgram $out/opt/brother/Printers/HL2260D/lpd/filter_HL2260D \ --prefix PATH ":" ${ lib.makeBinPath [ ghostscript which ] } - ''; + + runHook postInstall + ''; meta = with lib; { homepage = "http://www.brother.com/"; diff --git a/pkgs/misc/cups/drivers/hl3140cw/default.nix b/pkgs/misc/cups/drivers/hl3140cw/default.nix index 2eceb64d3668d..3ca1e76addbeb 100644 --- a/pkgs/misc/cups/drivers/hl3140cw/default.nix +++ b/pkgs/misc/cups/drivers/hl3140cw/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + # install lpr dpkg-deb -x ${lprdeb} $out @@ -67,6 +69,8 @@ stdenv.mkDerivation { wrapProgram $out/opt/brother/Printers/hl3140cw/cupswrapper/cupswrapperhl3140cw \ --prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] } + + runHook postInstall ''; meta = { diff --git a/pkgs/misc/cups/drivers/hll2340dw/default.nix b/pkgs/misc/cups/drivers/hll2340dw/default.nix index 74f3c3819ae8e..bd86189c172f1 100644 --- a/pkgs/misc/cups/drivers/hll2340dw/default.nix +++ b/pkgs/misc/cups/drivers/hll2340dw/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out dpkg-deb -x ${cupsdeb} $out dpkg-deb -x ${lprdeb} $out @@ -58,7 +60,9 @@ stdenv.mkDerivation { wrapProgram $out/opt/brother/Printers/HLL2340D/lpd/filter_HLL2340D \ --prefix PATH ":" ${ lib.makeBinPath [ ghostscript a2ps file gnused gnugrep coreutils which ] } - ''; + + runHook postInstall + ''; meta = with lib; { homepage = "http://www.brother.com/"; diff --git a/pkgs/misc/cups/drivers/kyocera-ecosys-m2x35-40-p2x35-40dnw/default.nix b/pkgs/misc/cups/drivers/kyocera-ecosys-m2x35-40-p2x35-40dnw/default.nix index 985a172d8731b..80550025ea890 100644 --- a/pkgs/misc/cups/drivers/kyocera-ecosys-m2x35-40-p2x35-40dnw/default.nix +++ b/pkgs/misc/cups/drivers/kyocera-ecosys-m2x35-40-p2x35-40dnw/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/cups/model/Kyocera cp ${region}/${language}/*.PPD $out/share/cups/model/Kyocera/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/cups/drivers/kyocera-ecosys-m552x-p502x/default.nix b/pkgs/misc/cups/drivers/kyocera-ecosys-m552x-p502x/default.nix index 66e3d036bcc63..05fd458f8ea17 100644 --- a/pkgs/misc/cups/drivers/kyocera-ecosys-m552x-p502x/default.nix +++ b/pkgs/misc/cups/drivers/kyocera-ecosys-m552x-p502x/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/cups/model/Kyocera cp ${region}/English/*.PPD $out/share/cups/model/Kyocera/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/cups/drivers/kyodialog/default.nix b/pkgs/misc/cups/drivers/kyodialog/default.nix index ad2d113465ce7..22ce449742a9b 100644 --- a/pkgs/misc/cups/drivers/kyodialog/default.nix +++ b/pkgs/misc/cups/drivers/kyodialog/default.nix @@ -72,6 +72,8 @@ stdenv.mkDerivation rec { propagatedBuildInputs = with python3Packages; [ reportlab pypdf3 setuptools ]; installPhase = '' + runHook preInstall + # allow cups to find the ppd files mkdir -p $out/share/cups/model mv ./usr/share/kyocera${kyodialog_version}/ppd${kyodialog_version} $out/share/cups/model/Kyocera @@ -97,6 +99,8 @@ stdenv.mkDerivation rec { substituteInPlace $out/share/applications/kyodialog.desktop \ --replace Exec=\"/usr/bin/kyodialog${kyodialog_version}\" Exec=\"$out/bin/kyodialog\" \ --replace Icon=/usr/share/kyocera/appicon_H.png Icon=$out/share/${pname}/icons/appicon_H.png + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/cups/drivers/mfc5890cncupswrapper/default.nix b/pkgs/misc/cups/drivers/mfc5890cncupswrapper/default.nix index 8ebcccbaa2819..e93f47fee5f64 100644 --- a/pkgs/misc/cups/drivers/mfc5890cncupswrapper/default.nix +++ b/pkgs/misc/cups/drivers/mfc5890cncupswrapper/default.nix @@ -33,6 +33,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + lpr=${mfc5890cnlpr}/usr/local/Brother/Printer/mfc5890cn dir=$out/usr/local/Brother/Printer/mfc5890cn @@ -62,7 +64,9 @@ stdenv.mkDerivation rec { ln $out/usr/lib64/cups/filter/brlpdwrappermfc5890cn $out/lib/cups/filter ln $dir/cupswrapper/cupswrappermfc5890cn $out/lib/cups/filter ln $out/usr/share/ppd/brmfc5890cn.ppd $out/share/cups/model - ''; + + runHook postInstall + ''; meta = with lib; { description = "Brother MFC-5890CN CUPS wrapper driver"; diff --git a/pkgs/misc/cups/drivers/mfc5890cnlpr/default.nix b/pkgs/misc/cups/drivers/mfc5890cnlpr/default.nix index 7878d77afc043..ca953935a3286 100644 --- a/pkgs/misc/cups/drivers/mfc5890cnlpr/default.nix +++ b/pkgs/misc/cups/drivers/mfc5890cnlpr/default.nix @@ -33,6 +33,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + dir=$out/usr/local/Brother/Printer/mfc5890cn patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $dir/lpd/brmfc5890cnfilter @@ -62,6 +64,8 @@ stdenv.mkDerivation rec { gnused gawk ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/cups/drivers/mfc9140cdncupswrapper/default.nix b/pkgs/misc/cups/drivers/mfc9140cdncupswrapper/default.nix index c38b526186515..8cd88aa94dfc3 100644 --- a/pkgs/misc/cups/drivers/mfc9140cdncupswrapper/default.nix +++ b/pkgs/misc/cups/drivers/mfc9140cdncupswrapper/default.nix @@ -32,6 +32,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + lpr=${mfc9140cdnlpr}/opt/brother/Printers/mfc9140cdn dir=$out/opt/brother/Printers/mfc9140cdn @@ -56,7 +58,9 @@ stdenv.mkDerivation rec { sed -n '/!ENDOFWFILTER!/,/!ENDOFWFILTER!/p' "$dir/cupswrapper/cupswrappermfc9140cdn" | sed '1 br; b; :r s/.*/printer_model=mfc9140cdn; cat < $out/lib/cups/filter/brother_lpdwrapper_mfc9140cdn sed -i "/#! \/bin\/sh/a PATH=${lib.makeBinPath [ coreutils gnused gnugrep ]}:\$PATH" $out/lib/cups/filter/brother_lpdwrapper_mfc9140cdn chmod +x $out/lib/cups/filter/brother_lpdwrapper_mfc9140cdn - ''; + + runHook postInstall + ''; meta = with lib; { description = "Brother MFC-9140CDN CUPS wrapper driver"; diff --git a/pkgs/misc/cups/drivers/mfc9140cdnlpr/default.nix b/pkgs/misc/cups/drivers/mfc9140cdnlpr/default.nix index ab20016c7ff0b..23ed88568507d 100644 --- a/pkgs/misc/cups/drivers/mfc9140cdnlpr/default.nix +++ b/pkgs/misc/cups/drivers/mfc9140cdnlpr/default.nix @@ -32,6 +32,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + dir=$out/opt/brother/Printers/mfc9140cdn patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $dir/lpd/brmfc9140cdnfilter @@ -61,6 +63,8 @@ stdenv.mkDerivation rec { gnused gawk ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix b/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix index 28be1b580a44f..1e53842da3226 100644 --- a/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix +++ b/pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + dpkg-deb -x $src $out substituteInPlace $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw \ @@ -32,7 +34,9 @@ stdenv.mkDerivation rec { wrapProgram $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw \ --prefix PATH ":" ${ lib.makeBinPath [ ghostscript a2ps file gnused coreutils ] } - ''; + + runHook postInstall + ''; meta = { homepage = "http://www.brother.com/"; diff --git a/pkgs/misc/cups/drivers/mfcj6510dwlpr/default.nix b/pkgs/misc/cups/drivers/mfcj6510dwlpr/default.nix index 0af79443ef6d4..2420d2837fbb0 100644 --- a/pkgs/misc/cups/drivers/mfcj6510dwlpr/default.nix +++ b/pkgs/misc/cups/drivers/mfcj6510dwlpr/default.nix @@ -43,6 +43,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + dpkg-deb -x $src $out substituteInPlace $out/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw \ --replace /opt "$out/opt" @@ -76,7 +78,9 @@ stdenv.mkDerivation rec { --prefix PATH ":" ${ lib.makeBinPath [ coreutils gnused gawk ] } wrapProgram $out/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw \ --prefix PATH ":" ${ lib.makeBinPath [ coreutils gnused file ghostscript a2ps ] } - ''; + + runHook postInstall + ''; meta = with lib; { description = "Brother MFC-J6510DW LPR driver"; diff --git a/pkgs/misc/cups/drivers/mfcl2700dncupswrapper/default.nix b/pkgs/misc/cups/drivers/mfcl2700dncupswrapper/default.nix index 0b145dfa38535..893e1405ada68 100644 --- a/pkgs/misc/cups/drivers/mfcl2700dncupswrapper/default.nix +++ b/pkgs/misc/cups/drivers/mfcl2700dncupswrapper/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + dpkg-deb -x $src $out basedir=${mfcl2700dnlpr}/opt/brother/Printers/MFCL2700DN @@ -32,6 +34,8 @@ stdenv.mkDerivation rec { ln $dir/cupswrapper/brother_lpdwrapper_MFCL2700DN $out/lib/cups/filter ln $dir/cupswrapper/brother-MFCL2700DN-cups-en.ppd $out/share/cups/model + + runHook postInstall ''; meta = { diff --git a/pkgs/misc/cups/drivers/mfcl2700dnlpr/default.nix b/pkgs/misc/cups/drivers/mfcl2700dnlpr/default.nix index 7e0c95582f533..ad26c914a4751 100644 --- a/pkgs/misc/cups/drivers/mfcl2700dnlpr/default.nix +++ b/pkgs/misc/cups/drivers/mfcl2700dnlpr/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + dpkg-deb -x $src $out dir=$out/opt/brother/Printers/MFCL2700DN @@ -32,6 +34,8 @@ stdenv.mkDerivation rec { patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3 patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3 + + runHook postInstall ''; meta = { diff --git a/pkgs/misc/cups/drivers/mfcl2720dwcupswrapper/default.nix b/pkgs/misc/cups/drivers/mfcl2720dwcupswrapper/default.nix index abf25ae69850e..54ed181cac092 100644 --- a/pkgs/misc/cups/drivers/mfcl2720dwcupswrapper/default.nix +++ b/pkgs/misc/cups/drivers/mfcl2720dwcupswrapper/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + dpkg-deb -x $src $out basedir=${mfcl2720dwlpr}/opt/brother/Printers/MFCL2720DW @@ -35,6 +37,8 @@ stdenv.mkDerivation rec { ln $dir/cupswrapper/brother_lpdwrapper_MFCL2720DW $out/lib/cups/filter ln $dir/cupswrapper/brother-MFCL2720DW-cups-en.ppd $out/share/cups/model + + runHook postInstall ''; meta = { diff --git a/pkgs/misc/cups/drivers/mfcl2720dwlpr/default.nix b/pkgs/misc/cups/drivers/mfcl2720dwlpr/default.nix index 36600a4505aaf..787027153ffb1 100644 --- a/pkgs/misc/cups/drivers/mfcl2720dwlpr/default.nix +++ b/pkgs/misc/cups/drivers/mfcl2720dwlpr/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + dpkg-deb -x $src $out dir=$out/opt/brother/Printers/MFCL2720DW @@ -33,6 +35,8 @@ stdenv.mkDerivation rec { patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3 patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3 + + runHook postInstall ''; meta = { diff --git a/pkgs/misc/cups/drivers/mfcl2740dwcupswrapper/default.nix b/pkgs/misc/cups/drivers/mfcl2740dwcupswrapper/default.nix index 9b2fe4ce1736a..2c0899a20518f 100644 --- a/pkgs/misc/cups/drivers/mfcl2740dwcupswrapper/default.nix +++ b/pkgs/misc/cups/drivers/mfcl2740dwcupswrapper/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { unpackPhase = "dpkg-deb -x $src $out"; installPhase = '' + runHook preInstall + basedir=${mfcl2740dwlpr}/opt/brother/Printers/MFCL2740DW dir=$out/opt/brother/Printers/MFCL2740DW @@ -33,6 +35,8 @@ stdenv.mkDerivation rec { ln $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW $out/lib/cups/filter ln $dir/cupswrapper/brother-MFCL2740DW-cups-en.ppd $out/share/cups/model + + runHook postInstall ''; meta = { diff --git a/pkgs/misc/cups/drivers/mfcl2740dwlpr/default.nix b/pkgs/misc/cups/drivers/mfcl2740dwlpr/default.nix index 162b019ac9b13..a7db3a734f5dd 100644 --- a/pkgs/misc/cups/drivers/mfcl2740dwlpr/default.nix +++ b/pkgs/misc/cups/drivers/mfcl2740dwlpr/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { unpackPhase = "dpkg-deb -x $src $out"; installPhase = '' + runHook preInstall + dir=$out/opt/brother/Printers/MFCL2740DW substituteInPlace $dir/lpd/filter_MFCL2740DW \ @@ -31,6 +33,8 @@ stdenv.mkDerivation rec { patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3 patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3 + + runHook postInstall ''; meta = { diff --git a/pkgs/misc/cups/drivers/mfcl8690cdwcupswrapper/default.nix b/pkgs/misc/cups/drivers/mfcl8690cdwcupswrapper/default.nix index dbc6a8fc8e5ec..af334939a395a 100644 --- a/pkgs/misc/cups/drivers/mfcl8690cdwcupswrapper/default.nix +++ b/pkgs/misc/cups/drivers/mfcl8690cdwcupswrapper/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + dpkg-deb -x $src $out basedir=${mfcl8690cdwlpr}/opt/brother/Printers/mfcl8690cdw @@ -33,7 +35,9 @@ stdenv.mkDerivation rec { ln $dir/cupswrapper/brother_lpdwrapper_mfcl8690cdw $out/lib/cups/filter ln $dir/cupswrapper/brother_mfcl8690cdw_printer_en.ppd $out/share/cups/model - ''; + + runHook postInstall + ''; meta = { description = "Brother MFC-L8690CDW CUPS wrapper driver"; diff --git a/pkgs/misc/cups/drivers/mfcl8690cdwlpr/default.nix b/pkgs/misc/cups/drivers/mfcl8690cdwlpr/default.nix index f290b9563cc75..e485639894044 100644 --- a/pkgs/misc/cups/drivers/mfcl8690cdwlpr/default.nix +++ b/pkgs/misc/cups/drivers/mfcl8690cdwlpr/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + dpkg-deb -x $src $out dir=$out/opt/brother/Printers/mfcl8690cdw @@ -33,6 +35,8 @@ stdenv.mkDerivation rec { # need to use i686 glibc here, these are 32bit proprietary binaries interpreter=${pkgs.pkgsi686Linux.glibc}/lib/ld-linux.so.2 patchelf --set-interpreter "$interpreter" $dir/lpd/brmfcl8690cdwfilter + + runHook postInstall ''; meta = { diff --git a/pkgs/misc/cups/drivers/splix/default.nix b/pkgs/misc/cups/drivers/splix/default.nix index 142f32dd2593c..56f5c075c7b12 100644 --- a/pkgs/misc/cups/drivers/splix/default.nix +++ b/pkgs/misc/cups/drivers/splix/default.nix @@ -12,8 +12,12 @@ let }; installPhase = '' + runHook preInstall + mkdir -p $out/share/cups/profiles/samsung cp * $out/share/cups/profiles/samsung/ + + runHook postInstall ''; }; diff --git a/pkgs/misc/cups/drivers/zj-58/default.nix b/pkgs/misc/cups/drivers/zj-58/default.nix index 0e2534997e350..a3ed433138525 100644 --- a/pkgs/misc/cups/drivers/zj-58/default.nix +++ b/pkgs/misc/cups/drivers/zj-58/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation { buildInputs = [ cups ]; installPhase = '' + runHook preInstall + install -D rastertozj $out/lib/cups/filter/rastertozj install -D ZJ-58.ppd $out/share/cups/model/zjiang/ZJ-58.ppd + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/drivers/epkowa/default.nix b/pkgs/misc/drivers/epkowa/default.nix index b29572b436bd5..e20455d3b445f 100644 --- a/pkgs/misc/drivers/epkowa/default.nix +++ b/pkgs/misc/drivers/epkowa/default.nix @@ -51,10 +51,14 @@ let plugins = { nativeBuildInputs = [ autoPatchelfHook rpm ]; installPhase = '' + runHook preInstall + ${rpm}/bin/rpm2cpio plugins/esci-interpreter-perfection-v330-*.x86_64.rpm | ${cpio}/bin/cpio -idmv mkdir $out{,/share,/lib} cp -r ./usr/share/{iscan-data,esci}/ $out/share/ cp -r ./usr/lib64/esci $out/lib + + runHook postInstall ''; passthru = { @@ -80,6 +84,8 @@ let plugins = { nativeBuildInputs = [ autoPatchelfHook rpm ]; installPhase = '' + runHook preInstall + cd plugins ${rpm}/bin/rpm2cpio iscan-plugin-perfection-v370-*.x86_64.rpm | ${cpio}/bin/cpio -idmv @@ -89,6 +95,8 @@ let plugins = { cp -r usr/lib64/iscan $out/lib mv $out/share/iscan $out/share/esci mv $out/lib/iscan $out/lib/esci + + runHook postInstall ''; passthru = { @@ -112,6 +120,8 @@ let plugins = { sha256 = "f8b3abf21354fc5b9bc87753cef950b6c0f07bf322a94aaff2c163bafcf50cd9"; }; installPhase = '' + runHook preInstall + cd plugins ${rpm}/bin/rpm2cpio iscan-plugin-perfection-v550-*.x86_64.rpm | ${cpio}/bin/cpio -idmv mkdir $out @@ -119,6 +129,8 @@ let plugins = { cp -r usr/lib64 $out/lib mv $out/share/iscan $out/share/esci mv $out/lib/iscan $out/lib/esci + + runHook postInstall ''; passthru = { registrationCommand = '' @@ -141,6 +153,8 @@ let plugins = { sha256 = "1vlba7dsgpk35nn3n7is8nwds3yzlk38q43mppjzwsz2d2n7sr33"; }; installPhase = '' + runHook preInstall + cd plugins ${rpm}/bin/rpm2cpio iscan-plugin-gt-x820-*.x86_64.rpm | ${cpio}/bin/cpio -idmv mkdir $out @@ -148,6 +162,8 @@ let plugins = { cp -r usr/lib64 $out/lib mv $out/share/iscan $out/share/esci mv $out/lib/iscan $out/lib/esci + + runHook postInstall ''; passthru = { registrationCommand = '' @@ -170,6 +186,8 @@ let plugins = { sha256 = "1chxdm6smv2d14pn2jl9xyd0vr42diy7vpskd3b9a61gf5h3gj03"; }; installPhase = '' + runHook preInstall + cd plugins ${rpm}/bin/rpm2cpio iscan-plugin-gt-x770-*.x86_64.rpm | ${cpio}/bin/cpio -idmv mkdir $out @@ -177,6 +195,8 @@ let plugins = { cp -r usr/lib64 $out/lib mv $out/share/iscan $out/share/esci mv $out/lib/iscan $out/lib/esci + + runHook postInstall ''; passthru = { registrationCommand = '' @@ -200,11 +220,15 @@ let plugins = { sha256 = "1xnbmb2rn610kqpg1x6k1cc13zlmx2f3l2xnj6809rnhg96qqn20"; }; installPhase = '' + runHook preInstall + cd plugins ${rpm}/bin/rpm2cpio esci-interpreter-gt-f720-*.x86_64.rpm | ${cpio}/bin/cpio -idmv mkdir $out cp -r usr/share $out cp -r usr/lib64 $out/lib + + runHook postInstall ''; passthru = { @@ -230,6 +254,8 @@ let plugins = { sha256 = "00qfdgs03k7bbs67zjrk8hbxvlyinsmk890amp9cmpfjfzdxgg58"; }; installPhase = '' + runHook preInstall + cd plugins ${rpm}/bin/rpm2cpio esci-interpreter-gt-s80-*.x86_64.rpm | ${cpio}/bin/cpio -idmv ${rpm}/bin/rpm2cpio iscan-plugin-esdip-*.x86_64.rpm | ${cpio}/bin/cpio -idmv @@ -237,6 +263,8 @@ let plugins = { cp -r usr/share $out cp -r usr/lib64 $out/lib mkdir $out/share/esci + + runHook postInstall ''; passthru = { @@ -266,6 +294,8 @@ let plugins = { nativeBuildInputs = [ autoPatchelfHook rpm ]; installPhase = '' + runHook preInstall + cd plugins ${rpm}/bin/rpm2cpio iscan-plugin-gt-s600-*.x86_64.rpm | ${cpio}/bin/cpio -idmv mkdir $out @@ -273,6 +303,8 @@ let plugins = { cp -r usr/lib64 $out/lib mv $out/share/iscan $out/share/esci mv $out/lib/iscan $out/lib/esci + + runHook postInstall ''; passthru = { @@ -298,6 +330,8 @@ let plugins = { nativeBuildInputs = [ autoPatchelfHook rpm ]; installPhase = '' + runHook preInstall + cd plugins ${rpm}/bin/rpm2cpio iscan-plugin-gt-s650-*.x86_64.rpm | ${cpio}/bin/cpio -idmv mkdir $out @@ -305,6 +339,8 @@ let plugins = { cp -r usr/lib64 $out/lib mv $out/share/iscan $out/share/esci mv $out/lib/iscan $out/lib/esci + + runHook postInstall ''; passthru = { @@ -331,6 +367,8 @@ let plugins = { nativeBuildInputs = [ autoPatchelfHook rpm ]; installPhase = '' + runHook preInstall + cd plugins ${rpm}/bin/rpm2cpio iscan-plugin-gt-x750-*.x86_64.rpm | ${cpio}/bin/cpio -idmv mkdir $out @@ -338,6 +376,8 @@ let plugins = { cp -r usr/lib64 $out/lib mv $out/share/iscan $out/share/esci mv $out/lib/iscan $out/lib/esci + + runHook postInstall ''; passthru = { @@ -363,6 +403,8 @@ let plugins = { nativeBuildInputs = [ autoPatchelfHook rpm ]; installPhase = '' + runHook preInstall + cd plugins ${rpm}/bin/rpm2cpio iscan-plugin-gt-1500-*.x86_64.rpm | ${cpio}/bin/cpio -idmv mkdir $out @@ -370,6 +412,8 @@ let plugins = { cp -r usr/lib64 $out/lib mv $out/share/iscan $out/share/esci mv $out/lib/iscan $out/lib/esci + + runHook postInstall ''; passthru = { @@ -396,6 +440,8 @@ let plugins = { sha256 = "0jssigsgkxb9i7qa7db291a1gbvwl795i4ahvb7bnqp33czkj85k"; }; installPhase = '' + runHook preInstall + cd plugins ${rpm}/bin/rpm2cpio iscan-network-nt-*.x86_64.rpm | ${cpio}/bin/cpio -idmv @@ -403,6 +449,8 @@ let plugins = { cp -r usr/share $out cp -r usr/lib64 $out/lib mkdir $out/share/esci + + runHook postInstall ''; passthru = { registrationCommand = ""; diff --git a/pkgs/misc/drivers/epson-workforce-635-nx625-series/default.nix b/pkgs/misc/drivers/epson-workforce-635-nx625-series/default.nix index 7a467ac1ad393..24e8d56cae113 100644 --- a/pkgs/misc/drivers/epson-workforce-635-nx625-series/default.nix +++ b/pkgs/misc/drivers/epson-workforce-635-nx625-series/default.nix @@ -46,6 +46,8 @@ in stdenv.mkDerivation rec { else if stdenv.system == "i686_linux" then "lib" else throw "other platforms than i686_linux and x86_64-linux are not yet supported"; in '' + runHook preInstall + mkdir -p "$out" "${docdir}" "${filterdir}" "${ppddir}" cp src/epson_inkjet_printer_filter "${filterdir}" @@ -56,6 +58,8 @@ in stdenv.mkDerivation rec { done cp COPYING.EPSON README "${docdir}" cp -r resource watermark ${libdir} "$out" + + runHook postInstall ''; meta = { diff --git a/pkgs/misc/drivers/m33-linux/default.nix b/pkgs/misc/drivers/m33-linux/default.nix index 9331760ef66bf..4c9237ccbb597 100644 --- a/pkgs/misc/drivers/m33-linux/default.nix +++ b/pkgs/misc/drivers/m33-linux/default.nix @@ -22,8 +22,12 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + install -Dm755 m33-linux $out/bin/m33-linux install -Dm755 90-micro-3d-local.rules $out/lib/udev/rules.d/90-micro-3d-local.rules + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/drivers/moltengamepad/default.nix b/pkgs/misc/drivers/moltengamepad/default.nix index 65259d73f2c73..3340a62c04183 100644 --- a/pkgs/misc/drivers/moltengamepad/default.nix +++ b/pkgs/misc/drivers/moltengamepad/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp moltengamepad $out/bin + + runHook postInstall ''; patchPhase = '' diff --git a/pkgs/misc/drivers/pantum-driver/default.nix b/pkgs/misc/drivers/pantum-driver/default.nix index 69e973fd95841..5744378136033 100644 --- a/pkgs/misc/drivers/pantum-driver/default.nix +++ b/pkgs/misc/drivers/pantum-driver/default.nix @@ -29,6 +29,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ dpkg autoPatchelfHook ]; installPhase = '' + runHook preInstall + dpkg-deb -x ./Resources/pantum_${version}-1_${architecture}.deb . mkdir -p $out $out/lib @@ -41,6 +43,8 @@ stdenv.mkDerivation rec { cp -r opt/pantum/* $out/ ln -s $out/lib/libqpdf.so* $out/lib/libqpdf.so ln -s $out/lib/libqpdf.so $out/lib/libqpdf.so.21 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/drivers/postscript-lexmark/default.nix b/pkgs/misc/drivers/postscript-lexmark/default.nix index d9544e4b330d3..2db00ba8f29a2 100644 --- a/pkgs/misc/drivers/postscript-lexmark/default.nix +++ b/pkgs/misc/drivers/postscript-lexmark/default.nix @@ -23,9 +23,13 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/cups/model/postscript-lexmark cp opt/OpenPrinting-Lexmark/ppds/Lexmark/*.ppd $out/share/cups/model/postscript-lexmark/ cp -r opt/OpenPrinting-Lexmark/doc $out/doc + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/drivers/sundtek/default.nix b/pkgs/misc/drivers/sundtek/default.nix index 3cba4a5f15c82..42b462e88c814 100644 --- a/pkgs/misc/drivers/sundtek/default.nix +++ b/pkgs/misc/drivers/sundtek/default.nix @@ -22,12 +22,16 @@ in sourceRoot = "."; installPhase = '' + runHook preInstall + cp -r opt $out # add and fix pkg-config file mkdir -p $out/lib/pkgconfig substitute $out/doc/libmedia.pc $out/lib/pkgconfig/libmedia.pc \ --replace /opt $out + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/misc/drivers/utsushi/networkscan.nix b/pkgs/misc/drivers/utsushi/networkscan.nix index b9aa1cbe904f4..7eb0310688d5c 100644 --- a/pkgs/misc/drivers/utsushi/networkscan.nix +++ b/pkgs/misc/drivers/utsushi/networkscan.nix @@ -16,12 +16,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ rpmextract ]; installPhase = '' + runHook preInstall + rpmextract plugins/imagescan-plugin-networkscan-${version}-*.x86_64.rpm install -Dm755 usr/libexec/utsushi/networkscan $out/libexec/utsushi/networkscan patchelf \ --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ --set-rpath ${lib.makeLibraryPath [ stdenv.cc.cc ]} \ $out/libexec/utsushi/networkscan + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/ghostscript/test-corpus-render.nix b/pkgs/misc/ghostscript/test-corpus-render.nix index 089661293c25d..8018487333596 100644 --- a/pkgs/misc/ghostscript/test-corpus-render.nix +++ b/pkgs/misc/ghostscript/test-corpus-render.nix @@ -32,6 +32,10 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + touch $out + + runHook postInstall ''; } diff --git a/pkgs/misc/gnuk/generic.nix b/pkgs/misc/gnuk/generic.nix index e9cc3aff2cf6f..01e2d8c4351ab 100644 --- a/pkgs/misc/gnuk/generic.nix +++ b/pkgs/misc/gnuk/generic.nix @@ -24,6 +24,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin find . -name gnuk.bin -exec cp {} $out \; @@ -41,6 +43,8 @@ stdenv.mkDerivation { echo "$out/bin/stlinkv2 -u \$@" >> $out/bin/unlock echo "$out/bin/stlinkv2 -b \$@ $out/gnuk.bin" >> $out/bin/flash chmod +x $out/bin/{unlock,flash} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/lguf-brightness/default.nix b/pkgs/misc/lguf-brightness/default.nix index 0bb288c217630..b89d2df06aa4d 100644 --- a/pkgs/misc/lguf-brightness/default.nix +++ b/pkgs/misc/lguf-brightness/default.nix @@ -17,7 +17,11 @@ stdenv.mkDerivation rec { buildInputs = [ libusb1 ncurses5 ]; installPhase = '' + runHook preInstall + install -D lguf_brightness $out/bin/lguf_brightness + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/lilypond/fonts.nix b/pkgs/misc/lilypond/fonts.nix index b624498f0920e..366bff6d276dc 100644 --- a/pkgs/misc/lilypond/fonts.nix +++ b/pkgs/misc/lilypond/fonts.nix @@ -14,6 +14,8 @@ let }; installPhase = '' + runHook preInstall + local fontsdir="$out/share/lilypond/${lilypond.version}/fonts" install -m755 -d "$fontsdir/otf" @@ -29,6 +31,8 @@ let for font in {svg,woff}/**.{svg,woff}; do install -Dt "$fontsdir/svg" -m644 "$font" done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/meson-tools/default.nix b/pkgs/misc/meson-tools/default.nix index 78e8549807917..a52f4ccfc132b 100644 --- a/pkgs/misc/meson-tools/default.nix +++ b/pkgs/misc/meson-tools/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { buildInputs = [ openssl ]; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" mv amlbootsig unamlbootsig amlinfo "$out/bin" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/mlxbf-bootimages/default.nix b/pkgs/misc/mlxbf-bootimages/default.nix index a7552c0bb5cb2..5dc69602e8f47 100644 --- a/pkgs/misc/mlxbf-bootimages/default.nix +++ b/pkgs/misc/mlxbf-bootimages/default.nix @@ -23,7 +23,11 @@ stdenv.mkDerivation rec { # Only install /lib. /usr only contains the licenses which are also available # in /lib. installPhase = '' + runHook preInstall + find lib -type f -exec install -D {} $out/{} \; + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/mnemonicode/default.nix b/pkgs/misc/mnemonicode/default.nix index 1cd78fdce093e..09cbf6f1cf5a5 100644 --- a/pkgs/misc/mnemonicode/default.nix +++ b/pkgs/misc/mnemonicode/default.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-bGipPvLj6ig+lMLsl/Yve8PmuA93ETvhNKoMPh0JMBM="; }; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv mnencode $out/bin mv mndecode $out/bin + + runHook postInstall ''; meta = with lib; { homepage = "https://github.com/singpolyma/mnemonicode"; diff --git a/pkgs/misc/sagetex/default.nix b/pkgs/misc/sagetex/default.nix index 96513b4f9f396..bb1a4b200598c 100644 --- a/pkgs/misc/sagetex/default.nix +++ b/pkgs/misc/sagetex/default.nix @@ -31,9 +31,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + path="$out/tex/latex/sagetex" mkdir -p "$path" cp -va *.sty *.cfg *.def "$path/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/screensavers/multilockscreen/default.nix b/pkgs/misc/screensavers/multilockscreen/default.nix index ad8045e705284..c7b74c8ad210c 100644 --- a/pkgs/misc/screensavers/multilockscreen/default.nix +++ b/pkgs/misc/screensavers/multilockscreen/default.nix @@ -28,9 +28,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp multilockscreen $out/bin/multilockscreen wrapProgram "$out/bin/multilockscreen" --prefix PATH : "${binPath}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/screensavers/pipes/default.nix b/pkgs/misc/screensavers/pipes/default.nix index bbabd02f4751d..97f392fcd4094 100644 --- a/pkgs/misc/screensavers/pipes/default.nix +++ b/pkgs/misc/screensavers/pipes/default.nix @@ -14,11 +14,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir $out -p make PREFIX=$out/ install wrapProgram $out/bin/pipes.sh \ --set PATH "${lib.makeBinPath [ coreutils ncurses ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/misc/translatelocally-models/default.nix b/pkgs/misc/translatelocally-models/default.nix index 9fb4754ed50d1..d50f01275d622 100644 --- a/pkgs/misc/translatelocally-models/default.nix +++ b/pkgs/misc/translatelocally-models/default.nix @@ -18,12 +18,16 @@ let dontUnpack = true; installPhase = '' + runHook preInstall + TARGET="$out/share/translateLocally/models" mkdir -p "$TARGET" tar -xzf "$src" -C "$TARGET" # avoid patching shebangs in inconsistently executable extra files find "$out" -type f -exec chmod -x {} + + + runHook postInstall ''; meta = { diff --git a/pkgs/misc/zeyple/default.nix b/pkgs/misc/zeyple/default.nix index fd5f628676aeb..9a50d48d453e8 100644 --- a/pkgs/misc/zeyple/default.nix +++ b/pkgs/misc/zeyple/default.nix @@ -15,7 +15,11 @@ python3Packages.buildPythonApplication rec { propagatedBuildInputs = [ python3Packages.gpgme ]; installPhase = '' + runHook preInstall + install -Dm755 $src/zeyple/zeyple.py $out/bin/zeyple + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libmd.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libmd.nix index 71d0c1e50d5ea..55c7a3b72c380 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/libmd.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libmd.nix @@ -29,6 +29,8 @@ mkDerivation { ''; installPhase = '' + runHook preInstall + # libmd is used by install. do it yourself! mkdir -p $out/include $out/lib $man/share/man cp libmd.a $out/lib/libmd.a @@ -40,6 +42,8 @@ mkDerivation { for f in $(make $makeFlags -V MAN); do cp "$f" "$man/share/man/$f" done + + runHook postInstall ''; outputs = [ diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/lorder.nix b/pkgs/os-specific/bsd/freebsd/pkgs/lorder.nix index 25e7f491a1c94..c47ec582ad782 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/lorder.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/lorder.nix @@ -8,10 +8,14 @@ mkDerivation { noCC = true; dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" "$man/share/man" mv "lorder.sh" "$out/bin/lorder" chmod +x "$out/bin/lorder" mv "lorder.1" "$man/share/man" + + runHook postInstall ''; nativeBuildInputs = [ bsdSetupHook diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix index aae852c487983..82fd7a6b0977a 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix @@ -101,7 +101,7 @@ lib.makeOverridable ( } // lib.optionalAttrs (stdenv'.isx86_32) { USE_SSP = "no"; } // lib.optionalAttrs (attrs.headersOnly or false) { - installPhase = "includesPhase"; + installPhase = "runHook preInstall; includesPhase; runHook postInstall"; dontBuild = true; } // attrs diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/libpthread/headers.nix b/pkgs/os-specific/bsd/netbsd/pkgs/libpthread/headers.nix index 41a447e2b4083..e0494a15aed0d 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/libpthread/headers.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/libpthread/headers.nix @@ -3,7 +3,7 @@ mkDerivation { path = "lib/libpthread"; pname = "libpthread-headers"; - installPhase = "includesPhase"; + installPhase = "runHook preInstall; includesPhase; runHook postInstall"; dontBuild = true; noCC = true; meta.platforms = lib.platforms.netbsd; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix b/pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix index e16027b535fca..248c7dde863ac 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix @@ -65,6 +65,10 @@ mkDerivation { ''; installPhase = '' + runHook preInstall + cp -r . $out + + runHook postInstall ''; } diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix index 8605bfbfcebe2..27bbd7df190de 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/mkDerivation.nix @@ -113,7 +113,7 @@ lib.makeOverridable ( } // lib.optionalAttrs (stdenv'.isx86_32) { USE_SSP = "no"; } // lib.optionalAttrs (attrs.headersOnly or false) { - installPhase = "includesPhase"; + installPhase = "runHook preInstall; includesPhase; runHook postInstall"; dontBuild = true; } // attrs diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/sys/headers.nix b/pkgs/os-specific/bsd/netbsd/pkgs/sys/headers.nix index d19d9d86cb382..8c197fc69126b 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/sys/headers.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/sys/headers.nix @@ -38,7 +38,7 @@ mkDerivation ( base // { pname = "sys-headers"; - installPhase = "includesPhase"; + installPhase = "runHook preInstall; includesPhase; runHook postInstall"; dontBuild = true; noCC = true; } diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/make-rules/package.nix b/pkgs/os-specific/bsd/openbsd/pkgs/make-rules/package.nix index a16448752566e..e4df73a18b4a5 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/make-rules/package.nix +++ b/pkgs/os-specific/bsd/openbsd/pkgs/make-rules/package.nix @@ -37,7 +37,11 @@ mkDerivation { ''; installPhase = '' + runHook preInstall + cp -r share/mk $out + + runHook postInstall ''; meta.platforms = lib.platforms.unix; diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix index 6ec9ba3429161..2e16f2927fb32 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix @@ -89,7 +89,7 @@ lib.makeOverridable ( CPP = "${stdenv'.cc.targetPrefix}cpp"; } // lib.optionalAttrs (attrs.headersOnly or false) { - installPhase = "includesPhase"; + installPhase = "runHook preInstall; includesPhase; runHook postInstall"; dontBuild = true; } // lib.optionalAttrs stdenv'.hostPlatform.isStatic { NOLIBSHARED = true; } diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix index fdc3bd45e55ee..6c033d69e4c3b 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix @@ -41,6 +41,8 @@ let nativeBuildInputs = [ buildPackages.darwin.rewrite-tbd ]; installPhase = '' + runHook preInstall + mkdir -p $out/Library/Frameworks cp -r ${MacOSX-SDK}${standardFrameworkPath name private} $out/Library/Frameworks @@ -63,6 +65,8 @@ let -r ${builtins.storeDir} \ "$tbd" done + + runHook postInstall ''; propagatedBuildInputs = builtins.attrValues deps; @@ -90,11 +94,15 @@ in rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/include pushd $out/include >/dev/null cp -r "${MacOSX-SDK}/usr/include/xpc" $out/include/xpc cp "${MacOSX-SDK}/usr/include/launch.h" $out/include/launch.h popd >/dev/null + + runHook postInstall ''; }; @@ -107,10 +115,14 @@ in rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/include $out/lib ln -s "${MacOSX-SDK}/include/Xplugin.h" $out/include/Xplugin.h cp ${MacOSX-SDK}/usr/lib/libXplugin.1.tbd $out/lib ln -s libXplugin.1.tbd $out/lib/libXplugin.tbd + + runHook postInstall ''; }; @@ -119,11 +131,15 @@ in rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/include pushd $out/include >/dev/null ln -s "${MacOSX-SDK}/include/utmp.h" ln -s "${MacOSX-SDK}/include/utmpx.h" popd >/dev/null + + runHook postInstall ''; }; @@ -134,10 +150,14 @@ in rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/include $out/lib ln -s "${MacOSX-SDK}/usr/include/sandbox.h" $out/include/sandbox.h cp "${MacOSX-SDK}/usr/lib/libsandbox.1.tbd" $out/lib ln -s libsandbox.1.tbd $out/lib/libsandbox.tbd + + runHook postInstall ''; }; @@ -145,8 +165,12 @@ in rec { name = "apple-lib-libDER"; dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/include cp -r ${MacOSX-SDK}/usr/include/libDER $out/include + + runHook postInstall ''; }; @@ -154,8 +178,12 @@ in rec { name = "apple-lib-simd"; dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/include cp -r ${MacOSX-SDK}/usr/include/simd $out/include + + runHook postInstall ''; }; }; diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix index 7262400c3eb02..f0fc229a1a7b9 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix @@ -31,7 +31,11 @@ let }; installPhase = '' + runHook preInstall + mv Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk $out + + runHook postInstall ''; }; @@ -46,7 +50,11 @@ let }; installPhase = '' + runHook preInstall + mv Library/Developer/CommandLineTools $out + + runHook postInstall ''; }; diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/libSystem.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/libSystem.nix index b661da75febe6..914d02ce5b936 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/libSystem.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/libSystem.nix @@ -26,6 +26,8 @@ stdenvNoCC.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir -p $out/{include,lib/swift} for dir in $includeDirs; do @@ -83,6 +85,8 @@ stdenvNoCC.mkDerivation { -r ${builtins.storeDir} \ "$tbd" done + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/libcharset.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/libcharset.nix index bf55037ab6057..9df592595068e 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/libcharset.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/libcharset.nix @@ -10,7 +10,11 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ buildPackages.darwin.checkReexportsHook ]; installPhase = '' + runHook preInstall + mkdir -p $out/{include,lib} cp ${MacOSX-SDK}/usr/lib/libcharset* $out/lib + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/libcompression.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/libcompression.nix index 92a45b7c5a50c..6f7dd81626372 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/libcompression.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/libcompression.nix @@ -8,8 +8,12 @@ let self = stdenvNoCC.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib cp ${MacOSX-SDK}/usr/lib/libcompression* $out/lib + + runHook postInstall ''; passthru = { diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/libnetwork.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/libnetwork.nix index 2e5c0593bf406..072eaad149c88 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/libnetwork.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/libnetwork.nix @@ -8,8 +8,12 @@ let self = stdenvNoCC.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib cp ${MacOSX-SDK}/usr/lib/libnetwork* $out/lib + + runHook postInstall ''; passthru = { diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/libobjc.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/libobjc.nix index 9288097ef3699..c27a941c29f07 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/libobjc.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/libobjc.nix @@ -8,11 +8,15 @@ let self = stdenvNoCC.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/{include,lib/swift} cp -r ${MacOSX-SDK}/usr/include/objc $out/include cp ${MacOSX-SDK}/usr/lib/libobjc* $out/lib cp -r ${MacOSX-SDK}/usr/lib/swift/ObjectiveC.swiftmodule $out/lib/swift cp ${MacOSX-SDK}/usr/lib/swift/libswiftObjectiveC.tbd $out/lib/swift + + runHook postInstall ''; passthru = { diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/libpm.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/libpm.nix index 995f2b20ce706..d05a8673879a1 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/libpm.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/libpm.nix @@ -10,8 +10,12 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ checkReexportsHook ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib cp ${MacOSX-SDK}/usr/lib/libpm* $out/lib + + runHook postInstall ''; passthru = { diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/libunwind.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/libunwind.nix index 885780eba75cd..bf835e3b3877f 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/libunwind.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/libunwind.nix @@ -10,6 +10,8 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ buildPackages.darwin.checkReexportsHook ]; installPhase = '' + runHook preInstall + mkdir -p $out/include/mach-o cp \ @@ -20,5 +22,7 @@ stdenvNoCC.mkDerivation { cp \ ${MacOSX-SDK}/usr/include/mach-o/compact_unwind_encoding.h \ $out/include/mach-o + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-sdk-12.3/frameworks/default.nix b/pkgs/os-specific/darwin/apple-sdk-12.3/frameworks/default.nix index 8ae0cd649c93c..5ec62685fb660 100644 --- a/pkgs/os-specific/darwin/apple-sdk-12.3/frameworks/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk-12.3/frameworks/default.nix @@ -71,6 +71,8 @@ let nativeBuildInputs = [ buildPackages.darwin.rewrite-tbd ]; installPhase = '' + runHook preInstall + mkdir -p $out/Library/Frameworks cp -r ${darwin-stubs}${standardFrameworkPath name private} $out/Library/Frameworks @@ -93,6 +95,8 @@ let -r ${builtins.storeDir} \ "$tbd" done + + runHook postInstall ''; propagatedBuildInputs = lib.attrValues deps; diff --git a/pkgs/os-specific/darwin/apple-sdk-12.3/libpm.nix b/pkgs/os-specific/darwin/apple-sdk-12.3/libpm.nix index 110b9a1ab4789..1a9a834c1aa23 100644 --- a/pkgs/os-specific/darwin/apple-sdk-12.3/libpm.nix +++ b/pkgs/os-specific/darwin/apple-sdk-12.3/libpm.nix @@ -14,8 +14,12 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ buildPackages.darwin.checkReexportsHook ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib cp ${darwin-stubs}/usr/lib/libpm* $out/lib + + runHook postInstall ''; passthru.tbdRewrites = { diff --git a/pkgs/os-specific/darwin/apple-sdk-12.3/libs/Xplugin.nix b/pkgs/os-specific/darwin/apple-sdk-12.3/libs/Xplugin.nix index 6e125c001183c..c022bf4d4ae55 100644 --- a/pkgs/os-specific/darwin/apple-sdk-12.3/libs/Xplugin.nix +++ b/pkgs/os-specific/darwin/apple-sdk-12.3/libs/Xplugin.nix @@ -22,9 +22,13 @@ stdenvNoCC.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir -p $out/include $out/lib cp "${darwin-stubs}/include/Xplugin.h" $out/include/Xplugin.h cp ${darwin-stubs}/usr/lib/libXplugin.1.tbd $out/lib ln -s libXplugin.1.tbd $out/lib/libXplugin.tbd + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-sdk-12.3/libunwind.nix b/pkgs/os-specific/darwin/apple-sdk-12.3/libunwind.nix index c1846a9bf92f5..cb4596151c37e 100644 --- a/pkgs/os-specific/darwin/apple-sdk-12.3/libunwind.nix +++ b/pkgs/os-specific/darwin/apple-sdk-12.3/libunwind.nix @@ -14,6 +14,8 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ buildPackages.darwin.checkReexportsHook ]; installPhase = '' + runHook preInstall + mkdir -p $out/include/mach-o cp \ @@ -24,5 +26,7 @@ stdenvNoCC.mkDerivation { cp \ ${darwin-stubs}/usr/include/mach-o/compact_unwind_encoding.h \ $out/include/mach-o + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index 1cd5afe193016..0f9151b60b5e1 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -27,6 +27,8 @@ let sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out cp -R System/Library $out @@ -40,6 +42,8 @@ let ln -s libcupsmime.1.tbd libcupsmime.tbd ln -s libcupsppdc.1.tbd libcupsppdc.tbd popd + + runHook postInstall ''; meta = with lib; { @@ -70,6 +74,8 @@ let extraTBDFiles = []; installPhase = '' + runHook preInstall + linkFramework() { local path="$1" local nested_path="$1" @@ -159,6 +165,8 @@ let fi done done + + runHook postInstall ''; propagatedBuildInputs = builtins.attrValues deps; @@ -174,6 +182,8 @@ let name = "apple-framework-${name}"; dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/Library/Frameworks/ cp -r ${darwin-stubs}/System/Library/${lib.optionalString private "Private"}Frameworks/${name}.framework \ $out/Library/Frameworks @@ -192,6 +202,8 @@ let ln -s Versions/Current/* . # NOTE there's no re-export checking here, this is probably wrong + + runHook postInstall ''; }; in rec { @@ -201,11 +213,15 @@ in rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/include pushd $out/include >/dev/null cp -r "${lib.getDev sdk}/include/xpc" $out/include/xpc cp "${lib.getDev sdk}/include/launch.h" $out/include/launch.h popd >/dev/null + + runHook postInstall ''; }; @@ -221,10 +237,14 @@ in rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/include $out/lib ln -s "${lib.getDev sdk}/include/Xplugin.h" $out/include/Xplugin.h cp ${darwin-stubs}/usr/lib/libXplugin.1.tbd $out/lib ln -s libXplugin.1.tbd $out/lib/libXplugin.tbd + + runHook postInstall ''; }; @@ -233,11 +253,15 @@ in rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/include pushd $out/include >/dev/null ln -s "${lib.getDev sdk}/include/utmp.h" ln -s "${lib.getDev sdk}/include/utmpx.h" popd >/dev/null + + runHook postInstall ''; }; @@ -246,10 +270,14 @@ in rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/include $out/lib ln -s "${lib.getDev sdk}/include/sandbox.h" $out/include/sandbox.h cp "${darwin-stubs}/usr/lib/libsandbox.1.tbd" $out/lib ln -s libsandbox.1.tbd $out/lib/libsandbox.tbd + + runHook postInstall ''; }; @@ -316,10 +344,14 @@ in rec { System = lib.overrideDerivation super.System (drv: { installPhase = '' + runHook preInstall + mkdir -p $out/Library/Frameworks/System.framework/Versions/B ln -s $out/Library/Frameworks/System.framework/Versions/{B,Current} ln -s ${pkgs.darwin.Libsystem}/lib/libSystem.B.tbd $out/Library/Frameworks/System.framework/Versions/B/System.tbd ln -s $out/Library/Frameworks/System.framework/{Versions/Current/,}System.tbd + + runHook postInstall ''; }); diff --git a/pkgs/os-specific/darwin/apple-source-releases/CarbonHeaders/default.nix b/pkgs/os-specific/darwin/apple-source-releases/CarbonHeaders/default.nix index f3ef0e9151f34..cf26376ec94bd 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/CarbonHeaders/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/CarbonHeaders/default.nix @@ -4,12 +4,16 @@ appleDerivation' stdenvNoCC { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/include cp MacTypes.h $out/include cp ConditionalMacros.h $out/include substituteInPlace $out/include/MacTypes.h \ --replace "CarbonCore/" "" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/apple-source-releases/CommonCrypto/default.nix b/pkgs/os-specific/darwin/apple-source-releases/CommonCrypto/default.nix index 32e142981f2d3..4ca4f60541bb2 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/CommonCrypto/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/CommonCrypto/default.nix @@ -2,8 +2,12 @@ appleDerivation' stdenvNoCC { installPhase = '' + runHook preInstall + mkdir -p $out/include/CommonCrypto cp include/* $out/include/CommonCrypto + + runHook postInstall ''; appleHeaders = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix b/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix index 3943e2b2a9b7a..c78d490be2614 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix @@ -12,6 +12,8 @@ appleDerivation' stdenv { ]; installPhase = '' + runHook preInstall + mkdir -p $out/Library/Frameworks/IOKit.framework ###### IMPURITIES @@ -178,6 +180,8 @@ appleDerivation' stdenv { cp IOUSBFamily*-630.4.5/IOUSBFamily/Headers/USBSpec.h $dest/usb # video: missing altogether + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix index 6ff3cec2f1eb1..ef303f2f641f4 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix @@ -8,6 +8,8 @@ appleDerivation' stdenvNoCC { ]; installPhase = '' + runHook preInstall + export SRCROOT=$PWD export DSTROOT=$out export PUBLIC_HEADERS_FOLDER_PATH=include @@ -17,6 +19,8 @@ appleDerivation' stdenvNoCC { cp ${./CrashReporterClient.h} $out/include/CrashReporterClient.h cp ${Libc_10-9}/include/NSSystemDirectories.h $out/include + + runHook postInstall ''; appleHeaders = builtins.readFile ./headers.txt; diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libinfo/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libinfo/default.nix index 789e536b8a7f1..4d56856c673d9 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libinfo/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libinfo/default.nix @@ -2,6 +2,8 @@ appleDerivation' stdenvNoCC { installPhase = '' + runHook preInstall + substituteInPlace xcodescripts/install_files.sh \ --replace "/usr/local/" "/" \ --replace "/usr/" "/" \ @@ -10,6 +12,8 @@ appleDerivation' stdenvNoCC { export DSTROOT=$out sh xcodescripts/install_files.sh + + runHook postInstall ''; appleHeaders = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libm/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libm/default.nix index 931bebeae5dd4..7ecf97fb95a92 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libm/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libm/default.nix @@ -9,10 +9,14 @@ appleDerivation' stdenvNoCC { ]; installPhase = '' + runHook preInstall + mkdir -p $out/include cp Source/Intel/math.h $out/include cp Source/Intel/fenv.h $out/include cp Source/complex.h $out/include + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libnotify/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libnotify/default.nix index 969e64427c9b9..055f59f04d3ee 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libnotify/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libnotify/default.nix @@ -2,8 +2,12 @@ appleDerivation' stdenvNoCC { installPhase = '' + runHook preInstall + mkdir -p $out/include cp notify.h $out/include cp notify_keys.h $out/include + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/Librpcsvc/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Librpcsvc/default.nix index 3c71531515a17..09522269b4fcb 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Librpcsvc/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Librpcsvc/default.nix @@ -4,6 +4,8 @@ appleDerivation { buildInputs = [ developer_cmds ]; installPhase = '' + runHook preInstall + export DSTROOT=$out export SRCROOT=$PWD export OBJROOT=$PWD @@ -12,6 +14,8 @@ appleDerivation { mv $out/usr/* $out rmdir $out/usr/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix index 520f4a823671f..3f5d6c8064637 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix @@ -34,6 +34,8 @@ appleDerivation' stdenv { dontFixup = true; installPhase = '' + runHook preInstall + export NIX_ENFORCE_PURITY= mkdir -p $out/lib $out/include @@ -143,6 +145,8 @@ appleDerivation' stdenv { -change "$resolv_libSystem" /usr/lib/libSystem.dylib \ $out/lib/libresolv.9.dylib ln -s libresolv.9.dylib $out/lib/libresolv.dylib + + runHook postInstall ''; appleHeaders = builtins.readFile ./headers.txt; diff --git a/pkgs/os-specific/darwin/apple-source-releases/PowerManagement/default.nix b/pkgs/os-specific/darwin/apple-source-releases/PowerManagement/default.nix index 5685d09e54feb..b635836911b44 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/PowerManagement/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/PowerManagement/default.nix @@ -5,6 +5,10 @@ appleDerivation { buildInputs = [ IOKit ]; xcbuildFlags = [ "-target" "caffeinate" ]; installPhase = '' + runHook preInstall + install -D Products/Deployment/caffeinate $out/bin/caffeinate + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix b/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix index f4fe65b8066c7..f85679e82f1fd 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix @@ -10,6 +10,8 @@ appleDerivation' stdenv { ]; installPhase = '' + runHook preInstall + mkdir -p $out/Library/Frameworks/Security.framework ###### IMPURITIES @@ -111,5 +113,6 @@ appleDerivation' stdenv { cp libsecurity_transform/lib/SecTransform.h $dest cp libsecurity_transform/lib/SecTransformReadTransform.h $dest + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/boot.nix b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/boot.nix index 7d1066a259150..a9ff339547f6a 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/boot.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/boot.nix @@ -75,6 +75,8 @@ in appleDerivation { ''; installPhase = '' + runHook preInstall + bsdmake -C usr-share-locale.tproj install DESTDIR="$locale/share/locale" # need to get rid of runtime dependency on flex @@ -85,6 +87,8 @@ in appleDerivation { install -d 0755 $ps/bin install ps $ps/bin/ps touch "$out" + + runHook postInstall ''; outputs = [ diff --git a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/default.nix index 3ac338d5c619d..261c8728feee6 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/default.nix @@ -41,6 +41,8 @@ appleDerivation { # temporary install phase until xcodebuild has "install" support installPhase = '' + runHook preInstall + for f in Products/Release/*; do if [ -f $f ]; then install -D $f $out/bin/$(basename $f) @@ -53,6 +55,8 @@ appleDerivation { # from variant_links.sh # ln -s $out/bin/pkill $out/bin/pgrep # ln -s $out/share/man/man1/pkill.1 $out/share/man/man1/pgrep.1 + + runHook postInstall ''; nativeBuildInputs = [ xcbuild ]; diff --git a/pkgs/os-specific/darwin/apple-source-releases/basic_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/basic_cmds/default.nix index 7d011d2d8cc86..73ff04e7e55e3 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/basic_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/basic_cmds/default.nix @@ -13,6 +13,8 @@ appleDerivation { # temporary install phase until xcodebuild has "install" support installPhase = '' + runHook preInstall + for f in Products/Release/*; do if [ -f $f ]; then install -D $f $out/bin/$(basename $f) @@ -23,6 +25,8 @@ appleDerivation { mkdir -p $out/share/man/man$n install */*.$n $out/share/man/man$n done + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix index ff98ed88804ce..b4a8591ea6b9d 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix @@ -25,6 +25,8 @@ appleDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/libexec $out/share/man/man1 chmod +x mig.sh @@ -39,5 +41,7 @@ appleDerivation { --replace '/usr/bin/' "" \ --replace '/bin/rmdir' "rmdir" \ --replace 'C=''${MIGCC}' "C=${targetTargetPrefix}cc" + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/bsdmake/default.nix b/pkgs/os-specific/darwin/apple-source-releases/bsdmake/default.nix index 214aa5dfad9ea..70b1f6b533e6e 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/bsdmake/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/bsdmake/default.nix @@ -39,10 +39,14 @@ appleDerivation { ''; installPhase = '' + runHook preInstall + install -d 0644 $out/bin install -m 0755 bsdmake $out/bin install -d 0644 $out/share/mk install -m 0755 mk/* $out/share/mk + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix index b46cf7628c8c7..7bfc3dd1aaf39 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix @@ -191,10 +191,14 @@ appleDerivation' stdenv { ''; installPhase = '' + runHook preInstall + mkdir -p $out/include cp dnsinfo/*.h $out/include/ '' + lib.optionalString (!headersOnly) '' mkdir -p $out/Library/Frameworks/ mv SystemConfiguration.fproj/SystemConfiguration.framework $out/Library/Frameworks + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/copyfile/default.nix b/pkgs/os-specific/darwin/apple-source-releases/copyfile/default.nix index 5e7f38e84d7d8..8ac049634edc4 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/copyfile/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/copyfile/default.nix @@ -3,7 +3,11 @@ appleDerivation' stdenvNoCC { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/include/ cp copyfile.h $out/include/ + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix index 23a5ae0067126..105251f93640d 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix @@ -22,6 +22,8 @@ appleDerivation { # temporary install phase until xcodebuild has "install" support installPhase = '' + runHook preInstall + for f in Products/Release/*; do if [ -f $f ]; then install -D $f $out/bin/$(basename $f) @@ -32,6 +34,8 @@ appleDerivation { mkdir -p $out/share/man/man$n install */*.$n $out/share/man/man$n done + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix index b642b993df0e3..4f9f473f7c0dd 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix @@ -30,6 +30,8 @@ in appleDerivation { --replace 'DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";' "" ''; installPhase = '' + runHook preInstall + install -D Products/Release/libdisk.a $out/lib/libdisk.a rm Products/Release/libdisk.a for f in Products/Release/*; do @@ -37,6 +39,8 @@ in appleDerivation { install -D $f $out/bin/$(basename $f) fi done + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix b/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix index afff7897488ef..fa978d674552f 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix @@ -39,6 +39,8 @@ appleDerivation { # xcbuild doesn't support install installPhase = '' + runHook preInstall + mkdir -p $out cp -r Products/Release/usr/include $out/include @@ -53,5 +55,7 @@ appleDerivation { mkdir -p $out/lib/dtrace install_name_tool -change $PWD/Products/Release/libdtrace.dylib $out/lib/libdtrace.dylib $out/bin/dtrace + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/dyld/default.nix b/pkgs/os-specific/darwin/apple-source-releases/dyld/default.nix index e91d703602650..61e99d4647ffa 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/dyld/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/dyld/default.nix @@ -2,9 +2,13 @@ appleDerivation' stdenvNoCC { installPhase = '' + runHook preInstall + mkdir -p $out/lib $out/include ln -s /usr/lib/dyld $out/lib/dyld cp -r include $out/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/apple-source-releases/eap8021x/default.nix b/pkgs/os-specific/darwin/apple-source-releases/eap8021x/default.nix index f5c47f01d37a9..096685ead9910 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/eap8021x/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/eap8021x/default.nix @@ -3,8 +3,12 @@ appleDerivation' stdenv { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/Library/Frameworks/EAP8021X.framework/Headers cp EAP8021X.fproj/EAPClientProperties.h $out/Library/Frameworks/EAP8021X.framework/Headers + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix index 8d44cc86194fa..07fb11050130c 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix @@ -23,6 +23,8 @@ appleDerivation { # temporary install phase until xcodebuild has "install" support installPhase = '' + runHook preInstall + for f in Products/Release/*; do if [ -f $f ]; then install -D $f $out/bin/$(basename $f) @@ -33,6 +35,8 @@ appleDerivation { mkdir -p $out/share/man/man$n install */*.$n $out/share/man/man$n done + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/darwin/apple-source-releases/launchd/default.nix b/pkgs/os-specific/darwin/apple-source-releases/launchd/default.nix index 67e051d56853e..5faa12613000f 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/launchd/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/launchd/default.nix @@ -3,11 +3,15 @@ appleDerivation' stdenvNoCC { # No clue why the same file has two different names. Ask Apple! installPhase = '' + runHook preInstall + mkdir -p $out/include/ $out/include/servers cp liblaunch/*.h $out/include cp liblaunch/bootstrap.h $out/include/servers cp liblaunch/bootstrap.h $out/include/servers/bootstrap_defs.h + + runHook postInstall ''; appleHeaders = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/libclosure/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libclosure/default.nix index 976658b7e5ddc..a7d8ce8058285 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libclosure/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libclosure/default.nix @@ -2,8 +2,12 @@ appleDerivation' stdenvNoCC { installPhase = '' + runHook preInstall + mkdir -p $out/include cp *.h $out/include/ + + runHook postInstall ''; appleHeaders = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/libdispatch/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libdispatch/default.nix index 335115f8fea6f..ea008c0c4c6ae 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libdispatch/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libdispatch/default.nix @@ -4,6 +4,8 @@ appleDerivation' stdenvNoCC (finalAttrs: { dontConfigure = true; dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/include/dispatch $out/include/os # Move these headers so CF can find @@ -20,6 +22,8 @@ appleDerivation' stdenvNoCC (finalAttrs: { #else typedef void* dispatch_block_t; #endif' + + runHook postInstall ''; appleHeaders = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/libmalloc/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libmalloc/default.nix index 8b362a2edd549..4b1acbda34523 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libmalloc/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libmalloc/default.nix @@ -4,7 +4,11 @@ # headers are needed by Libsystem. appleDerivation' stdenvNoCC { installPhase = '' + runHook preInstall + mkdir -p $out/include cp -R include/malloc $out/include/ + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/libplatform/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libplatform/default.nix index e0b25d27778a9..2cd5196bbe5c9 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libplatform/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libplatform/default.nix @@ -2,9 +2,13 @@ appleDerivation' stdenvNoCC (finalAttrs: { installPhase = '' + runHook preInstall + mkdir $out cp -r include $out/include test -d private && cp -r private/* $out/include + + runHook postInstall ''; appleHeaders = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix index 3d62270d76c0d..6def91b0624e6 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix @@ -4,6 +4,8 @@ appleDerivation' stdenvNoCC { propagatedBuildInputs = [ libdispatch xnu ]; installPhase = '' + runHook preInstall + mkdir -p $out/include/pthread/ mkdir -p $out/include/sys/_types cp pthread/*.h $out/include/pthread/ @@ -13,6 +15,8 @@ appleDerivation' stdenvNoCC { cp -r sys $out/include cp -r sys/_pthread/*.h $out/include/sys/_types/ + + runHook postInstall ''; appleHeaders = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix index 2a8a609472a20..61ad3e5c1d011 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix @@ -37,6 +37,8 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) { ''; installPhase = '' + runHook preInstall + mkdir -p $out/include $out/include/arpa $out/lib cp dns.h $out/include/ @@ -48,5 +50,7 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) { cp libresolv.9.dylib $out/lib ln -s libresolv.9.dylib $out/lib/libresolv.dylib + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/libunwind/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libunwind/default.nix index df3c5650452de..e0bf63daa18bc 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libunwind/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libunwind/default.nix @@ -5,8 +5,12 @@ appleDerivation { # install headers only installPhase = '' + runHook preInstall + mkdir -p $out/lib cp -R include $out/include + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/apple-source-releases/libutil/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libutil/default.nix index 5cc8e0ffa28ab..5a3c5ec315d06 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libutil/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libutil/default.nix @@ -14,6 +14,8 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) { xcbuildFlags = [ "-target" "util" ]; installPhase = '' + runHook preInstall + mkdir -p $out/include '' + lib.optionalString headersOnly '' cp *.h $out/include @@ -25,6 +27,8 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) { # TODO: figure out how to get this to be right the first time around install_name_tool -id $out/lib/libutil.dylib $out/lib/libutil.dylib + + runHook postInstall ''; # FIXME: headers are different against headersOnly. And all the headers are NOT in macos, do we really want them? diff --git a/pkgs/os-specific/darwin/apple-source-releases/mDNSResponder/default.nix b/pkgs/os-specific/darwin/apple-source-releases/mDNSResponder/default.nix index 0ba4caee6289a..173baa50131d5 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/mDNSResponder/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/mDNSResponder/default.nix @@ -3,10 +3,14 @@ appleDerivation' stdenvNoCC { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/include # TODO: Do this only for 765.50.9 once there is a way to apply version-specific # logic in a source-release derivation. substitute mDNSShared/dns_sd.h $out/include/dns_sd.h \ --replace '#define _DNS_SD_LIBDISPATCH 0' '#define _DNS_SD_LIBDISPATCH 1' + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix index c6ac966a65caf..d263fe16c6439 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix @@ -24,6 +24,8 @@ appleDerivation { # temporary install phase until xcodebuild has "install" support installPhase = '' + runHook preInstall + for f in Products/Release/*; do if [ -f $f ]; then install -D $f $out/bin/$(basename $f) @@ -45,7 +47,9 @@ appleDerivation { # mkdir -p $out/System/Library/LaunchDaemons # install kdumpd.tproj/com.apple.kdumpd.plist $out/System/Library/LaunchDaemons - ''; + + runHook postInstall + ''; meta = { platforms = lib.platforms.darwin; diff --git a/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix b/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix index 315f0fb06219b..4c418a0be3d24 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/objc4/default.nix @@ -11,6 +11,8 @@ appleDerivation { ]; installPhase = '' + runHook preInstall + mkdir -p $out/include/objc $out/lib cp ${darwin-stubs}/usr/lib/libobjc.A.tbd $out/lib/libobjc.A.tbd ln -s libobjc.A.tbd $out/lib/libobjc.tbd @@ -31,5 +33,7 @@ appleDerivation { cp runtime/objc-sync.h $out/include/objc/objc-sync.h cp runtime/objc.h $out/include/objc/objc.h cp runtime/runtime.h $out/include/objc/runtime.h + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/ppp/default.nix b/pkgs/os-specific/darwin/apple-source-releases/ppp/default.nix index 4ced564ffb722..12c9c591b62b7 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/ppp/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/ppp/default.nix @@ -3,6 +3,8 @@ appleDerivation' stdenv { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/include/ppp cp Controller/ppp_msg.h $out/include/ppp @@ -11,5 +13,7 @@ appleDerivation' stdenv { cp Controller/pppcontroller.defs $out/include/ppp cp Controller/pppcontroller_mach_defines.h $out/include cp Controller/PPPControllerPriv.h $out/include/ppp + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/removefile/default.nix b/pkgs/os-specific/darwin/apple-source-releases/removefile/default.nix index 611f445e1ec94..ed974934fc91c 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/removefile/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/removefile/default.nix @@ -2,8 +2,12 @@ appleDerivation' stdenvNoCC { installPhase = '' + runHook preInstall + mkdir -p $out/include/ cp removefile.h checkint.h $out/include/ + + runHook postInstall ''; appleHeaders = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/default.nix index a8352285c78e0..6ab2492c81c04 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/default.nix @@ -28,6 +28,8 @@ appleDerivation { # temporary install phase until xcodebuild has "install" support installPhase = '' + runHook preInstall + for f in Products/Release/*; do if [ -f $f ]; then install -D $f $out/usr/bin/$(basename $f) @@ -41,6 +43,8 @@ appleDerivation { mv $out/usr/* $out mv $out/private/etc $out rmdir $out/usr $out/private + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/darwin/apple-source-releases/text_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/text_cmds/default.nix index c6fc009430374..6df5249bfcc2f 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/text_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/text_cmds/default.nix @@ -13,11 +13,15 @@ appleDerivation { ''; installPhase = '' + runHook preInstall + for f in Products/Release/*; do if [ -f $f ]; then install -D $f $out/bin/$(basename $f) fi done + + runHook postInstall ''; env.NIX_CFLAGS_COMPILE = toString [ diff --git a/pkgs/os-specific/darwin/apple-source-releases/top/default.nix b/pkgs/os-specific/darwin/apple-source-releases/top/default.nix index 2a47de021dc6c..55ebcc485ba87 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/top/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/top/default.nix @@ -8,9 +8,13 @@ appleDerivation { env.NIX_CFLAGS_COMPILE = "-fcommon"; NIX_LDFLAGS = "-lutil"; installPhase = '' + runHook preInstall + install -D Products/Release/libtop.a $out/lib/libtop.a install -D Products/Release/libtop.h $out/include/libtop.h install -D Products/Release/top $out/bin/top + + runHook postInstall ''; meta = { platforms = lib.platforms.darwin; diff --git a/pkgs/os-specific/darwin/darwin-stubs/default.nix b/pkgs/os-specific/darwin/darwin-stubs/default.nix index 6e3439455cce5..71256b42a558f 100644 --- a/pkgs/os-specific/darwin/darwin-stubs/default.nix +++ b/pkgs/os-specific/darwin/darwin-stubs/default.nix @@ -12,7 +12,11 @@ stdenvNoCC.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir $out mv * $out + + runHook postInstall ''; } diff --git a/pkgs/os-specific/darwin/discrete-scroll/default.nix b/pkgs/os-specific/darwin/discrete-scroll/default.nix index f38bf8d813229..0660364414c31 100644 --- a/pkgs/os-specific/darwin/discrete-scroll/default.nix +++ b/pkgs/os-specific/darwin/discrete-scroll/default.nix @@ -22,8 +22,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ./dc $out/bin/discretescroll + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/goku/default.nix b/pkgs/os-specific/darwin/goku/default.nix index 13aadfce24043..948c2e31a549a 100644 --- a/pkgs/os-specific/darwin/goku/default.nix +++ b/pkgs/os-specific/darwin/goku/default.nix @@ -30,11 +30,15 @@ stdenv.mkDerivation rec { sourceRoot = if stdenv.isAarch64 then "goku" else "."; installPhase = '' + runHook preInstall + chmod +x goku chmod +x gokuw mkdir -p $out/bin cp goku $out/bin cp gokuw $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/grandperspective/default.nix b/pkgs/os-specific/darwin/grandperspective/default.nix index 816440ec1155e..3806ea2960475 100644 --- a/pkgs/os-specific/darwin/grandperspective/default.nix +++ b/pkgs/os-specific/darwin/grandperspective/default.nix @@ -16,9 +16,13 @@ stdenv.mkDerivation (finalAttrs: { # Create a trampoline script in $out/bin/ because a symlink doesn’t work for # this app. installPhase = '' + runHook preInstall + mkdir -p "$out/Applications/GrandPerspective.app" "$out/bin" cp -R . "$out/Applications/GrandPerspective.app" makeWrapper "$out/Applications/GrandPerspective.app/Contents/MacOS/GrandPerspective" "$out/bin/grandperspective" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/hexfiend/default.nix b/pkgs/os-specific/darwin/hexfiend/default.nix index 2a5ec7a461c5f..91ece2a3fbea9 100644 --- a/pkgs/os-specific/darwin/hexfiend/default.nix +++ b/pkgs/os-specific/darwin/hexfiend/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { sourceRoot = "Hex Fiend.app"; nativeBuildInputs = [ undmg ]; installPhase = '' + runHook preInstall + mkdir -p "$out/Applications/Hex Fiend.app" cp -R . "$out/Applications/Hex Fiend.app" + + runHook postInstall ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/os-specific/darwin/iproute2mac/default.nix b/pkgs/os-specific/darwin/iproute2mac/default.nix index c7582de3352a1..e0b4eff6c6b9b 100644 --- a/pkgs/os-specific/darwin/iproute2mac/default.nix +++ b/pkgs/os-specific/darwin/iproute2mac/default.nix @@ -23,8 +23,12 @@ stdenv.mkDerivation rec { --replace /usr/sbin/networksetup ${darwin.network_cmds}/bin/networksetup ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -D -m 755 src/ip.py $out/bin/ip + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/karabiner-elements/default.nix b/pkgs/os-specific/darwin/karabiner-elements/default.nix index 367f7bc0ad444..4b949992e9e81 100644 --- a/pkgs/os-specific/darwin/karabiner-elements/default.nix +++ b/pkgs/os-specific/darwin/karabiner-elements/default.nix @@ -33,11 +33,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out $driver cp -R Installer.pkg/Applications Installer.pkg/Library $out cp -R Karabiner-DriverKit-VirtualHIDDevice.pkg/Applications Karabiner-DriverKit-VirtualHIDDevice.pkg/Library $driver cp "$out/Library/Application Support/org.pqrs/Karabiner-Elements/package-version" "$out/Library/Application Support/org.pqrs/Karabiner-Elements/version" + + runHook postInstall ''; passthru.updateScript = ./updater.sh; diff --git a/pkgs/os-specific/darwin/khd/default.nix b/pkgs/os-specific/darwin/khd/default.nix index 9c10dc89a69d3..f99087ed18a21 100644 --- a/pkgs/os-specific/darwin/khd/default.nix +++ b/pkgs/os-specific/darwin/khd/default.nix @@ -26,12 +26,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bin/khd $out/bin/khd mkdir -p $out/Library/LaunchDaemons cp ${./org.nixos.khd.plist} $out/Library/LaunchDaemons/org.nixos.khd.plist substituteInPlace $out/Library/LaunchDaemons/org.nixos.khd.plist --subst-var out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/kwm/default.nix b/pkgs/os-specific/darwin/kwm/default.nix index c210f9e8c65dd..674778239e779 100644 --- a/pkgs/os-specific/darwin/kwm/default.nix +++ b/pkgs/os-specific/darwin/kwm/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp kwmc $out/bin/kwmc cp kwm overlaylib.dylib $out @@ -21,6 +23,8 @@ stdenv.mkDerivation rec { mkdir -p $out/Library/LaunchDaemons cp ${./org.nixos.kwm.plist} $out/Library/LaunchDaemons/org.nixos.kwm.plist substituteInPlace $out/Library/LaunchDaemons/org.nixos.kwm.plist --subst-var out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/lsusb/default.nix b/pkgs/os-specific/darwin/lsusb/default.nix index 712e32f16fe4a..d4fd0d3869187 100644 --- a/pkgs/os-specific/darwin/lsusb/default.nix +++ b/pkgs/os-specific/darwin/lsusb/default.nix @@ -12,10 +12,14 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/man/man8 install -m 0755 lsusb $out/bin install -m 0444 man/lsusb.8 $out/share/man/man8 + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/darwin/m-cli/default.nix b/pkgs/os-specific/darwin/m-cli/default.nix index 41f112cf4802e..764d560a25e4c 100644 --- a/pkgs/os-specific/darwin/m-cli/default.nix +++ b/pkgs/os-specific/darwin/m-cli/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + local MPATH="$out/share/m" gawk -i inplace '{ @@ -30,6 +32,8 @@ stdenv.mkDerivation rec { install -Dt "$out/share/bash-completion/completions/" -m444 completion/bash/m install -Dt "$out/share/fish/vendor_completions.d/" -m444 completion/fish/m.fish install -Dt "$out/share/zsh/site-functions/" -m444 completion/zsh/_m + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/macfuse/default.nix b/pkgs/os-specific/darwin/macfuse/default.nix index 4de9600e79108..497a9584b5f71 100644 --- a/pkgs/os-specific/darwin/macfuse/default.nix +++ b/pkgs/os-specific/darwin/macfuse/default.nix @@ -32,10 +32,14 @@ stdenv.mkDerivation rec { # NOTE: Keep in mind that different parts of macFUSE are distributed under a # different license installPhase = '' + runHook preInstall + mkdir -p $out/include $out/lib/pkgconfig cp usr/local/lib/*.tbd $out/lib cp usr/local/lib/pkgconfig/*.pc $out/lib/pkgconfig cp -R usr/local/include/* $out/include + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/mas/default.nix b/pkgs/os-specific/darwin/mas/default.nix index 968cb10cd5a3b..af495842b1519 100644 --- a/pkgs/os-specific/darwin/mas/default.nix +++ b/pkgs/os-specific/darwin/mas/default.nix @@ -20,8 +20,12 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ installShellFiles ]; installPhase = '' + runHook preInstall + install -D './${version}/bin/mas' "$out/bin/mas" installShellCompletion --cmd mas --bash './${version}/etc/bash_completion.d/mas' + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/os-specific/darwin/osx-cpu-temp/default.nix b/pkgs/os-specific/darwin/osx-cpu-temp/default.nix index 2f3154fe9ea41..857a17bbc00e5 100644 --- a/pkgs/os-specific/darwin/osx-cpu-temp/default.nix +++ b/pkgs/os-specific/darwin/osx-cpu-temp/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { buildInputs = [ IOKit ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp osx-cpu-temp $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/pngpaste/default.nix b/pkgs/os-specific/darwin/pngpaste/default.nix index 99ae8048f7fde..b0072e3f6f6d6 100644 --- a/pkgs/os-specific/darwin/pngpaste/default.nix +++ b/pkgs/os-specific/darwin/pngpaste/default.nix @@ -15,8 +15,12 @@ in stdenv.mkDerivation { buildInputs = [ AppKit Cocoa ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp pngpaste $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/print-reexports/default.nix b/pkgs/os-specific/darwin/print-reexports/default.nix index 992cf1bff8ea3..9b090b1619a84 100644 --- a/pkgs/os-specific/darwin/print-reexports/default.nix +++ b/pkgs/os-specific/darwin/print-reexports/default.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv print-reexports $out/bin + + runHook postInstall ''; meta.mainProgram = "print-reexports"; } diff --git a/pkgs/os-specific/darwin/reattach-to-user-namespace/default.nix b/pkgs/os-specific/darwin/reattach-to-user-namespace/default.nix index ea3dd694962e4..29d0e08a32a21 100644 --- a/pkgs/os-specific/darwin/reattach-to-user-namespace/default.nix +++ b/pkgs/os-specific/darwin/reattach-to-user-namespace/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { else throw "reattach-to-user-namespace isn't being built for ${stdenv.hostPlatform.system} yet."; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp reattach-to-user-namespace $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/shortcat/default.nix b/pkgs/os-specific/darwin/shortcat/default.nix index 59009fede2b2e..9dc6a284641c5 100644 --- a/pkgs/os-specific/darwin/shortcat/default.nix +++ b/pkgs/os-specific/darwin/shortcat/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out/Applications/Shortcat.app cp -R . $out/Applications/Shortcat.app + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/signing-utils/default.nix b/pkgs/os-specific/darwin/signing-utils/default.nix index 035ac59b725ae..ec30fd305937d 100644 --- a/pkgs/os-specific/darwin/signing-utils/default.nix +++ b/pkgs/os-specific/darwin/signing-utils/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + substituteAll ${./utils.sh} $out + + runHook postInstall ''; # Substituted variables diff --git a/pkgs/os-specific/darwin/spacebar/default.nix b/pkgs/os-specific/darwin/spacebar/default.nix index 051bbfc46c15d..1604ee3f8c1a7 100644 --- a/pkgs/os-specific/darwin/spacebar/default.nix +++ b/pkgs/os-specific/darwin/spacebar/default.nix @@ -14,10 +14,14 @@ stdenv.mkDerivation rec { buildInputs = [ Carbon Cocoa ScriptingBridge SkyLight ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/man/man1/ cp ./bin/spacebar $out/bin/spacebar cp ./doc/spacebar.1 $out/share/man/man1/spacebar.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/darwin/trash/default.nix b/pkgs/os-specific/darwin/trash/default.nix index a239f6607b1fb..da1fad6e90ce5 100644 --- a/pkgs/os-specific/darwin/trash/default.nix +++ b/pkgs/os-specific/darwin/trash/default.nix @@ -18,10 +18,14 @@ stdenv.mkDerivation rec { buildPhase = "make all docs"; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/man/man1 install -m 0755 trash $out/bin install -m 0444 trash.1 $out/share/man/man1 + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/darwin/wifi-password/default.nix b/pkgs/os-specific/darwin/wifi-password/default.nix index f66af1ddfb56f..e70d9f058ce86 100644 --- a/pkgs/os-specific/darwin/wifi-password/default.nix +++ b/pkgs/os-specific/darwin/wifi-password/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp wifi-password.sh $out/bin/wifi-password + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/915resolution/default.nix b/pkgs/os-specific/linux/915resolution/default.nix index 8a6732d8737fa..d2efab042c878 100644 --- a/pkgs/os-specific/linux/915resolution/default.nix +++ b/pkgs/os-specific/linux/915resolution/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { }; patchPhase = "rm *.o"; - installPhase = "mkdir -p $out/sbin; cp 915resolution $out/sbin/"; + installPhase = "runHook preInstall; mkdir -p $out/sbin; cp 915resolution $out/sbin/; runHook postInstall"; meta = with lib; { homepage = "http://915resolution.mango-lang.org/"; diff --git a/pkgs/os-specific/linux/acpi-call/default.nix b/pkgs/os-specific/linux/acpi-call/default.nix index f812316fd7749..41d9abf98008c 100644 --- a/pkgs/os-specific/linux/acpi-call/default.nix +++ b/pkgs/os-specific/linux/acpi-call/default.nix @@ -21,8 +21,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -D acpi_call.ko $out/lib/modules/${kernel.modDirVersion}/misc/acpi_call.ko install -D -m755 examples/turn_off_gpu.sh $out/bin/test_discrete_video_off.sh + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/akvcam/default.nix b/pkgs/os-specific/linux/akvcam/default.nix index 3fdb247a33ebb..3db50b792adc2 100644 --- a/pkgs/os-specific/linux/akvcam/default.nix +++ b/pkgs/os-specific/linux/akvcam/default.nix @@ -18,7 +18,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -m644 -b -D akvcam.ko $out/lib/modules/${kernel.modDirVersion}/akvcam.ko + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index f70ba4c7aad18..1deca494dabe0 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -303,8 +303,12 @@ let dontBuild = true; installPhase = '' + runHook preInstall + mkdir "$out" cp -R ./kernel-patches/* "$out" + + runHook postInstall ''; inherit doCheck; diff --git a/pkgs/os-specific/linux/aseq2json/default.nix b/pkgs/os-specific/linux/aseq2json/default.nix index d828c808037a6..d428f67f5711f 100644 --- a/pkgs/os-specific/linux/aseq2json/default.nix +++ b/pkgs/os-specific/linux/aseq2json/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ alsa-lib glib json-glib ]; installPhase = '' + runHook preInstall + install -D --target-directory "$out/bin" aseq2json + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/asus-ec-sensors/default.nix b/pkgs/os-specific/linux/asus-ec-sensors/default.nix index ae5c370ed21f6..bda45ce8ccf40 100644 --- a/pkgs/os-specific/linux/asus-ec-sensors/default.nix +++ b/pkgs/os-specific/linux/asus-ec-sensors/default.nix @@ -21,7 +21,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install asus-ec-sensors.ko -Dm444 -t ${placeholder "out"}/lib/modules/${kernel.modDirVersion}/kernel/drivers/hwmon + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/autofs/default.nix b/pkgs/os-specific/linux/autofs/default.nix index d308ba6594e23..03c495f633ee3 100644 --- a/pkgs/os-specific/linux/autofs/default.nix +++ b/pkgs/os-specific/linux/autofs/default.nix @@ -43,8 +43,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + make install SUBDIRS="lib daemon modules man" # all but samples #make install SUBDIRS="samples" # impure! + + runHook postInstall ''; buildInputs = [ linuxHeaders libtirpc libxml2 libkrb5 kmod openldap sssd diff --git a/pkgs/os-specific/linux/ax99100/default.nix b/pkgs/os-specific/linux/ax99100/default.nix index 0e99d9390c15f..a1755baf81b78 100644 --- a/pkgs/os-specific/linux/ax99100/default.nix +++ b/pkgs/os-specific/linux/ax99100/default.nix @@ -36,8 +36,12 @@ stdenv.mkDerivation { makeFlags = [ "KDIR='${kernel.dev}/lib/modules/${kernel.modDirVersion}/build'" ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/tty/serial cp ax99100.ko $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/tty/serial + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/bbswitch/default.nix b/pkgs/os-specific/linux/bbswitch/default.nix index a65bcab50ee25..5bb3dde03c334 100644 --- a/pkgs/os-specific/linux/bbswitch/default.nix +++ b/pkgs/os-specific/linux/bbswitch/default.nix @@ -37,6 +37,8 @@ stdenv.mkDerivation { makeFlags = kernel.makeFlags; installPhase = '' + runHook preInstall + mkdir -p $out/lib/modules/${kernel.modDirVersion}/misc cp bbswitch.ko $out/lib/modules/${kernel.modDirVersion}/misc @@ -52,6 +54,8 @@ stdenv.mkDerivation { echo -n ON > /proc/acpi/bbswitch EOF chmod +x $out/bin/discrete_vga_poweroff $out/bin/discrete_vga_poweron + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/beefi/default.nix b/pkgs/os-specific/linux/beefi/default.nix index 57ab2d7c8574c..75960f1a33765 100644 --- a/pkgs/os-specific/linux/beefi/default.nix +++ b/pkgs/os-specific/linux/beefi/default.nix @@ -30,8 +30,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 beefi $out/bin/beefi installManPage beefi.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/bpftools/default.nix b/pkgs/os-specific/linux/bpftools/default.nix index eda3fe62fa804..825d75cd48c13 100644 --- a/pkgs/os-specific/linux/bpftools/default.nix +++ b/pkgs/os-specific/linux/bpftools/default.nix @@ -37,9 +37,13 @@ stdenv.mkDerivation rec { buildFlags = [ "bpftool" "bpf_asm" "bpf_dbg" ]; installPhase = '' + runHook preInstall + make -C bpftool install install -Dm755 -t $out/bin bpf_asm install -Dm755 -t $out/bin bpf_dbg + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/broadcom-sta/default.nix b/pkgs/os-specific/linux/broadcom-sta/default.nix index e4bff61698348..7cfbefa96f404 100644 --- a/pkgs/os-specific/linux/broadcom-sta/default.nix +++ b/pkgs/os-specific/linux/broadcom-sta/default.nix @@ -60,11 +60,15 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + binDir="$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/" docDir="$out/share/doc/broadcom-sta/" mkdir -p "$binDir" "$docDir" cp wl.ko "$binDir" cp lib/LICENSE.txt "$docDir" + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/checksec/default.nix b/pkgs/os-specific/linux/checksec/default.nix index 488bfdff1a6ad..07133878e089d 100644 --- a/pkgs/os-specific/linux/checksec/default.nix +++ b/pkgs/os-specific/linux/checksec/default.nix @@ -73,6 +73,8 @@ stdenv.mkDerivation rec { ]; in '' + runHook preInstall + mkdir -p $out/bin install checksec $out/bin substituteInPlace $out/bin/checksec \ @@ -81,6 +83,8 @@ stdenv.mkDerivation rec { --replace "/lib/libc.so.6" "${glibc}/lib/libc.so.6" wrapProgram $out/bin/checksec \ --prefix PATH : ${path} + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/os-specific/linux/cpuid/default.nix b/pkgs/os-specific/linux/cpuid/default.nix index d74d25398f645..7378840f8afe1 100644 --- a/pkgs/os-specific/linux/cpuid/default.nix +++ b/pkgs/os-specific/linux/cpuid/default.nix @@ -28,12 +28,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + make install BUILDROOT=$out if [ ! -x $out/bin/cpuid ]; then echo Failed to properly patch Makefile. exit 1 fi + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/cramfsprogs/default.nix b/pkgs/os-specific/linux/cramfsprogs/default.nix index bde2686624d3c..7636602bcac88 100644 --- a/pkgs/os-specific/linux/cramfsprogs/default.nix +++ b/pkgs/os-specific/linux/cramfsprogs/default.nix @@ -21,7 +21,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install --target $out/bin -D cramfsck mkcramfs + + runHook postInstall ''; buildInputs = [ zlib ]; diff --git a/pkgs/os-specific/linux/cramfsswap/default.nix b/pkgs/os-specific/linux/cramfsswap/default.nix index c696df6f00849..e777dfdc8cbb9 100644 --- a/pkgs/os-specific/linux/cramfsswap/default.nix +++ b/pkgs/os-specific/linux/cramfsswap/default.nix @@ -19,7 +19,11 @@ stdenv.mkDerivation rec { buildInputs = [zlib]; installPhase = '' + runHook preInstall + install --target $out/bin -D cramfsswap + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/dpdk-kmods/default.nix b/pkgs/os-specific/linux/dpdk-kmods/default.nix index 4205da7e7e80c..a3f636c94aa8f 100644 --- a/pkgs/os-specific/linux/dpdk-kmods/default.nix +++ b/pkgs/os-specific/linux/dpdk-kmods/default.nix @@ -21,7 +21,11 @@ stdenv.mkDerivation rec { preBuild = "cd linux/igb_uio"; installPhase = '' + runHook preInstall + make -C ${KSRC} M=$(pwd) modules_install $makeFlags + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/os-specific/linux/e1000e/default.nix b/pkgs/os-specific/linux/e1000e/default.nix index 1ed7f6aa0193a..128ecd7cf7073 100644 --- a/pkgs/os-specific/linux/e1000e/default.nix +++ b/pkgs/os-specific/linux/e1000e/default.nix @@ -22,7 +22,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -v -D -m 644 e1000e.ko "$out/lib/modules/$kernel_version/kernel/drivers/net/e1000e/e1000e.ko" + + runHook postInstall ''; dontStrip = true; diff --git a/pkgs/os-specific/linux/exfat/default.nix b/pkgs/os-specific/linux/exfat/default.nix index c252238f7bd69..bc4af4a8fc30a 100644 --- a/pkgs/os-specific/linux/exfat/default.nix +++ b/pkgs/os-specific/linux/exfat/default.nix @@ -23,7 +23,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -m644 -b -D exfat.ko $out/lib/modules/${kernel.modDirVersion}/kernel/fs/exfat/exfat.ko + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix b/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix index a5683a1ce5352..9f97f938b94f8 100644 --- a/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix +++ b/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix @@ -14,8 +14,12 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ b43FirmwareCutter ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/firmware b43-fwcutter -w $out/lib/firmware linux/wl_apsta.o + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix b/pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix index e117db45b1829..0ec09361865ea 100644 --- a/pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix +++ b/pkgs/os-specific/linux/firmware/b43-firmware/6.30.163.46.nix @@ -14,8 +14,12 @@ stdenvNoCC.mkDerivation rec { sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/lib/firmware b43-fwcutter -w $out/lib/firmware *.wl_apsta.o + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix b/pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix index 073d443bee414..6de30cf712e09 100644 --- a/pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix +++ b/pkgs/os-specific/linux/firmware/broadcom-bt-firmware/default.nix @@ -17,6 +17,8 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib/firmware/brcm bt-fw-converter -f bcbtums.inf -o $out/lib/firmware/brcm for filename in $out/lib/firmware/brcm/*.hcd @@ -27,6 +29,8 @@ stdenvNoCC.mkDerivation rec { ln -s --relative -T $filename $out/lib/firmware/brcm/$linkname fi done + + runHook postInstall ''; outputHashMode = "recursive"; diff --git a/pkgs/os-specific/linux/firmware/bt-fw-converter/default.nix b/pkgs/os-specific/linux/firmware/bt-fw-converter/default.nix index 655b8f7ddedd9..bfa51e2bf50cd 100644 --- a/pkgs/os-specific/linux/firmware/bt-fw-converter/default.nix +++ b/pkgs/os-specific/linux/firmware/bt-fw-converter/default.nix @@ -20,9 +20,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D -m755 bt-fw-converter.pl $out/bin/bt-fw-converter substituteInPlace $out/bin/bt-fw-converter --replace /usr/bin/hex2hcd ${bluez}/bin/hex2hcd wrapProgram $out/bin/bt-fw-converter --set PERL5LIB $PERL5LIB + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/firmware/raspberrypi/default.nix b/pkgs/os-specific/linux/firmware/raspberrypi/default.nix index ece39dade72b0..bc93822f308fa 100644 --- a/pkgs/os-specific/linux/firmware/raspberrypi/default.nix +++ b/pkgs/os-specific/linux/firmware/raspberrypi/default.nix @@ -13,8 +13,12 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/raspberrypi/ mv boot "$out/share/raspberrypi/" + + runHook postInstall ''; dontConfigure = true; diff --git a/pkgs/os-specific/linux/firmware/rt5677/default.nix b/pkgs/os-specific/linux/firmware/rt5677/default.nix index 47e0068cc3483..7e4014bb4c79c 100644 --- a/pkgs/os-specific/linux/firmware/rt5677/default.nix +++ b/pkgs/os-specific/linux/firmware/rt5677/default.nix @@ -11,8 +11,12 @@ stdenvNoCC.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/lib/firmware cp ./firmware/rt5677_elf_vad $out/lib/firmware + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix b/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix index 49a3b9c13ac4f..9c8c0e6a4e878 100644 --- a/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix +++ b/pkgs/os-specific/linux/firmware/rtl8192su-firmware/default.nix @@ -13,6 +13,8 @@ stdenvNoCC.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + for i in rtl8192sfw.bin \ rtl8192sufw-ap.bin \ rtl8192sufw-apple.bin \ @@ -24,6 +26,8 @@ stdenvNoCC.mkDerivation { do install -D -pm644 firmwares/$i $out/lib/firmware/rtlwifi/$i done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/firmware/rtl8761b-firmware/default.nix b/pkgs/os-specific/linux/firmware/rtl8761b-firmware/default.nix index c3fbe79537c46..767b9e9deaa8e 100644 --- a/pkgs/os-specific/linux/firmware/rtl8761b-firmware/default.nix +++ b/pkgs/os-specific/linux/firmware/rtl8761b-firmware/default.nix @@ -11,6 +11,8 @@ stdenvNoCC.mkDerivation { }; installPhase = '' + runHook preInstall + install -D -pm644 \ bt/rtkbt/Firmware/BT/rtl8761b_fw \ $out/lib/firmware/rtl_bt/rtl8761b_fw.bin @@ -18,6 +20,8 @@ stdenvNoCC.mkDerivation { install -D -pm644 \ bt/rtkbt/Firmware/BT/rtl8761b_config \ $out/lib/firmware/rtl_bt/rtl8761b_config.bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/firmware/xow_dongle-firmware/default.nix b/pkgs/os-specific/linux/firmware/xow_dongle-firmware/default.nix index 4445851894340..5d95ace0523c1 100644 --- a/pkgs/os-specific/linux/firmware/xow_dongle-firmware/default.nix +++ b/pkgs/os-specific/linux/firmware/xow_dongle-firmware/default.nix @@ -21,7 +21,11 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm644 FW_ACC_00U.bin ${placeholder "out"}/lib/firmware/xow_dongle.bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix b/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix index a1e3a8be430e5..f7dd48055f064 100644 --- a/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix +++ b/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix @@ -25,7 +25,11 @@ in stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -D {,$out/${kerneldir}/extra/}gcadapter_oc.ko + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/gfxtablet/default.nix b/pkgs/os-specific/linux/gfxtablet/default.nix index 3ee35844f9995..c24bf7790ddaa 100644 --- a/pkgs/os-specific/linux/gfxtablet/default.nix +++ b/pkgs/os-specific/linux/gfxtablet/default.nix @@ -18,10 +18,14 @@ stdenv.mkDerivation rec { preBuild = "cd driver-uinput"; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp networktablet "$out/bin" mkdir -p "$out/share/doc/gfxtablet/" cp ../*.md "$out/share/doc/gfxtablet/" + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/google-authenticator/default.nix b/pkgs/os-specific/linux/google-authenticator/default.nix index 11791a664c8bb..fab3750dba649 100644 --- a/pkgs/os-specific/linux/google-authenticator/default.nix +++ b/pkgs/os-specific/linux/google-authenticator/default.nix @@ -19,9 +19,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib/security cp ./.libs/pam_google_authenticator.so $out/lib/security cp google-authenticator $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/gpu-switch/default.nix b/pkgs/os-specific/linux/gpu-switch/default.nix index d6f749aa8f1e3..86b7ead1b2639 100644 --- a/pkgs/os-specific/linux/gpu-switch/default.nix +++ b/pkgs/os-specific/linux/gpu-switch/default.nix @@ -10,8 +10,12 @@ stdenv.mkDerivation { sha256 = "1jnh43nijkqd83h7piq7225ixziggyzaalabgissyxdyz6szcn0r"; }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp gpu-switch $out/bin/ + + runHook postInstall ''; meta = with lib; { description = "Application that allows to switch between the graphic cards of dual-GPU MacBook Pro models"; diff --git a/pkgs/os-specific/linux/hibernate/default.nix b/pkgs/os-specific/linux/hibernate/default.nix index dfd3407f2a03d..896f230cd3b22 100644 --- a/pkgs/os-specific/linux/hibernate/default.nix +++ b/pkgs/os-specific/linux/hibernate/default.nix @@ -15,6 +15,8 @@ in buildInputs = [ gawk ]; installPhase = '' + runHook preInstall + # FIXME: Storing config files under `$out/etc' is not very useful. substituteInPlace "hibernate.sh" --replace \ @@ -29,6 +31,8 @@ in PREFIX="$out" CONFIG_PREFIX="$out" ./install.sh ln -s "$out/share/hibernate/scriptlets.d" "$out/etc/hibernate" + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/hid-t150/default.nix b/pkgs/os-specific/linux/hid-t150/default.nix index 7cb40d01aaffe..dc1bf51d4c06e 100644 --- a/pkgs/os-specific/linux/hid-t150/default.nix +++ b/pkgs/os-specific/linux/hid-t150/default.nix @@ -27,7 +27,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + make -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build M=$(pwd) modules_install $makeFlags + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/ifenslave/default.nix b/pkgs/os-specific/linux/ifenslave/default.nix index 8aeeff77ecbb7..0d2b7af3acb50 100644 --- a/pkgs/os-specific/linux/ifenslave/default.nix +++ b/pkgs/os-specific/linux/ifenslave/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a ifenslave $out/bin + + runHook postInstall ''; hardeningDisable = [ "format" ]; diff --git a/pkgs/os-specific/linux/iptstate/default.nix b/pkgs/os-specific/linux/iptstate/default.nix index d1e193f831ca9..896b139987fcc 100644 --- a/pkgs/os-specific/linux/iptstate/default.nix +++ b/pkgs/os-specific/linux/iptstate/default.nix @@ -22,7 +22,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -m755 -D iptstate $out/bin/iptstate + + runHook postInstall ''; } diff --git a/pkgs/os-specific/linux/joycond/default.nix b/pkgs/os-specific/linux/joycond/default.nix index 0620f1dee7224..16ff49b9400be 100644 --- a/pkgs/os-specific/linux/joycond/default.nix +++ b/pkgs/os-specific/linux/joycond/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { # CMake has hardcoded install paths installPhase = '' + runHook preInstall + mkdir -p $out/{bin,etc/{systemd/system,udev/rules.d},lib/modules-load.d} cp ./joycond $out/bin @@ -28,6 +30,8 @@ stdenv.mkDerivation rec { substituteInPlace $out/etc/udev/rules.d/89-joycond.rules --replace \ "/bin/setfacl" "${acl}/bin/setfacl" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 74e603623412e..ab8d0b91e3b74 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -187,7 +187,7 @@ let perl -w $generateConfig ''; - installPhase = "mv $buildRoot/.config $out"; + installPhase = "runHook preInstall; mv $buildRoot/.config $out; runHook postInstall"; enableParallelBuilding = true; diff --git a/pkgs/os-specific/linux/kernel/htmldocs.nix b/pkgs/os-specific/linux/kernel/htmldocs.nix index b811cf12bb01d..4a0c9a3e15a90 100644 --- a/pkgs/os-specific/linux/kernel/htmldocs.nix +++ b/pkgs/os-specific/linux/kernel/htmldocs.nix @@ -42,9 +42,13 @@ stdenv.mkDerivation { makeFlags = [ "htmldocs" ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/doc mv Documentation/output $out/share/doc/linux-doc cp -r Documentation/* $out/share/doc/linux-doc/ + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/kernel/linux-libre.nix b/pkgs/os-specific/linux/kernel/linux-libre.nix index 46b412c302261..37d0ce1a546b4 100644 --- a/pkgs/os-specific/linux/kernel/linux-libre.nix +++ b/pkgs/os-specific/linux/kernel/linux-libre.nix @@ -37,7 +37,11 @@ in linux.override { ${scripts}/deblob-check ''; installPhase = '' + runHook preInstall + cp -r . "$out" + + runHook postInstall ''; }; diff --git a/pkgs/os-specific/linux/kernel/perf/default.nix b/pkgs/os-specific/linux/kernel/perf/default.nix index 17f1fc2da464a..ac06ec4cbedc2 100644 --- a/pkgs/os-specific/linux/kernel/perf/default.nix +++ b/pkgs/os-specific/linux/kernel/perf/default.nix @@ -50,7 +50,11 @@ let }; installPhase = '' + runHook preInstall + install -D -m 0755 -t $out/share/d3-flame-graph/ ./dist/templates/* + + runHook postInstall ''; }; in diff --git a/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix b/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix index 464b77ce969ea..1af509729fa2c 100644 --- a/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix +++ b/pkgs/os-specific/linux/kmod-blacklist-ubuntu/default.nix @@ -13,6 +13,8 @@ in stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir "$out" for f in modprobe.d/*.conf; do echo "''\n''\n## file: "`basename "$f"`"''\n''\n" >> "$out"/modprobe.conf @@ -27,6 +29,8 @@ in stdenv.mkDerivation { --replace /sbin/modprobe /run/booted-system/sw/bin/modprobe \ --replace " grep " " /run/booted-system/sw/bin/grep " \ --replace " xargs " " /run/booted-system/sw/bin/xargs " + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/kmod-debian-aliases/default.nix b/pkgs/os-specific/linux/kmod-debian-aliases/default.nix index a4474f7c08fa9..eace9a96d7ba6 100644 --- a/pkgs/os-specific/linux/kmod-debian-aliases/default.nix +++ b/pkgs/os-specific/linux/kmod-debian-aliases/default.nix @@ -10,7 +10,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + cp extra/aliases.conf $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/kvmfr/default.nix b/pkgs/os-specific/linux/kvmfr/default.nix index 3224fc137db1b..a5ed5898bb981 100644 --- a/pkgs/os-specific/linux/kvmfr/default.nix +++ b/pkgs/os-specific/linux/kvmfr/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + install -D kvmfr.ko -t "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/misc/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/ldm/default.nix b/pkgs/os-specific/linux/ldm/default.nix index 5214f270bfb26..ee13715057900 100644 --- a/pkgs/os-specific/linux/ldm/default.nix +++ b/pkgs/os-specific/linux/ldm/default.nix @@ -28,8 +28,12 @@ stdenv.mkDerivation rec { buildFlags = [ "ldm" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -v ldm $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/ledger-udev-rules/default.nix b/pkgs/os-specific/linux/ledger-udev-rules/default.nix index 8201f12480c39..5e5416e45ebda 100644 --- a/pkgs/os-specific/linux/ledger-udev-rules/default.nix +++ b/pkgs/os-specific/linux/ledger-udev-rules/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation { dontConfigure = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib/udev/rules.d cp 20-hw1.rules $out/lib/udev/rules.d/20-ledger.rules + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/libudev0-shim/default.nix b/pkgs/os-specific/linux/libudev0-shim/default.nix index 642dd534232ba..7860e7c4def5b 100644 --- a/pkgs/os-specific/linux/libudev0-shim/default.nix +++ b/pkgs/os-specific/linux/libudev0-shim/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { buildInputs = [ udev ]; installPhase = '' + runHook preInstall + name="$(echo libudev.so.*)" install -Dm755 "$name" "$out/lib/$name" ln -s "$name" "$out/lib/libudev.so.0" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/lightum/default.nix b/pkgs/os-specific/linux/lightum/default.nix index f1f95d5563b01..1fa4607815c93 100644 --- a/pkgs/os-specific/linux/lightum/default.nix +++ b/pkgs/os-specific/linux/lightum/default.nix @@ -28,8 +28,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + make install prefix=$out bindir=$out/bin docdir=$out/share/doc \ mandir=$out/share/man INSTALL="install -c" INSTALLDATA="install -c -m 644" + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/liquidtux/default.nix b/pkgs/os-specific/linux/liquidtux/default.nix index ca4fb27c8f199..ad527da4ccd50 100644 --- a/pkgs/os-specific/linux/liquidtux/default.nix +++ b/pkgs/os-specific/linux/liquidtux/default.nix @@ -20,7 +20,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install nzxt-grid3.ko nzxt-kraken2.ko nzxt-kraken3.ko nzxt-smart2.ko -Dm444 -t ${placeholder "out"}/lib/modules/${kernel.modDirVersion}/kernel/drivers/hwmon + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/lockdep/default.nix b/pkgs/os-specific/linux/lockdep/default.nix index 971ba71d8a759..61a6ce65a7e12 100644 --- a/pkgs/os-specific/linux/lockdep/default.nix +++ b/pkgs/os-specific/linux/lockdep/default.nix @@ -49,12 +49,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib $out/include cp -R include/liblockdep $out/include make install DESTDIR=$out prefix="" substituteInPlace $out/bin/lockdep --replace "./liblockdep.so" "$out/lib/liblockdep.so.$fullver" + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/mbp-modules/mbp2018-bridge-drv/default.nix b/pkgs/os-specific/linux/mbp-modules/mbp2018-bridge-drv/default.nix index 2670c72544491..1b8c4d7d05477 100644 --- a/pkgs/os-specific/linux/mbp-modules/mbp2018-bridge-drv/default.nix +++ b/pkgs/os-specific/linux/mbp-modules/mbp2018-bridge-drv/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + make -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build \ INSTALL_MOD_PATH=$out M=$(pwd) modules_install $makeFlags + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/mbpfan/default.nix b/pkgs/os-specific/linux/mbpfan/default.nix index 0178e3e751a10..2c63d1e4e072e 100644 --- a/pkgs/os-specific/linux/mbpfan/default.nix +++ b/pkgs/os-specific/linux/mbpfan/default.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-F9IWUcILOuLn5K4zRSU5jn+1Wk1xy0CONSI6JTXU2pA="; }; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/etc cp bin/mbpfan $out/bin cp mbpfan.conf $out/etc + + runHook postInstall ''; meta = with lib; { description = "Daemon that uses input from coretemp module and sets the fan speed using the applesmc module"; diff --git a/pkgs/os-specific/linux/microcode/amd.nix b/pkgs/os-specific/linux/microcode/amd.nix index 3c82cdec29fb7..0b968cc075cf0 100644 --- a/pkgs/os-specific/linux/microcode/amd.nix +++ b/pkgs/os-specific/linux/microcode/amd.nix @@ -17,9 +17,13 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out touch -d @$SOURCE_DATE_EPOCH kernel/x86/microcode/AuthenticAMD.bin echo kernel/x86/microcode/AuthenticAMD.bin | bsdtar --uid 0 --gid 0 -cnf - -T - | bsdtar --null -cf - --format=newc @- > $out/amd-ucode.img + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/molly-guard/default.nix b/pkgs/os-specific/linux/molly-guard/default.nix index 1100751f451e0..2c7af6b379e10 100644 --- a/pkgs/os-specific/linux/molly-guard/default.nix +++ b/pkgs/os-specific/linux/molly-guard/default.nix @@ -16,10 +16,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + sed -i "s|/lib/molly-guard|${systemd}/sbin|g" lib/molly-guard/molly-guard sed -i "s|run-parts|${busybox}/bin/run-parts|g" lib/molly-guard/molly-guard sed -i "s|/etc/molly-guard/|$out/etc/molly-guard/|g" lib/molly-guard/molly-guard cp -r ./ $out/ + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/os-specific/linux/mxu11x0/default.nix b/pkgs/os-specific/linux/mxu11x0/default.nix index 17d0c69382069..26a3aceb1f760 100644 --- a/pkgs/os-specific/linux/mxu11x0/default.nix +++ b/pkgs/os-specific/linux/mxu11x0/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -v -D -m 644 ./driver/mxu11x0.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/usb/serial/mxu11x0.ko" install -v -D -m 644 ./driver/mxu11x0.ko "$out/lib/modules/${kernel.modDirVersion}/misc/mxu11x0.ko" + + runHook postInstall ''; dontStrip = true; diff --git a/pkgs/os-specific/linux/ndiswrapper/default.nix b/pkgs/os-specific/linux/ndiswrapper/default.nix index 39a8d919d8be6..1ec66e3325a6a 100644 --- a/pkgs/os-specific/linux/ndiswrapper/default.nix +++ b/pkgs/os-specific/linux/ndiswrapper/default.nix @@ -21,12 +21,16 @@ stdenv.mkDerivation { "; installPhase = '' + runHook preInstall + make install KBUILD=$(cat kbuild_path) DESTDIR=$out mv $out/usr/sbin/* $out/sbin/ mv $out/usr/share $out/ rm -r $out/usr patchShebangs $out/sbin + + runHook postInstall ''; src = fetchurl { diff --git a/pkgs/os-specific/linux/nmon/default.nix b/pkgs/os-specific/linux/nmon/default.nix index 3de22bfae6d76..3008d1eaed773 100644 --- a/pkgs/os-specific/linux/nmon/default.nix +++ b/pkgs/os-specific/linux/nmon/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { else "UNKNOWN" }"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp nmon $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/numworks-udev-rules/default.nix b/pkgs/os-specific/linux/numworks-udev-rules/default.nix index dbea6e4df79d9..359c7a63cf7a9 100644 --- a/pkgs/os-specific/linux/numworks-udev-rules/default.nix +++ b/pkgs/os-specific/linux/numworks-udev-rules/default.nix @@ -8,7 +8,11 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + install -Dm 644 "${udevRules}" "$out/lib/udev/rules.d/50-numworks-calculator.rules" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/nvidia-x11/fabricmanager.nix b/pkgs/os-specific/linux/nvidia-x11/fabricmanager.nix index e70857ea356ed..e356bbb24a910 100644 --- a/pkgs/os-specific/linux/nvidia-x11/fabricmanager.nix +++ b/pkgs/os-specific/linux/nvidia-x11/fabricmanager.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/nvidia-fabricmanager} for bin in nv{-fabricmanager,switch-audit};do ${patchelf}/bin/patchelf \ @@ -33,6 +35,8 @@ stdenv.mkDerivation rec { for d in include lib;do mv $d $out/. done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/nvidia-x11/settings.nix b/pkgs/os-specific/linux/nvidia-x11/settings.nix index df05a859b4c9c..ad711c2b3071a 100644 --- a/pkgs/os-specific/linux/nvidia-x11/settings.nix +++ b/pkgs/os-specific/linux/nvidia-x11/settings.nix @@ -61,6 +61,8 @@ let ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib mkdir -p $out/include/NVCtrl @@ -68,6 +70,8 @@ let cp NVCtrl.h $out/include/NVCtrl cp NVCtrlLib.h $out/include/NVCtrl cp -P libXNVCtrl.so* $out/lib + + runHook postInstall ''; meta = meta // { diff --git a/pkgs/os-specific/linux/oci-seccomp-bpf-hook/default.nix b/pkgs/os-specific/linux/oci-seccomp-bpf-hook/default.nix index 4f499197fbfde..5d9991d637a32 100644 --- a/pkgs/os-specific/linux/oci-seccomp-bpf-hook/default.nix +++ b/pkgs/os-specific/linux/oci-seccomp-bpf-hook/default.nix @@ -43,9 +43,13 @@ buildGoModule rec { ''; installPhase = '' + runHook preInstall + install -Dm755 bin/* -t $out/bin install -Dm644 oci-seccomp-bpf-hook.json -t $out installManPage docs/*.[1-9] + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/otpw/default.nix b/pkgs/os-specific/linux/otpw/default.nix index 337e422eebdd1..6a5c60ec0acb5 100644 --- a/pkgs/os-specific/linux/otpw/default.nix +++ b/pkgs/os-specific/linux/otpw/default.nix @@ -34,11 +34,15 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib/security $out/share/man/man{1,8} cp pam_*.so $out/lib/security cp otpw-gen $out/bin cp *.1 $out/share/man/man1 cp *.8 $out/share/man/man8 + + runHook postInstall ''; hardeningDisable = [ diff --git a/pkgs/os-specific/linux/pcimem/default.nix b/pkgs/os-specific/linux/pcimem/default.nix index 2f41e4c7395e6..3faffc6942755 100644 --- a/pkgs/os-specific/linux/pcimem/default.nix +++ b/pkgs/os-specific/linux/pcimem/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { makeFlags = [ "CFLAGS=-Wno-maybe-uninitialized" ]; installPhase = '' + runHook preInstall + install -D pcimem "$out/bin/pcimem" install -D README "$doc/doc/README" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/perf-tools/default.nix b/pkgs/os-specific/linux/perf-tools/default.nix index 8c3e31e453849..c8478fd4e0ac6 100644 --- a/pkgs/os-specific/linux/perf-tools/default.nix +++ b/pkgs/os-specific/linux/perf-tools/default.nix @@ -28,11 +28,15 @@ stdenv.mkDerivation { installPhase = '' + runHook preInstall + d=$out/libexec/perf-tools mkdir -p $d $out/share cp -prvd . $d/ ln -s $d/bin $out/bin mv $d/man $out/share/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/phc-intel/default.nix b/pkgs/os-specific/linux/phc-intel/default.nix index a2e2456ad6e09..94968a02aa9f9 100644 --- a/pkgs/os-specific/linux/phc-intel/default.nix +++ b/pkgs/os-specific/linux/phc-intel/default.nix @@ -32,8 +32,12 @@ in stdenv.mkDerivation rec { enableParallelBuilding = false; installPhase = '' + runHook preInstall + install -m 755 -d $out/lib/modules/${kernel.modDirVersion}/extra/ install -m 644 *.ko $out/lib/modules/${kernel.modDirVersion}/extra/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/pipework/default.nix b/pkgs/os-specific/linux/pipework/default.nix index fa3698b362061..7ddfdc93772bc 100644 --- a/pkgs/os-specific/linux/pipework/default.nix +++ b/pkgs/os-specific/linux/pipework/default.nix @@ -13,9 +13,13 @@ stdenv.mkDerivation { }; nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -D pipework $out/bin/pipework wrapProgram $out/bin/pipework --prefix PATH : \ ${lib.makeBinPath [ bridge-utils iproute2 lxc openvswitch docker busybox dhcpcd ]}; + + runHook postInstall ''; meta = with lib; { description = "Software-Defined Networking tools for LXC"; diff --git a/pkgs/os-specific/linux/pommed-light/default.nix b/pkgs/os-specific/linux/pommed-light/default.nix index 11a5cebc76bfb..de65fe8da4d3b 100644 --- a/pkgs/os-specific/linux/pommed-light/default.nix +++ b/pkgs/os-specific/linux/pommed-light/default.nix @@ -49,6 +49,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -Dm755 pommed/pommed $out/bin/pommed install -Dm644 pommed.conf.mactel $out/etc/pommed.conf.mactel install -Dm644 pommed.conf.pmac $out/etc/pommed.conf.pmac @@ -59,6 +61,8 @@ stdenv.mkDerivation rec { # Sounds install -Dm644 pommed/data/goutte.wav $out/share/pommed/goutte.wav install -Dm644 pommed/data/click.wav $out/share/pommed/click.wav + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/pps-tools/default.nix b/pkgs/os-specific/linux/pps-tools/default.nix index 66754e5148ec6..e5cc0a6289763 100644 --- a/pkgs/os-specific/linux/pps-tools/default.nix +++ b/pkgs/os-specific/linux/pps-tools/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $dev/include mkdir -p $out/{usr/bin,usr/include/sys} @@ -21,6 +23,8 @@ stdenv.mkDerivation rec { mv $out/usr/bin/* $out/bin mv $out/usr/include/* $dev/include/ rm -rf $out/usr/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/r8168/default.nix b/pkgs/os-specific/linux/r8168/default.nix index 9806ddebb8d31..314449a2cddb7 100644 --- a/pkgs/os-specific/linux/r8168/default.nix +++ b/pkgs/os-specific/linux/r8168/default.nix @@ -39,9 +39,13 @@ in stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + mkdir -p ${modDestDir} find . -name '*.ko' -exec cp --parents '{}' ${modDestDir} \; find ${modDestDir} -name '*.ko' -exec xz -f '{}' \; + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/regionset/default.nix b/pkgs/os-specific/linux/regionset/default.nix index 07154a1fc9a1b..64ae450fc8f3a 100644 --- a/pkgs/os-specific/linux/regionset/default.nix +++ b/pkgs/os-specific/linux/regionset/default.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + install -Dm755 {.,$out/bin}/regionset install -Dm644 {.,$out/share/man/man8}/regionset.8 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/rfkill/udev.nix b/pkgs/os-specific/linux/rfkill/udev.nix index 53cbf68330c64..7853eedb8a8f4 100644 --- a/pkgs/os-specific/linux/rfkill/udev.nix +++ b/pkgs/os-specific/linux/rfkill/udev.nix @@ -38,6 +38,8 @@ in stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p "$out/etc/udev/rules.d/"; cat > "$out/etc/udev/rules.d/90-rfkill.rules" << EOF SUBSYSTEM=="rfkill", ATTR{type}=="wlan", RUN+="$out/bin/rfkill-hook.sh" @@ -45,6 +47,8 @@ in stdenv.mkDerivation { mkdir -p "$out/bin/"; cp ${rfkillHook} "$out/bin/rfkill-hook.sh" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/ryzenadj/default.nix b/pkgs/os-specific/linux/ryzenadj/default.nix index 1d61f22b33e51..0a80793b19d28 100644 --- a/pkgs/os-specific/linux/ryzenadj/default.nix +++ b/pkgs/os-specific/linux/ryzenadj/default.nix @@ -13,8 +13,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pciutils cmake ]; installPhase = '' + runHook preInstall + install -D libryzenadj.so $out/lib/libryzenadj.so install -D ryzenadj $out/bin/ryzenadj + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/seturgent/default.nix b/pkgs/os-specific/linux/seturgent/default.nix index b8c02f47d0eeb..82990fd81b53c 100644 --- a/pkgs/os-specific/linux/seturgent/default.nix +++ b/pkgs/os-specific/linux/seturgent/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -pv $out/bin mv seturgent $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/shufflecake/default.nix b/pkgs/os-specific/linux/shufflecake/default.nix index 01c634cc4bfd3..e8d1ed48549c1 100644 --- a/pkgs/os-specific/linux/shufflecake/default.nix +++ b/pkgs/os-specific/linux/shufflecake/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "bin" ]; installPhase = '' + runHook preInstall + install -Dm444 dm-sflc.ko $out/lib/modules/${kernel.modDirVersion}/drivers/md/dm-sflc.ko install -Dm555 shufflecake $bin/shufflecake + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/smem/default.nix b/pkgs/os-specific/linux/smem/default.nix index bfeb5902a4232..56af11792be0b 100644 --- a/pkgs/os-specific/linux/smem/default.nix +++ b/pkgs/os-specific/linux/smem/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + install -Dm555 -t $out/bin/ smem smemcap install -Dm444 -t $out/share/man/man8/ smem.8 + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/syscall_limiter/default.nix b/pkgs/os-specific/linux/syscall_limiter/default.nix index 329ec522c422e..5d591d7eb11ee 100644 --- a/pkgs/os-specific/linux/syscall_limiter/default.nix +++ b/pkgs/os-specific/linux/syscall_limiter/default.nix @@ -19,12 +19,16 @@ stdenv.mkDerivation { buildInputs = [ libseccomp ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -v limit_syscalls $out/bin cp -v monitor.sh $out/bin/limit_syscalls_monitor.sh substituteInPlace $out/bin/limit_syscalls_monitor.sh \ --replace perl ${perl}/bin/perl \ --replace which ${which}/bin/which + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/system76-acpi/default.nix b/pkgs/os-specific/linux/system76-acpi/default.nix index b384cf6394872..0f89e7d01f766 100644 --- a/pkgs/os-specific/linux/system76-acpi/default.nix +++ b/pkgs/os-specific/linux/system76-acpi/default.nix @@ -24,9 +24,13 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + install -D system76_acpi.ko $out/lib/modules/${kernel.modDirVersion}/misc/system76_acpi.ko mkdir -p $out/lib/udev/hwdb.d mv lib/udev/hwdb.d/* $out/lib/udev/hwdb.d + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/system76-io/default.nix b/pkgs/os-specific/linux/system76-io/default.nix index 54af222bc7d88..8088958a527b3 100644 --- a/pkgs/os-specific/linux/system76-io/default.nix +++ b/pkgs/os-specific/linux/system76-io/default.nix @@ -24,7 +24,11 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + install -D system76-io.ko $out/lib/modules/${kernel.modDirVersion}/misc/system76-io.ko + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/system76/default.nix b/pkgs/os-specific/linux/system76/default.nix index 7d9cd9bde0241..7ac65b902b3be 100644 --- a/pkgs/os-specific/linux/system76/default.nix +++ b/pkgs/os-specific/linux/system76/default.nix @@ -24,9 +24,13 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + install -D system76.ko $out/lib/modules/${kernel.modDirVersion}/misc/system76.ko mkdir -p $out/lib/udev/hwdb.d mv lib/udev/hwdb.d/* $out/lib/udev/hwdb.d + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/tcp-wrappers/default.nix b/pkgs/os-specific/linux/tcp-wrappers/default.nix index 92a6b328b2ccc..983328cbfbbe2 100644 --- a/pkgs/os-specific/linux/tcp-wrappers/default.nix +++ b/pkgs/os-specific/linux/tcp-wrappers/default.nix @@ -38,6 +38,8 @@ in stdenv.mkDerivation rec { makeFlags = [ "REAL_DAEMON_DIR=$(out)/bin" "linux" "AR:=$(AR)" ]; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp -v safe_finger tcpd tcpdchk tcpdmatch try-from "$out/bin" @@ -52,6 +54,8 @@ in stdenv.mkDerivation rec { mkdir -p "$out/man/man$i" cp *.$i "$out/man/man$i" ; done + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/teensy-udev-rules/default.nix b/pkgs/os-specific/linux/teensy-udev-rules/default.nix index 326cf0a3245f7..007336f831a79 100644 --- a/pkgs/os-specific/linux/teensy-udev-rules/default.nix +++ b/pkgs/os-specific/linux/teensy-udev-rules/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation { runtimeDeps = [ coreutils ]; installPhase = '' + runHook preInstall + install -D $src $out/etc/udev/rules.d/70-teensy.rules substituteInPlace $out/etc/udev/rules.d/70-teensy.rules \ --replace "/bin/stty" "${coreutils}/bin/stty" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/tp_smapi/default.nix b/pkgs/os-specific/linux/tp_smapi/default.nix index b0f760e3b00ad..63246a3608811 100644 --- a/pkgs/os-specific/linux/tp_smapi/default.nix +++ b/pkgs/os-specific/linux/tp_smapi/default.nix @@ -43,9 +43,13 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -v -D -m 644 thinkpad_ec.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/thinkpad_ec.ko" install -v -D -m 644 tp_smapi.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/tp_smapi.ko" install -v -D -m 644 hdaps.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/hdapsd.ko" + + runHook postInstall ''; dontStrip = true; diff --git a/pkgs/os-specific/linux/tpacpi-bat/default.nix b/pkgs/os-specific/linux/tpacpi-bat/default.nix index 42d8a0f9dbcfe..9d321a4f3e663 100644 --- a/pkgs/os-specific/linux/tpacpi-bat/default.nix +++ b/pkgs/os-specific/linux/tpacpi-bat/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { buildInputs = [ perl ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp tpacpi-bat $out/bin + + runHook postInstall ''; postPatch = '' diff --git a/pkgs/os-specific/linux/trezor-udev-rules/default.nix b/pkgs/os-specific/linux/trezor-udev-rules/default.nix index c631b57127333..a06299580305d 100644 --- a/pkgs/os-specific/linux/trezor-udev-rules/default.nix +++ b/pkgs/os-specific/linux/trezor-udev-rules/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + cp ${udevRules} 51-trezor.rules mkdir -p $out/lib/udev/rules.d # we use trezord group, not plugdev @@ -21,6 +23,8 @@ stdenv.mkDerivation rec { --replace 'GROUP="plugdev"' 'GROUP="trezord"' \ --replace ', TAG+="udev-acl"' "" cp 51-trezor.rules $out/lib/udev/rules.d/51-trezor.rules + + runHook postInstall ''; passthru.tests = { inherit (nixosTests) trezord; }; diff --git a/pkgs/os-specific/linux/tunctl/default.nix b/pkgs/os-specific/linux/tunctl/default.nix index 40d1aa572487a..a624bdf8d05af 100644 --- a/pkgs/os-specific/linux/tunctl/default.nix +++ b/pkgs/os-specific/linux/tunctl/default.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation rec { makeFlags = [ "tunctl" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp tunctl $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/usb-blaster-udev-rules/default.nix b/pkgs/os-specific/linux/usb-blaster-udev-rules/default.nix index d04c8ddb93985..052e697be3f74 100644 --- a/pkgs/os-specific/linux/usb-blaster-udev-rules/default.nix +++ b/pkgs/os-specific/linux/usb-blaster-udev-rules/default.nix @@ -7,7 +7,11 @@ stdenvNoCC.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + install -Dm 644 "${udevRules}" "$out/lib/udev/rules.d/51-usbblaster.rules" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/usermount/default.nix b/pkgs/os-specific/linux/usermount/default.nix index 883e927444bee..7ce8308480a66 100644 --- a/pkgs/os-specific/linux/usermount/default.nix +++ b/pkgs/os-specific/linux/usermount/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation { env.NIX_CFLAGS_COMPILE = "-DENABLE_NOTIFICATIONS"; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv usermount $out/bin/ + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/veikk-linux-driver/default.nix b/pkgs/os-specific/linux/veikk-linux-driver/default.nix index 8cf4896ae0270..2cc7f1d4f8b46 100644 --- a/pkgs/os-specific/linux/veikk-linux-driver/default.nix +++ b/pkgs/os-specific/linux/veikk-linux-driver/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/veikk install -Dm755 veikk.ko $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/veikk + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/vendor-reset/default.nix b/pkgs/os-specific/linux/vendor-reset/default.nix index 7c0a4f1ed1f54..4f57be2f170b2 100644 --- a/pkgs/os-specific/linux/vendor-reset/default.nix +++ b/pkgs/os-specific/linux/vendor-reset/default.nix @@ -30,7 +30,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -D vendor-reset.ko -t "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/misc/" + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/os-specific/linux/waydroid/default.nix b/pkgs/os-specific/linux/waydroid/default.nix index 5e29b911ca548..d0add67806998 100644 --- a/pkgs/os-specific/linux/waydroid/default.nix +++ b/pkgs/os-specific/linux/waydroid/default.nix @@ -60,7 +60,11 @@ python3Packages.buildPythonApplication rec { dontWrapGApps = true; installPhase = '' + runHook preInstall + make install PREFIX=$out USE_SYSTEMD=0 + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/os-specific/linux/wooting-udev-rules/default.nix b/pkgs/os-specific/linux/wooting-udev-rules/default.nix index 8231e3e3ea331..df142f186f1a3 100644 --- a/pkgs/os-specific/linux/wooting-udev-rules/default.nix +++ b/pkgs/os-specific/linux/wooting-udev-rules/default.nix @@ -10,7 +10,11 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + install -Dpm644 $src $out/lib/udev/rules.d/70-wooting.rules + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/x86info/default.nix b/pkgs/os-specific/linux/x86info/default.nix index 86830c851e55d..413660253a626 100644 --- a/pkgs/os-specific/linux/x86info/default.nix +++ b/pkgs/os-specific/linux/x86info/default.nix @@ -35,9 +35,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp x86info $out/bin cp lsmsr/lsmsr $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/os-specific/linux/xp-pen-drivers/g430/default.nix b/pkgs/os-specific/linux/xp-pen-drivers/g430/default.nix index 10169ff3fe4ee..ac2cf42eee7c2 100644 --- a/pkgs/os-specific/linux/xp-pen-drivers/g430/default.nix +++ b/pkgs/os-specific/linux/xp-pen-drivers/g430/default.nix @@ -23,9 +23,13 @@ mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp Pentablet_Driver $out/bin/pentablet-driver cp config.xml $out/bin/config.xml + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/xsos/default.nix b/pkgs/os-specific/linux/xsos/default.nix index 8d2dd747ffb69..03ae2c292926d 100644 --- a/pkgs/os-specific/linux/xsos/default.nix +++ b/pkgs/os-specific/linux/xsos/default.nix @@ -36,10 +36,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper installShellFiles ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a xsos $out/bin wrapProgram "$out/bin/xsos" --prefix PATH : ${lib.makeBinPath binPath} installShellCompletion --bash --name xsos.bash xsos-bash-completion.bash + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/zenpower/default.nix b/pkgs/os-specific/linux/zenpower/default.nix index f5819f0d1d221..0480f46e27064 100644 --- a/pkgs/os-specific/linux/zenpower/default.nix +++ b/pkgs/os-specific/linux/zenpower/default.nix @@ -19,7 +19,11 @@ stdenv.mkDerivation rec { makeFlags = [ "KERNEL_BUILD=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; installPhase = '' + runHook preInstall + install -D zenpower.ko -t "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/hwmon/zenpower/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/linux/zenstates/default.nix b/pkgs/os-specific/linux/zenstates/default.nix index a320e959f0210..144f762401479 100644 --- a/pkgs/os-specific/linux/zenstates/default.nix +++ b/pkgs/os-specific/linux/zenstates/default.nix @@ -36,11 +36,15 @@ stdenv.mkDerivation rec { buildInputs = [ python3 ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp $src/zenstates.py $out/bin/zenstates chmod +x $out/bin/zenstates patchShebangs --build $out/bin/zenstates - ''; + + runHook postInstall + ''; meta = with lib; { description = "Linux utility for Ryzen processors and motherboards"; diff --git a/pkgs/os-specific/linux/zsa-udev-rules/default.nix b/pkgs/os-specific/linux/zsa-udev-rules/default.nix index 66485ab51dd82..ed63c0d8d4f5e 100644 --- a/pkgs/os-specific/linux/zsa-udev-rules/default.nix +++ b/pkgs/os-specific/linux/zsa-udev-rules/default.nix @@ -17,9 +17,13 @@ stdenv.mkDerivation rec { dontFixup = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib/udev/rules.d cp dist/linux64/50-oryx.rules $out/lib/udev/rules.d/ cp dist/linux64/50-wally.rules $out/lib/udev/rules.d/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/os-specific/windows/cygwin-setup/default.nix b/pkgs/os-specific/windows/cygwin-setup/default.nix index a88d802c5cf79..99caa3f7b213a 100644 --- a/pkgs/os-specific/windows/cygwin-setup/default.nix +++ b/pkgs/os-specific/windows/cygwin-setup/default.nix @@ -33,7 +33,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -vD setup.exe "$out/bin/setup.exe" + + runHook postInstall ''; meta = { diff --git a/pkgs/pkgs-lib/formats/java-properties/test/default.nix b/pkgs/pkgs-lib/formats/java-properties/test/default.nix index 3c03ec66bd125..f6a4a3c12b1e3 100644 --- a/pkgs/pkgs-lib/formats/java-properties/test/default.nix +++ b/pkgs/pkgs-lib/formats/java-properties/test/default.nix @@ -87,5 +87,5 @@ stdenv.mkDerivation { java Main $properties >actual diff -U3 $expectedPath actual ''; - installPhase = "touch $out"; + installPhase = "runHook preInstall; touch $out; runHook postInstall"; } diff --git a/pkgs/pkgs-lib/formats/libconfig/test/comprehensive/default.nix b/pkgs/pkgs-lib/formats/libconfig/test/comprehensive/default.nix index 7b0df23ee6639..59445bc9716a8 100644 --- a/pkgs/pkgs-lib/formats/libconfig/test/comprehensive/default.nix +++ b/pkgs/pkgs-lib/formats/libconfig/test/comprehensive/default.nix @@ -67,10 +67,14 @@ in ''; installPhase = '' + runHook preInstall + mkdir $out cp expected.txt $out cp ${libconfig-test-cfg} $out/libconfig-test.cfg cp ${libconfig-test-cfg.passthru.json} $out/libconfig-test.json + + runHook postInstall ''; } diff --git a/pkgs/servers/adguardhome/default.nix b/pkgs/servers/adguardhome/default.nix index 9739e39c4a0d1..08aa0930e788e 100644 --- a/pkgs/servers/adguardhome/default.nix +++ b/pkgs/servers/adguardhome/default.nix @@ -11,7 +11,11 @@ stdenv.mkDerivation rec { src = sources.${system} or (throw "Source for ${pname} is not available for ${system}"); installPhase = '' + runHook preInstall + install -m755 -D ./AdGuardHome $out/bin/adguardhome + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/althttpd/default.nix b/pkgs/servers/althttpd/default.nix index 70c2fbcaa3235..840074db6a9e9 100644 --- a/pkgs/servers/althttpd/default.nix +++ b/pkgs/servers/althttpd/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation rec { makeFlags = [ "CC:=$(CC)" ]; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin althttpd + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/apache-airflow/python-package.nix b/pkgs/servers/apache-airflow/python-package.nix index 14c39ede5a855..2f27772c07e47 100644 --- a/pkgs/servers/apache-airflow/python-package.nix +++ b/pkgs/servers/apache-airflow/python-package.nix @@ -130,8 +130,12 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/static/ cp -r static/dist $out/static + + runHook postInstall ''; }; diff --git a/pkgs/servers/apache-kafka/default.nix b/pkgs/servers/apache-kafka/default.nix index 815905f76edb6..b5e57695621a6 100644 --- a/pkgs/servers/apache-kafka/default.nix +++ b/pkgs/servers/apache-kafka/default.nix @@ -31,6 +31,8 @@ let buildInputs = [ jre bash gnugrep gnused coreutils ps ]; installPhase = '' + runHook preInstall + mkdir -p $out cp -R config libs $out @@ -52,6 +54,8 @@ let --prefix PATH : "${bash}/bin:${coreutils}/bin:${gnugrep}/bin:${gnused}/bin" done chmod +x $out/bin\/* + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/atlassian/bamboo.nix b/pkgs/servers/atlassian/bamboo.nix index b5e97a87da569..28ffb793b13f4 100644 --- a/pkgs/servers/atlassian/bamboo.nix +++ b/pkgs/servers/atlassian/bamboo.nix @@ -24,8 +24,12 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cp -rva . $out patchShebangs $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/atlassian/confluence.nix b/pkgs/servers/atlassian/confluence.nix index ea33a66ee0449..c9a2527a1fed1 100644 --- a/pkgs/servers/atlassian/confluence.nix +++ b/pkgs/servers/atlassian/confluence.nix @@ -37,8 +37,12 @@ lib.warnIf (crowdProperties != null) "Using `crowdProperties` is deprecated!" ''; installPhase = '' + runHook preInstall + cp -rva . $out patchShebangs $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/atlassian/crowd.nix b/pkgs/servers/atlassian/crowd.nix index 44c44a0d2681b..356328ff8bf42 100644 --- a/pkgs/servers/atlassian/crowd.nix +++ b/pkgs/servers/atlassian/crowd.nix @@ -38,7 +38,11 @@ lib.warnIf (openidPassword != "WILL_NEVER_BE_SET") "Using `crowdProperties` is d ''; installPhase = '' + runHook preInstall + cp -rva . $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/atlassian/jira.nix b/pkgs/servers/atlassian/jira.nix index ea0f6579845b3..d4c4d43722586 100644 --- a/pkgs/servers/atlassian/jira.nix +++ b/pkgs/servers/atlassian/jira.nix @@ -32,7 +32,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + cp -rva . $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/brickd/default.nix b/pkgs/servers/brickd/default.nix index be087b0525bcc..2ccf86ac0d83e 100644 --- a/pkgs/servers/brickd/default.nix +++ b/pkgs/servers/brickd/default.nix @@ -48,9 +48,13 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + cd ../brickd mkdir -p $out/bin cp brickd $out/bin/brickd + + runHook postInstall ''; meta = { diff --git a/pkgs/servers/computing/slurm-spank-stunnel/default.nix b/pkgs/servers/computing/slurm-spank-stunnel/default.nix index 3534c8981a269..420b6689c4e59 100644 --- a/pkgs/servers/computing/slurm-spank-stunnel/default.nix +++ b/pkgs/servers/computing/slurm-spank-stunnel/default.nix @@ -18,9 +18,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib $out/etc/slurm/plugstack.conf.d install -m 755 stunnel.so $out/lib install -m 644 plugstack.conf $out/etc/slurm/plugstack.conf.d/stunnel.conf.example + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/computing/slurm-spank-x11/default.nix b/pkgs/servers/computing/slurm-spank-x11/default.nix index 278e1320fa0a1..824846318032f 100644 --- a/pkgs/servers/computing/slurm-spank-x11/default.nix +++ b/pkgs/servers/computing/slurm-spank-x11/default.nix @@ -20,9 +20,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib install -m 755 slurm-spank-x11 $out/bin install -m 755 x11.so $out/lib + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/computing/storm/default.nix b/pkgs/servers/computing/storm/default.nix index c5f790a5be05d..973f3a2486fde 100644 --- a/pkgs/servers/computing/storm/default.nix +++ b/pkgs/servers/computing/storm/default.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ zip unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/${finalAttrs.name} mv public $out/docs mv examples $out/share/${finalAttrs.name}/. @@ -26,6 +28,8 @@ stdenv.mkDerivation (finalAttrs: { mv external extlib* lib $out/. mv conf bin $out/. mv log4j2 $out/conf/. + + runHook postInstall ''; fixupPhase = '' diff --git a/pkgs/servers/dict/dictd-db-collector.nix b/pkgs/servers/dict/dictd-db-collector.nix index 793cbf66a46d3..00b931ee33130 100644 --- a/pkgs/servers/dict/dictd-db-collector.nix +++ b/pkgs/servers/dict/dictd-db-collector.nix @@ -28,6 +28,8 @@ let } "; installPhase = '' + runHook preInstall + mkdir -p $out/share/dictd cd $out/share/dictd echo "${databases}" >databases.names @@ -70,7 +72,9 @@ let echo " index_suffix $out/share/dictd/$base.suffix" >> dictd.conf echo "}" >> dictd.conf done - ''; + + runHook postInstall + ''; in diff --git a/pkgs/servers/dict/dictd-db.nix b/pkgs/servers/dict/dictd-db.nix index 2e2191c5aaa3e..50101e130df9a 100644 --- a/pkgs/servers/dict/dictd-db.nix +++ b/pkgs/servers/dict/dictd-db.nix @@ -17,9 +17,13 @@ let tar xf ${src} ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/dictd cp $(ls ./${_subdir}/*.{dict*,index} || true) $out/share/dictd echo "${_locale}" >$out/share/dictd/locale + + runHook postInstall ''; meta = { diff --git a/pkgs/servers/dict/wiktionary/default.nix b/pkgs/servers/dict/wiktionary/default.nix index 8ec15db4f3193..cd6ac23aee48b 100644 --- a/pkgs/servers/dict/wiktionary/default.nix +++ b/pkgs/servers/dict/wiktionary/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/dictd/ cd $out/share/dictd @@ -21,6 +23,8 @@ stdenv.mkDerivation rec { faketime -f "$source_date" ${python3.interpreter} -O ${./wiktionary2dict.py} "${src}" faketime -f "$source_date" dictzip wiktionary-en.dict echo en_US.UTF-8 > locale + + runHook postInstall ''; passthru.updateScript = ./update.sh; diff --git a/pkgs/servers/dns/ncdns/default.nix b/pkgs/servers/dns/ncdns/default.nix index 1f896ec21a5c0..a96180c4c4156 100644 --- a/pkgs/servers/dns/ncdns/default.nix +++ b/pkgs/servers/dns/ncdns/default.nix @@ -49,7 +49,11 @@ let ''; installPhase = '' + runHook preInstall + cp -r . "$out" + + runHook postInstall ''; }; diff --git a/pkgs/servers/domoticz/default.nix b/pkgs/servers/domoticz/default.nix index 61fcc87624410..187d19e274fd0 100644 --- a/pkgs/servers/domoticz/default.nix +++ b/pkgs/servers/domoticz/default.nix @@ -62,6 +62,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/domoticz cp -r $src/www $out/share/domoticz/ cp -r $src/Config $out/share/domoticz @@ -71,6 +73,8 @@ stdenv.mkDerivation rec { mkdir -p $out/bin cp domoticz $out/bin wrapProgram $out/bin/domoticz --set LD_LIBRARY_PATH ${python3}/lib; + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/elasticmq-server-bin/default.nix b/pkgs/servers/elasticmq-server-bin/default.nix index debb1d8a57bcb..c2552a7bab09a 100644 --- a/pkgs/servers/elasticmq-server-bin/default.nix +++ b/pkgs/servers/elasticmq-server-bin/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ makeBinaryWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/elasticmq-server cp $src $out/share/elasticmq-server/elasticmq-server.jar @@ -22,6 +24,8 @@ stdenv.mkDerivation (finalAttrs: { # TODO: how to add extraArgs? current workaround is to use JAVA_TOOL_OPTIONS environment to specify properties makeWrapper ${jre}/bin/java $out/bin/elasticmq-server \ --add-flags "-jar $out/share/elasticmq-server/elasticmq-server.jar" + + runHook postInstall ''; passthru.tests.elasticmqTest = import ./elasticmq-test.nix { diff --git a/pkgs/servers/etcd/3.4.nix b/pkgs/servers/etcd/3.4.nix index 597cad35021b8..a9b7b30175299 100644 --- a/pkgs/servers/etcd/3.4.nix +++ b/pkgs/servers/etcd/3.4.nix @@ -22,7 +22,11 @@ buildGoModule rec { doCheck = false; installPhase = '' + runHook preInstall + install -Dm755 bin/* bin/functional/cmd/* -t $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/fastnetmon-advanced/default.nix b/pkgs/servers/fastnetmon-advanced/default.nix index ab655bca526cc..ba99328e33cd8 100644 --- a/pkgs/servers/fastnetmon-advanced/default.nix +++ b/pkgs/servers/fastnetmon-advanced/default.nix @@ -42,6 +42,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/libexec/fastnetmon cp -r opt/fastnetmon/app/bin $out/bin cp -r opt/fastnetmon/libraries $out/libexec/fastnetmon @@ -53,6 +55,8 @@ stdenv.mkDerivation rec { ln -s $(readlink usr/bin/gobgp | sed "s:/opt/fastnetmon:$out/libexec/fastnetmon:") $out/bin/fnm-gobgp addAutoPatchelfSearchPath $out/libexec/fastnetmon/libraries + + runHook postInstall ''; doInstallCheck = true; diff --git a/pkgs/servers/fiche/default.nix b/pkgs/servers/fiche/default.nix index 375733d272ccb..38d0c573f1312 100644 --- a/pkgs/servers/fiche/default.nix +++ b/pkgs/servers/fiche/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -Dm755 fiche -t $out/bin + + runHook postInstall ''; doCheck = true; diff --git a/pkgs/servers/fileshare/default.nix b/pkgs/servers/fileshare/default.nix index e7c0bc6ad2602..01850c41fbc4d 100644 --- a/pkgs/servers/fileshare/default.nix +++ b/pkgs/servers/fileshare/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { makeFlags = [ "BUILD=release" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bin/release/fileshare $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/frr/clippy-helper.nix b/pkgs/servers/frr/clippy-helper.nix index c2b4b918ceca5..f11957c46cbca 100644 --- a/pkgs/servers/frr/clippy-helper.nix +++ b/pkgs/servers/frr/clippy-helper.nix @@ -39,8 +39,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp lib/clippy $out/bin + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/servers/gobetween/default.nix b/pkgs/servers/gobetween/default.nix index db201e5ba48a9..eb677d9366e1a 100644 --- a/pkgs/servers/gobetween/default.nix +++ b/pkgs/servers/gobetween/default.nix @@ -24,10 +24,14 @@ buildGoModule rec { vendorHash = null; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bin/gobetween $out/bin cp -r share $out/share cp -r config $out/share + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/hashi-ui/default.nix b/pkgs/servers/hashi-ui/default.nix index db4f6fc00091d..5966b2952a892 100644 --- a/pkgs/servers/hashi-ui/default.nix +++ b/pkgs/servers/hashi-ui/default.nix @@ -13,7 +13,11 @@ stdenv.mkDerivation rec { sourceRoot = "."; installPhase = '' + runHook preInstall + install -m755 -D $src $out/bin/hashi-ui + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/hbase/default.nix b/pkgs/servers/hbase/default.nix index 401ebef8bd2bf..24128866849e4 100644 --- a/pkgs/servers/hbase/default.nix +++ b/pkgs/servers/hbase/default.nix @@ -19,11 +19,15 @@ let common = { version, hash, jdk ? jdk11_headless, tests }: nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out cp -R * $out wrapProgram $out/bin/hbase --set-default JAVA_HOME ${jdk.home} \ --run "test -d /etc/hadoop-conf && export HBASE_CONF_DIR=\''${HBASE_CONF_DIR-'/etc/hadoop-conf/'}" \ --set-default HBASE_CONF_DIR "$out/conf/" + + runHook postInstall ''; passthru = { inherit tests; }; diff --git a/pkgs/servers/hockeypuck/web.nix b/pkgs/servers/hockeypuck/web.nix index 32f2b1acd22e1..473b69bc9d669 100644 --- a/pkgs/servers/hockeypuck/web.nix +++ b/pkgs/servers/hockeypuck/web.nix @@ -11,10 +11,14 @@ stdenv.mkDerivation { dontBuild = true; # We should just copy the web templates installPhase = '' + runHook preInstall + mkdir -p $out/share/ cp -vr contrib/webroot $out/share/ cp -vr contrib/templates $out/share/ + + runHook postInstall ''; passthru.tests = nixosTests.hockeypuck; diff --git a/pkgs/servers/http/apache-modules/mod_auth_mellon/default.nix b/pkgs/servers/http/apache-modules/mod_auth_mellon/default.nix index 4b6c5681470fa..6d0ac2ac30576 100644 --- a/pkgs/servers/http/apache-modules/mod_auth_mellon/default.nix +++ b/pkgs/servers/http/apache-modules/mod_auth_mellon/default.nix @@ -18,10 +18,14 @@ stdenv.mkDerivation rec { configureFlags = ["--with-apxs2=${apacheHttpd.dev}/bin/apxs" "--exec-prefix=$out"]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ./mellon_create_metadata.sh $out/bin mkdir -p $out/modules cp ./.libs/mod_auth_mellon.so $out/modules + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/http/apache-modules/mod_jk/default.nix b/pkgs/servers/http/apache-modules/mod_jk/default.nix index 22a50ea8feb67..72fee99e7da4e 100644 --- a/pkgs/servers/http/apache-modules/mod_jk/default.nix +++ b/pkgs/servers/http/apache-modules/mod_jk/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/modules cp apache-2.0/mod_jk.so $out/modules + + runHook postInstall ''; buildInputs = [ apacheHttpd jdk ]; diff --git a/pkgs/servers/http/apache-modules/mod_perl/default.nix b/pkgs/servers/http/apache-modules/mod_perl/default.nix index 09089855d1cde..18a263c014e35 100644 --- a/pkgs/servers/http/apache-modules/mod_perl/default.nix +++ b/pkgs/servers/http/apache-modules/mod_perl/default.nix @@ -29,12 +29,16 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out make install DESTDIR=$out mv $out${apacheHttpd}/* $out mv $out${apacheHttpd.dev}/* $out mv $out${perl}/* $out rm $out/nix -rf + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/http/envoy/default.nix b/pkgs/servers/http/envoy/default.nix index 5fbd3cdaf0d0b..d3fe44274dc70 100644 --- a/pkgs/servers/http/envoy/default.nix +++ b/pkgs/servers/http/envoy/default.nix @@ -141,7 +141,11 @@ buildBazelPackage { $bazelOut/external/*_pip3/BUILD.bazel ''; installPhase = '' + runHook preInstall + install -Dm0755 bazel-bin/source/exe/envoy-static $out/bin/envoy + + runHook postInstall ''; }; diff --git a/pkgs/servers/http/jboss/default.nix b/pkgs/servers/http/jboss/default.nix index 4ad126afa501f..3019a11b82aec 100644 --- a/pkgs/servers/http/jboss/default.nix +++ b/pkgs/servers/http/jboss/default.nix @@ -9,8 +9,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mv $PWD $out find $out/bin -name \*.sh -print0 | xargs -0 sed -i -e '/#!\/bin\/sh/aJAVA_HOME=${jdk}' + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/http/jetty/common.nix b/pkgs/servers/http/jetty/common.nix index 9b9e064e993f4..555933e6fdef2 100644 --- a/pkgs/servers/http/jetty/common.nix +++ b/pkgs/servers/http/jetty/common.nix @@ -15,8 +15,12 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out mv etc lib modules start.jar $out + + runHook postInstall ''; passthru.updateScript = gitUpdater { diff --git a/pkgs/servers/http/nix-binary-cache/default.nix b/pkgs/servers/http/nix-binary-cache/default.nix index 393415ae61e25..de3d07f738eb1 100644 --- a/pkgs/servers/http/nix-binary-cache/default.nix +++ b/pkgs/servers/http/nix-binary-cache/default.nix @@ -8,6 +8,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" substitute "${./nix-binary-cache.cgi.in}" "$out"/bin/nix-binary-cache.cgi \ --replace @out@ "$out/bin" \ @@ -42,6 +44,8 @@ stdenv.mkDerivation rec { --replace "xXxXx" "xXxXx" chmod a+x "$out/bin/nix-binary-cache-start" + + runHook postInstall ''; meta = { diff --git a/pkgs/servers/http/tomcat/default.nix b/pkgs/servers/http/tomcat/default.nix index c05e62f50c3a3..4114500462616 100644 --- a/pkgs/servers/http/tomcat/default.nix +++ b/pkgs/servers/http/tomcat/default.nix @@ -25,10 +25,14 @@ let "webapps" ]; installPhase = '' + runHook preInstall + mkdir $out mv * $out mkdir -p $webapps/webapps mv $out/webapps $webapps/ + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/icingaweb2/default.nix b/pkgs/servers/icingaweb2/default.nix index 8a16f3afe3450..d532c5cf59176 100644 --- a/pkgs/servers/icingaweb2/default.nix +++ b/pkgs/servers/icingaweb2/default.nix @@ -14,11 +14,15 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/share cp -ra application bin etc library modules public $out cp -ra doc $out/share wrapProgram $out/bin/icingacli --prefix PATH : "${lib.makeBinPath [ php ]}" + + runHook postInstall ''; passthru.tests = { inherit (nixosTests) icingaweb2; }; diff --git a/pkgs/servers/icingaweb2/ipl.nix b/pkgs/servers/icingaweb2/ipl.nix index 254729a31762c..d42a0823b63b7 100644 --- a/pkgs/servers/icingaweb2/ipl.nix +++ b/pkgs/servers/icingaweb2/ipl.nix @@ -12,8 +12,12 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -r * "$out" + + runHook postInstall ''; passthru.tests = { inherit (nixosTests) icingaweb2; }; diff --git a/pkgs/servers/icingaweb2/theme-april/default.nix b/pkgs/servers/icingaweb2/theme-april/default.nix index 05f9b9c971b72..92709932a8564 100644 --- a/pkgs/servers/icingaweb2/theme-april/default.nix +++ b/pkgs/servers/icingaweb2/theme-april/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -r * "$out" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/icingaweb2/theme-lsd/default.nix b/pkgs/servers/icingaweb2/theme-lsd/default.nix index e2c60ef798695..f02a946c6a03f 100644 --- a/pkgs/servers/icingaweb2/theme-lsd/default.nix +++ b/pkgs/servers/icingaweb2/theme-lsd/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -r * "$out" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/icingaweb2/theme-particles/default.nix b/pkgs/servers/icingaweb2/theme-particles/default.nix index 7e8adb72c6d93..25db902fc6151 100644 --- a/pkgs/servers/icingaweb2/theme-particles/default.nix +++ b/pkgs/servers/icingaweb2/theme-particles/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -r * "$out" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/icingaweb2/theme-snow/default.nix b/pkgs/servers/icingaweb2/theme-snow/default.nix index 9b571b948b523..9c05292510c40 100644 --- a/pkgs/servers/icingaweb2/theme-snow/default.nix +++ b/pkgs/servers/icingaweb2/theme-snow/default.nix @@ -21,8 +21,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -r * "$out" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/icingaweb2/theme-spring/default.nix b/pkgs/servers/icingaweb2/theme-spring/default.nix index 8392124eb072a..73f281cb20f4e 100644 --- a/pkgs/servers/icingaweb2/theme-spring/default.nix +++ b/pkgs/servers/icingaweb2/theme-spring/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -r * "$out" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/icingaweb2/theme-unicorn/default.nix b/pkgs/servers/icingaweb2/theme-unicorn/default.nix index 39c4e7b927438..b19bc396346d0 100644 --- a/pkgs/servers/icingaweb2/theme-unicorn/default.nix +++ b/pkgs/servers/icingaweb2/theme-unicorn/default.nix @@ -35,10 +35,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -r * "$out" chmod 755 $out/public/img cp unicorn.png "$out/public/img/unicorn.png" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/icingaweb2/thirdparty.nix b/pkgs/servers/icingaweb2/thirdparty.nix index 6a2a8bebd4947..7949d7961a36f 100644 --- a/pkgs/servers/icingaweb2/thirdparty.nix +++ b/pkgs/servers/icingaweb2/thirdparty.nix @@ -12,8 +12,12 @@ stdenvNoCC.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -r * "$out" + + runHook postInstall ''; passthru.tests = { inherit (nixosTests) icingaweb2; }; diff --git a/pkgs/servers/identd/nullidentdmod/default.nix b/pkgs/servers/identd/nullidentdmod/default.nix index 7df6eac5fb0d6..27b44c874b307 100644 --- a/pkgs/servers/identd/nullidentdmod/default.nix +++ b/pkgs/servers/identd/nullidentdmod/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -Dm755 nullidentdmod $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/jitsi-excalidraw/default.nix b/pkgs/servers/jitsi-excalidraw/default.nix index 26b91355a7393..396a2e0db1a24 100644 --- a/pkgs/servers/jitsi-excalidraw/default.nix +++ b/pkgs/servers/jitsi-excalidraw/default.nix @@ -23,8 +23,12 @@ buildNpmPackage rec { nativeBuildInputs = [ python3 ]; installPhase = '' + runHook preInstall + mkdir -p $out/share cp -r {node_modules,dist} $out/share + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/servers/keycloak/scim-for-keycloak/default.nix b/pkgs/servers/keycloak/scim-for-keycloak/default.nix index 88c20e05123e1..266d36212c2fb 100644 --- a/pkgs/servers/keycloak/scim-for-keycloak/default.nix +++ b/pkgs/servers/keycloak/scim-for-keycloak/default.nix @@ -17,7 +17,11 @@ maven.buildMavenPackage rec { mvnHash = "sha256-cOuJSU57OuP+U7lI+pDD7g9HPIfZAoDPYLf+eO+XuF4="; installPhase = '' + runHook preInstall + install -D "scim-for-keycloak-server/target/scim-for-keycloak-${version}.jar" "$out/scim-for-keycloak-${version}.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/keycloak/scim-keycloak-user-storage-spi/default.nix b/pkgs/servers/keycloak/scim-keycloak-user-storage-spi/default.nix index 8da97cca54956..502e16a157d84 100644 --- a/pkgs/servers/keycloak/scim-keycloak-user-storage-spi/default.nix +++ b/pkgs/servers/keycloak/scim-keycloak-user-storage-spi/default.nix @@ -17,7 +17,11 @@ maven.buildMavenPackage { mvnHash = "sha256-xbGlVZl3YtbF372kCDh+UdK5pLe6C6WnGgbEXahlyLw="; installPhase = '' + runHook preInstall + install -D "target/scim-user-spi-0.0.1-SNAPSHOT.jar" "$out/scim-user-spi-0.0.1-SNAPSHOT.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/klipper/klipper-firmware.nix b/pkgs/servers/klipper/klipper-firmware.nix index 53a57279a3649..da91cc80eb9ca 100644 --- a/pkgs/servers/klipper/klipper-firmware.nix +++ b/pkgs/servers/klipper/klipper-firmware.nix @@ -44,11 +44,15 @@ ]; installPhase = '' + runHook preInstall + mkdir -p $out cp ./.config $out/config cp out/klipper.bin $out/ || true cp out/klipper.elf $out/ || true cp out/klipper.uf2 $out/ || true + + runHook postInstall ''; dontFixup = true; diff --git a/pkgs/servers/ldap/apache-directory-server/default.nix b/pkgs/servers/ldap/apache-directory-server/default.nix index 4b7fb4086fba6..4450e33cd8c42 100644 --- a/pkgs/servers/ldap/apache-directory-server/default.nix +++ b/pkgs/servers/ldap/apache-directory-server/default.nix @@ -12,11 +12,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/apacheds install -D $src/lib/*.jar $out/share/apacheds classpath=$(jars=($out/share/apacheds/*.jar); IFS=:; echo "''${jars[*]}") makeWrapper ${jdk11}/bin/java $out/bin/apache-directory-server \ --add-flags "-classpath $classpath org.apache.directory.server.UberjarMain" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/ldap/lldap/default.nix b/pkgs/servers/ldap/lldap/default.nix index 24a55436d93d2..70a715434ad7d 100644 --- a/pkgs/servers/ldap/lldap/default.nix +++ b/pkgs/servers/ldap/lldap/default.nix @@ -53,8 +53,12 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -R app/{index.html,pkg,static} $out/ + + runHook postInstall ''; doCheck = false; diff --git a/pkgs/servers/mail/mailpit/default.nix b/pkgs/servers/mail/mailpit/default.nix index fd8f01674d80b..8fd3ca60a92a5 100644 --- a/pkgs/servers/mail/mailpit/default.nix +++ b/pkgs/servers/mail/mailpit/default.nix @@ -57,7 +57,11 @@ let ''; installPhase = '' + runHook preInstall + mv server/ui/dist $out + + runHook postInstall ''; }; diff --git a/pkgs/servers/mail/postfix/pflogsumm.nix b/pkgs/servers/mail/postfix/pflogsumm.nix index d70cde6b9da26..0ef50a3ae7235 100644 --- a/pkgs/servers/mail/postfix/pflogsumm.nix +++ b/pkgs/servers/mail/postfix/pflogsumm.nix @@ -18,11 +18,15 @@ perlPackages.buildPerlPackage rec { doCheck = false; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" mv "pflogsumm.pl" "$out/bin/pflogsumm" mkdir -p "$out/share/man/man1" mv "pflogsumm.1" "$out/share/man/man1" + + runHook postInstall ''; meta = { diff --git a/pkgs/servers/memos/default.nix b/pkgs/servers/memos/default.nix index c389245dc7426..26ebecb2ce271 100644 --- a/pkgs/servers/memos/default.nix +++ b/pkgs/servers/memos/default.nix @@ -22,7 +22,11 @@ let ''; installPhase = '' + runHook preInstall + cp -r dist $out + + runHook postInstall ''; }; in diff --git a/pkgs/servers/meteor/default.nix b/pkgs/servers/meteor/default.nix index 2036d31e5b20f..0407ab37ee1fe 100644 --- a/pkgs/servers/meteor/default.nix +++ b/pkgs/servers/meteor/default.nix @@ -27,6 +27,8 @@ stdenv.mkDerivation { sourceRoot = ".meteor"; installPhase = '' + runHook preInstall + mkdir $out cp -r packages $out @@ -56,6 +58,8 @@ stdenv.mkDerivation { $out/dev_bundle/bin/node --no-wasm-code-gc \''${TOOL_NODE_FLAGS} $out/tools/index.js "\$@" EOF chmod +x $out/bin/meteor + + runHook postInstall ''; postFixup = lib.optionalString stdenv.isLinux '' diff --git a/pkgs/servers/misc/oven-media-engine/default.nix b/pkgs/servers/misc/oven-media-engine/default.nix index 5b7442cfdeb65..159f98cb4a27c 100644 --- a/pkgs/servers/misc/oven-media-engine/default.nix +++ b/pkgs/servers/misc/oven-media-engine/default.nix @@ -43,11 +43,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm0755 bin/RELEASE/OvenMediaEngine $out/bin/OvenMediaEngine install -Dm0644 ../misc/conf_examples/Origin.xml $out/share/examples/origin_conf/Server.xml install -Dm0644 ../misc/conf_examples/Logger.xml $out/share/examples/origin_conf/Logger.xml install -Dm0644 ../misc/conf_examples/Edge.xml $out/share/examples/edge_conf/Server.xml install -Dm0644 ../misc/conf_examples/Logger.xml $out/share/examples/edge_conf/Logger.xml + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/monitoring/fusion-inventory/default.nix b/pkgs/servers/monitoring/fusion-inventory/default.nix index b4535c80877de..5715460862203 100644 --- a/pkgs/servers/monitoring/fusion-inventory/default.nix +++ b/pkgs/servers/monitoring/fusion-inventory/default.nix @@ -59,6 +59,8 @@ perlPackages.buildPerlPackage rec { doCheck = false; installPhase = '' + runHook preInstall + mkdir -p $out cp -r bin $out @@ -71,6 +73,8 @@ perlPackages.buildPerlPackage rec { wrapProgram "$cur" --prefix PATH : ${lib.makeBinPath [nix dmidecode pciutils usbutils nettools iproute2]} fi done + + runHook postInstall ''; outputs = [ "out" ]; diff --git a/pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix b/pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix index 2351df623a561..b80678594eb25 100644 --- a/pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix +++ b/pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix @@ -26,9 +26,13 @@ let plat = stdenvNoCC.hostPlatform.system; in stdenvNoCC.mkDerivation ({ nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + cp -R "." "$out" chmod -R a-w "$out" chmod u+w "$out" + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/monitoring/karma/default.nix b/pkgs/servers/monitoring/karma/default.nix index 95f66e1dd7b34..ee7d8a1718ca1 100644 --- a/pkgs/servers/monitoring/karma/default.nix +++ b/pkgs/servers/monitoring/karma/default.nix @@ -53,7 +53,11 @@ buildGoModule rec { ''; installPhase = '' + runHook preInstall + install -Dm 755 ./karma $out/bin/karma + + runHook postInstall ''; passthru.tests.karma = nixosTests.karma; diff --git a/pkgs/servers/monitoring/longview/default.nix b/pkgs/servers/monitoring/longview/default.nix index cfd9ddab9a2c9..ad37d53d011ed 100644 --- a/pkgs/servers/monitoring/longview/default.nix +++ b/pkgs/servers/monitoring/longview/default.nix @@ -45,6 +45,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/usr mv Linode $out ln -s ../Linode/Longview.pl $out/bin/longview @@ -56,6 +58,8 @@ stdenv.mkDerivation rec { wrapProgram $out/Linode/Longview.pl --prefix PATH : ${perl}/bin:$out/bin \ --suffix PERL5LIB : $out/Linode --suffix PERL5LIB : $PERL5LIB \ --suffix PERL5LIB : $out --suffix INC : $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/monitoring/newrelic-sysmond/default.nix b/pkgs/servers/monitoring/newrelic-sysmond/default.nix index 35a6a5e828e5c..0c239eb52309e 100644 --- a/pkgs/servers/monitoring/newrelic-sysmond/default.nix +++ b/pkgs/servers/monitoring/newrelic-sysmond/default.nix @@ -10,10 +10,14 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -v -m755 daemon/nrsysmond.x64 $out/bin/nrsysmond patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ $out/bin/nrsysmond + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/monitoring/prometheus/bitcoin-exporter.nix b/pkgs/servers/monitoring/prometheus/bitcoin-exporter.nix index dace095e13d25..b31436f7d447f 100644 --- a/pkgs/servers/monitoring/prometheus/bitcoin-exporter.nix +++ b/pkgs/servers/monitoring/prometheus/bitcoin-exporter.nix @@ -20,11 +20,15 @@ python3Packages.buildPythonApplication rec { propagatedBuildInputs = with python3Packages; [ prometheus-client bitcoinlib riprova ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bitcoind-monitor.py $out/bin/ mkdir -p $out/share/${pname} cp -r dashboard README.md $out/share/${pname}/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/monitoring/prometheus/jmx-httpserver.nix b/pkgs/servers/monitoring/prometheus/jmx-httpserver.nix index 9326e5bdff3fe..7a3d2b781a321 100644 --- a/pkgs/servers/monitoring/prometheus/jmx-httpserver.nix +++ b/pkgs/servers/monitoring/prometheus/jmx-httpserver.nix @@ -17,10 +17,14 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/libexec mkdir -p $out/bin cp $src $out/libexec/$jarName makeWrapper "${jre}/bin/java" $out/bin/jmx_prometheus_httpserver --add-flags "-jar $out/libexec/$jarName" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/monitoring/prometheus/kthxbye.nix b/pkgs/servers/monitoring/prometheus/kthxbye.nix index a0eb30f6819b6..001d414b9d352 100644 --- a/pkgs/servers/monitoring/prometheus/kthxbye.nix +++ b/pkgs/servers/monitoring/prometheus/kthxbye.nix @@ -23,7 +23,11 @@ buildGoModule rec { ''; installPhase = '' + runHook preInstall + install -Dm755 ./kthxbye -t $out/bin + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/servers/monitoring/prometheus/tor-exporter.nix b/pkgs/servers/monitoring/prometheus/tor-exporter.nix index c12e92c5ee564..235df5285016a 100644 --- a/pkgs/servers/monitoring/prometheus/tor-exporter.nix +++ b/pkgs/servers/monitoring/prometheus/tor-exporter.nix @@ -17,8 +17,12 @@ python3Packages.buildPythonApplication rec { propagatedBuildInputs = with python3Packages; [ prometheus-client stem retrying ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/ cp prometheus-tor-exporter.py $out/share/ + + runHook postInstall ''; fixupPhase = '' diff --git a/pkgs/servers/monitoring/riemann/default.nix b/pkgs/servers/monitoring/riemann/default.nix index 0b678a0a0fd70..cf8571afa7b37 100644 --- a/pkgs/servers/monitoring/riemann/default.nix +++ b/pkgs/servers/monitoring/riemann/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + substituteInPlace bin/riemann --replace '$top/lib/riemann.jar' "$out/share/java/riemann.jar" mkdir -p $out/share/java $out/bin $out/etc @@ -20,6 +22,8 @@ stdenv.mkDerivation rec { mv etc/riemann.config $out/etc/ wrapProgram "$out/bin/riemann" --prefix PATH : "${jre}/bin" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/monitoring/seyren/default.nix b/pkgs/servers/monitoring/seyren/default.nix index 25f83587af7c8..9560c13d464c0 100644 --- a/pkgs/servers/monitoring/seyren/default.nix +++ b/pkgs/servers/monitoring/seyren/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { buildInputs = [ jre ]; installPhase = '' + runHook preInstall + mkdir -p "$out"/bin makeWrapper "${jre}/bin/java" "$out"/bin/seyren --add-flags "-jar $src" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/monitoring/zabbix/agent2.nix b/pkgs/servers/monitoring/zabbix/agent2.nix index befc1954473e4..014bf7d9e4faf 100644 --- a/pkgs/servers/monitoring/zabbix/agent2.nix +++ b/pkgs/servers/monitoring/zabbix/agent2.nix @@ -47,6 +47,8 @@ import ./versions.nix ({ version, hash, vendorHash ? throw "unsupported version ''; installPhase = '' + runHook preInstall + mkdir -p $out/sbin install -Dm0644 src/go/conf/zabbix_agent2.conf $out/etc/zabbix_agent2.conf @@ -54,6 +56,8 @@ import ./versions.nix ({ version, hash, vendorHash ? throw "unsupported version # create a symlink which is compatible with the zabbixAgent module ln -s $out/bin/zabbix_agent2 $out/sbin/zabbix_agentd + + runHook postInstall ''; meta = { diff --git a/pkgs/servers/monitoring/zabbix/web.nix b/pkgs/servers/monitoring/zabbix/web.nix index 8a4226fb9d32f..c601efe24568d 100644 --- a/pkgs/servers/monitoring/zabbix/web.nix +++ b/pkgs/servers/monitoring/zabbix/web.nix @@ -17,9 +17,13 @@ import ./versions.nix ({ version, hash, ... }: ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/zabbix/ cp -a ${if lib.versionAtLeast version "5.0.0" then "ui/." else "frontends/php/."} $out/share/zabbix/ cp ${phpConfig} $out/share/zabbix/conf/zabbix.conf.php + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/moonraker/default.nix b/pkgs/servers/moonraker/default.nix index a6b3f3eb21e7f..2bde1f1a35853 100644 --- a/pkgs/servers/moonraker/default.nix +++ b/pkgs/servers/moonraker/default.nix @@ -36,11 +36,15 @@ in stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out $out/bin $out/lib cp -r moonraker $out/lib makeWrapper ${pythonEnv}/bin/python $out/bin/moonraker \ --add-flags "$out/lib/moonraker/moonraker.py" + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/mtprotoproxy/default.nix b/pkgs/servers/mtprotoproxy/default.nix index 44ecc6481ecd8..7e0cc63ab1165 100644 --- a/pkgs/servers/mtprotoproxy/default.nix +++ b/pkgs/servers/mtprotoproxy/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { pythonPath = [ pyaes pycrypto uvloop ]; installPhase = '' + runHook preInstall + install -Dm755 mtprotoproxy.py $out/bin/mtprotoproxy wrapPythonPrograms + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/mx-puppet-discord/node-packages.nix b/pkgs/servers/mx-puppet-discord/node-packages.nix index 9cf1324ae6fa9..eafc122a4c318 100644 --- a/pkgs/servers/mx-puppet-discord/node-packages.nix +++ b/pkgs/servers/mx-puppet-discord/node-packages.nix @@ -3757,7 +3757,7 @@ in "!package-lock.json" ] args.src; dontBuild = true; - installPhase = "mkdir -p $out; cp -r ./* $out;"; + installPhase = "runHook preInstall; mkdir -p $out; cp -r ./* $out;; runHook postInstall"; }; }); } diff --git a/pkgs/servers/nosql/aerospike/default.nix b/pkgs/servers/nosql/aerospike/default.nix index 4e0f7b3c6b857..4ab9eda76785e 100644 --- a/pkgs/servers/nosql/aerospike/default.nix +++ b/pkgs/servers/nosql/aerospike/default.nix @@ -23,8 +23,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp target/Linux-x86_64/bin/asd $out/bin/asd + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/nosql/apache-jena/binary.nix b/pkgs/servers/nosql/apache-jena/binary.nix index 362337ae293d3..a745d332a433c 100644 --- a/pkgs/servers/nosql/apache-jena/binary.nix +++ b/pkgs/servers/nosql/apache-jena/binary.nix @@ -11,10 +11,14 @@ stdenv.mkDerivation rec { makeWrapper ]; installPhase = '' + runHook preInstall + cp -r . "$out" for i in "$out"/bin/*; do wrapProgram "$i" --prefix "PATH" : "${java}/bin/" done + + runHook postInstall ''; meta = with lib; { description = "RDF database"; diff --git a/pkgs/servers/nosql/apache-jena/fuseki-binary.nix b/pkgs/servers/nosql/apache-jena/fuseki-binary.nix index 65a5b720d4686..216629846e2a5 100644 --- a/pkgs/servers/nosql/apache-jena/fuseki-binary.nix +++ b/pkgs/servers/nosql/apache-jena/fuseki-binary.nix @@ -20,6 +20,8 @@ stdenv.mkDerivation rec { makeWrapper ]; installPhase = '' + runHook preInstall + cp -r . "$out" chmod +x $out/fuseki ln -s "$out"/{fuseki-backup,fuseki-server,fuseki} "$out/bin" @@ -32,6 +34,8 @@ stdenv.mkDerivation rec { --run "if [ -z \"\$FUSEKI_BASE\" ]; then export FUSEKI_BASE=\"\$HOME/.local/fuseki\" ; mkdir -p \"\$HOME/.local/fuseki\" ; fi" \ ; done + + runHook postInstall ''; passthru = { tests = { diff --git a/pkgs/servers/nosql/influxdb2/provision.nix b/pkgs/servers/nosql/influxdb2/provision.nix index 0d0740969cd46..c9124dfe3975c 100644 --- a/pkgs/servers/nosql/influxdb2/provision.nix +++ b/pkgs/servers/nosql/influxdb2/provision.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { buildInputs = [ python3Packages.python python3Packages.influxdb-client ]; installPhase = '' + runHook preInstall + install -Dm0555 influxdb2-provision.py $out/bin/influxdb2-provision wrapProgram $out/bin/influxdb2-provision --prefix PYTHONPATH : "$PYTHONPATH" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/nosql/janusgraph/default.nix b/pkgs/servers/nosql/janusgraph/default.nix index 614058bb0ebed..965dd74bdfc49 100644 --- a/pkgs/servers/nosql/janusgraph/default.nix +++ b/pkgs/servers/nosql/janusgraph/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/janusgraph install -D $src/lib/*.jar $out/share/janusgraph cd $src @@ -34,6 +36,8 @@ stdenv.mkDerivation rec { # temporary workaround for # https://github.com/NixOS/nixpkgs/pull/244400#issuecomment-1667330430 cd "$TMPDIR" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/nosql/neo4j/default.nix b/pkgs/servers/nosql/neo4j/default.nix index f4b375a62cc1b..13654536a9665 100644 --- a/pkgs/servers/nosql/neo4j/default.nix +++ b/pkgs/servers/nosql/neo4j/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p "$out/share/neo4j" cp -R * "$out/share/neo4j" @@ -30,6 +32,8 @@ stdenv.mkDerivation rec { # user will be asked to change password on first login # password must be at least 8 characters long $out/bin/neo4j-admin dbms set-initial-password neo4jadmin + + runHook postInstall ''; passthru.tests.nixos = nixosTests.neo4j; diff --git a/pkgs/servers/ombi/default.nix b/pkgs/servers/ombi/default.nix index 6e6ece8ea7cb9..39d579c9df358 100644 --- a/pkgs/servers/ombi/default.nix +++ b/pkgs/servers/ombi/default.nix @@ -33,12 +33,16 @@ in stdenv.mkDerivation rec { propagatedBuildInputs = [ stdenv.cc.cc zlib krb5 ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/${pname}-${version}} cp -r * $out/share/${pname}-${version} makeWrapper $out/share/${pname}-${version}/Ombi $out/bin/Ombi \ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ openssl icu ]} \ --chdir "$out/share/${pname}-${version}" + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/onlyoffice-documentserver/default.nix b/pkgs/servers/onlyoffice-documentserver/default.nix index 7369e0b25bb0a..6c68e5ba2c0d7 100644 --- a/pkgs/servers/onlyoffice-documentserver/default.nix +++ b/pkgs/servers/onlyoffice-documentserver/default.nix @@ -31,6 +31,8 @@ let ]; installPhase = '' + runHook preInstall + # replace dangling symlinks which are not copied into fhs with actually files rm lib/*.so* for file in var/www/onlyoffice/documentserver/server/FileConverter/bin/*.so* ; do @@ -51,6 +53,8 @@ let mkdir -p var/lib/onlyoffice/ var/www/onlyoffice/documentserver/fonts/ mv * $out/ + + runHook postInstall ''; # stripping self extracting javascript binaries likely breaks them diff --git a/pkgs/servers/openafs/1.8/module.nix b/pkgs/servers/openafs/1.8/module.nix index 7060faf7890f3..2ea5db53a7275 100644 --- a/pkgs/servers/openafs/1.8/module.nix +++ b/pkgs/servers/openafs/1.8/module.nix @@ -274,9 +274,13 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p ${modDestDir} cp src/libafs/MODLOAD-*/libafs-${kernel.modDirVersion}.* ${modDestDir}/libafs.ko xz -f ${modDestDir}/libafs.ko + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/peertube/default.nix b/pkgs/servers/peertube/default.nix index a839feda1f0a8..2d1ee9b6d5d3c 100644 --- a/pkgs/servers/peertube/default.nix +++ b/pkgs/servers/peertube/default.nix @@ -139,6 +139,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/dist mv ~/dist $out mv ~/node_modules $out/node_modules @@ -166,6 +168,8 @@ stdenv.mkDerivation rec { --type file --search-path $out/client/dist --threads $NIX_BUILD_CORES \ --exec gzip -9 -n -c {} > {}.gz \;\ --exec brotli --best -f {} -o {}.br + + runHook postInstall ''; passthru.tests.peertube = nixosTests.peertube; diff --git a/pkgs/servers/persistent-evdev/default.nix b/pkgs/servers/persistent-evdev/default.nix index 83518b904a509..84591a5503ab3 100644 --- a/pkgs/servers/persistent-evdev/default.nix +++ b/pkgs/servers/persistent-evdev/default.nix @@ -23,11 +23,15 @@ buildPythonPackage rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bin/persistent-evdev.py $out/bin mkdir -p $out/etc/udev/rules.d cp udev/60-persistent-input-uinput.rules $out/etc/udev/rules.d + + runHook postInstall ''; # has no tests diff --git a/pkgs/servers/photofield/default.nix b/pkgs/servers/photofield/default.nix index 3c9cf8245022a..5a78ef26a6632 100644 --- a/pkgs/servers/photofield/default.nix +++ b/pkgs/servers/photofield/default.nix @@ -29,8 +29,12 @@ let npmDepsHash = "sha256-trKcNuhRdiabFKMafOLtPg8x1bQHLOif6Hm4k5bTAYc="; installPhase = '' + runHook preInstall + mkdir -p $out/share mv dist $out/share/photofield-ui + + runHook postInstall ''; }; in diff --git a/pkgs/servers/photoprism/libtensorflow.nix b/pkgs/servers/photoprism/libtensorflow.nix index e1c8f9338cc8b..81c4b439e9792 100644 --- a/pkgs/servers/photoprism/libtensorflow.nix +++ b/pkgs/servers/photoprism/libtensorflow.nix @@ -75,8 +75,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -r LICENSE THIRD_PARTY_TF_C_LICENSES lib include $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/postfixadmin/default.nix b/pkgs/servers/postfixadmin/default.nix index 26628e13ea08b..9d9e4fd365693 100644 --- a/pkgs/servers/postfixadmin/default.nix +++ b/pkgs/servers/postfixadmin/default.nix @@ -12,10 +12,14 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir $out cp -r * $out/ ln -sf /etc/postfixadmin/config.local.php $out/ ln -sf /var/cache/postfixadmin/templates_c $out/ + + runHook postInstall ''; passthru.tests = { inherit (nixosTests) postfixadmin; }; diff --git a/pkgs/servers/psitransfer/default.nix b/pkgs/servers/psitransfer/default.nix index 621ad70184a6c..6d6794e80cca5 100644 --- a/pkgs/servers/psitransfer/default.nix +++ b/pkgs/servers/psitransfer/default.nix @@ -27,7 +27,11 @@ let ''; installPhase = '' + runHook preInstall + cp -r ../public/app $out + + runHook postInstall ''; }; in buildNpmPackage { diff --git a/pkgs/servers/rainloop/default.nix b/pkgs/servers/rainloop/default.nix index f034f83f48354..27a28df694b56 100644 --- a/pkgs/servers/rainloop/default.nix +++ b/pkgs/servers/rainloop/default.nix @@ -42,12 +42,16 @@ ''; installPhase = '' + runHook preInstall + mkdir $out cp -r rainloop/* $out rm -rf $out/data cp ${includeScript} $out/include.php mkdir $out/data chmod 700 $out/data + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/roapi/http.nix b/pkgs/servers/roapi/http.nix index 019c979b47a21..6c459bf767c9a 100644 --- a/pkgs/servers/roapi/http.nix +++ b/pkgs/servers/roapi/http.nix @@ -40,9 +40,13 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + tar xvzf $src mkdir -p "$out/bin" cp roapi-http $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/roundcube/default.nix b/pkgs/servers/roundcube/default.nix index 646379e3e6415..337b016fdf1f3 100644 --- a/pkgs/servers/roundcube/default.nix +++ b/pkgs/servers/roundcube/default.nix @@ -14,12 +14,16 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir $out cp -r * $out/ ln -sf /etc/roundcube/config.inc.php $out/config/config.inc.php rm -rf $out/installer # shut up updater rm $out/composer.json-dist + + runHook postInstall ''; passthru.withPlugins = f: buildEnv { diff --git a/pkgs/servers/search/elasticsearch/7.x.nix b/pkgs/servers/search/elasticsearch/7.x.nix index 0244783c58735..437045d14c1d5 100644 --- a/pkgs/servers/search/elasticsearch/7.x.nix +++ b/pkgs/servers/search/elasticsearch/7.x.nix @@ -52,6 +52,8 @@ stdenv.mkDerivation rec { runtimeDependencies = [ zlib ]; installPhase = '' + runHook preInstall + mkdir -p $out cp -R bin config lib modules plugins $out @@ -65,6 +67,8 @@ stdenv.mkDerivation rec { --set JAVA_HOME "${jre_headless}" wrapProgram $out/bin/elasticsearch-plugin --set JAVA_HOME "${jre_headless}" + + runHook postInstall ''; passthru = { enableUnfree = true; }; diff --git a/pkgs/servers/search/quickwit/default.nix b/pkgs/servers/search/quickwit/default.nix index ccc32cb90056e..d07b3f85945ac 100644 --- a/pkgs/servers/search/quickwit/default.nix +++ b/pkgs/servers/search/quickwit/default.nix @@ -56,8 +56,12 @@ let ''; installPhase = '' + runHook preInstall + mkdir $out mv build/* $out + + runHook postInstall ''; }; in diff --git a/pkgs/servers/search/typesense/default.nix b/pkgs/servers/search/typesense/default.nix index 762cc190f242f..aebcc63937c2c 100644 --- a/pkgs/servers/search/typesense/default.nix +++ b/pkgs/servers/search/typesense/default.nix @@ -29,8 +29,12 @@ stdenv.mkDerivation { sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp $sourceRoot/typesense-server $out/bin + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/search/zincsearch/default.nix b/pkgs/servers/search/zincsearch/default.nix index beef1758422f7..b7b86cf7a4726 100644 --- a/pkgs/servers/search/zincsearch/default.nix +++ b/pkgs/servers/search/zincsearch/default.nix @@ -26,8 +26,12 @@ let }; installPhase = '' + runHook preInstall + mkdir -p $out/share mv dist $out/share/zinc-ui + + runHook postInstall ''; }; in diff --git a/pkgs/servers/serviio/default.nix b/pkgs/servers/serviio/default.nix index f2e652adaae3d..8337496b19468 100644 --- a/pkgs/servers/serviio/default.nix +++ b/pkgs/servers/serviio/default.nix @@ -10,8 +10,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out cp -R config legal lib library plugins LICENCE.txt NOTICE.txt README.txt RELEASE_NOTES.txt $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sickbeard/sickgear.nix b/pkgs/servers/sickbeard/sickgear.nix index f01358146197c..c282efca1432b 100644 --- a/pkgs/servers/sickbeard/sickgear.nix +++ b/pkgs/servers/sickbeard/sickgear.nix @@ -24,11 +24,15 @@ in stdenv.mkDerivation rec { buildInputs = [ pythonEnv libarchive ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/opt/sickgear cp -R {autoProcessTV,gui,lib,sickgear,sickgear.py} $out/opt/sickgear/ makeWrapper $out/opt/sickgear/sickgear.py $out/bin/sickgear \ --suffix PATH : ${lib.makeBinPath [ libarchive ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/snappymail/default.nix b/pkgs/servers/snappymail/default.nix index fa90943d1ce12..7428315f9bcd9 100644 --- a/pkgs/servers/snappymail/default.nix +++ b/pkgs/servers/snappymail/default.nix @@ -24,10 +24,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir $out cp -r ../* $out rm -rf $out/{data,env-vars,_include.php} cp ${includeScript} $out/include.php + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/mssql/jdbc/jtds.nix b/pkgs/servers/sql/mssql/jdbc/jtds.nix index 71561409c7582..472ec3eed8d37 100644 --- a/pkgs/servers/sql/mssql/jdbc/jtds.nix +++ b/pkgs/servers/sql/mssql/jdbc/jtds.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/share/java cp jtds-*.jar $out/share/java/jtds-jdbc.jar + + runHook postInstall ''; nativeBuildInputs = [ unzip ]; diff --git a/pkgs/servers/sql/mysql/jdbc/default.nix b/pkgs/servers/sql/mysql/jdbc/default.nix index 1a92e75b93220..a3ac958c4f4c0 100644 --- a/pkgs/servers/sql/mysql/jdbc/default.nix +++ b/pkgs/servers/sql/mysql/jdbc/default.nix @@ -10,8 +10,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/java cp mysql-connector-j-*.jar $out/share/java/mysql-connector-j.jar + + runHook postInstall ''; nativeBuildInputs = [ unzip ]; diff --git a/pkgs/servers/sql/postgresql/ext/age.nix b/pkgs/servers/sql/postgresql/ext/age.nix index 2c68d6dcbbad9..6f8819a54849e 100644 --- a/pkgs/servers/sql/postgresql/ext/age.nix +++ b/pkgs/servers/sql/postgresql/ext/age.nix @@ -29,9 +29,13 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -D -t $out/lib *${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control + + runHook postInstall ''; passthru.tests = stdenv.mkDerivation { @@ -59,7 +63,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + touch $out + + runHook postInstall ''; }; diff --git a/pkgs/servers/sql/postgresql/ext/cstore_fdw.nix b/pkgs/servers/sql/postgresql/ext/cstore_fdw.nix index c9f01190c9126..741f50582fd0e 100644 --- a/pkgs/servers/sql/postgresql/ext/cstore_fdw.nix +++ b/pkgs/servers/sql/postgresql/ext/cstore_fdw.nix @@ -15,11 +15,15 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/{lib,share/postgresql/extension} cp *.so $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/h3-pg.nix b/pkgs/servers/sql/postgresql/ext/h3-pg.nix index 2b8edb366ffae..1811f8d94bfa2 100644 --- a/pkgs/servers/sql/postgresql/ext/h3-pg.nix +++ b/pkgs/servers/sql/postgresql/ext/h3-pg.nix @@ -36,10 +36,14 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = '' + runHook preInstall + install -D -t $out/lib h3/h3.so install -D -t $out/share/postgresql/extension h3/h3-*.sql h3/h3.control install -D -t $out/lib h3_postgis/h3_postgis.so install -D -t $out/share/postgresql/extension h3_postgis/h3_postgis-*.sql h3_postgis/h3_postgis.control + + runHook postInstall ''; passthru.tests.extension = stdenv.mkDerivation { @@ -63,7 +67,7 @@ stdenv.mkDerivation (finalAttrs: { psql -a -v ON_ERROR_STOP=1 -f $sqlPath runHook postCheck ''; - installPhase = "touch $out"; + installPhase = "runHook preInstall; touch $out; runHook postInstall"; }; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/hypopg.nix b/pkgs/servers/sql/postgresql/ext/hypopg.nix index 62f2e9263e76f..68da7fc0e50c5 100644 --- a/pkgs/servers/sql/postgresql/ext/hypopg.nix +++ b/pkgs/servers/sql/postgresql/ext/hypopg.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; installPhase = '' + runHook preInstall + install -D -t $out/lib *${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.control install -D -t $out/share/postgresql/extension *.sql + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/jsonb_deep_sum.nix b/pkgs/servers/sql/postgresql/ext/jsonb_deep_sum.nix index 092212aa3de00..06aa4d3af89ff 100644 --- a/pkgs/servers/sql/postgresql/ext/jsonb_deep_sum.nix +++ b/pkgs/servers/sql/postgresql/ext/jsonb_deep_sum.nix @@ -14,11 +14,15 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; installPhase = '' + runHook preInstall + mkdir -p $out/{lib,share/postgresql/extension} cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/periods.nix b/pkgs/servers/sql/postgresql/ext/periods.nix index 422d6ddaf2b34..29909cfcae7e7 100644 --- a/pkgs/servers/sql/postgresql/ext/periods.nix +++ b/pkgs/servers/sql/postgresql/ext/periods.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; installPhase = '' + runHook preInstall + install -D -t $out/lib *${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_auto_failover.nix b/pkgs/servers/sql/postgresql/ext/pg_auto_failover.nix index ed0bfde0caba8..6a0f8135f8675 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_auto_failover.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_auto_failover.nix @@ -14,10 +14,14 @@ stdenv.mkDerivation rec { buildInputs = postgresql.buildInputs ++ [ postgresql ]; installPhase = '' + runHook preInstall + install -D -t $out/bin src/bin/pg_autoctl/pg_autoctl install -D -t $out/lib src/monitor/pgautofailover.so install -D -t $out/share/postgresql/extension src/monitor/*.sql install -D -t $out/share/postgresql/extension src/monitor/pgautofailover.control + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_bigm.nix b/pkgs/servers/sql/postgresql/ext/pg_bigm.nix index f47ce5694588e..b2fac3ce82c0f 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_bigm.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_bigm.nix @@ -24,9 +24,13 @@ stdenv.mkDerivation rec { makeFlags = [ "USE_PGXS=1" ]; installPhase = '' + runHook preInstall + install -D -t $out/lib pg_bigm${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_cron.nix b/pkgs/servers/sql/postgresql/ext/pg_cron.nix index 02c6e6435ae75..155b1b5aaae90 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_cron.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_cron.nix @@ -14,11 +14,15 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/{lib,share/postgresql/extension} cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_ed25519.nix b/pkgs/servers/sql/postgresql/ext/pg_ed25519.nix index 010f8f819da94..8933dae9bb5bb 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_ed25519.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_ed25519.nix @@ -13,12 +13,16 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin # For buildEnv to setup proper symlinks. See #22653 mkdir -p $out/{lib,share/postgresql/extension} cp *.so $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_embedding.nix b/pkgs/servers/sql/postgresql/ext/pg_embedding.nix index 5306a619038d5..45375b49ee787 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_embedding.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_embedding.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; installPhase = '' + runHook preInstall + install -D -t $out/lib *.so install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_hint_plan.nix b/pkgs/servers/sql/postgresql/ext/pg_hint_plan.nix index afc5b9fe65065..cf13500990fc8 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_hint_plan.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_hint_plan.nix @@ -43,9 +43,13 @@ stdenv.mkDerivation { buildInputs = [ postgresql ]; installPhase = '' + runHook preInstall + install -D -t $out/lib pg_hint_plan${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_hll.nix b/pkgs/servers/sql/postgresql/ext/pg_hll.nix index a60601aef569a..4681c2000a270 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_hll.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_hll.nix @@ -14,10 +14,14 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D -t $out/lib hll${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control - ''; + + runHook postInstall + ''; meta = with lib; { description = "HyperLogLog for PostgreSQL"; diff --git a/pkgs/servers/sql/postgresql/ext/pg_ivm.nix b/pkgs/servers/sql/postgresql/ext/pg_ivm.nix index 46c01251d503e..ba9a134a3449f 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_ivm.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_ivm.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; installPhase = '' + runHook preInstall + install -D -t $out/lib pg_ivm${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_net.nix b/pkgs/servers/sql/postgresql/ext/pg_net.nix index a86f53eeef05f..421d3142cd9c7 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_net.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_net.nix @@ -16,11 +16,15 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = "-Wno-error"; installPhase = '' + runHook preInstall + mkdir -p $out/{lib,share/postgresql/extension} cp *${postgresql.dlSuffix} $out/lib cp sql/*.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_partman.nix b/pkgs/servers/sql/postgresql/ext/pg_partman.nix index 87ee50411b754..9cb2179776ca6 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_partman.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_partman.nix @@ -14,12 +14,16 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/{lib,share/postgresql/extension} cp src/*${postgresql.dlSuffix} $out/lib cp updates/* $out/share/postgresql/extension cp -r sql/* $out/share/postgresql/extension cp *.control $out/share/postgresql/extension + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_relusage.nix b/pkgs/servers/sql/postgresql/ext/pg_relusage.nix index 1fe9fd3cac876..ded6508596598 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_relusage.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_relusage.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D -t $out/lib *${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_repack.nix b/pkgs/servers/sql/postgresql/ext/pg_repack.nix index c265ae39ca461..29c33b523ea7c 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_repack.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_repack.nix @@ -23,9 +23,13 @@ stdenv.mkDerivation (finalAttrs: { }; installPhase = '' + runHook preInstall + install -D bin/pg_repack -t $out/bin/ install -D lib/pg_repack${postgresql.dlSuffix} -t $out/lib/ install -D lib/{pg_repack--${finalAttrs.version}.sql,pg_repack.control} -t $out/share/postgresql/extension + + runHook postInstall ''; passthru.tests = { @@ -45,7 +49,7 @@ stdenv.mkDerivation (finalAttrs: { psql -a -v ON_ERROR_STOP=1 -c "CREATE EXTENSION pg_repack;" runHook postCheck ''; - installPhase = "touch $out"; + installPhase = "runHook preInstall; touch $out; runHook postInstall"; }; }; diff --git a/pkgs/servers/sql/postgresql/ext/pg_roaringbitmap.nix b/pkgs/servers/sql/postgresql/ext/pg_roaringbitmap.nix index 682275fbf15ca..15cf4669bff4c 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_roaringbitmap.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_roaringbitmap.nix @@ -16,9 +16,13 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = '' + runHook preInstall + install -D -t $out/lib roaringbitmap${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension roaringbitmap-*.sql install -D -t $out/share/postgresql/extension roaringbitmap.control + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_safeupdate.nix b/pkgs/servers/sql/postgresql/ext/pg_safeupdate.nix index 6637c98c95654..06ec060e9c026 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_safeupdate.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_safeupdate.nix @@ -37,7 +37,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D safeupdate${postgresql.dlSuffix} -t $out/lib + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_similarity.nix b/pkgs/servers/sql/postgresql/ext/pg_similarity.nix index 20e5299da25ae..3eb353c189d30 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_similarity.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_similarity.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation { buildInputs = [ postgresql gcc ]; buildPhase = "USE_PGXS=1 make"; installPhase = '' + runHook preInstall + install -D pg_similarity${postgresql.dlSuffix} -t $out/lib/ install -D ./{pg_similarity--unpackaged--1.0.sql,pg_similarity--1.0.sql,pg_similarity.control} -t $out/share/postgresql/extension + + runHook postInstall ''; meta = { diff --git a/pkgs/servers/sql/postgresql/ext/pg_topn.nix b/pkgs/servers/sql/postgresql/ext/pg_topn.nix index 2a11417c90831..4a12946194a89 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_topn.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_topn.nix @@ -14,11 +14,15 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/{lib,share/postgresql/extension} cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pg_uuidv7.nix b/pkgs/servers/sql/postgresql/ext/pg_uuidv7.nix index 80afe05db808e..1cdc5085a54cc 100644 --- a/pkgs/servers/sql/postgresql/ext/pg_uuidv7.nix +++ b/pkgs/servers/sql/postgresql/ext/pg_uuidv7.nix @@ -18,9 +18,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D -t $out/lib pg_uuidv7${postgresql.dlSuffix} install -D {sql/pg_uuidv7--${lib.versions.majorMinor version}.sql,pg_uuidv7.control} -t $out/share/postgresql/extension - ''; + + runHook postInstall + ''; meta = with lib; { description = "Tiny Postgres extension to create version 7 UUIDs"; diff --git a/pkgs/servers/sql/postgresql/ext/pgaudit.nix b/pkgs/servers/sql/postgresql/ext/pgaudit.nix index f4c03d611f503..005f70302053e 100644 --- a/pkgs/servers/sql/postgresql/ext/pgaudit.nix +++ b/pkgs/servers/sql/postgresql/ext/pgaudit.nix @@ -40,9 +40,13 @@ stdenv.mkDerivation { makeFlags = [ "USE_PGXS=1" ]; installPhase = '' + runHook preInstall + install -D -t $out/lib pgaudit${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pgjwt.nix b/pkgs/servers/sql/postgresql/ext/pgjwt.nix index be088b81f861c..852f3f1fb35a8 100644 --- a/pkgs/servers/sql/postgresql/ext/pgjwt.nix +++ b/pkgs/servers/sql/postgresql/ext/pgjwt.nix @@ -13,8 +13,12 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/postgresql/extension cp pg*sql *.control $out/share/postgresql/extension + + runHook postInstall ''; passthru.updateScript = unstableGitUpdater { }; diff --git a/pkgs/servers/sql/postgresql/ext/pgroonga.nix b/pkgs/servers/sql/postgresql/ext/pgroonga.nix index 0ba7fa093820c..2d61076d4c7d8 100644 --- a/pkgs/servers/sql/postgresql/ext/pgroonga.nix +++ b/pkgs/servers/sql/postgresql/ext/pgroonga.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -D pgroonga${postgresql.dlSuffix} -t $out/lib/ install -D pgroonga.control -t $out/share/postgresql/extension install -D data/pgroonga-*.sql -t $out/share/postgresql/extension @@ -25,6 +27,8 @@ stdenv.mkDerivation rec { install -D pgroonga_database${postgresql.dlSuffix} -t $out/lib/ install -D pgroonga_database.control -t $out/share/postgresql/extension install -D data/pgroonga_database-*.sql -t $out/share/postgresql/extension + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pgrouting.nix b/pkgs/servers/sql/postgresql/ext/pgrouting.nix index 86fab4f8dbaef..e8aae69f62371 100644 --- a/pkgs/servers/sql/postgresql/ext/pgrouting.nix +++ b/pkgs/servers/sql/postgresql/ext/pgrouting.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D lib/*.so -t $out/lib install -D sql/pgrouting--${version}.sql -t $out/share/postgresql/extension install -D sql/common/pgrouting.control -t $out/share/postgresql/extension + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pgsql-http.nix b/pkgs/servers/sql/postgresql/ext/pgsql-http.nix index bfe9052acf587..4eed79249d76c 100644 --- a/pkgs/servers/sql/postgresql/ext/pgsql-http.nix +++ b/pkgs/servers/sql/postgresql/ext/pgsql-http.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { buildInputs = [ curl postgresql ]; installPhase = '' + runHook preInstall + install -D -t $out/lib *${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pgtap.nix b/pkgs/servers/sql/postgresql/ext/pgtap.nix index 24ad1f610e8f4..ac6d8900cc3a2 100644 --- a/pkgs/servers/sql/postgresql/ext/pgtap.nix +++ b/pkgs/servers/sql/postgresql/ext/pgtap.nix @@ -22,7 +22,11 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ postgresql perl perlPackages.TAPParserSourceHandlerpgTAP which ]; installPhase = '' + runHook preInstall + install -D {sql/pgtap--${finalAttrs.version}.sql,pgtap.control} -t $out/share/postgresql/extension + + runHook postInstall ''; passthru.tests.extension = stdenv.mkDerivation { @@ -46,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: { psql -a -v ON_ERROR_STOP=1 -f $sqlPath runHook postCheck ''; - installPhase = "touch $out"; + installPhase = "runHook preInstall; touch $out; runHook postInstall"; }; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/pgvector.nix b/pkgs/servers/sql/postgresql/ext/pgvector.nix index 619c5e7ab24d3..d4907c09b4ead 100644 --- a/pkgs/servers/sql/postgresql/ext/pgvector.nix +++ b/pkgs/servers/sql/postgresql/ext/pgvector.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; installPhase = '' + runHook preInstall + install -D -t $out/lib vector${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension sql/vector-*.sql install -D -t $out/share/postgresql/extension vector.control + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/plpgsql_check.nix b/pkgs/servers/sql/postgresql/ext/plpgsql_check.nix index 51747dce056bc..6732ac1173dc8 100644 --- a/pkgs/servers/sql/postgresql/ext/plpgsql_check.nix +++ b/pkgs/servers/sql/postgresql/ext/plpgsql_check.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; installPhase = '' + runHook preInstall + install -D -t $out/lib *${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control + + runHook postInstall ''; passthru.tests.extension = stdenv.mkDerivation { @@ -32,7 +36,7 @@ stdenv.mkDerivation rec { psql -a -v ON_ERROR_STOP=1 -c "CREATE EXTENSION plpgsql_check;" runHook postCheck ''; - installPhase = "touch $out"; + installPhase = "runHook preInstall; touch $out; runHook postInstall"; }; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/plr.nix b/pkgs/servers/sql/postgresql/ext/plr.nix index 1800b424716f9..b73e765199c04 100644 --- a/pkgs/servers/sql/postgresql/ext/plr.nix +++ b/pkgs/servers/sql/postgresql/ext/plr.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { export USE_PGXS=1 ''; installPhase = '' + runHook preInstall + install -D plr${postgresql.dlSuffix} -t $out/lib/ install -D {plr--*.sql,plr.control} -t $out/share/postgresql/extension + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/repmgr.nix b/pkgs/servers/sql/postgresql/ext/repmgr.nix index e4e8c5afdb242..48e79c0cf1ff3 100644 --- a/pkgs/servers/sql/postgresql/ext/repmgr.nix +++ b/pkgs/servers/sql/postgresql/ext/repmgr.nix @@ -27,12 +27,16 @@ stdenv.mkDerivation rec { buildInputs = postgresql.buildInputs ++ [ postgresql curl json_c ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib,share/postgresql/extension} cp repmgr{,d} $out/bin cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/rum.nix b/pkgs/servers/sql/postgresql/ext/rum.nix index 0fb6635529ae2..aeedfcc6fcd63 100644 --- a/pkgs/servers/sql/postgresql/ext/rum.nix +++ b/pkgs/servers/sql/postgresql/ext/rum.nix @@ -16,9 +16,13 @@ stdenv.mkDerivation rec { makeFlags = [ "USE_PGXS=1" ]; installPhase = '' + runHook preInstall + install -D -t $out/lib *${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.control install -D -t $out/share/postgresql/extension *.sql + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/smlar.nix b/pkgs/servers/sql/postgresql/ext/smlar.nix index 12fdd79cc8f42..20dfbf2bbcfe0 100644 --- a/pkgs/servers/sql/postgresql/ext/smlar.nix +++ b/pkgs/servers/sql/postgresql/ext/smlar.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation rec { makeFlags = [ "USE_PGXS=1" ]; installPhase = '' + runHook preInstall + install -D -t $out/lib *.so install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/tds_fdw.nix b/pkgs/servers/sql/postgresql/ext/tds_fdw.nix index 4a192cda9aa33..e6532d0a29e97 100644 --- a/pkgs/servers/sql/postgresql/ext/tds_fdw.nix +++ b/pkgs/servers/sql/postgresql/ext/tds_fdw.nix @@ -15,10 +15,14 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + version="$(sed -En "s,^default_version *= *'([^']*)'.*,\1,p" tds_fdw.control)" install -D tds_fdw${postgresql.dlSuffix} -t $out/lib install -D sql/tds_fdw.sql "$out/share/postgresql/extension/tds_fdw--$version.sql" install -D tds_fdw.control -t $out/share/postgresql/extension + + runHook postInstall ''; passthru.updateScript = unstableGitUpdater { diff --git a/pkgs/servers/sql/postgresql/ext/temporal_tables.nix b/pkgs/servers/sql/postgresql/ext/temporal_tables.nix index cb401829b2425..779c8f8f3b8c2 100644 --- a/pkgs/servers/sql/postgresql/ext/temporal_tables.nix +++ b/pkgs/servers/sql/postgresql/ext/temporal_tables.nix @@ -14,10 +14,14 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D -t $out/lib temporal_tables${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension *.sql install -D -t $out/share/postgresql/extension *.control - ''; + + runHook postInstall + ''; meta = with lib; { description = "Temporal Tables PostgreSQL Extension"; diff --git a/pkgs/servers/sql/postgresql/ext/tsearch_extras.nix b/pkgs/servers/sql/postgresql/ext/tsearch_extras.nix index b42095acd715c..85b1ca0501150 100644 --- a/pkgs/servers/sql/postgresql/ext/tsearch_extras.nix +++ b/pkgs/servers/sql/postgresql/ext/tsearch_extras.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation { buildInputs = [ postgresql ]; installPhase = '' + runHook preInstall + install -D tsearch_extras${postgresql.dlSuffix} -t $out/lib/ install -D ./{tsearch_extras--1.0.sql,tsearch_extras.control} -t $out/share/postgresql/extension + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/ext/tsja.nix b/pkgs/servers/sql/postgresql/ext/tsja.nix index f62eae5b6a3e2..a57fda81272ed 100644 --- a/pkgs/servers/sql/postgresql/ext/tsja.nix +++ b/pkgs/servers/sql/postgresql/ext/tsja.nix @@ -27,9 +27,13 @@ stdenv.mkDerivation rec { buildInputs = [ mecab postgresql ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib $out/share/postgresql/extension mv libtsja.so $out/lib mv dbinit_libtsja.txt $out/share/postgresql/extension/libtsja_dbinit.sql + + runHook postInstall ''; passthru.tests.tsja = nixosTests.tsja; diff --git a/pkgs/servers/sql/postgresql/ext/wal2json.nix b/pkgs/servers/sql/postgresql/ext/wal2json.nix index 26d4cb0c15412..8cd5672096905 100644 --- a/pkgs/servers/sql/postgresql/ext/wal2json.nix +++ b/pkgs/servers/sql/postgresql/ext/wal2json.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { makeFlags = [ "USE_PGXS=1" ]; installPhase = '' + runHook preInstall + install -D -t $out/lib *${postgresql.dlSuffix} install -D -t $out/share/postgresql/extension sql/*.sql + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/sql/sqlite/jdbc/default.nix b/pkgs/servers/sql/sqlite/jdbc/default.nix index 01c301e1a4545..d5f9fd852b2ce 100644 --- a/pkgs/servers/sql/sqlite/jdbc/default.nix +++ b/pkgs/servers/sql/sqlite/jdbc/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -m444 -D ${src}/share/java/*${pname}-${version}.jar "$out/share/java/${pname}-${version}.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/teleport/generic.nix b/pkgs/servers/teleport/generic.nix index caf345d944b3d..35efb549841cd 100644 --- a/pkgs/servers/teleport/generic.nix +++ b/pkgs/servers/teleport/generic.nix @@ -113,8 +113,12 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -R webassets/. $out + + runHook postInstall ''; }; in diff --git a/pkgs/servers/timetagger/default.nix b/pkgs/servers/timetagger/default.nix index 8505a897a675b..68bddf1bda481 100644 --- a/pkgs/servers/timetagger/default.nix +++ b/pkgs/servers/timetagger/default.nix @@ -20,12 +20,16 @@ python3.pkgs.buildPythonApplication { format = "custom"; installPhase = '' + runHook preInstall + mkdir -p $out/bin echo "#!${python3.interpreter}" >> $out/bin/timetagger cat timetagger/__main__.py >> $out/bin/timetagger chmod +x $out/bin/timetagger wrapProgram $out/bin/timetagger \ --set TIMETAGGER_BIND "${addr}:${toString port}" + + runHook postInstall ''; } diff --git a/pkgs/servers/tt-rss/plugin-auth-ldap/default.nix b/pkgs/servers/tt-rss/plugin-auth-ldap/default.nix index 6261c1f5f3fd6..bc81fbe495c69 100644 --- a/pkgs/servers/tt-rss/plugin-auth-ldap/default.nix +++ b/pkgs/servers/tt-rss/plugin-auth-ldap/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D plugins/auth_ldap/init.php $out/auth_ldap/init.php + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/tt-rss/plugin-feediron/default.nix b/pkgs/servers/tt-rss/plugin-feediron/default.nix index d7353bf4c439d..1b3c3f5104d77 100644 --- a/pkgs/servers/tt-rss/plugin-feediron/default.nix +++ b/pkgs/servers/tt-rss/plugin-feediron/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/feediron cp -r bin filters init.php preftab recipes $out/feediron/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/tt-rss/plugin-ff-instagram/default.nix b/pkgs/servers/tt-rss/plugin-ff-instagram/default.nix index 7ef093e3f70d6..4dd389434d865 100644 --- a/pkgs/servers/tt-rss/plugin-ff-instagram/default.nix +++ b/pkgs/servers/tt-rss/plugin-ff-instagram/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/ff_instagram cp *.php $out/ff_instagram + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/tt-rss/theme-feedly/default.nix b/pkgs/servers/tt-rss/theme-feedly/default.nix index 84ade1ef70ade..2cd14c39fcb46 100644 --- a/pkgs/servers/tt-rss/theme-feedly/default.nix +++ b/pkgs/servers/tt-rss/theme-feedly/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir $out cp -ra feedly *.css $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/u9fs/default.nix b/pkgs/servers/u9fs/default.nix index cb85a972e034e..61a08f70592fd 100644 --- a/pkgs/servers/u9fs/default.nix +++ b/pkgs/servers/u9fs/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + install -Dm644 u9fs.man "$out/share/man/man4/u9fs.4" install -Dm755 u9fs -t "$out/bin" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/uftp/default.nix b/pkgs/servers/uftp/default.nix index e2251e1a20c8f..b1731de9075a5 100644 --- a/pkgs/servers/uftp/default.nix +++ b/pkgs/servers/uftp/default.nix @@ -18,9 +18,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $man/share/man/man1 cp {uftp,uftpd,uftp_keymgt,uftpproxyd} $out/bin/ cp {uftp.1,uftpd.1,uftp_keymgt.1,uftpproxyd.1} $man/share/man/man1 + + runHook postInstall ''; meta = { diff --git a/pkgs/servers/ums/default.nix b/pkgs/servers/ums/default.nix index bfed80373746e..e0607dc8dedd5 100644 --- a/pkgs/servers/ums/default.nix +++ b/pkgs/servers/ums/default.nix @@ -20,6 +20,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + cp -a . $out/ mkdir $out/bin mv $out/documentation /$out/doc @@ -31,6 +33,8 @@ stdenv.mkDerivation rec { makeWrapper "$out/UMS.sh" "$out/bin/ums" \ --prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath [ libzen libmediainfo] }" \ --set JAVA_HOME "${jre8}" + + runHook postInstall ''; meta = { diff --git a/pkgs/servers/urserver/default.nix b/pkgs/servers/urserver/default.nix index 0e73bebe71fbc..b82a0f6afd487 100644 --- a/pkgs/servers/urserver/default.nix +++ b/pkgs/servers/urserver/default.nix @@ -29,10 +29,14 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = '' + runHook preInstall + install -m755 -D urserver $out/bin/urserver wrapProgram $out/bin/urserver --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.buildInputs}" cp -r remotes $out/bin/remotes cp -r manager $out/bin/manager + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/web-apps/anuko-time-tracker/default.nix b/pkgs/servers/web-apps/anuko-time-tracker/default.nix index 583f2db81938d..b0e5b9fb6e7ba 100644 --- a/pkgs/servers/web-apps/anuko-time-tracker/default.nix +++ b/pkgs/servers/web-apps/anuko-time-tracker/default.nix @@ -24,8 +24,12 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir $out/ cp -R ./* $out + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/servers/web-apps/discourse/mail_receiver/default.nix b/pkgs/servers/web-apps/discourse/mail_receiver/default.nix index d5fbb4fb3976e..40cc8b490865f 100644 --- a/pkgs/servers/web-apps/discourse/mail_receiver/default.nix +++ b/pkgs/servers/web-apps/discourse/mail_receiver/default.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin replace-literal -f -r -e /etc/postfix /run/discourse-mail-receiver . @@ -26,6 +28,8 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/receive-mail --set RUBYLIB $out/lib wrapProgram $out/bin/discourse-smtp-fast-rejection --set RUBYLIB $out/lib + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/web-apps/dolibarr/default.nix b/pkgs/servers/web-apps/dolibarr/default.nix index b1292c9bd66a7..6a23d6ec6a418 100644 --- a/pkgs/servers/web-apps/dolibarr/default.nix +++ b/pkgs/servers/web-apps/dolibarr/default.nix @@ -26,8 +26,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out" cp -r * $out + + runHook postInstall ''; passthru.tests = { inherit (nixosTests) dolibarr; }; diff --git a/pkgs/servers/web-apps/healthchecks/default.nix b/pkgs/servers/web-apps/healthchecks/default.nix index 5436555cd28a0..0e4289518c41c 100644 --- a/pkgs/servers/web-apps/healthchecks/default.nix +++ b/pkgs/servers/web-apps/healthchecks/default.nix @@ -76,10 +76,14 @@ py.pkgs.buildPythonApplication rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/opt/healthchecks cp -r . $out/opt/healthchecks chmod +x $out/opt/healthchecks/manage.py cp ${localSettings} $out/opt/healthchecks/hc/local_settings.py + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/web-apps/invoiceplane/default.nix b/pkgs/servers/web-apps/invoiceplane/default.nix index ade13a137574d..881d7f235b927 100644 --- a/pkgs/servers/web-apps/invoiceplane/default.nix +++ b/pkgs/servers/web-apps/invoiceplane/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { sourceRoot = "."; installPhase = '' + runHook preInstall + mkdir -p $out/ cp -r ip/. $out/ + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/servers/web-apps/jirafeau/default.nix b/pkgs/servers/web-apps/jirafeau/default.nix index 96496ee83a641..4dca9b9eb9acb 100644 --- a/pkgs/servers/web-apps/jirafeau/default.nix +++ b/pkgs/servers/web-apps/jirafeau/default.nix @@ -18,9 +18,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir $out cp -r * $out/ cp ${localConfig} $out/lib/config.local.php + + runHook postInstall ''; passthru.tests = { inherit (nixosTests) jirafeau; }; diff --git a/pkgs/servers/web-apps/monica/default.nix b/pkgs/servers/web-apps/monica/default.nix index 950078194d3be..d41d50e49d020 100644 --- a/pkgs/servers/web-apps/monica/default.nix +++ b/pkgs/servers/web-apps/monica/default.nix @@ -17,11 +17,15 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir $out cp -R * $out/ rm -rf $out/storage ln -s ${dataDir}/.env $out/.env ln -s ${dataDir}/storage $out/storage + + runHook postInstall ''; passthru.tests.monica = nixosTests.monica; diff --git a/pkgs/servers/web-apps/netbox/generic.nix b/pkgs/servers/web-apps/netbox/generic.nix index c7a5225a66e30..5f4176835357d 100644 --- a/pkgs/servers/web-apps/netbox/generic.nix +++ b/pkgs/servers/web-apps/netbox/generic.nix @@ -84,11 +84,15 @@ ''; installPhase = '' + runHook preInstall + mkdir -p $out/opt/netbox cp -r . $out/opt/netbox chmod +x $out/opt/netbox/netbox/manage.py makeWrapper $out/opt/netbox/netbox/manage.py $out/bin/netbox \ --prefix PYTHONPATH : "$PYTHONPATH" + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/web-apps/nifi/default.nix b/pkgs/servers/web-apps/nifi/default.nix index 3a65cb0fecfa3..60a540ad6e37d 100644 --- a/pkgs/servers/web-apps/nifi/default.nix +++ b/pkgs/servers/web-apps/nifi/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { buildInputs = [ jdk11 ]; installPhase = '' + runHook preInstall + cp -r ../$sourceRoot $out rm -f $out/bin/*bat rm -rf $out/extensions @@ -25,6 +27,8 @@ stdenv.mkDerivation rec { --replace "/bin/sh" "${stdenv.shell}" substituteInPlace $out/bin/nifi-env.sh \ --replace "#export JAVA_HOME=/usr/java/jdk1.8.0/" "export JAVA_HOME=${jdk11}" + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/web-apps/pgpkeyserver-lite/default.nix b/pkgs/servers/web-apps/pgpkeyserver-lite/default.nix index 6568409b11aa3..c0137a6363e7d 100644 --- a/pkgs/servers/web-apps/pgpkeyserver-lite/default.nix +++ b/pkgs/servers/web-apps/pgpkeyserver-lite/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out cp -R 404.html assets favicon.ico index.html robots.txt $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/web-apps/rss-bridge/default.nix b/pkgs/servers/web-apps/rss-bridge/default.nix index 9f64313c4de08..63714c2866ec6 100644 --- a/pkgs/servers/web-apps/rss-bridge/default.nix +++ b/pkgs/servers/web-apps/rss-bridge/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir $out/ cp -R ./* $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/web-apps/shaarli/default.nix b/pkgs/servers/web-apps/shaarli/default.nix index ac8670ce740fc..bf0e1f58bf993 100644 --- a/pkgs/servers/web-apps/shaarli/default.nix +++ b/pkgs/servers/web-apps/shaarli/default.nix @@ -44,11 +44,15 @@ stdenv.mkDerivation rec { # */ ?> installPhase = '' + runHook preInstall + rm -r {cache,pagecache,tmp,data}/ mkdir -p $doc/share/doc mv doc/ $doc/share/doc/shaarli mkdir $out/ cp -R ./* $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/servers/wsdd/default.nix b/pkgs/servers/wsdd/default.nix index d408706f4ee3f..dbcb48948fabb 100644 --- a/pkgs/servers/wsdd/default.nix +++ b/pkgs/servers/wsdd/default.nix @@ -18,9 +18,13 @@ stdenv.mkDerivation rec { buildInputs = [ python3 ]; installPhase = '' + runHook preInstall + install -Dm0555 src/wsdd.py $out/bin/wsdd installManPage man/wsdd.8 wrapProgram $out/bin/wsdd --prefix PYTHONPATH : "$PYTHONPATH" + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/x11/xquartz/default.nix b/pkgs/servers/x11/xquartz/default.nix index dfa9dda457c91..2e905b72bf636 100644 --- a/pkgs/servers/x11/xquartz/default.nix +++ b/pkgs/servers/x11/xquartz/default.nix @@ -104,6 +104,8 @@ in stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + cp -rT ${xorg.xinit} $out chmod -R u+w $out cp -rT ${xorg.xorgserver} $out @@ -169,6 +171,8 @@ in stdenv.mkDerivation { --subst-var-by "MKFONTSCALE" "${xorg.mkfontscale}/bin/mkfontscale" \ --subst-var-by "FC_CACHE" "${fontconfig.bin}/bin/fc-cache" \ --subst-var-by "FONTCONFIG_FILE" "$fontsConfPath" + + runHook postInstall ''; passthru = { diff --git a/pkgs/servers/xmpp/ejabberd/default.nix b/pkgs/servers/xmpp/ejabberd/default.nix index 37830973fbe9b..ce377adc6a470 100644 --- a/pkgs/servers/xmpp/ejabberd/default.nix +++ b/pkgs/servers/xmpp/ejabberd/default.nix @@ -62,6 +62,8 @@ in stdenv.mkDerivation rec { makeFlags = [ "deps" ]; installPhase = '' + runHook preInstall + for i in deps/*; do ( cd $i git reset --hard @@ -74,6 +76,8 @@ in stdenv.mkDerivation rec { rm deps/.got cp -r deps $out + + runHook postInstall ''; dontPatchELF = true; diff --git a/pkgs/shells/bash/fzf-obc/default.nix b/pkgs/shells/bash/fzf-obc/default.nix index 7621ae8c73c0a..50e76731c9aea 100644 --- a/pkgs/shells/bash/fzf-obc/default.nix +++ b/pkgs/shells/bash/fzf-obc/default.nix @@ -14,11 +14,15 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/fzf-obc/{bin,lib/fzf-obc,plugins/{kill,gradle}} install -m644 bin/* $out/share/fzf-obc/bin install -m644 lib/fzf-obc/* $out/share/fzf-obc/lib/fzf-obc install -m644 plugins/kill/* $out/share/fzf-obc/plugins/kill install -m644 plugins/gradle/* $out/share/fzf-obc/plugins/gradle + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/bash/undistract-me/default.nix b/pkgs/shells/bash/undistract-me/default.nix index b15903e779ea9..758ce22addab5 100644 --- a/pkgs/shells/bash/undistract-me/default.nix +++ b/pkgs/shells/bash/undistract-me/default.nix @@ -65,11 +65,15 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/share/undistract-me" "$out/etc/profile.d" "$out/share/licenses/undistract-me" cp long-running.bash "$out/share/undistract-me" cp preexec.bash "$out/share/undistract-me" cp undistract-me.sh "$out/etc/profile.d" cp LICENSE "$out/share/licenses/undistract-me" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/fzf-git-sh/default.nix b/pkgs/shells/fzf-git-sh/default.nix index e9cda521fb1db..f029aaaec0479 100644 --- a/pkgs/shells/fzf-git-sh/default.nix +++ b/pkgs/shells/fzf-git-sh/default.nix @@ -51,7 +51,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D fzf-git.sh $out/share/${pname}/fzf-git.sh + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/agkozak-zsh-prompt/default.nix b/pkgs/shells/zsh/agkozak-zsh-prompt/default.nix index 9d87f3b7385f1..728fc63873716 100644 --- a/pkgs/shells/zsh/agkozak-zsh-prompt/default.nix +++ b/pkgs/shells/zsh/agkozak-zsh-prompt/default.nix @@ -16,10 +16,14 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + plugindir="$out/share/zsh/site-functions" mkdir -p "$plugindir" cp -r -- lib/*.zsh agkozak-zsh-prompt.plugin.zsh prompt_agkozak-zsh-prompt_setup "$plugindir"/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/antigen/default.nix b/pkgs/shells/zsh/antigen/default.nix index 1b2795ee971ef..1620e615f073b 100644 --- a/pkgs/shells/zsh/antigen/default.nix +++ b/pkgs/shells/zsh/antigen/default.nix @@ -13,9 +13,13 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + outdir=$out/share/antigen mkdir -p $outdir cp $src $outdir/antigen.zsh + + runHook postInstall ''; meta = { diff --git a/pkgs/shells/zsh/fzf-zsh/default.nix b/pkgs/shells/zsh/fzf-zsh/default.nix index 089a443a8237b..6e6783609fc6a 100644 --- a/pkgs/shells/zsh/fzf-zsh/default.nix +++ b/pkgs/shells/zsh/fzf-zsh/default.nix @@ -25,7 +25,11 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -Dm0644 fzf-zsh.plugin.zsh $out/share/zsh/plugins/fzf-zsh/fzf-zsh.plugin.zsh + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/grml-zsh-config/default.nix b/pkgs/shells/zsh/grml-zsh-config/default.nix index 00349696bd3f3..553a260e93219 100644 --- a/pkgs/shells/zsh/grml-zsh-config/default.nix +++ b/pkgs/shells/zsh/grml-zsh-config/default.nix @@ -22,11 +22,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D -m644 etc/zsh/keephack $out/etc/zsh/keephack install -D -m644 etc/zsh/zshrc $out/etc/zsh/zshrc install -D -m644 doc/grmlzshrc.5 $out/share/man/man5/grmlzshrc.5 ln -s grmlzshrc.5.gz $out/share/man/man5/grml-zsh-config.5.gz + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/lambda-mod-zsh-theme/default.nix b/pkgs/shells/zsh/lambda-mod-zsh-theme/default.nix index 85bd6d5bf2e0a..d0fffa4bc0b3f 100644 --- a/pkgs/shells/zsh/lambda-mod-zsh-theme/default.nix +++ b/pkgs/shells/zsh/lambda-mod-zsh-theme/default.nix @@ -13,7 +13,11 @@ stdenv.mkDerivation { strictDeps = true; installPhase = '' + runHook preInstall + install -Dm0644 lambda-mod.zsh-theme $out/share/zsh/themes/lambda-mod.zsh-theme + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/nix-zsh-completions/default.nix b/pkgs/shells/zsh/nix-zsh-completions/default.nix index 2d4edf3d34ba1..5cdf85e51c20a 100644 --- a/pkgs/shells/zsh/nix-zsh-completions/default.nix +++ b/pkgs/shells/zsh/nix-zsh-completions/default.nix @@ -13,9 +13,13 @@ stdenv.mkDerivation rec { strictDeps = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/zsh/{site-functions,plugins/nix} cp _* $out/share/zsh/site-functions cp *.zsh $out/share/zsh/plugins/nix + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/pure-prompt/default.nix b/pkgs/shells/zsh/pure-prompt/default.nix index 20da12041805b..d29bf7940333e 100644 --- a/pkgs/shells/zsh/pure-prompt/default.nix +++ b/pkgs/shells/zsh/pure-prompt/default.nix @@ -13,10 +13,14 @@ stdenv.mkDerivation rec { strictDeps = true; installPhase = '' + runHook preInstall + OUTDIR="$out/share/zsh/site-functions" mkdir -p "$OUTDIR" cp pure.zsh "$OUTDIR/prompt_pure_setup" cp async.zsh "$OUTDIR/async" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/spaceship-prompt/default.nix b/pkgs/shells/zsh/spaceship-prompt/default.nix index 8639aa68056fa..ffe2c809b2a7a 100644 --- a/pkgs/shells/zsh/spaceship-prompt/default.nix +++ b/pkgs/shells/zsh/spaceship-prompt/default.nix @@ -15,6 +15,8 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -Dm644 LICENSE.md "$out/share/licenses/spaceship-prompt/LICENSE" install -Dm644 README.md "$out/share/doc/spaceship-prompt/README.md" find docs -type f -exec install -Dm644 {} "$out/share/doc/spaceship-prompt/{}" \; @@ -27,6 +29,8 @@ stdenvNoCC.mkDerivation rec { ln -s "$out/lib/spaceship-prompt/spaceship.zsh" "$out/share/zsh/themes/spaceship.zsh-theme" install -d "$out/share/zsh/site-functions/" ln -s "$out/lib/spaceship-prompt/spaceship.zsh" "$out/share/zsh/site-functions/prompt_spaceship_setup" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zi/default.nix b/pkgs/shells/zsh/zi/default.nix index 1649a6a7fe88f..8d559ddc52c1a 100644 --- a/pkgs/shells/zsh/zi/default.nix +++ b/pkgs/shells/zsh/zi/default.nix @@ -15,10 +15,14 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ installShellFiles ]; installPhase = '' + runHook preInstall + mkdir -p $out cp -r lib zi.zsh $out installManPage docs/man/zi.1 installShellCompletion --zsh lib/_zi + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zinit/default.nix b/pkgs/shells/zsh/zinit/default.nix index c226b5565451d..093d4c46c3a8d 100644 --- a/pkgs/shells/zsh/zinit/default.nix +++ b/pkgs/shells/zsh/zinit/default.nix @@ -14,6 +14,8 @@ stdenvNoCC.mkDerivation rec { strictDeps = true; nativeBuildInputs = [ installShellFiles ]; installPhase = '' + runHook preInstall + outdir="$out/share/$pname" cd "$src" @@ -31,6 +33,7 @@ stdenvNoCC.mkDerivation rec { # find zmodules/ -type d -exec install -dm 755 "{}" "$outdir/{}" \; # find zmodules/ -type f -exec install -m 744 "{}" "$outdir/{}" \; + runHook postInstall ''; #TODO:doc output diff --git a/pkgs/shells/zsh/zplug/default.nix b/pkgs/shells/zsh/zplug/default.nix index 4f6231d141103..f11fce86cd075 100644 --- a/pkgs/shells/zsh/zplug/default.nix +++ b/pkgs/shells/zsh/zplug/default.nix @@ -17,10 +17,14 @@ stdenv.mkDerivation rec { dontPatch = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/zplug cp -r $src/{autoload,base,bin,init.zsh,misc} $out/share/zplug/ mkdir -p $out/share/man cp -r $src/doc/man/* $out/share/man/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-abbr/default.nix b/pkgs/shells/zsh/zsh-abbr/default.nix index 842c6d975b92c..4bfaddd3cd93a 100644 --- a/pkgs/shells/zsh/zsh-abbr/default.nix +++ b/pkgs/shells/zsh/zsh-abbr/default.nix @@ -17,10 +17,14 @@ stdenv.mkDerivation rec { strictDeps = true; installPhase = '' + runHook preInstall + install -D zsh-abbr.zsh $out/share/zsh/${pname}/abbr.plugin.zsh # Needed so that `man` can find the manpage, since it looks via PATH mkdir -p $out/bin mv man $out/share/man + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-autocomplete/default.nix b/pkgs/shells/zsh/zsh-autocomplete/default.nix index 1ecd96121972e..13f0c4334f14d 100644 --- a/pkgs/shells/zsh/zsh-autocomplete/default.nix +++ b/pkgs/shells/zsh/zsh-autocomplete/default.nix @@ -13,9 +13,13 @@ stdenvNoCC.mkDerivation rec { strictDeps = true; installPhase = '' + runHook preInstall + install -D zsh-autocomplete.plugin.zsh $out/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh cp -R Completions $out/share/zsh-autocomplete/Completions cp -R Functions $out/share/zsh-autocomplete/Functions + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-autopair/default.nix b/pkgs/shells/zsh/zsh-autopair/default.nix index e950eadbcf401..6acddbf629b21 100644 --- a/pkgs/shells/zsh/zsh-autopair/default.nix +++ b/pkgs/shells/zsh/zsh-autopair/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation rec { strictDeps = true; installPhase = '' + runHook preInstall + install -D autopair.zsh $out/share/zsh/${pname}/autopair.zsh + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-autosuggestions/default.nix b/pkgs/shells/zsh/zsh-autosuggestions/default.nix index b1df50a9c6813..f46c9b8fe02fe 100644 --- a/pkgs/shells/zsh/zsh-autosuggestions/default.nix +++ b/pkgs/shells/zsh/zsh-autosuggestions/default.nix @@ -17,9 +17,13 @@ stdenv.mkDerivation rec { buildInputs = [ zsh ]; installPhase = '' + runHook preInstall + install -D zsh-autosuggestions.zsh \ $out/share/zsh-autosuggestions/zsh-autosuggestions.zsh - ''; + + runHook postInstall + ''; meta = with lib; { description = "Fish shell autosuggestions for Zsh"; diff --git a/pkgs/shells/zsh/zsh-bd/default.nix b/pkgs/shells/zsh/zsh-bd/default.nix index b0704065901b1..4dd7e928341ab 100644 --- a/pkgs/shells/zsh/zsh-bd/default.nix +++ b/pkgs/shells/zsh/zsh-bd/default.nix @@ -15,10 +15,14 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/zsh-bd cp {.,$out/share/zsh-bd}/bd.zsh cd $out/share/zsh-bd ln -s bd{,.plugin}.zsh + + runHook postInstall ''; meta = { diff --git a/pkgs/shells/zsh/zsh-better-npm-completion/default.nix b/pkgs/shells/zsh/zsh-better-npm-completion/default.nix index d9a813bbbfdd6..d59a320151d2b 100644 --- a/pkgs/shells/zsh/zsh-better-npm-completion/default.nix +++ b/pkgs/shells/zsh/zsh-better-npm-completion/default.nix @@ -13,7 +13,11 @@ stdenv.mkDerivation rec { strictDeps = true; installPhase = '' + runHook preInstall + install -Dm 0644 zsh-better-npm-completion.plugin.zsh $out/share/zsh-better-npm-completion + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-clipboard/default.nix b/pkgs/shells/zsh/zsh-clipboard/default.nix index 312731e7cb162..bee2c10a7f1ac 100644 --- a/pkgs/shells/zsh/zsh-clipboard/default.nix +++ b/pkgs/shells/zsh/zsh-clipboard/default.nix @@ -9,7 +9,11 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -D -m0444 -T ${./clipboard.plugin.zsh} $out/share/zsh/plugins/clipboard/clipboard.plugin.zsh + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-command-time/default.nix b/pkgs/shells/zsh/zsh-command-time/default.nix index c10b67c2b3de4..eeff35696fb5f 100644 --- a/pkgs/shells/zsh/zsh-command-time/default.nix +++ b/pkgs/shells/zsh/zsh-command-time/default.nix @@ -23,7 +23,11 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + install -Dm0444 $src/command-time.plugin.zsh --target-directory=$out/share/zsh/plugins/command-time + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-completions/default.nix b/pkgs/shells/zsh/zsh-completions/default.nix index a32d56bedd1f3..3a0f0ba9ed8ca 100644 --- a/pkgs/shells/zsh/zsh-completions/default.nix +++ b/pkgs/shells/zsh/zsh-completions/default.nix @@ -13,10 +13,14 @@ stdenv.mkDerivation rec { strictDeps = true; installPhase = '' + runHook preInstall + install -D --target-directory=$out/share/zsh/site-functions src/* # tmuxp install it so avoid collision rm $out/share/zsh/site-functions/_tmuxp + + runHook postInstall ''; meta = { diff --git a/pkgs/shells/zsh/zsh-deer/default.nix b/pkgs/shells/zsh/zsh-deer/default.nix index 0d3a6bc9ee61a..6aaeb29738a3f 100644 --- a/pkgs/shells/zsh/zsh-deer/default.nix +++ b/pkgs/shells/zsh/zsh-deer/default.nix @@ -21,8 +21,12 @@ stdenv.mkDerivation rec { patches = [ ./realpath.patch ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/zsh/site-functions/ cp deer $out/share/zsh/site-functions/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-defer/default.nix b/pkgs/shells/zsh/zsh-defer/default.nix index e21a254af52a3..73a396793e39d 100644 --- a/pkgs/shells/zsh/zsh-defer/default.nix +++ b/pkgs/shells/zsh/zsh-defer/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { dontConfigure = true; dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/zsh-defer cp zsh-defer* $out/share/zsh-defer + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-edit/default.nix b/pkgs/shells/zsh/zsh-edit/default.nix index b1ca81e30ce85..56890f56d6eb5 100644 --- a/pkgs/shells/zsh/zsh-edit/default.nix +++ b/pkgs/shells/zsh/zsh-edit/default.nix @@ -16,11 +16,15 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + outdir=$out/share/zsh/${pname} install -D zsh-edit.plugin.zsh $outdir/zsh-edit.plugin.zsh install -D _bind $outdir/_bind install -d $outdir/functions install -D functions/{,.edit}* $outdir/functions + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-f-sy-h/default.nix b/pkgs/shells/zsh/zsh-f-sy-h/default.nix index 0e18eaa95838d..2bb2670d1690d 100644 --- a/pkgs/shells/zsh/zsh-f-sy-h/default.nix +++ b/pkgs/shells/zsh/zsh-f-sy-h/default.nix @@ -16,10 +16,14 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + plugindir="$out/share/zsh/site-functions" mkdir -p "$plugindir" cp -r -- F-Sy-H.plugin.zsh chroma functions share themes "$plugindir"/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-fast-syntax-highlighting/default.nix b/pkgs/shells/zsh/zsh-fast-syntax-highlighting/default.nix index 68f09828b4562..fe78f02aeb634 100644 --- a/pkgs/shells/zsh/zsh-fast-syntax-highlighting/default.nix +++ b/pkgs/shells/zsh/zsh-fast-syntax-highlighting/default.nix @@ -16,10 +16,14 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + plugindir="$out/share/zsh/site-functions" mkdir -p "$plugindir" cp -r -- {,_,-,.}fast-* *chroma themes "$plugindir"/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-history-search-multi-word/default.nix b/pkgs/shells/zsh/zsh-history-search-multi-word/default.nix index 30d26c9676621..04f1178861ff5 100644 --- a/pkgs/shells/zsh/zsh-history-search-multi-word/default.nix +++ b/pkgs/shells/zsh/zsh-history-search-multi-word/default.nix @@ -16,10 +16,14 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + plugindir="$out/share/zsh/${pname}" mkdir -p "$plugindir" cp -r -- history-* hsmw-* "$plugindir"/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-history-substring-search/default.nix b/pkgs/shells/zsh/zsh-history-substring-search/default.nix index 4b2aea76a7b7c..1975a2d0cbb57 100644 --- a/pkgs/shells/zsh/zsh-history-substring-search/default.nix +++ b/pkgs/shells/zsh/zsh-history-substring-search/default.nix @@ -13,8 +13,12 @@ stdenv.mkDerivation rec { strictDeps = true; installPhase = '' + runHook preInstall + install -D zsh-history-substring-search.zsh \ "$out/share/zsh-history-substring-search/zsh-history-substring-search.zsh" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-nix-shell/default.nix b/pkgs/shells/zsh/zsh-nix-shell/default.nix index ddd21683d3b13..b98e07cc1e31b 100644 --- a/pkgs/shells/zsh/zsh-nix-shell/default.nix +++ b/pkgs/shells/zsh/zsh-nix-shell/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { strictDeps = true; buildInputs = [ bash ]; installPhase = '' + runHook preInstall + install -D nix-shell.plugin.zsh --target-directory=$out/share/zsh-nix-shell install -D scripts/* --target-directory=$out/share/zsh-nix-shell/scripts + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-powerlevel10k/default.nix b/pkgs/shells/zsh/zsh-powerlevel10k/default.nix index c9f610471f575..8f8cec4e48e2b 100644 --- a/pkgs/shells/zsh/zsh-powerlevel10k/default.nix +++ b/pkgs/shells/zsh/zsh-powerlevel10k/default.nix @@ -43,11 +43,15 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -D powerlevel10k.zsh-theme --target-directory=$out/share/zsh-powerlevel10k install -D powerlevel9k.zsh-theme --target-directory=$out/share/zsh-powerlevel10k install -D config/* --target-directory=$out/share/zsh-powerlevel10k/config install -D internal/* --target-directory=$out/share/zsh-powerlevel10k/internal cp -R gitstatus $out/share/zsh-powerlevel10k/gitstatus + + runHook postInstall ''; meta = { diff --git a/pkgs/shells/zsh/zsh-prezto/default.nix b/pkgs/shells/zsh/zsh-prezto/default.nix index ff79e8ea1a761..47f6278c6d50a 100644 --- a/pkgs/shells/zsh/zsh-prezto/default.nix +++ b/pkgs/shells/zsh/zsh-prezto/default.nix @@ -21,8 +21,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/zsh-prezto cp -R ./ $out/share/zsh-prezto + + runHook postInstall ''; passthru.updateScript = unstableGitUpdater {}; diff --git a/pkgs/shells/zsh/zsh-system-clipboard/default.nix b/pkgs/shells/zsh/zsh-system-clipboard/default.nix index 10853b4dc0f1d..e06a4d1d5127d 100644 --- a/pkgs/shells/zsh/zsh-system-clipboard/default.nix +++ b/pkgs/shells/zsh/zsh-system-clipboard/default.nix @@ -13,7 +13,11 @@ stdenv.mkDerivation rec { strictDeps = true; installPhase = '' + runHook preInstall + install -D zsh-system-clipboard.zsh $out/share/zsh/${pname}/zsh-system-clipboard.zsh + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-vi-mode/default.nix b/pkgs/shells/zsh/zsh-vi-mode/default.nix index b29dc4a344d17..85cfac67501ca 100644 --- a/pkgs/shells/zsh/zsh-vi-mode/default.nix +++ b/pkgs/shells/zsh/zsh-vi-mode/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/${pname} cp *.zsh $out/share/${pname}/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-you-should-use/default.nix b/pkgs/shells/zsh/zsh-you-should-use/default.nix index 222d958be1767..8d1de83c36bbe 100644 --- a/pkgs/shells/zsh/zsh-you-should-use/default.nix +++ b/pkgs/shells/zsh/zsh-you-should-use/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -D you-should-use.plugin.zsh $out/share/zsh/plugins/you-should-use/you-should-use.plugin.zsh + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/shells/zsh/zsh-z/default.nix b/pkgs/shells/zsh/zsh-z/default.nix index a03b81cb6bfd2..510005e8f0b2b 100644 --- a/pkgs/shells/zsh/zsh-z/default.nix +++ b/pkgs/shells/zsh/zsh-z/default.nix @@ -15,8 +15,12 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/share/zsh-z cp _zshz zsh-z.plugin.zsh $out/share/zsh-z + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/test/auto-patchelf-hook/package.nix b/pkgs/test/auto-patchelf-hook/package.nix index be03ee68c0391..740e77ff8952d 100644 --- a/pkgs/test/auto-patchelf-hook/package.nix +++ b/pkgs/test/auto-patchelf-hook/package.nix @@ -43,7 +43,11 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + mv usr $out + + runHook postInstall ''; buildInputs = [ diff --git a/pkgs/test/buildFHSEnv/default.nix b/pkgs/test/buildFHSEnv/default.nix index 0a355e1aeeac4..a32de073d90c6 100644 --- a/pkgs/test/buildFHSEnv/default.nix +++ b/pkgs/test/buildFHSEnv/default.nix @@ -19,9 +19,13 @@ let dontConfigure = true; dontFixup = true; installPhase = '' + runHook preInstall + echo shared objects found are: ls -l usr/lib/*/ cp usr/lib/*/${sharedObjectName} $out + + runHook postInstall ''; }; diff --git a/pkgs/test/haskell/shellFor/default.nix b/pkgs/test/haskell/shellFor/default.nix index 82cd9e38e7315..c6331297e079c 100644 --- a/pkgs/test/haskell/shellFor/default.nix +++ b/pkgs/test/haskell/shellFor/default.nix @@ -40,7 +40,11 @@ cabal v2-build --offline --verbose constraints cereal --ghc-options="-O0 -j$NIX_BUILD_CORES" ''; installPhase = '' + runHook preInstall + touch $out + + runHook postInstall ''; }).overrideAttrs (oldAttrs: { meta = diff --git a/pkgs/test/ld-library-path/default.nix b/pkgs/test/ld-library-path/default.nix index 74c52cef25328..2a75086cbbdab 100644 --- a/pkgs/test/ld-library-path/default.nix +++ b/pkgs/test/ld-library-path/default.nix @@ -16,9 +16,13 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/lib $CC -c -fpic libgreeting.c $CC -shared libgreeting.o -o $out/lib/libgreeting.so + + runHook postInstall ''; }; @@ -51,6 +55,8 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $CC -c greeting-test.c $CC greeting-test.o -lgreeting -o $out/bin/greeting-test @@ -67,6 +73,8 @@ let # And finally, test that a library in LD_LIBRARY_PATH takes precedence over the linked-in library. [ "$(LD_LIBRARY_PATH=${libgoodbye}/lib greeting-test)" = "Goodbye, world!" ] ) + + runHook postInstall ''; }; diff --git a/pkgs/test/macos-sierra-shared/default.nix b/pkgs/test/macos-sierra-shared/default.nix index 810d5d97829ba..26b6d5635c6fa 100644 --- a/pkgs/test/macos-sierra-shared/default.nix +++ b/pkgs/test/macos-sierra-shared/default.nix @@ -19,8 +19,12 @@ let $CC -std=c99 -shared ${name}.c -o lib${name}.dylib -Wl,-install_name,$out/lib/lib${name}.dylib ''; installPhase = '' + runHook preInstall + mkdir -p "$out/lib" mv lib${name}.dylib "$out/lib" + + runHook postInstall ''; meta.platforms = lib.platforms.darwin; }) count; @@ -58,8 +62,12 @@ let ''; buildInputs = sillyLibs; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" mv ${prefix}-asdf "$out/bin" + + runHook postInstall ''; meta.platforms = lib.platforms.darwin; }; diff --git a/pkgs/test/stdenv-inputs/default.nix b/pkgs/test/stdenv-inputs/default.nix index 6a2e441d01917..c9063dd87fcd1 100644 --- a/pkgs/test/stdenv-inputs/default.nix +++ b/pkgs/test/stdenv-inputs/default.nix @@ -7,6 +7,8 @@ let dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/include $out/lib $CC -o $out/bin/foo ${./cc-main.c} chmod +x $out/bin/foo @@ -15,6 +17,8 @@ let ${lib.optionalString stdenv.isDarwin "-Wl,-install_name,$out/lib/libfoo.dylib"} \ -o $out/lib/libfoo${stdenv.hostPlatform.extensions.sharedLibrary} \ ${./foo.c} + + runHook postInstall ''; }; @@ -25,6 +29,8 @@ let dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $dev/include $dev/lib $CC -o $out/bin/bar ${./cc-main.c} chmod +x $out/bin/bar @@ -33,6 +39,8 @@ let ${lib.optionalString stdenv.isDarwin "-Wl,-install_name,$dev/lib/libbar.dylib"} \ -o $dev/lib/libbar${stdenv.hostPlatform.extensions.sharedLibrary} \ ${./bar.c} + + runHook postInstall ''; }; in diff --git a/pkgs/tools/X11/autocutsel/default.nix b/pkgs/tools/X11/autocutsel/default.nix index e1b9a3c1c73a5..9e5356f508026 100644 --- a/pkgs/tools/X11/autocutsel/default.nix +++ b/pkgs/tools/X11/autocutsel/default.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 libXaw ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp autocutsel $out/bin/ + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/X11/ckbcomp/default.nix b/pkgs/tools/X11/ckbcomp/default.nix index 6c7526db99995..27b5e33cf7026 100644 --- a/pkgs/tools/X11/ckbcomp/default.nix +++ b/pkgs/tools/X11/ckbcomp/default.nix @@ -22,8 +22,12 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -Dm0555 -t $out/bin Keyboard/ckbcomp install -Dm0444 -t $out/share/man/man1 man/ckbcomp.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/X11/devour/default.nix b/pkgs/tools/X11/devour/default.nix index 861eaf905f9d1..42adafb5a7b6c 100644 --- a/pkgs/tools/X11/devour/default.nix +++ b/pkgs/tools/X11/devour/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -Dm555 -t $out/bin devour + + runHook postInstall ''; buildInputs = [ libX11 ]; diff --git a/pkgs/tools/X11/keynav/default.nix b/pkgs/tools/X11/keynav/default.nix index 63732f478cbaa..8284c8485afe1 100644 --- a/pkgs/tools/X11/keynav/default.nix +++ b/pkgs/tools/X11/keynav/default.nix @@ -47,9 +47,13 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/keynav/doc cp keynav $out/bin cp keynavrc $out/share/keynav/doc + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/X11/nx-libs/default.nix b/pkgs/tools/X11/nx-libs/default.nix index a3afc4fa264a6..5da757aa27886 100644 --- a/pkgs/tools/X11/nx-libs/default.nix +++ b/pkgs/tools/X11/nx-libs/default.nix @@ -46,11 +46,15 @@ stdenv.mkDerivation rec { PREFIX=""; # Don't install to $out/usr/local installPhase = '' + runHook preInstall + make DESTDIR="$out" install # See: # - https://salsa.debian.org/debian-remote-team/nx-libs/blob/bcc152100617dc59156015a36603a15db530a64f/debian/rules#L66-72 # - https://github.com/ArcticaProject/nx-libs/issues/652 patchelf --remove-needed "libX11.so.6" $out/bin/nxagent + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/X11/primus/lib.nix b/pkgs/tools/X11/primus/lib.nix index 43e0a8233fd0b..d01bcd0cf8823 100644 --- a/pkgs/tools/X11/primus/lib.nix +++ b/pkgs/tools/X11/primus/lib.nix @@ -45,7 +45,11 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + ln -s $out/lib/libGL.so.1 $out/lib/libGL.so + + runHook postInstall ''; passthru.glvnd = if nvidia_x11 != null && nvidia_x11.useGLVND then nvidia_x11 else null; diff --git a/pkgs/tools/X11/run-scaled/default.nix b/pkgs/tools/X11/run-scaled/default.nix index b9cdc20f78aa5..fb4205dc1d0fd 100644 --- a/pkgs/tools/X11/run-scaled/default.nix +++ b/pkgs/tools/X11/run-scaled/default.nix @@ -14,10 +14,14 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp run_scaled $out/bin wrapProgram $out/bin/run_scaled --prefix PATH ":" \ ${lib.makeBinPath [ bc xorgserver xpra xrandr ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/X11/runningx/default.nix b/pkgs/tools/X11/runningx/default.nix index 01c3bb5e0233d..206165db24fcc 100644 --- a/pkgs/tools/X11/runningx/default.nix +++ b/pkgs/tools/X11/runningx/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p "$out"/bin cp -vai RunningX "$out/bin" + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/X11/smart-wallpaper/default.nix b/pkgs/tools/X11/smart-wallpaper/default.nix index bdcc572377d31..03f0123cc8417 100644 --- a/pkgs/tools/X11/smart-wallpaper/default.nix +++ b/pkgs/tools/X11/smart-wallpaper/default.nix @@ -23,9 +23,13 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin smart-wallpaper wrapProgram $out/bin/smart-wallpaper \ --prefix PATH : ${lib.makeBinPath [ xdpyinfo killall xwinwrap swaybg redshift ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/X11/xbindkeys-config/default.nix b/pkgs/tools/X11/xbindkeys-config/default.nix index 8a5c07ef96ecd..8492909be1f93 100644 --- a/pkgs/tools/X11/xbindkeys-config/default.nix +++ b/pkgs/tools/X11/xbindkeys-config/default.nix @@ -35,9 +35,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man/man1 gzip -c ${./xbindkeys-config.1} > $out/share/man/man1/xbindkeys-config.1.gz cp xbindkeys_config $out/bin/xbindkeys-config wrapProgram $out/bin/xbindkeys-config --prefix PATH ":" "${procps}/bin" + + runHook postInstall ''; } diff --git a/pkgs/tools/X11/xcalib/default.nix b/pkgs/tools/X11/xcalib/default.nix index cb3ac66284a16..61b2e27add8c2 100644 --- a/pkgs/tools/X11/xcalib/default.nix +++ b/pkgs/tools/X11/xcalib/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 libXxf86vm libXext libXrandr ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp xcalib $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/X11/xgeometry-select/default.nix b/pkgs/tools/X11/xgeometry-select/default.nix index 005bf302cc342..75b9a06bb4566 100644 --- a/pkgs/tools/X11/xgeometry-select/default.nix +++ b/pkgs/tools/X11/xgeometry-select/default.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv -v xgeometry-select $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/X11/xloadimage/default.nix b/pkgs/tools/X11/xloadimage/default.nix index c3ef05b0a7745..0525ec6d0c092 100644 --- a/pkgs/tools/X11/xloadimage/default.nix +++ b/pkgs/tools/X11/xloadimage/default.nix @@ -61,12 +61,16 @@ stdenv.mkDerivation rec { # NOTE: we're not installing the `uufilter` binary; if needed, the standard # `uudecode` tool should work just fine. installPhase = '' + runHook preInstall + install -Dm755 xloadimage $out/bin/xloadimage ln -sv $out/bin/{xloadimage,xsetbg} install -D -m644 xloadimagerc $out/etc/xloadimagerc.example install -D -m644 xloadimage.man $out/share/man/man1/xloadimage.1x ln -sv $out/share/man/man1/{xloadimage,xsetbg}.1x + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/X11/xwinwrap/default.nix b/pkgs/tools/X11/xwinwrap/default.nix index 8ebd071ddb42e..4e866e1836304 100644 --- a/pkgs/tools/X11/xwinwrap/default.nix +++ b/pkgs/tools/X11/xwinwrap/default.nix @@ -23,8 +23,12 @@ stdenv.mkDerivation rec { '' else throw "xwinwrap is not supported on ${stdenv.hostPlatform.system}"; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv */xwinwrap $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/admin/amazon-ec2-utils/default.nix b/pkgs/tools/admin/amazon-ec2-utils/default.nix index 5458572f311c8..b6d293ca1ddc8 100644 --- a/pkgs/tools/admin/amazon-ec2-utils/default.nix +++ b/pkgs/tools/admin/amazon-ec2-utils/default.nix @@ -33,6 +33,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin/ ebsnvme-id install -Dm755 -t $out/bin/ ec2-metadata install -Dm755 -t $out/bin/ ec2nvme-nsid @@ -45,6 +47,8 @@ stdenv.mkDerivation rec { install -Dm644 -t $out/lib/udev/rules.d/ 60-cdrom_id.rules installManPage doc/*.8 + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/admin/analog/default.nix b/pkgs/tools/admin/analog/default.nix index f63ed35379237..e4bfcd09b5af9 100644 --- a/pkgs/tools/admin/analog/default.nix +++ b/pkgs/tools/admin/analog/default.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/etc $out/share/doc/$pname $out/share/man/man1 $out/share/$pname mv analog $out/bin/ cp examples/big.cfg $out/etc/analog.cfg @@ -26,6 +28,8 @@ stdenv.mkDerivation rec { mv docs $out/share/doc/$pname/manual mv how-to $out/share/doc/$pname/ mv lang images examples $out/share/$pname/ + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/admin/bluemix-cli/default.nix b/pkgs/tools/admin/bluemix-cli/default.nix index ebfcd17064ed2..8fe398b840323 100644 --- a/pkgs/tools/admin/bluemix-cli/default.nix +++ b/pkgs/tools/admin/bluemix-cli/default.nix @@ -20,12 +20,16 @@ stdenv.mkDerivation rec { ; installPhase = '' + runHook preInstall + install -m755 -D -t $out/bin bin/ibmcloud bin/ibmcloud-analytics install -m755 -D -t $out/bin/cfcli bin/cfcli/cf ln -sv $out/bin/ibmcloud $out/bin/bx ln -sv $out/bin/ibmcloud $out/bin/bluemix install -D -t "$out/share/bash-completion/completions" bx/bash_autocomplete install -D -t "$out/share/zsh/site-functions" bx/zsh_autocomplete + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/admin/cjdns-tools/default.nix b/pkgs/tools/admin/cjdns-tools/default.nix index dc76ce190760b..43bd6a1cb0124 100644 --- a/pkgs/tools/admin/cjdns-tools/default.nix +++ b/pkgs/tools/admin/cjdns-tools/default.nix @@ -27,6 +27,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cat ${./wrapper.sh} | sed "s|@@out@@|$out|g" > $out/bin/cjdns-tools chmod +x $out/bin/cjdns-tools @@ -34,6 +36,8 @@ stdenv.mkDerivation { cp -r tools $out/tools find $out/tools -maxdepth 1 -type f -exec chmod -v a+x {} \; cp -r node_modules $out/node_modules + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/admin/daemontools/default.nix b/pkgs/tools/admin/daemontools/default.nix index 491a03bb81e2b..582a7be8b6cdf 100644 --- a/pkgs/tools/admin/daemontools/default.nix +++ b/pkgs/tools/admin/daemontools/default.nix @@ -39,6 +39,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + for cmd in $(cat package/commands); do install -Dm755 "command/$cmd" "$out/bin/$cmd" done @@ -50,6 +52,8 @@ stdenv.mkDerivation rec { sed -i "s_/command/__" "$out/bin/svscanboot" sed -i "s_/service_/var/service_g" "$out/bin/svscanboot" sed -i "s_^PATH=.*_PATH=$out/bin:\$PATH_" "$out/bin/svscanboot" + + runHook postInstall ''; # Keep README.man in the man output (see _multioutDocs()) diff --git a/pkgs/tools/admin/dehydrated/default.nix b/pkgs/tools/admin/dehydrated/default.nix index 93a4c4f740d7d..3e62a83243e14 100644 --- a/pkgs/tools/admin/dehydrated/default.nix +++ b/pkgs/tools/admin/dehydrated/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper installShellFiles ]; installPhase = '' + runHook preInstall + installManPage docs/man/dehydrated.1 mkdir -p "$out/share/docs/dehydrated" @@ -23,6 +25,8 @@ stdenv.mkDerivation rec { mkdir -p $out/bin cp -a dehydrated $out/bin wrapProgram "$out/bin/dehydrated" --prefix PATH : "${lib.makeBinPath [ openssl coreutils gnused gnugrep diffutils curl gawk hexdump ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/admin/docker-credential-helpers/default.nix b/pkgs/tools/admin/docker-credential-helpers/default.nix index f9e90afb272a4..7d19bae1920b0 100644 --- a/pkgs/tools/admin/docker-credential-helpers/default.nix +++ b/pkgs/tools/admin/docker-credential-helpers/default.nix @@ -34,7 +34,11 @@ buildGoModule rec { ''; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin bin/docker-credential-* + + runHook postInstall ''; passthru.tests.version = testers.testVersion { diff --git a/pkgs/tools/admin/google-cloud-sdk/components.nix b/pkgs/tools/admin/google-cloud-sdk/components.nix index f63b5049e2015..7b69e2fdb6b99 100644 --- a/pkgs/tools/admin/google-cloud-sdk/components.nix +++ b/pkgs/tools/admin/google-cloud-sdk/components.nix @@ -145,6 +145,8 @@ let }); dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/google-cloud-sdk/.install # If there is a source, unpack it @@ -160,6 +162,8 @@ let # Write the snapshot file to the `.install` folder cp $snapshotPath $out/google-cloud-sdk/.install/${pname}.snapshot.json + + runHook postInstall ''; nativeBuildInputs = [ python3 diff --git a/pkgs/tools/admin/nomachine-client/default.nix b/pkgs/tools/admin/nomachine-client/default.nix index 78685e067859a..da9eadf386778 100644 --- a/pkgs/tools/admin/nomachine-client/default.nix +++ b/pkgs/tools/admin/nomachine-client/default.nix @@ -40,6 +40,8 @@ in buildInputs = [ jsoncpp libpulseaudio ]; installPhase = '' + runHook preInstall + rm bin/nxplayer bin/nxrunner mkdir -p $out/NX @@ -64,6 +66,8 @@ in for i in $out/share/applications/*.desktop; do substituteInPlace "$i" --replace /usr/NX/bin $out/bin done + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/admin/pulumi-bin/default.nix b/pkgs/tools/admin/pulumi-bin/default.nix index 2515af2bacbb0..359bb5603b07f 100644 --- a/pkgs/tools/admin/pulumi-bin/default.nix +++ b/pkgs/tools/admin/pulumi-bin/default.nix @@ -13,6 +13,8 @@ in stdenv.mkDerivation { srcs = map fetchurl data.pulumiPkgs.${stdenv.hostPlatform.system}; installPhase = '' + runHook preInstall + install -D -t $out/bin/ * '' + lib.optionalString stdenv.isLinux '' wrapProgram $out/bin/pulumi --set LD_LIBRARY_PATH "${stdenv.cc.cc.lib}/lib" @@ -21,6 +23,8 @@ in stdenv.mkDerivation { --bash <($out/bin/pulumi completion bash) \ --fish <($out/bin/pulumi completion fish) \ --zsh <($out/bin/pulumi completion zsh) + + runHook postInstall ''; nativeBuildInputs = [ installShellFiles ] ++ lib.optionals stdenv.isLinux [ autoPatchelfHook makeWrapper ]; diff --git a/pkgs/tools/admin/sec/default.nix b/pkgs/tools/admin/sec/default.nix index 4a769dbf56cb5..0432ebb707e51 100644 --- a/pkgs/tools/admin/sec/default.nix +++ b/pkgs/tools/admin/sec/default.nix @@ -17,9 +17,13 @@ stdenv.mkDerivation rec { doCheck = false; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man/man1 cp sec $out/bin cp sec.man $out/share/man/man1/sec.1 + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/admin/ssl-cert-check/default.nix b/pkgs/tools/admin/ssl-cert-check/default.nix index 857fc096e06d3..7026ae755464e 100644 --- a/pkgs/tools/admin/ssl-cert-check/default.nix +++ b/pkgs/tools/admin/ssl-cert-check/default.nix @@ -43,10 +43,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp $pname $out/bin/$pname wrapProgram $out/bin/$pname \ --set PATH "${lib.makeBinPath buildInputs}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/archivers/cromfs/default.nix b/pkgs/tools/archivers/cromfs/default.nix index f3bacd2c40fa1..eb38db0e70bf4 100644 --- a/pkgs/tools/archivers/cromfs/default.nix +++ b/pkgs/tools/archivers/cromfs/default.nix @@ -12,11 +12,15 @@ stdenv.mkDerivation rec { postPatch = "patchShebangs configure"; installPhase = '' + runHook preInstall + install -d $out/bin install cromfs-driver $out/bin install util/cvcromfs $out/bin install util/mkcromfs $out/bin install util/unmkcromfs $out/bin + + runHook postInstall ''; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/tools/archivers/dumpnar/default.nix b/pkgs/tools/archivers/dumpnar/default.nix index 77ce4649b3993..4c649cc37fbb2 100644 --- a/pkgs/tools/archivers/dumpnar/default.nix +++ b/pkgs/tools/archivers/dumpnar/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp dumpnar $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/archivers/pax/default.nix b/pkgs/tools/archivers/pax/default.nix index feacf73fe87b2..32860b269d122 100644 --- a/pkgs/tools/archivers/pax/default.nix +++ b/pkgs/tools/archivers/pax/default.nix @@ -19,10 +19,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm555 pax $out/bin/pax ln -s $out/bin/pax $out/bin/paxcpio ln -s $out/bin/pax $out/bin/paxtar install -Dm444 mans/pax{,cpio,tar}.1 -t $out/share/man/man1/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/archivers/pxattr/default.nix b/pkgs/tools/archivers/pxattr/default.nix index a5a7ab40115cc..c510135563585 100644 --- a/pkgs/tools/archivers/pxattr/default.nix +++ b/pkgs/tools/archivers/pxattr/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { buildInputs = [ gcc ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp pxattr $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/archivers/torrent7z/default.nix b/pkgs/tools/archivers/torrent7z/default.nix index f18871baae93f..4b6ac8ac51ae2 100644 --- a/pkgs/tools/archivers/torrent7z/default.nix +++ b/pkgs/tools/archivers/torrent7z/default.nix @@ -37,8 +37,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ../../../../bin/t7z $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/archivers/unp/default.nix b/pkgs/tools/archivers/unp/default.nix index 247f393226d7e..d3e7a04636786 100644 --- a/pkgs/tools/archivers/unp/default.nix +++ b/pkgs/tools/archivers/unp/default.nix @@ -22,6 +22,8 @@ in stdenv.mkDerivation { dontConfigure = true; buildPhase = "true"; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/man/man1 install ./unp $out/bin/unp @@ -32,7 +34,9 @@ in stdenv.mkDerivation { --prefix PATH : ${lib.makeBinPath runtime_bins} wrapProgram $out/bin/ucat \ --prefix PATH : ${lib.makeBinPath runtime_bins} - ''; + + runHook postInstall +''; meta = with lib; { description = "Command line tool for unpacking archives easily"; diff --git a/pkgs/tools/archivers/zpaq/zpaqd.nix b/pkgs/tools/archivers/zpaq/zpaqd.nix index 07ef4db4d6b05..13e9996d6d4d7 100644 --- a/pkgs/tools/archivers/zpaq/zpaqd.nix +++ b/pkgs/tools/archivers/zpaq/zpaqd.nix @@ -24,11 +24,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,include,lib,share/doc/zpaq} cp libzpaq.so "$out/lib" cp zpaqd "$out/bin" cp libzpaq.h "$out/include" cp readme_zpaqd.txt "$out/share/doc/zpaq" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/audio/essentia-extractor/default.nix b/pkgs/tools/audio/essentia-extractor/default.nix index de3bf45d10c58..2cfb8f57f924a 100644 --- a/pkgs/tools/audio/essentia-extractor/default.nix +++ b/pkgs/tools/audio/essentia-extractor/default.nix @@ -25,8 +25,12 @@ stdenv.mkDerivation rec { unpackPhase = "unpackFile $src ; export sourceRoot=."; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp streaming_extractor_music $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/audio/headset-charge-indicator/default.nix b/pkgs/tools/audio/headset-charge-indicator/default.nix index d365b4a5c6737..d357ff8b79f56 100644 --- a/pkgs/tools/audio/headset-charge-indicator/default.nix +++ b/pkgs/tools/audio/headset-charge-indicator/default.nix @@ -24,6 +24,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp $src/headset-charge-indicator.py $out/bin/headset-charge-indicator.py chmod +x $out/bin/headset-charge-indicator.py @@ -47,6 +49,8 @@ stdenv.mkDerivation rec { mkdir -p $out/etc/xdg/autostart cp ${pname}.desktop $out/share/applications/${pname}.desktop cp ${pname}.desktop $out/etc/xdg/autostart/${pname}.desktop + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/audio/midimonster/default.nix b/pkgs/tools/audio/midimonster/default.nix index 8ff97968b0008..4c8358a6a28d7 100644 --- a/pkgs/tools/audio/midimonster/default.nix +++ b/pkgs/tools/audio/midimonster/default.nix @@ -37,6 +37,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + PREFIX=$out make install mkdir -p "$man/share/man/man1" @@ -44,6 +46,8 @@ stdenv.mkDerivation { mkdir -p "$out/share/icons/hicolor/scalable/apps" cp assets/MIDIMonster.svg "$out/share/icons/hicolor/scalable/apps/" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/audio/nanotts/default.nix b/pkgs/tools/audio/nanotts/default.nix index 41214ffe9206a..274e516225a70 100644 --- a/pkgs/tools/audio/nanotts/default.nix +++ b/pkgs/tools/audio/nanotts/default.nix @@ -21,10 +21,14 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin nanotts install -Dm644 -t $out/share/lang $src/lang/* wrapProgram $out/bin/nanotts \ --set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/audio/pulsemixer/default.nix b/pkgs/tools/audio/pulsemixer/default.nix index f38a741b66822..857b8bed7dc75 100644 --- a/pkgs/tools/audio/pulsemixer/default.nix +++ b/pkgs/tools/audio/pulsemixer/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { buildInputs = [ python3 ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin install pulsemixer $out/bin/ + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/audio/stt/default.nix b/pkgs/tools/audio/stt/default.nix index 89ed5f983973f..d00bbbf5641e9 100644 --- a/pkgs/tools/audio/stt/default.nix +++ b/pkgs/tools/audio/stt/default.nix @@ -22,11 +22,15 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + install -D stt $out/bin/stt install -D coqui-stt.h $out/include/coqui-stt.h install -D libkenlm.so $out/lib/libkenlm.so install -D libsox.so.3 $out/lib/libsox.so.3 install -D libstt.so $out/lib/libstt.so + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/audio/video2midi/default.nix b/pkgs/tools/audio/video2midi/default.nix index 1e3b85858294f..ec1bfdff6501c 100644 --- a/pkgs/tools/audio/video2midi/default.nix +++ b/pkgs/tools/audio/video2midi/default.nix @@ -22,7 +22,11 @@ in pythonPackages.buildPythonApplication rec { propagatedBuildInputs = with pythonPackages; [ opencv4_ midiutil pygame pyopengl ]; installPhase = '' + runHook preInstall + install -Dm755 v2m.py $out/bin/v2m.py + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/backup/automysqlbackup/default.nix b/pkgs/tools/backup/automysqlbackup/default.nix index ec6d0cdc4afbd..26a52e3bae3e2 100644 --- a/pkgs/tools/backup/automysqlbackup/default.nix +++ b/pkgs/tools/backup/automysqlbackup/default.nix @@ -14,12 +14,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/etc cp automysqlbackup $out/bin/ cp automysqlbackup.conf $out/etc/ wrapProgram $out/bin/automysqlbackup --prefix PATH : ${lib.makeBinPath [ mariadb mailutils pbzip2 pigz bzip2 gzip ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/backup/bakelite/default.nix b/pkgs/tools/backup/bakelite/default.nix index d9505562768a5..172bbf2056c44 100644 --- a/pkgs/tools/backup/bakelite/default.nix +++ b/pkgs/tools/backup/bakelite/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bakelite $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/backup/bdsync/default.nix b/pkgs/tools/backup/bdsync/default.nix index 55aff33b03d98..f25ebbfe1da6e 100644 --- a/pkgs/tools/backup/bdsync/default.nix +++ b/pkgs/tools/backup/bdsync/default.nix @@ -26,8 +26,12 @@ stdenv.mkDerivation rec { doCheck = true; installPhase = '' + runHook preInstall + install -Dm755 bdsync -t $out/bin/ install -Dm644 bdsync.1 -t $out/share/man/man1/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/backup/dirvish/default.nix b/pkgs/tools/backup/dirvish/default.nix index 4f99e60f4dbe0..c646595fb72f8 100644 --- a/pkgs/tools/backup/dirvish/default.nix +++ b/pkgs/tools/backup/dirvish/default.nix @@ -32,6 +32,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp --target-directory=$out/bin $executables @@ -45,6 +47,8 @@ stdenv.mkDerivation rec { exit 1 fi done + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/backup/duplicati/default.nix b/pkgs/tools/backup/duplicati/default.nix index 2cb003d2d080f..de7e4292cc08a 100644 --- a/pkgs/tools/backup/duplicati/default.nix +++ b/pkgs/tools/backup/duplicati/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/${pname}-${version}} cp -r * $out/share/${pname}-${version} makeWrapper "${mono}/bin/mono" $out/bin/duplicati-cli \ @@ -25,6 +27,8 @@ stdenv.mkDerivation rec { --add-flags "$out/share/${pname}-${version}/Duplicati.Server.exe" \ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ sqlite ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/backup/duply/default.nix b/pkgs/tools/backup/duply/default.nix index 77da73a412bb8..340df5ecb27b6 100644 --- a/pkgs/tools/backup/duply/default.nix +++ b/pkgs/tools/backup/duply/default.nix @@ -17,12 +17,16 @@ stdenv.mkDerivation rec { postPatch = "patchShebangs ."; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" mkdir -p "$out/share/man/man1" install -vD duply "$out/bin" wrapProgram "$out/bin/duply" --prefix PATH : \ ${lib.makeBinPath [ coreutils python3 duplicity gawk gnupg bash gnugrep txt2man which ]} "$out/bin/duply" txt2man > "$out/share/man/man1/duply.1" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/backup/easysnap/default.nix b/pkgs/tools/backup/easysnap/default.nix index 46952ce5327a3..2693f02d3fd68 100644 --- a/pkgs/tools/backup/easysnap/default.nix +++ b/pkgs/tools/backup/easysnap/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp easysnap* $out/bin/ @@ -19,6 +21,8 @@ stdenv.mkDerivation { substituteInPlace $i \ --replace zfs ${zfs}/bin/zfs done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/backup/flockit/default.nix b/pkgs/tools/backup/flockit/default.nix index c1df7f368043e..911cda2def526 100644 --- a/pkgs/tools/backup/flockit/default.nix +++ b/pkgs/tools/backup/flockit/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/lib $out/bin cp ./libflockit.so $out/lib @@ -21,6 +23,8 @@ stdenv.mkDerivation { EOI ) > $out/bin/flockit chmod +x $out/bin/flockit + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/backup/iceshelf/default.nix b/pkgs/tools/backup/iceshelf/default.nix index 631f82f350107..34414d007425d 100644 --- a/pkgs/tools/backup/iceshelf/default.nix +++ b/pkgs/tools/backup/iceshelf/default.nix @@ -20,10 +20,14 @@ python3.pkgs.buildPythonApplication rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/doc/${pname} $out/${python3.sitePackages} cp -v iceshelf iceshelf-restore $out/bin cp -v iceshelf.sample.conf $out/share/doc/${pname}/ cp -rv modules $out/${python3.sitePackages} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/backup/lvmsync/default.nix b/pkgs/tools/backup/lvmsync/default.nix index bbea71b7f370d..2471ed8cca0b6 100644 --- a/pkgs/tools/backup/lvmsync/default.nix +++ b/pkgs/tools/backup/lvmsync/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { gemset = ./gemset.nix; }; in '' + runHook preInstall + mkdir -p $out/bin makeWrapper ${env}/bin/lvmsync $out/bin/lvmsync + + runHook postInstall ''; passthru.updateScript = bundlerUpdateScript "lvmsync"; diff --git a/pkgs/tools/backup/store-backup/default.nix b/pkgs/tools/backup/store-backup/default.nix index 74c867e9ec5e5..46269fd4ead5e 100644 --- a/pkgs/tools/backup/store-backup/default.nix +++ b/pkgs/tools/backup/store-backup/default.nix @@ -34,6 +34,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/scripts mv * $out mv $out/_ATTENTION_ $out/doc @@ -104,6 +106,8 @@ stdenv.mkDerivation rec { backupRestore 'test 3: backup, restore' $out backupRestore 'test 4: backup diffutils to same backup locations, restore' ${diffutils} } + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/backup/zfs-prune-snapshots/default.nix b/pkgs/tools/backup/zfs-prune-snapshots/default.nix index 18ddacd4d55fd..03a582e278465 100644 --- a/pkgs/tools/backup/zfs-prune-snapshots/default.nix +++ b/pkgs/tools/backup/zfs-prune-snapshots/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { makeTargets = [ "man" ]; installPhase = '' + runHook preInstall + install -m 755 -D zfs-prune-snapshots $out/bin/zfs-prune-snapshots install -m 644 -D man/zfs-prune-snapshots.1 $out/share/man/man1/zfs-prune-snapshots.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/backup/zfsnap/default.nix b/pkgs/tools/backup/zfsnap/default.nix index 7c78fc8f17208..2133e546d3709 100644 --- a/pkgs/tools/backup/zfsnap/default.nix +++ b/pkgs/tools/backup/zfsnap/default.nix @@ -25,11 +25,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv sbin/zfsnap.sh $out/bin/zfsnap mv share $out installManPage man/*/* installShellCompletion completion/*.{bash,zsh} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/cd-dvd/bchunk/default.nix b/pkgs/tools/cd-dvd/bchunk/default.nix index 17b46536b53f1..c18fcb88f7cc2 100644 --- a/pkgs/tools/cd-dvd/bchunk/default.nix +++ b/pkgs/tools/cd-dvd/bchunk/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { makeFlags = lib.optionals stdenv.cc.isClang [ "CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc" ]; installPhase = '' + runHook preInstall + install -Dt $out/bin bchunk install -Dt $out/share/man/man1 bchunk.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/cd-dvd/cdi2iso/default.nix b/pkgs/tools/cd-dvd/cdi2iso/default.nix index c6c4c3f3ab35c..2e2bd3d866ef9 100644 --- a/pkgs/tools/cd-dvd/cdi2iso/default.nix +++ b/pkgs/tools/cd-dvd/cdi2iso/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp cdi2iso $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/cd-dvd/nrg2iso/default.nix b/pkgs/tools/cd-dvd/nrg2iso/default.nix index a196f23544bb9..a489cb2be93df 100644 --- a/pkgs/tools/cd-dvd/nrg2iso/default.nix +++ b/pkgs/tools/cd-dvd/nrg2iso/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { patches = [ ./c-compiler.patch ]; installPhase = '' + runHook preInstall + mkdir -pv $out/bin/ cp -v nrg2iso $out/bin/nrg2iso + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/cd-dvd/srt-to-vtt-cl/default.nix b/pkgs/tools/cd-dvd/srt-to-vtt-cl/default.nix index b0868c885edd6..ca0ea81921920 100644 --- a/pkgs/tools/cd-dvd/srt-to-vtt-cl/default.nix +++ b/pkgs/tools/cd-dvd/srt-to-vtt-cl/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bin/srt-vtt $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/cd-dvd/uif2iso/default.nix b/pkgs/tools/cd-dvd/uif2iso/default.nix index ae1eff26568fb..7c81c4dad5e5a 100644 --- a/pkgs/tools/cd-dvd/uif2iso/default.nix +++ b/pkgs/tools/cd-dvd/uif2iso/default.nix @@ -13,7 +13,11 @@ stdenv.mkDerivation rec { buildInputs = [zlib]; installPhase = '' + runHook preInstall + make -C . prefix="$out" install; + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/compression/bsdiff/default.nix b/pkgs/tools/compression/bsdiff/default.nix index e5be1e515b5ae..05651249964ed 100644 --- a/pkgs/tools/compression/bsdiff/default.nix +++ b/pkgs/tools/compression/bsdiff/default.nix @@ -38,6 +38,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mkdir -p $out/share/man/man1 @@ -45,6 +47,8 @@ stdenv.mkDerivation rec { cp bspatch $out/bin cp bsdiff.1 $out/share/man/man1 cp bspatch.1 $out/share/man/man1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/compression/dejsonlz4/default.nix b/pkgs/tools/compression/dejsonlz4/default.nix index 51c5d485cfa9d..2ec2d702401ed 100644 --- a/pkgs/tools/compression/dejsonlz4/default.nix +++ b/pkgs/tools/compression/dejsonlz4/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin/ cp dejsonlz4 $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/compression/gzrt/default.nix b/pkgs/tools/compression/gzrt/default.nix index d28b5af803efc..00ac1db191764 100644 --- a/pkgs/tools/compression/gzrt/default.nix +++ b/pkgs/tools/compression/gzrt/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { buildInputs = [ zlib ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp gzrecover $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/compression/hacpack/default.nix b/pkgs/tools/compression/hacpack/default.nix index 8bab34043c47c..2487c7dc8e575 100644 --- a/pkgs/tools/compression/hacpack/default.nix +++ b/pkgs/tools/compression/hacpack/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ./hacpack $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/compression/hactool/default.nix b/pkgs/tools/compression/hactool/default.nix index 9cc3a26f6f5e4..7c10e60262d32 100644 --- a/pkgs/tools/compression/hactool/default.nix +++ b/pkgs/tools/compression/hactool/default.nix @@ -21,7 +21,11 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + install -D hactool $out/bin/hactool + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/compression/imagelol/default.nix b/pkgs/tools/compression/imagelol/default.nix index 89515e31b4d2b..42f2d9cc82edd 100644 --- a/pkgs/tools/compression/imagelol/default.nix +++ b/pkgs/tools/compression/imagelol/default.nix @@ -41,8 +41,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ./ImageLOL $out/bin + + runHook postInstall ''; cmakeFlags = [ (lib.cmakeFeature "CMAKE_C_FLAGS" "-std=gnu90") ] ++ lib.optional (stdenv.isDarwin && stdenv.isAarch64) "-DPNG_ARM_NEON=off"; diff --git a/pkgs/tools/compression/kzipmix/default.nix b/pkgs/tools/compression/kzipmix/default.nix index 9da423396593b..4ca138ab70bd0 100644 --- a/pkgs/tools/compression/kzipmix/default.nix +++ b/pkgs/tools/compression/kzipmix/default.nix @@ -10,11 +10,15 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp amd64/{kzip,zipmix} $out/bin patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/bin/kzip patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/bin/zipmix + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/compression/lzbench/default.nix b/pkgs/tools/compression/lzbench/default.nix index c35f738b2bdec..32ed2b06e8fa4 100644 --- a/pkgs/tools/compression/lzbench/default.nix +++ b/pkgs/tools/compression/lzbench/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp lzbench $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/compression/lzham/default.nix b/pkgs/tools/compression/lzham/default.nix index 7d2879f63cd86..9f7063729f68a 100644 --- a/pkgs/tools/compression/lzham/default.nix +++ b/pkgs/tools/compression/lzham/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ../bin_linux/lzhamtest $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/compression/mozlz4a/default.nix b/pkgs/tools/compression/mozlz4a/default.nix index a9ab74bc7a592..7046e0f16540c 100644 --- a/pkgs/tools/compression/mozlz4a/default.nix +++ b/pkgs/tools/compression/mozlz4a/default.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation rec { buildInputs = [ python3 python3.pkgs.lz4 ]; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" "$out/${python3.sitePackages}/" cp "${src}" "$out/${python3.sitePackages}/mozlz4a.py" @@ -26,6 +28,8 @@ stdenv.mkDerivation rec { echo "export PYTHONPATH='$PYTHONPATH'" >> "$out/bin/mozlz4a" echo "'${python3}/bin/python' '$out/${python3.sitePackages}/mozlz4a.py' \"\$@\"" >> "$out/bin/mozlz4a" chmod a+x "$out/bin/mozlz4a" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/compression/nx2elf/default.nix b/pkgs/tools/compression/nx2elf/default.nix index a2597b985c081..db2f3faa0aebe 100644 --- a/pkgs/tools/compression/nx2elf/default.nix +++ b/pkgs/tools/compression/nx2elf/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -D nx2elf $out/bin/nx2elf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/compression/pbzx/default.nix b/pkgs/tools/compression/pbzx/default.nix index 44555cd6ddbc5..15c0b8da7548f 100644 --- a/pkgs/tools/compression/pbzx/default.nix +++ b/pkgs/tools/compression/pbzx/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { ${stdenv.cc.targetPrefix}cc pbzx.c -llzma -lxar -o pbzx ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp pbzx $out/bin + + runHook postInstall ''; meta = with lib; { description = "Stream parser of Apple's pbzx compression format"; diff --git a/pkgs/tools/compression/xdelta/default.nix b/pkgs/tools/compression/xdelta/default.nix index 7ce9417d40cc3..0c1d9b56f3240 100644 --- a/pkgs/tools/compression/xdelta/default.nix +++ b/pkgs/tools/compression/xdelta/default.nix @@ -43,8 +43,12 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D -m755 xdelta3 $out/bin/xdelta3 install -D -m644 xdelta3.1 $out/share/man/man1/xdelta3.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/compression/xdelta/unstable.nix b/pkgs/tools/compression/xdelta/unstable.nix index 2ac8398dbc2df..0d7f55a46e703 100644 --- a/pkgs/tools/compression/xdelta/unstable.nix +++ b/pkgs/tools/compression/xdelta/unstable.nix @@ -47,8 +47,12 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D -m755 xdelta3 $out/bin/xdelta3 install -D -m644 xdelta3.1 $out/share/man/man1/xdelta3.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/compression/zdelta/default.nix b/pkgs/tools/compression/zdelta/default.nix index b30a43f33c13a..b1f0e110bcea3 100644 --- a/pkgs/tools/compression/zdelta/default.nix +++ b/pkgs/tools/compression/zdelta/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -p zdc zdu $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/bashmount/default.nix b/pkgs/tools/filesystems/bashmount/default.nix index e1995474abc75..b8c109f355ad7 100644 --- a/pkgs/tools/filesystems/bashmount/default.nix +++ b/pkgs/tools/filesystems/bashmount/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bashmount $out/bin @@ -25,6 +27,8 @@ stdenv.mkDerivation rec { mkdir -p $out/share/doc/bashmount cp COPYING $out/share/doc/bashmount cp NEWS $out/share/doc/bashmount + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/boxfs/default.nix b/pkgs/tools/filesystems/boxfs/default.nix index 04106ee68b314..9b75de874528e 100644 --- a/pkgs/tools/filesystems/boxfs/default.nix +++ b/pkgs/tools/filesystems/boxfs/default.nix @@ -46,8 +46,12 @@ in stdenv.mkDerivation { ] ++ lib.optional stdenv.isDarwin "CFLAGS=-D_BSD_SOURCE"; installPhase = '' + runHook preInstall + mkdir -p $out/bin install boxfs boxfs-init $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/btrfs-snap/default.nix b/pkgs/tools/filesystems/btrfs-snap/default.nix index 40838c1fed62e..292af5ed52fff 100644 --- a/pkgs/tools/filesystems/btrfs-snap/default.nix +++ b/pkgs/tools/filesystems/btrfs-snap/default.nix @@ -13,6 +13,8 @@ stdenvNoCC.mkDerivation rec { dontConfigure = true; dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp btrfs-snap $out/bin/ wrapProgram $out/bin/btrfs-snap --prefix PATH : ${lib.makeBinPath [ @@ -21,6 +23,8 @@ stdenvNoCC.mkDerivation rec { gnugrep # grep util-linuxMinimal # logger, mount ]} + + runHook postInstall ''; meta = with lib; { description = "Create and maintain the history of snapshots of btrfs filesystems"; diff --git a/pkgs/tools/filesystems/ceph-csi/default.nix b/pkgs/tools/filesystems/ceph-csi/default.nix index 5d0a4c5a53a92..7adf03637761f 100644 --- a/pkgs/tools/filesystems/ceph-csi/default.nix +++ b/pkgs/tools/filesystems/ceph-csi/default.nix @@ -19,8 +19,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ./_output/* $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/dduper/default.nix b/pkgs/tools/filesystems/dduper/default.nix index c63846e2c46a2..b0a410a0fd200 100644 --- a/pkgs/tools/filesystems/dduper/default.nix +++ b/pkgs/tools/filesystems/dduper/default.nix @@ -35,8 +35,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -m755 ./dduper $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/hfsprogs/default.nix b/pkgs/tools/filesystems/hfsprogs/default.nix index 127050f025851..ebf1daac0be7f 100644 --- a/pkgs/tools/filesystems/hfsprogs/default.nix +++ b/pkgs/tools/filesystems/hfsprogs/default.nix @@ -36,6 +36,8 @@ stdenv.mkDerivation rec { # Inspired by PKGBUILD of https://www.archlinux.org/packages/community/x86_64/hfsprogs/ installPhase = '' + runHook preInstall + # Create required package directories install -m 755 -d "$out/bin" install -m 755 -d "$out/share/hfsprogs" @@ -48,6 +50,8 @@ stdenv.mkDerivation rec { # Copy man pages install -m 644 "newfs_hfs.tproj/newfs_hfs.8" "$out/share/man/man8/mkfs.hfsplus.8" install -m 644 "fsck_hfs.tproj/fsck_hfs.8" "$out/share/man/man8/fsck.hfsplus.8" + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/filesystems/httpfs/default.nix b/pkgs/tools/filesystems/httpfs/default.nix index 4cf618826b8fb..ccda5c1a6ccb4 100644 --- a/pkgs/tools/filesystems/httpfs/default.nix +++ b/pkgs/tools/filesystems/httpfs/default.nix @@ -17,12 +17,17 @@ stdenv.mkDerivation rec { ]; installPhase = - '' mkdir -p "$out/bin" + '' + runHook preInstall + + mkdir -p "$out/bin" cp -v httpfs2 "$out/bin" mkdir -p "$out/share/man/man1" cp -v *.1 "$out/share/man/man1" - ''; + + runHook postInstall +''; meta = { description = "FUSE-based HTTP filesystem for Linux"; diff --git a/pkgs/tools/filesystems/mhddfs/default.nix b/pkgs/tools/filesystems/mhddfs/default.nix index 58986c25dbf27..041cda5ab3b6c 100644 --- a/pkgs/tools/filesystems/mhddfs/default.nix +++ b/pkgs/tools/filesystems/mhddfs/default.nix @@ -22,8 +22,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp mhddfs $out/bin/ + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/filesystems/mkspiffs/default.nix b/pkgs/tools/filesystems/mkspiffs/default.nix index c2712376da6bb..b60e3d4ff4353 100644 --- a/pkgs/tools/filesystems/mkspiffs/default.nix +++ b/pkgs/tools/filesystems/mkspiffs/default.nix @@ -23,8 +23,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp mkspiffs $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/rmount/default.nix b/pkgs/tools/filesystems/rmount/default.nix index 257db9af80f68..8314e1ca3bb01 100644 --- a/pkgs/tools/filesystems/rmount/default.nix +++ b/pkgs/tools/filesystems/rmount/default.nix @@ -15,11 +15,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -D ${src}/rmount.man $out/share/man/man1/rmount.1 install -D ${src}/rmount.bash $out/bin/rmount install -D ${src}/config.json $out/share/config.json wrapProgram $out/bin/rmount --prefix PATH : ${lib.makeBinPath [ nmap jq cifs-utils sshfs ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/sdat2img/default.nix b/pkgs/tools/filesystems/sdat2img/default.nix index 93493356eb512..cb0b7376d6c0f 100644 --- a/pkgs/tools/filesystems/sdat2img/default.nix +++ b/pkgs/tools/filesystems/sdat2img/default.nix @@ -13,7 +13,11 @@ python3Packages.buildPythonApplication { format = "other"; installPhase = '' + runHook preInstall + install -D $src/sdat2img.py $out/bin/sdat2img + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/filesystems/wiimms-iso-tools/default.nix b/pkgs/tools/filesystems/wiimms-iso-tools/default.nix index 59d846324b650..c6e9f3615903c 100644 --- a/pkgs/tools/filesystems/wiimms-iso-tools/default.nix +++ b/pkgs/tools/filesystems/wiimms-iso-tools/default.nix @@ -33,9 +33,13 @@ stdenv.mkDerivation rec { INSTALL_PATH = "$out"; installPhase = '' + runHook preInstall + mkdir "$out" patchShebangs install.sh ./install.sh --no-sudo + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/zerofree/default.nix b/pkgs/tools/filesystems/zerofree/default.nix index 77099a01e44f6..e2f3490b806c9 100644 --- a/pkgs/tools/filesystems/zerofree/default.nix +++ b/pkgs/tools/filesystems/zerofree/default.nix @@ -17,10 +17,14 @@ in stdenv.mkDerivation rec { buildInputs = [ e2fsprogs installShellFiles ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/zerofree cp zerofree $out/bin cp COPYING $out/share/zerofree/COPYING installManPage ${manpage} + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/filesystems/zfstools/default.nix b/pkgs/tools/filesystems/zfstools/default.nix index 0a4447bacc4f3..80ebf9643d429 100644 --- a/pkgs/tools/filesystems/zfstools/default.nix +++ b/pkgs/tools/filesystems/zfstools/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bin/* $out/bin/ @@ -25,6 +27,8 @@ stdenv.mkDerivation rec { --set RUBYLIB $out/lib \ --prefix PATH : ${zfs}/bin done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/zkfuse/default.nix b/pkgs/tools/filesystems/zkfuse/default.nix index 00d78af0146fd..819be759e6e00 100644 --- a/pkgs/tools/filesystems/zkfuse/default.nix +++ b/pkgs/tools/filesystems/zkfuse/default.nix @@ -29,8 +29,12 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = toString [ "-std=c++14" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -v src/zkfuse $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/filesystems/zpool-iostat-viz/default.nix b/pkgs/tools/filesystems/zpool-iostat-viz/default.nix index 4f546e544e66c..0ef0edf3bfe7e 100644 --- a/pkgs/tools/filesystems/zpool-iostat-viz/default.nix +++ b/pkgs/tools/filesystems/zpool-iostat-viz/default.nix @@ -27,9 +27,13 @@ python3Packages.buildPythonApplication rec { doCheck = false; installPhase = '' + runHook preInstall + wrapPythonPrograms install -D zpool-iostat-viz $out/bin/zpool-iostat-viz installManPage zpool-iostat-viz.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/games/er-patcher/default.nix b/pkgs/tools/games/er-patcher/default.nix index 79ba027d4c96a..2d663c82ee2be 100644 --- a/pkgs/tools/games/er-patcher/default.nix +++ b/pkgs/tools/games/er-patcher/default.nix @@ -20,9 +20,13 @@ stdenvNoCC.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -Dm755 $src/er-patcher $out/bin/er-patcher patchShebangs $out/bin/er-patcher + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/games/minecraft/amidst/default.nix b/pkgs/tools/games/minecraft/amidst/default.nix index 7661e04430feb..3817048d9e5bf 100644 --- a/pkgs/tools/games/minecraft/amidst/default.nix +++ b/pkgs/tools/games/minecraft/amidst/default.nix @@ -18,10 +18,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ jre makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib/amidst} cp $src $out/lib/amidst/amidst.jar makeWrapper ${jre}/bin/java $out/bin/amidst \ --add-flags "-jar $out/lib/amidst/amidst.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/games/minecraft/fabric-installer/default.nix b/pkgs/tools/games/minecraft/fabric-installer/default.nix index 5667a55fd609e..4666766c2944a 100644 --- a/pkgs/tools/games/minecraft/fabric-installer/default.nix +++ b/pkgs/tools/games/minecraft/fabric-installer/default.nix @@ -18,11 +18,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ jre makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,lib/fabric} cp $src $out/lib/fabric/fabric-installer.jar makeWrapper ${jre}/bin/java $out/bin/fabric-installer \ --add-flags "-jar $out/lib/fabric/fabric-installer.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/games/ps3iso-utils/default.nix b/pkgs/tools/games/ps3iso-utils/default.nix index 63093b59b2cc8..e7c77483675ca 100644 --- a/pkgs/tools/games/ps3iso-utils/default.nix +++ b/pkgs/tools/games/ps3iso-utils/default.nix @@ -21,8 +21,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bin/* $out/bin + + runHook postInstall ''; passthru.updateScript = unstableGitUpdater { }; diff --git a/pkgs/tools/graphics/amber/default.nix b/pkgs/tools/graphics/amber/default.nix index 9c9a43a49be40..6521f19f67d53 100644 --- a/pkgs/tools/graphics/amber/default.nix +++ b/pkgs/tools/graphics/amber/default.nix @@ -87,9 +87,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin amber image_diff wrapProgram $out/bin/amber \ --suffix VK_LAYER_PATH : ${vulkan-validation-layers}/share/vulkan/explicit_layer.d + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/briss/default.nix b/pkgs/tools/graphics/briss/default.nix index 801b8f5a4862c..f3cb3f81eb187 100644 --- a/pkgs/tools/graphics/briss/default.nix +++ b/pkgs/tools/graphics/briss/default.nix @@ -13,10 +13,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [makeWrapper]; installPhase = '' + runHook preInstall + mkdir -p "$out/bin"; mkdir -p "$out/share"; install -D -m444 -t "$out/share" *.jar makeWrapper "${jre}/bin/java" "$out/bin/briss" --add-flags "-Xms128m -Xmx1024m -cp \"$out/share/\" -jar \"$out/share/briss-${version}.jar\"" + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/graphics/convchain/default.nix b/pkgs/tools/graphics/convchain/default.nix index 20f29b2a0ad5b..ada5b57114e3b 100644 --- a/pkgs/tools/graphics/convchain/default.nix +++ b/pkgs/tools/graphics/convchain/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { grep -m1 -B999 '^[*][/]' ConvChainFast.cs > COPYING.MIT ''; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,share/doc/convchain,share/convchain} cp README.md COPYING.MIT "$out"/share/doc/convchain cp convchain*.exe "$out"/bin @@ -28,6 +30,8 @@ stdenv.mkDerivation rec { echo "chmod u+w ." >> "$out/bin/convchainfast" echo "'${mono}/bin/mono' '$out/bin/convchainfast.exe' \"\$@\"" >> "$out/bin/convchainfast" chmod a+x "$out/bin/convchainfast" + + runHook postInstall ''; buildInputs = [mono]; meta = { diff --git a/pkgs/tools/graphics/directx-shader-compiler/default.nix b/pkgs/tools/graphics/directx-shader-compiler/default.nix index 11deeca44d06e..ac533d931ed45 100644 --- a/pkgs/tools/graphics/directx-shader-compiler/default.nix +++ b/pkgs/tools/graphics/directx-shader-compiler/default.nix @@ -44,10 +44,12 @@ stdenv.mkDerivation (finalAttrs: { # https://github.com/microsoft/DirectXShaderCompiler/blob/master/appveyor.yml#L63-L66 installPhase = '' runHook preInstall + mkdir -p $out/bin $out/lib $dev/include mv bin/dxc* $out/bin/ mv lib/libdxcompiler.so* lib/libdxcompiler.*dylib $out/lib/ cp -r $src/include/dxc $dev/include/ + runHook postInstall ''; diff --git a/pkgs/tools/graphics/ditaa/default.nix b/pkgs/tools/graphics/ditaa/default.nix index c6823fbed3696..debd08d610642 100644 --- a/pkgs/tools/graphics/ditaa/default.nix +++ b/pkgs/tools/graphics/ditaa/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib cp ${src} "$out/lib/ditaa.jar" @@ -22,6 +24,8 @@ stdenv.mkDerivation rec { EOF chmod a+x "$out/bin/ditaa" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/epstool/default.nix b/pkgs/tools/graphics/epstool/default.nix index fadc5e62e2481..0bc28c4fc9a0f 100644 --- a/pkgs/tools/graphics/epstool/default.nix +++ b/pkgs/tools/graphics/epstool/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + make EPSTOOL_ROOT=$out install + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/esshader/default.nix b/pkgs/tools/graphics/esshader/default.nix index 38bd4d1b7f0ad..7b949d3e241f4 100644 --- a/pkgs/tools/graphics/esshader/default.nix +++ b/pkgs/tools/graphics/esshader/default.nix @@ -24,8 +24,12 @@ stdenv.mkDerivation { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a esshader $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/facedetect/default.nix b/pkgs/tools/graphics/facedetect/default.nix index 623f9e249ff8b..8c64d37fe77be 100644 --- a/pkgs/tools/graphics/facedetect/default.nix +++ b/pkgs/tools/graphics/facedetect/default.nix @@ -30,9 +30,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -v -m644 -D README.rst $out/share/doc/${pname}-${version}/README.rst install -v -m755 -D facedetect $out/bin/facedetect wrapPythonPrograms + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/fgallery/default.nix b/pkgs/tools/graphics/fgallery/default.nix index 8e2e636d90f7e..133b5b39a30b4 100644 --- a/pkgs/tools/graphics/fgallery/default.nix +++ b/pkgs/tools/graphics/fgallery/default.nix @@ -26,6 +26,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" mkdir -p "$out/share/fgallery" @@ -41,6 +43,8 @@ stdenv.mkDerivation rec { --set PERL5LIB "$PERL5LIB" \ --set PATH "${lib.makeBinPath [ coreutils zip imagemagick pngcrush lcms2 facedetect fbida ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/ibniz/default.nix b/pkgs/tools/graphics/ibniz/default.nix index 04aadf911e1e1..e3ac394645965 100644 --- a/pkgs/tools/graphics/ibniz/default.nix +++ b/pkgs/tools/graphics/ibniz/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { buildInputs = [ SDL ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ibniz $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/imgur-screenshot/default.nix b/pkgs/tools/graphics/imgur-screenshot/default.nix index a557657143f9c..0dba9664e26f6 100644 --- a/pkgs/tools/graphics/imgur-screenshot/default.nix +++ b/pkgs/tools/graphics/imgur-screenshot/default.nix @@ -15,8 +15,12 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm755 imgur-screenshot $out/bin/imgur-screenshot wrapProgram $out/bin/imgur-screenshot --prefix PATH ':' ${deps} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/imgurbash2/default.nix b/pkgs/tools/graphics/imgurbash2/default.nix index aff33f6d7dc80..518a243e0d610 100644 --- a/pkgs/tools/graphics/imgurbash2/default.nix +++ b/pkgs/tools/graphics/imgurbash2/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cat <$out/bin/imgurbash2 #!${bash}/bin/bash @@ -19,6 +21,8 @@ stdenv.mkDerivation rec { EOF cat imgurbash2 >> $out/bin/imgurbash2 chmod +x $out/bin/imgurbash2 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/jhead/default.nix b/pkgs/tools/graphics/jhead/default.nix index 391780a4df350..42e15e664b5c3 100644 --- a/pkgs/tools/graphics/jhead/default.nix +++ b/pkgs/tools/graphics/jhead/default.nix @@ -29,6 +29,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p \ $out/bin \ $out/man/man1 \ @@ -37,6 +39,8 @@ stdenv.mkDerivation rec { cp -v jhead $out/bin cp -v jhead.1 $out/man/man1 cp -v *.txt $out/share/doc/${pname}-${version} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/jpegexiforient/default.nix b/pkgs/tools/graphics/jpegexiforient/default.nix index f2f107d9b0d30..031fa9d72b476 100644 --- a/pkgs/tools/graphics/jpegexiforient/default.nix +++ b/pkgs/tools/graphics/jpegexiforient/default.nix @@ -13,7 +13,11 @@ stdenv.mkDerivation { $CC -o jpegexiforient jpegexiforient.c ''; installPhase = '' + runHook preInstall + install -Dt $out/bin jpegexiforient + + runHook postInstall ''; meta = with lib; { description = "Utility program to get and set the Exif Orientation Tag"; diff --git a/pkgs/tools/graphics/metapixel/default.nix b/pkgs/tools/graphics/metapixel/default.nix index 8c9fef0cd484d..57a41ddb6ce5e 100644 --- a/pkgs/tools/graphics/metapixel/default.nix +++ b/pkgs/tools/graphics/metapixel/default.nix @@ -18,10 +18,14 @@ stdenv.mkDerivation rec { buildInputs = [ libpng libjpeg giflib perl ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp metapixel $out/bin/metapixel cp metapixel-prepare $out/bin/metapixel-prepare cp metapixel-sizesort $out/bin/metapixel-sizesort + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/pdftoipe/default.nix b/pkgs/tools/graphics/pdftoipe/default.nix index 62734d4e610c5..20c5d134ef493 100644 --- a/pkgs/tools/graphics/pdftoipe/default.nix +++ b/pkgs/tools/graphics/pdftoipe/default.nix @@ -41,7 +41,11 @@ stdenv.mkDerivation rec { buildInputs = [ poppler ]; installPhase = '' + runHook preInstall + install -D pdftoipe $out/bin/pdftoipe + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/pngout/default.nix b/pkgs/tools/graphics/pngout/default.nix index 41724043930c7..2c101af08ec3f 100644 --- a/pkgs/tools/graphics/pngout/default.nix +++ b/pkgs/tools/graphics/pngout/default.nix @@ -33,10 +33,14 @@ stdenv.mkDerivation rec { dontFixup = stdenv.isDarwin; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${platform.folder}/pngout $out/bin '' + lib.optionalString stdenv.isLinux '' patchelf --set-interpreter ${stdenv.cc.libc}/lib/${platform.ld-linux} $out/bin/pngout + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/graphics/realesrgan-ncnn-vulkan/default.nix b/pkgs/tools/graphics/realesrgan-ncnn-vulkan/default.nix index 59c2753011d31..635b81b44ded3 100644 --- a/pkgs/tools/graphics/realesrgan-ncnn-vulkan/default.nix +++ b/pkgs/tools/graphics/realesrgan-ncnn-vulkan/default.nix @@ -49,10 +49,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share cp realesrgan-ncnn-vulkan $out/bin/ cp -r ${models}/models $out/share + + runHook postInstall ''; postFixup = lib.optionalString stdenv.isLinux '' diff --git a/pkgs/tools/graphics/rocket/default.nix b/pkgs/tools/graphics/rocket/default.nix index 28f0efae7e9a3..cd78301945fad 100644 --- a/pkgs/tools/graphics/rocket/default.nix +++ b/pkgs/tools/graphics/rocket/default.nix @@ -17,8 +17,12 @@ mkDerivation { dontConfigure = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r editor/editor $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/syntex/default.nix b/pkgs/tools/graphics/syntex/default.nix index b149333f2eac6..7242a10942c6c 100644 --- a/pkgs/tools/graphics/syntex/default.nix +++ b/pkgs/tools/graphics/syntex/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { grep -m1 -B999 '^[*][/]' SynTex.cs > COPYING.MIT ''; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,share/doc/syntex,share/syntex} cp README.md COPYING.MIT "$out"/share/doc/syntex cp syntex.exe "$out"/bin @@ -22,6 +24,8 @@ stdenv.mkDerivation rec { echo "chmod u+w ." >> "$out/bin/syntex" echo "'${mono}/bin/mono' '$out/bin/syntex.exe' \"\$@\"" >> "$out/bin/syntex" chmod a+x "$out/bin/syntex" + + runHook postInstall ''; buildInputs = [mono]; meta = { diff --git a/pkgs/tools/graphics/twilight/default.nix b/pkgs/tools/graphics/twilight/default.nix index bd900d455d6d3..9c8026a47c98d 100644 --- a/pkgs/tools/graphics/twilight/default.nix +++ b/pkgs/tools/graphics/twilight/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation rec { buildInputs = [ libGL libGLU libglut libX11 ]; installPhase = '' + runHook preInstall + install -Dm755 twilight $out/bin/twilight + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/wavefunctioncollapse/default.nix b/pkgs/tools/graphics/wavefunctioncollapse/default.nix index 0aabe83542706..6728a14a49430 100644 --- a/pkgs/tools/graphics/wavefunctioncollapse/default.nix +++ b/pkgs/tools/graphics/wavefunctioncollapse/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { grep -m1 -B999 '^[*][/]' Main.cs > COPYING.MIT ''; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,share/doc/wavefunctioncollapse,share/wavefunctioncollapse} cp README.md COPYING.MIT "$out"/share/doc/wavefunctioncollapse cp wavefunctioncollapse.exe "$out"/bin @@ -22,6 +24,8 @@ stdenv.mkDerivation rec { echo "chmod u+w ." >> "$out/bin/wavefunctioncollapse" echo "'${mono}/bin/mono' '$out/bin/wavefunctioncollapse.exe' \"\$@\"" >> "$out/bin/wavefunctioncollapse" chmod a+x "$out/bin/wavefunctioncollapse" + + runHook postInstall ''; buildInputs = [mono]; meta = { diff --git a/pkgs/tools/graphics/welkin/default.nix b/pkgs/tools/graphics/welkin/default.nix index a35d4c48ee37a..6eafb486e32b5 100644 --- a/pkgs/tools/graphics/welkin/default.nix +++ b/pkgs/tools/graphics/welkin/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { buildInputs = [ jre ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share} cp -R . $out/share cp $out/share/welkin.sh $out/bin/welkin @@ -23,6 +25,8 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/welkin \ --set JAVA_HOME ${jre} chmod a+x $out/bin/welkin + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/graphics/yaxg/default.nix b/pkgs/tools/graphics/yaxg/default.nix index dd428ae0c427f..fdc3c28d47dac 100644 --- a/pkgs/tools/graphics/yaxg/default.nix +++ b/pkgs/tools/graphics/yaxg/default.nix @@ -16,10 +16,14 @@ stdenv.mkDerivation rec { buildInputs = [ maim slop ffmpeg byzanz libnotify xdpyinfo ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin/ mv yaxg $out/bin/ chmod +x $out/bin/yaxg wrapProgram $out/bin/yaxg --prefix PATH : ${ lib.makeBinPath [ maim slop ffmpeg byzanz libnotify xdpyinfo ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/graphics/zxing/default.nix b/pkgs/tools/graphics/zxing/default.nix index 175b15b22aecb..2e4b4804172a3 100644 --- a/pkgs/tools/graphics/zxing/default.nix +++ b/pkgs/tools/graphics/zxing/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { inherit jre; dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p "$out/lib/java" "$out/bin" cp "${core_jar}" "${javase_jar}" "$out/lib/java" substituteAll "${./java-zxing.sh}" "$out/bin/java-zxing" @@ -22,6 +24,8 @@ stdenv.mkDerivation rec { substituteAll "${./zxing.sh}" "$out/bin/zxing" chmod a+x "$out/bin"/* cd "$out/lib/java"; for i in *.jar; do mv "$i" "''${i#*-}"; done + + runHook postInstall ''; meta = { description = "1D and 2D code reading library"; diff --git a/pkgs/tools/inputmethods/keyd/default.nix b/pkgs/tools/inputmethods/keyd/default.nix index d74cc15254990..73aa483678015 100644 --- a/pkgs/tools/inputmethods/keyd/default.nix +++ b/pkgs/tools/inputmethods/keyd/default.nix @@ -34,7 +34,11 @@ let dontBuild = true; installPhase = '' + runHook preInstall + install -Dm555 -t $out/bin scripts/${pname} + + runHook postInstall ''; meta.mainProgram = "keyd-application-mapper"; diff --git a/pkgs/tools/inputmethods/netevent/default.nix b/pkgs/tools/inputmethods/netevent/default.nix index 9d09d9ed2bf29..8402d1900b189 100644 --- a/pkgs/tools/inputmethods/netevent/default.nix +++ b/pkgs/tools/inputmethods/netevent/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -m 0755 netevent $out/bin/ @@ -29,6 +31,8 @@ stdenv.mkDerivation { mkdir -p $doc/share/doc/netevent cp doc/netevent.rst $doc/share/doc/netevent/netevent.rst + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/inputmethods/skk/skk-dicts/default.nix b/pkgs/tools/inputmethods/skk/skk-dicts/default.nix index 7b224cb7d2855..4b5e996ec4303 100644 --- a/pkgs/tools/inputmethods/skk/skk-dicts/default.nix +++ b/pkgs/tools/inputmethods/skk/skk-dicts/default.nix @@ -38,6 +38,8 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + function dictname() { src=$1 name=$(basename $src) # remove dir name @@ -59,6 +61,8 @@ stdenv.mkDerivation { $out/share/$(dictname ${large}) + \ $out/share/$(dictname ${edict}) + \ $out/share/$(dictname ${assoc}) >> $dst + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/tools/misc/asdf-vm/default.nix b/pkgs/tools/misc/asdf-vm/default.nix index c9b7f27c42b0b..84ef8b55751c8 100644 --- a/pkgs/tools/misc/asdf-vm/default.nix +++ b/pkgs/tools/misc/asdf-vm/default.nix @@ -58,6 +58,8 @@ in stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/share/asdf-vm cp -r . $out/share/asdf-vm @@ -73,6 +75,8 @@ in stdenv.mkDerivation rec { --zsh completions/_asdf \ --fish completions/asdf.fish \ --bash completions/asdf.bash + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/autojump/default.nix b/pkgs/tools/misc/autojump/default.nix index 8305c82937ebd..cf97e86f44fad 100644 --- a/pkgs/tools/misc/autojump/default.nix +++ b/pkgs/tools/misc/autojump/default.nix @@ -17,12 +17,16 @@ stdenv.mkDerivation rec { strictDeps = true; installPhase = '' + runHook preInstall + python ./install.py -d "$out" -p "" -z "$out/share/zsh/site-functions/" chmod +x "$out/etc/profile.d/autojump.sh" install -Dt "$out/share/bash-completion/completions/" -m444 "$out/share/autojump/autojump.bash" install -Dt "$out/share/fish/vendor_conf.d/" -m444 "$out/share/autojump/autojump.fish" install -Dt "$out/share/zsh/site-functions/" -m444 "$out/share/autojump/autojump.zsh" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/aws-mturk-clt/default.nix b/pkgs/tools/misc/aws-mturk-clt/default.nix index 9b03e2dd1bdbd..61928797f9652 100644 --- a/pkgs/tools/misc/aws-mturk-clt/default.nix +++ b/pkgs/tools/misc/aws-mturk-clt/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + mkdir -p $out cp -prvd bin $out/ @@ -20,6 +22,8 @@ stdenv.mkDerivation rec { mkdir -p $out/lib cp -prvd lib/* $out/lib/ + + runHook postInstall ''; # */ meta = { diff --git a/pkgs/tools/misc/bandwidth/default.nix b/pkgs/tools/misc/bandwidth/default.nix index 9a34442b22101..eb093dfa7e2cf 100644 --- a/pkgs/tools/misc/bandwidth/default.nix +++ b/pkgs/tools/misc/bandwidth/default.nix @@ -43,8 +43,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${arch} $out/bin/bandwidth + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/bash_unit/default.nix b/pkgs/tools/misc/bash_unit/default.nix index ebf7d6916b32d..20fbb9451149a 100644 --- a/pkgs/tools/misc/bash_unit/default.nix +++ b/pkgs/tools/misc/bash_unit/default.nix @@ -38,8 +38,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp bash_unit $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/bashcards/default.nix b/pkgs/tools/misc/bashcards/default.nix index bce5ab40e2dd6..bec16aa47d40b 100644 --- a/pkgs/tools/misc/bashcards/default.nix +++ b/pkgs/tools/misc/bashcards/default.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man/man8 cp bashcards.8 $out/share/man/man8/ cp bashcards $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/bfscripts/default.nix b/pkgs/tools/misc/bfscripts/default.nix index 537cab8697a39..8d5f980e7904f 100644 --- a/pkgs/tools/misc/bfscripts/default.nix +++ b/pkgs/tools/misc/bfscripts/default.nix @@ -49,7 +49,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + ${lib.concatStringsSep "\n" (map (b: "install -D ${b} $out/bin/${b}") binaries)} + + runHook postInstall ''; meta = with lib; diff --git a/pkgs/tools/misc/birdfont/default.nix b/pkgs/tools/misc/birdfont/default.nix index 731eeb0513358..c596dbc345445 100644 --- a/pkgs/tools/misc/birdfont/default.nix +++ b/pkgs/tools/misc/birdfont/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { buildPhase = "./build.py"; - installPhase = "./install.py"; + installPhase = "runHook preInstall; ./install.py; runHook postInstall"; meta = with lib; { description = "Font editor which can generate fonts in TTF, EOT, SVG and BIRDFONT format"; diff --git a/pkgs/tools/misc/birdfont/xmlbird.nix b/pkgs/tools/misc/birdfont/xmlbird.nix index 2fbdbcf777a5b..881b3d26d58de 100644 --- a/pkgs/tools/misc/birdfont/xmlbird.nix +++ b/pkgs/tools/misc/birdfont/xmlbird.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { buildPhase = "./build.py"; - installPhase = "./install.py"; + installPhase = "runHook preInstall; ./install.py; runHook postInstall"; meta = with lib; { description = "XML parser for Vala and C programs"; diff --git a/pkgs/tools/misc/capture/default.nix b/pkgs/tools/misc/capture/default.nix index 9eac4dd0bbc55..20c94e6482f16 100644 --- a/pkgs/tools/misc/capture/default.nix +++ b/pkgs/tools/misc/capture/default.nix @@ -14,11 +14,15 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm755 src/capture.sh $out/bin/capture patchShebangs $out/bin/capture wrapProgram $out/bin/capture \ --prefix PATH : '${lib.makeBinPath [ slop ffmpeg ]}' + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/chelf/default.nix b/pkgs/tools/misc/chelf/default.nix index 7dd84eba1e441..89263ff1fff1b 100644 --- a/pkgs/tools/misc/chelf/default.nix +++ b/pkgs/tools/misc/chelf/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv chelf $out/bin/chelf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/chrome-export/default.nix b/pkgs/tools/misc/chrome-export/default.nix index d3f4878ee6918..184f7ba5be975 100644 --- a/pkgs/tools/misc/chrome-export/default.nix +++ b/pkgs/tools/misc/chrome-export/default.nix @@ -17,10 +17,14 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp export-chrome-bookmarks export-chrome-history $out/bin mkdir -p $out/share/man/man1 cp man_pages/*.1 $out/share/man/man1 + + runHook postInstall ''; doInstallCheck = true; installCheckPhase = '' diff --git a/pkgs/tools/misc/cht.sh/default.nix b/pkgs/tools/misc/cht.sh/default.nix index f61defdbdedae..73e43a58ff9a6 100644 --- a/pkgs/tools/misc/cht.sh/default.nix +++ b/pkgs/tools/misc/cht.sh/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation { postPatch = "substituteInPlace share/cht.sh.txt --replace '\${0##*/}' cht.sh"; installPhase = '' + runHook preInstall + install -m755 -D share/cht.sh.txt "$out/bin/cht.sh" # install shell completion files @@ -34,6 +36,8 @@ stdenv.mkDerivation { wrapProgram "$out/bin/cht.sh" \ --prefix PATH : "${lib.makeBinPath [ curl rlwrap ncurses xsel ]}" + + runHook postInstall ''; passthru.updateScript = unstableGitUpdater { diff --git a/pkgs/tools/misc/clipnotify/default.nix b/pkgs/tools/misc/clipnotify/default.nix index 8f94f974b058d..4360ddb6b401a 100644 --- a/pkgs/tools/misc/clipnotify/default.nix +++ b/pkgs/tools/misc/clipnotify/default.nix @@ -13,8 +13,12 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 libXfixes ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp clipnotify $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/clipster/default.nix b/pkgs/tools/misc/clipster/default.nix index 5c9c2cd1054ca..b5a4959f1160a 100644 --- a/pkgs/tools/misc/clipster/default.nix +++ b/pkgs/tools/misc/clipster/default.nix @@ -18,9 +18,13 @@ stdenv.mkDerivation rec { buildInputs = [ pythonEnv gtk3 libwnck wrapGAppsHook3 ]; installPhase = '' + runHook preInstall + sed -i 's/python/python3/g' clipster mkdir -p $out/bin/ cp clipster $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/colorpicker/default.nix b/pkgs/tools/misc/colorpicker/default.nix index 8b45da17626c1..57b5ba9d08c79 100644 --- a/pkgs/tools/misc/colorpicker/default.nix +++ b/pkgs/tools/misc/colorpicker/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation rec { buildInputs = [ gtk2 ]; installPhase = '' + runHook preInstall + install -Dt $out/bin colorpicker + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/contacts/default.nix b/pkgs/tools/misc/contacts/default.nix index 1c789ca1d11db..ca67cf928e817 100644 --- a/pkgs/tools/misc/contacts/default.nix +++ b/pkgs/tools/misc/contacts/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation { buildInputs = [ Foundation AddressBook ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp Products/Default/contacts $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/convbin/default.nix b/pkgs/tools/misc/convbin/default.nix index 96164902dc2c5..b46bed404f7e4 100644 --- a/pkgs/tools/misc/convbin/default.nix +++ b/pkgs/tools/misc/convbin/default.nix @@ -29,7 +29,11 @@ stdenv.mkDerivation rec { doCheck = true; installPhase = '' + runHook preInstall + install -Dm755 bin/convbin $out/bin/convbin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/convfont/default.nix b/pkgs/tools/misc/convfont/default.nix index d58f7ecc2bea4..1256a443153e1 100644 --- a/pkgs/tools/misc/convfont/default.nix +++ b/pkgs/tools/misc/convfont/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation rec { makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; installPhase = '' + runHook preInstall + install -Dm755 convfont $out/bin/convfont + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/convimg/default.nix b/pkgs/tools/misc/convimg/default.nix index e10c2102fec51..cabca4f26740e 100644 --- a/pkgs/tools/misc/convimg/default.nix +++ b/pkgs/tools/misc/convimg/default.nix @@ -26,7 +26,11 @@ stdenv.mkDerivation rec { doCheck = true; installPhase = '' + runHook preInstall + install -Dm755 bin/convimg $out/bin/convimg + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/cp437/default.nix b/pkgs/tools/misc/cp437/default.nix index cb4b1b8508cb9..5b43475fab14f 100644 --- a/pkgs/tools/misc/cp437/default.nix +++ b/pkgs/tools/misc/cp437/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -Dm755 cp437 -t $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/cpulimit/default.nix b/pkgs/tools/misc/cpulimit/default.nix index 4788bc57befe3..99d047aee2943 100644 --- a/pkgs/tools/misc/cpulimit/default.nix +++ b/pkgs/tools/misc/cpulimit/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + mkdir -p $out/bin cp src/cpulimit $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/csv2latex/default.nix b/pkgs/tools/misc/csv2latex/default.nix index acfe07f262284..46f837d14737a 100644 --- a/pkgs/tools/misc/csv2latex/default.nix +++ b/pkgs/tools/misc/csv2latex/default.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin make PREFIX=$out install - ''; + + runHook postInstall +''; meta = with lib; { description = "Command-line CSV to LaTeX file converter"; diff --git a/pkgs/tools/misc/cyberchef/default.nix b/pkgs/tools/misc/cyberchef/default.nix index 11fc25bd9d17f..b613e9284645a 100644 --- a/pkgs/tools/misc/cyberchef/default.nix +++ b/pkgs/tools/misc/cyberchef/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p "$out/share/cyberchef" mv "CyberChef_v${version}.html" index.html mv * "$out/share/cyberchef" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/dbus-map/default.nix b/pkgs/tools/misc/dbus-map/default.nix index de5c07041fdb4..c438050f43960 100644 --- a/pkgs/tools/misc/dbus-map/default.nix +++ b/pkgs/tools/misc/dbus-map/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation { glib procps libxml2 ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv dbus-map $out/bin + + runHook postInstall ''; meta = with lib; { description = "Simple utility for enumerating D-Bus endpoints, an nmap for D-Bus"; diff --git a/pkgs/tools/misc/discocss/default.nix b/pkgs/tools/misc/discocss/default.nix index 102b75aee71f3..3c2290b3adafe 100644 --- a/pkgs/tools/misc/discocss/default.nix +++ b/pkgs/tools/misc/discocss/default.nix @@ -22,6 +22,8 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm755 discocss $out/bin/discocss '' + lib.optionalString discordAlias '' wrapProgram $out/bin/discocss --set DISCOCSS_DISCORD_BIN ${discord}/bin/Discord @@ -29,6 +31,8 @@ stdenvNoCC.mkDerivation rec { ln -s $out/bin/discocss $out/bin/discord mkdir -p $out/share ln -s ${discord}/share/* $out/share + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/dmg2img/default.nix b/pkgs/tools/misc/dmg2img/default.nix index 8b1e997ff7367..4c02bd9b5f98f 100644 --- a/pkgs/tools/misc/dmg2img/default.nix +++ b/pkgs/tools/misc/dmg2img/default.nix @@ -21,8 +21,12 @@ stdenv.mkDerivation rec { patchFlags = [ "-p0" ]; installPhase = '' + runHook preInstall + install -D dmg2img $out/bin/dmg2img install -D vfdecrypt $out/bin/vfdecrypt + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/misc/dtach/default.nix b/pkgs/tools/misc/dtach/default.nix index 4629715d434da..e4f2e8df861fd 100644 --- a/pkgs/tools/misc/dtach/default.nix +++ b/pkgs/tools/misc/dtach/default.nix @@ -10,8 +10,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp dtach $out/bin/dtach + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/misc/dumptorrent/default.nix b/pkgs/tools/misc/dumptorrent/default.nix index c80a696f8cba1..e8e5708154dc6 100644 --- a/pkgs/tools/misc/dumptorrent/default.nix +++ b/pkgs/tools/misc/dumptorrent/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ./dumptorrent $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/edid-generator/default.nix b/pkgs/tools/misc/edid-generator/default.nix index fc7f01226972b..5ed843d3288f2 100644 --- a/pkgs/tools/misc/edid-generator/default.nix +++ b/pkgs/tools/misc/edid-generator/default.nix @@ -65,7 +65,11 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + install -Dm 444 *.bin -t "$out/lib/firmware/edid" + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/misc/emv/default.nix b/pkgs/tools/misc/emv/default.nix index a317805e463ce..28d5b4829f14d 100644 --- a/pkgs/tools/misc/emv/default.nix +++ b/pkgs/tools/misc/emv/default.nix @@ -12,9 +12,13 @@ stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -pv $out/bin cp $src $out/bin/emv chmod +x $out/bin/emv + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/misc/enjarify/default.nix b/pkgs/tools/misc/enjarify/default.nix index 4e4f21430132e..13355441e6977 100644 --- a/pkgs/tools/misc/enjarify/default.nix +++ b/pkgs/tools/misc/enjarify/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + pypath="$out/${python3.sitePackages}" mkdir -p $out/bin $pypath mv enjarify $pypath @@ -22,6 +24,8 @@ stdenv.mkDerivation rec { exec ${python3.interpreter} -O -m enjarify.main "\$@" EOF chmod +x $out/bin/enjarify + + runHook postInstall ''; buildInputs = [ ]; diff --git a/pkgs/tools/misc/ent/default.nix b/pkgs/tools/misc/ent/default.nix index 3152e00503bb3..858c91ea91e90 100644 --- a/pkgs/tools/misc/ent/default.nix +++ b/pkgs/tools/misc/ent/default.nix @@ -18,8 +18,12 @@ stdenv.mkDerivation { buildFlags = lib.optional stdenv.cc.isClang "CC=clang"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ent $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/esptool-ck/default.nix b/pkgs/tools/misc/esptool-ck/default.nix index 58f84c9b06306..f545ddebf6683 100644 --- a/pkgs/tools/misc/esptool-ck/default.nix +++ b/pkgs/tools/misc/esptool-ck/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { makeFlags = [ "VERSION=${version}" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp esptool $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/evhz/default.nix b/pkgs/tools/misc/evhz/default.nix index 712606c6913a1..39b46cb151dc2 100644 --- a/pkgs/tools/misc/evhz/default.nix +++ b/pkgs/tools/misc/evhz/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation { buildPhase = "gcc -o evhz evhz.c"; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv evhz $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/fasd/default.nix b/pkgs/tools/misc/fasd/default.nix index 45ec3d6ddfdd9..397ff6f4c4604 100644 --- a/pkgs/tools/misc/fasd/default.nix +++ b/pkgs/tools/misc/fasd/default.nix @@ -12,7 +12,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + PREFIX=$out make install + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/fdtools/default.nix b/pkgs/tools/misc/fdtools/default.nix index e0dc8ea17fe72..b8c640922003a 100644 --- a/pkgs/tools/misc/fdtools/default.nix +++ b/pkgs/tools/misc/fdtools/default.nix @@ -41,6 +41,8 @@ in stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $bin/bin tools=( grabconsole multitee pipecycle recvfd seek0 sendfd setblock setstate statfile vc-get vc-lock vc-switch ) @@ -75,6 +77,8 @@ in stdenv.mkDerivation { # we don’t use this, but nixpkgs requires it touch $out + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/misc/fet-sh/default.nix b/pkgs/tools/misc/fet-sh/default.nix index 3a95451d00162..d0bcb882bb968 100644 --- a/pkgs/tools/misc/fet-sh/default.nix +++ b/pkgs/tools/misc/fet-sh/default.nix @@ -16,7 +16,11 @@ stdenvNoCC.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -m755 -D fet.sh $out/bin/fet.sh + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/fpp/default.nix b/pkgs/tools/misc/fpp/default.nix index d8f575b1363b1..6d3fe3cdb253d 100644 --- a/pkgs/tools/misc/fpp/default.nix +++ b/pkgs/tools/misc/fpp/default.nix @@ -18,10 +18,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/share/fpp $out/bin cp -r fpp src $out/share/fpp ln -s $out/share/fpp/fpp $out/bin/fpp installManPage debian/usr/share/man/man1/fpp.1 + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/misc/fsmark/default.nix b/pkgs/tools/misc/fsmark/default.nix index 340be1a56c2ed..28a37278a45ba 100644 --- a/pkgs/tools/misc/fsmark/default.nix +++ b/pkgs/tools/misc/fsmark/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp fs_mark $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/fsmon/default.nix b/pkgs/tools/misc/fsmon/default.nix index 5e38561078017..a3de05b0a2572 100644 --- a/pkgs/tools/misc/fsmon/default.nix +++ b/pkgs/tools/misc/fsmon/default.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + make install PREFIX=$out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/fxlinuxprintutil/default.nix b/pkgs/tools/misc/fxlinuxprintutil/default.nix index e5285cba642cf..9b0a24374e9aa 100644 --- a/pkgs/tools/misc/fxlinuxprintutil/default.nix +++ b/pkgs/tools/misc/fxlinuxprintutil/default.nix @@ -42,11 +42,15 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out mv usr/bin $out mv usr/lib $out wrapProgram $out/bin/fxlputil --prefix PATH : ${lib.makeBinPath [ tcl tk ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/gams/default.nix b/pkgs/tools/misc/gams/default.nix index be71618aae204..5d3edfe5319b2 100644 --- a/pkgs/tools/misc/gams/default.nix +++ b/pkgs/tools/misc/gams/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" "$out/share/gams" cp -a * "$out/share/gams" @@ -22,6 +24,8 @@ stdenv.mkDerivation rec { '' + lib.optionalString (optgamsFile != null) '' cp ${optgamsFile} $out/share/gams/optgams.def ln -s $out/share/gams/optgams.def $out/bin/optgams.def + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/misc/geteltorito/default.nix b/pkgs/tools/misc/geteltorito/default.nix index 7bbedde4dac6b..2c61280a944a9 100644 --- a/pkgs/tools/misc/geteltorito/default.nix +++ b/pkgs/tools/misc/geteltorito/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { dontBuild = true; configurePhase = ""; installPhase = '' + runHook preInstall + # reformat README to ronn markdown cat > README.new < $out/man/man1/geteltorito.1 install -vD geteltorito $out/bin/geteltorito + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/misc/gibo/default.nix b/pkgs/tools/misc/gibo/default.nix index d037059fd4e3b..417bb06a16481 100644 --- a/pkgs/tools/misc/gibo/default.nix +++ b/pkgs/tools/misc/gibo/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/bash-completion/completions cp gibo $out/bin cp gibo-completion.bash $out/share/bash-completion/completions @@ -21,6 +23,8 @@ stdenv.mkDerivation rec { -i "$out/bin/gibo" sed -e 's|\ $out/share/man/man1/nat-traverse.1.gz + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/nettee/default.nix b/pkgs/tools/networking/nettee/default.nix index 74b1f317e2046..d000004ac0092 100644 --- a/pkgs/tools/networking/nettee/default.nix +++ b/pkgs/tools/networking/nettee/default.nix @@ -40,6 +40,8 @@ in stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + ${cleanPackaging.commonFileActions { docFiles = [ "*.html" @@ -60,6 +62,8 @@ in stdenv.mkDerivation { mkdir -p $man/share/man/{man1,man3} mv nettee.1 $man/share/man/man1 mv nettee_cmd.3 $man/share/man/man3 + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/networking/networkd-notify/default.nix b/pkgs/tools/networking/networkd-notify/default.nix index 6671983e1e7d1..fc10f7fb862e1 100644 --- a/pkgs/tools/networking/networkd-notify/default.nix +++ b/pkgs/tools/networking/networkd-notify/default.nix @@ -40,8 +40,12 @@ buildPythonApplication rec { dontBuild = true; installPhase = '' + runHook preInstall + install -D networkd-notify -t "$out/bin/" install -D -m0644 networkd-notify.desktop -t "$out/share/applications/" + + runHook postInstall ''; # Let the Python wrapper add gappsWrapperArgs, to avoid two layers of wrapping. diff --git a/pkgs/tools/networking/networkmanager/dmenu/default.nix b/pkgs/tools/networking/networkmanager/dmenu/default.nix index 78a0414807e24..6c4bd2c8c4ac9 100644 --- a/pkgs/tools/networking/networkmanager/dmenu/default.nix +++ b/pkgs/tools/networking/networkmanager/dmenu/default.nix @@ -19,11 +19,15 @@ in stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/applications $out/share/doc/$pname cp networkmanager_dmenu $out/bin/ cp networkmanager_dmenu.desktop $out/share/applications cp README.md $out/share/doc/$pname/ cp config.ini.example $out/share/doc/$pname/ + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/networking/noip/default.nix b/pkgs/tools/networking/noip/default.nix index d71cbcec507af..3b8b69e5f2857 100644 --- a/pkgs/tools/networking/noip/default.nix +++ b/pkgs/tools/networking/noip/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation { makeFlags = [ "PREFIX=\${out}" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp noip2 $out/bin + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/tools/networking/nuttcp/default.nix b/pkgs/tools/networking/nuttcp/default.nix index 7bee729c4ed96..4f3c4edb22adf 100644 --- a/pkgs/tools/networking/nuttcp/default.nix +++ b/pkgs/tools/networking/nuttcp/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp nuttcp-${version} $out/bin/nuttcp + + runHook postInstall ''; postInstall = '' diff --git a/pkgs/tools/networking/ookla-speedtest/default.nix b/pkgs/tools/networking/ookla-speedtest/default.nix index e36d5f7f17774..f1441bb55ca0e 100644 --- a/pkgs/tools/networking/ookla-speedtest/default.nix +++ b/pkgs/tools/networking/ookla-speedtest/default.nix @@ -42,8 +42,12 @@ stdenv.mkDerivation rec { dontConfigure = true; installPhase = '' + runHook preInstall + install -D speedtest $out/bin/speedtest install -D speedtest.5 $out/share/man/man5/speedtest.5 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/openvpn/openvpn_learnaddress.nix b/pkgs/tools/networking/openvpn/openvpn_learnaddress.nix index 514491c2be21b..93d203951bfa6 100644 --- a/pkgs/tools/networking/openvpn/openvpn_learnaddress.nix +++ b/pkgs/tools/networking/openvpn/openvpn_learnaddress.nix @@ -14,10 +14,14 @@ stdenv.mkDerivation { buildInputs = [ coreutils gawk util-linux ]; installPhase = '' + runHook preInstall + install -Dm555 ovpn-learnaddress $out/libexec/openvpn/openvpn-learnaddress wrapProgram $out/libexec/openvpn/openvpn-learnaddress \ --prefix PATH : ${lib.makeBinPath [ coreutils gawk util-linux ]} + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/networking/openvpn/update-resolv-conf.nix b/pkgs/tools/networking/openvpn/update-resolv-conf.nix index 53d2b272c4499..18db3ddd6de48 100644 --- a/pkgs/tools/networking/openvpn/update-resolv-conf.nix +++ b/pkgs/tools/networking/openvpn/update-resolv-conf.nix @@ -18,12 +18,16 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm555 update-resolv-conf.sh $out/libexec/openvpn/update-resolv-conf install -Dm555 update-systemd-network.sh $out/libexec/openvpn/update-systemd-network for i in $out/libexec/openvpn/*; do wrapProgram $i --prefix PATH : ${binPath} done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/packetdrill/default.nix b/pkgs/tools/networking/packetdrill/default.nix index baf2a53c4d78e..10b1273c4eddf 100644 --- a/pkgs/tools/networking/packetdrill/default.nix +++ b/pkgs/tools/networking/packetdrill/default.nix @@ -32,6 +32,8 @@ stdenv.mkDerivation rec { buildInputs = [ libpcap ]; installPhase = '' + runHook preInstall + install -m 0755 -t $out/bin -D \ packetdrill \ packet_parser_test \ @@ -39,6 +41,8 @@ stdenv.mkDerivation rec { checksum_test mkdir -p $out/share cp -r ../tests $out/share/packetdrill-tests + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/networking/passh/default.nix b/pkgs/tools/networking/passh/default.nix index 6fc3efba9bd20..84ae15b1b5d09 100644 --- a/pkgs/tools/networking/passh/default.nix +++ b/pkgs/tools/networking/passh/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation (finalAttrs: { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ${finalAttrs.pname} $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/photon/default.nix b/pkgs/tools/networking/photon/default.nix index 5a60e145aeda7..7ca4bb96fc68c 100644 --- a/pkgs/tools/networking/photon/default.nix +++ b/pkgs/tools/networking/photon/default.nix @@ -18,12 +18,16 @@ python3Packages.buildPythonApplication rec { propagatedBuildInputs = with python3Packages; [ requests urllib3 tld ]; installPhase = '' + runHook preInstall + mkdir -p "$out"/{bin,share/photon} cp -R photon.py core plugins $out/share/photon makeWrapper ${python3Packages.python.interpreter} $out/bin/photon \ --set PYTHONPATH "$PYTHONPATH:$out/share/photon" \ --add-flags "-O $out/share/photon/photon.py" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/prettyping/default.nix b/pkgs/tools/networking/prettyping/default.nix index 3f42a07261dd2..b8d9cd62cd6fc 100644 --- a/pkgs/tools/networking/prettyping/default.nix +++ b/pkgs/tools/networking/prettyping/default.nix @@ -11,7 +11,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -Dt $out/bin prettyping + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/pritunl-ssh/default.nix b/pkgs/tools/networking/pritunl-ssh/default.nix index 06cfc4d1a4ceb..591207a816ce8 100644 --- a/pkgs/tools/networking/pritunl-ssh/default.nix +++ b/pkgs/tools/networking/pritunl-ssh/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { buildInputs = [ python3 ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin install ssh_client.py $out/bin/pritunl-ssh install ssh_host_client.py $out/bin/pritunl-ssh-host + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/ratman/default.nix b/pkgs/tools/networking/ratman/default.nix index ebadc2a41c933..caeacee3a688a 100644 --- a/pkgs/tools/networking/ratman/default.nix +++ b/pkgs/tools/networking/ratman/default.nix @@ -72,10 +72,14 @@ rustPlatform.buildRustPackage rec { ''; installPhase = '' + runHook preInstall + cp -R . $out mv $out/dist $dist ln -s $dist $out/dist + + runHook postInstall ''; }; diff --git a/pkgs/tools/networking/ratools/default.nix b/pkgs/tools/networking/ratools/default.nix index 1399fc4c8d599..919843e26ae44 100644 --- a/pkgs/tools/networking/ratools/default.nix +++ b/pkgs/tools/networking/ratools/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { makeFlags = [ "-C" "src" ]; installPhase = '' + runHook preInstall + install -vD bin/* -t $out/bin install -vD man/* -t $out/share/man/man8 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/reaver-wps/default.nix b/pkgs/tools/networking/reaver-wps/default.nix index 050cadf3ed641..453f623f2801a 100644 --- a/pkgs/tools/networking/reaver-wps/default.nix +++ b/pkgs/tools/networking/reaver-wps/default.nix @@ -25,12 +25,16 @@ stdenv.mkDerivation rec { configureFlags = [ "--sysconfdir=${confdir}" ]; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,etc} cp reaver.db $out/etc/ cp reaver wash $out/bin/ wrapProgram $out/bin/reaver --run "[ -s ${confdir}/reaver/reaver.db ] || install -D $out/etc/reaver.db ${confdir}/reaver/reaver.db" wrapProgram $out/bin/wash --run "[ -s ${confdir}/reaver/reaver.db ] || install -D $out/etc/reaver.db ${confdir}/reaver/reaver.db" + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/tools/networking/redsocks/default.nix b/pkgs/tools/networking/redsocks/default.nix index f97dd01e074d3..bf371bff25177 100644 --- a/pkgs/tools/networking/redsocks/default.nix +++ b/pkgs/tools/networking/redsocks/default.nix @@ -13,9 +13,13 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share} mv redsocks $out/bin mv doc $out/share + + runHook postInstall ''; buildInputs = [ libevent ]; diff --git a/pkgs/tools/networking/shorewall/default.nix b/pkgs/tools/networking/shorewall/default.nix index f3edc8d0d01c7..71ba9b17b5108 100644 --- a/pkgs/tools/networking/shorewall/default.nix +++ b/pkgs/tools/networking/shorewall/default.nix @@ -76,6 +76,8 @@ stdenv.mkDerivation rec { DEFAULT_PAGER= ''; installPhase = '' + runHook preInstall + export DESTDIR=/ shorewall-core-${version}/install.sh @@ -101,6 +103,8 @@ stdenv.mkDerivation rec { # will generate the config files. sed -i $out/share/shorewall/shorewallrc \ -e 's~^CONFDIR=.*~CONFDIR=/etc~' + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/networking/simple-dlna-browser/default.nix b/pkgs/tools/networking/simple-dlna-browser/default.nix index ae6ccc4a4aaa0..8dd68cfbfa233 100644 --- a/pkgs/tools/networking/simple-dlna-browser/default.nix +++ b/pkgs/tools/networking/simple-dlna-browser/default.nix @@ -30,6 +30,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + outputWrapper="$out/bin/simple-dlna-browser" outputWrapped="$out/bin/wrapped-simple-dlna-browser" @@ -48,6 +50,8 @@ stdenv.mkDerivation { # Set the program name to a fixed value # Normally it is guessed by the filename, but we don't want it to be the name of the wrapper sed -i -e 's/PROGNAME=".*"/PROGNAME="simple-dlna-browser"/' $outputWrapped + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/networking/slack-cli/default.nix b/pkgs/tools/networking/slack-cli/default.nix index 56248107115e0..8ea3a0f6d5eb8 100644 --- a/pkgs/tools/networking/slack-cli/default.nix +++ b/pkgs/tools/networking/slack-cli/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" cp src/slack "$out/bin/.slack-wrapped" @@ -39,6 +41,8 @@ stdenv.mkDerivation rec { WRAPPER chmod +x "$out/bin/slack" + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/networking/snabb/default.nix b/pkgs/tools/networking/snabb/default.nix index 2cb9f3b62a929..b871b14a9bf37 100644 --- a/pkgs/tools/networking/snabb/default.nix +++ b/pkgs/tools/networking/snabb/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp src/snabb $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/snmpcheck/default.nix b/pkgs/tools/networking/snmpcheck/default.nix index dbf6c95de8ac1..cb40be8332372 100644 --- a/pkgs/tools/networking/snmpcheck/default.nix +++ b/pkgs/tools/networking/snmpcheck/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { buildInputs = [ rubyEnv.wrappedRuby ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp $src $out/bin/snmp-check + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/sockdump/default.nix b/pkgs/tools/networking/sockdump/default.nix index 98e88d0d6f83f..800e14f861415 100644 --- a/pkgs/tools/networking/sockdump/default.nix +++ b/pkgs/tools/networking/sockdump/default.nix @@ -15,7 +15,7 @@ python3.pkgs.buildPythonApplication rec { format = "other"; # none - installPhase = "install -D ${pname}.py $out/bin/${pname}"; + installPhase = "runHook preInstall; install -D ${pname}.py $out/bin/${pname}; runHook postInstall"; meta = src.meta // { description = "Dump unix domain socket traffic with bpf"; diff --git a/pkgs/tools/networking/srelay/default.nix b/pkgs/tools/networking/srelay/default.nix index a8d6a33ac3d17..b8a5ffbed4344 100644 --- a/pkgs/tools/networking/srelay/default.nix +++ b/pkgs/tools/networking/srelay/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ libxcrypt ]; - installPhase = "install -D srelay $out/bin/srelay"; + installPhase = "runHook preInstall; install -D srelay $out/bin/srelay; runHook postInstall"; meta = { description = "SOCKS proxy and relay"; diff --git a/pkgs/tools/networking/ssh-ident/default.nix b/pkgs/tools/networking/ssh-ident/default.nix index 3886828c52210..82edd30af6376 100644 --- a/pkgs/tools/networking/ssh-ident/default.nix +++ b/pkgs/tools/networking/ssh-ident/default.nix @@ -17,8 +17,12 @@ stdenvNoCC.mkDerivation { buildInputs = [ python3 ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -m 755 ssh-ident $out/bin/ssh-ident + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/sshoogr/default.nix b/pkgs/tools/networking/sshoogr/default.nix index abd42dcb5aa42..deb72a5a4f2a7 100644 --- a/pkgs/tools/networking/sshoogr/default.nix +++ b/pkgs/tools/networking/sshoogr/default.nix @@ -12,10 +12,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + rm bin/sshoogr.bat cp -r . $out wrapProgram $out/bin/sshoogr \ --prefix JAVA_HOME : ${jdk} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/sshping/default.nix b/pkgs/tools/networking/sshping/default.nix index 608c8125f0d2b..ee81f606744dc 100644 --- a/pkgs/tools/networking/sshping/default.nix +++ b/pkgs/tools/networking/sshping/default.nix @@ -18,7 +18,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 bin/sshping $out/bin/sshping + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/stun/default.nix b/pkgs/tools/networking/stun/default.nix index de4787eca63a5..bd10c68c72b76 100644 --- a/pkgs/tools/networking/stun/default.nix +++ b/pkgs/tools/networking/stun/default.nix @@ -24,11 +24,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $server/bin $out/man/man1 $server/man/man8 cp -v client $out/bin/stun cp -v server $server/bin/stund cp -v debian/manpages/stun.1.gz $out/man/man1 cp -v debian/manpages/stund.8.gz $server/man/man8 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/swagger-codegen/default.nix b/pkgs/tools/networking/swagger-codegen/default.nix index 15e125f64fb9d..2de2bf3de92bc 100644 --- a/pkgs/tools/networking/swagger-codegen/default.nix +++ b/pkgs/tools/networking/swagger-codegen/default.nix @@ -18,10 +18,14 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + install -D $src $out/share/java/${jarfilename} makeWrapper ${jre}/bin/java $out/bin/${pname} \ --add-flags "-jar $out/share/java/${jarfilename}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/swagger-codegen3/default.nix b/pkgs/tools/networking/swagger-codegen3/default.nix index c23cd944a6e2c..2570a24dde4a8 100644 --- a/pkgs/tools/networking/swagger-codegen3/default.nix +++ b/pkgs/tools/networking/swagger-codegen3/default.nix @@ -18,10 +18,14 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + install -D $src $out/share/java/${jarfilename} makeWrapper ${jre}/bin/java $out/bin/${pname}3 \ --add-flags "-jar $out/share/java/${jarfilename}" + + runHook postInstall ''; passthru.tests.version = testers.testVersion { diff --git a/pkgs/tools/networking/swaks/default.nix b/pkgs/tools/networking/swaks/default.nix index a42d6773fc83f..f3e784db2c70f 100644 --- a/pkgs/tools/networking/swaks/default.nix +++ b/pkgs/tools/networking/swaks/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { buildInputs = [ perl ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv swaks $out/bin/ @@ -20,6 +22,8 @@ stdenv.mkDerivation rec { "${with perlPackages; makePerlPath [ NetSSLeay AuthenSASL NetDNS IOSocketINET6 ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/tcp-cutter/default.nix b/pkgs/tools/networking/tcp-cutter/default.nix index 4231ddef24332..ea8e4e19f88b0 100644 --- a/pkgs/tools/networking/tcp-cutter/default.nix +++ b/pkgs/tools/networking/tcp-cutter/default.nix @@ -10,7 +10,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D -m 0755 cutter $out/bin/tcp-cutter + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/tuntox/default.nix b/pkgs/tools/networking/tuntox/default.nix index e59a615e26275..c9d66688345bf 100644 --- a/pkgs/tools/networking/tuntox/default.nix +++ b/pkgs/tools/networking/tuntox/default.nix @@ -63,8 +63,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv tuntox $out/bin/ + + runHook postInstall ''; doCheck = false; diff --git a/pkgs/tools/networking/ucspi-tcp/default.nix b/pkgs/tools/networking/ucspi-tcp/default.nix index 4b307079266b1..6d4654bba5ea7 100644 --- a/pkgs/tools/networking/ucspi-tcp/default.nix +++ b/pkgs/tools/networking/ucspi-tcp/default.nix @@ -40,6 +40,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" mkdir -p "$out/share/man/man1" @@ -48,6 +50,8 @@ stdenv.mkDerivation rec { # Install Debian man pages (upstream has none) cp debian/ucspi-tcp-man/*.1 "$out/share/man/man1" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/udptunnel/default.nix b/pkgs/tools/networking/udptunnel/default.nix index e7b2832b40b57..5a4f6c738ee53 100644 --- a/pkgs/tools/networking/udptunnel/default.nix +++ b/pkgs/tools/networking/udptunnel/default.nix @@ -10,9 +10,13 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/udptunnel cp udptunnel $out/bin cp README COPYING* $out/share/udptunnel + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/networking/uget-integrator/default.nix b/pkgs/tools/networking/uget-integrator/default.nix index 3ab9a0bafef4d..a02fcf1f11028 100644 --- a/pkgs/tools/networking/uget-integrator/default.nix +++ b/pkgs/tools/networking/uget-integrator/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { buildInputs = [ uget python3Packages.python ]; installPhase = '' + runHook preInstall + for f in conf/com.ugetdm.{chrome,firefox}.json; do substituteInPlace $f --replace "/usr" "$out" done @@ -27,6 +29,8 @@ stdenv.mkDerivation rec { install -D -t $out/lib/mozilla/native-messaging-hosts conf/com.ugetdm.firefox.json wrapPythonPrograms + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/uwimap/default.nix b/pkgs/tools/networking/uwimap/default.nix index a39f0d4660fb4..a70e83164d930 100644 --- a/pkgs/tools/networking/uwimap/default.nix +++ b/pkgs/tools/networking/uwimap/default.nix @@ -49,11 +49,15 @@ stdenv.mkDerivation rec { "-I${openssl.dev}/include/openssl"; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib $out/include/c-client cp c-client/*.h osdep/unix/*.h c-client/linkage.c c-client/auths.c $out/include/c-client/ cp c-client/c-client.a $out/lib/libc-client.a cp mailutil/mailutil imapd/imapd dmail/dmail mlock/mlock mtest/mtest tmail/tmail \ tools/{an,ua} $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/vlan/default.nix b/pkgs/tools/networking/vlan/default.nix index d93c61bda547b..45d618a824a68 100644 --- a/pkgs/tools/networking/vlan/default.nix +++ b/pkgs/tools/networking/vlan/default.nix @@ -19,11 +19,15 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + mkdir -p $out/sbin cp vconfig $out/sbin/ mkdir -p $out/share/man/man8 cp vconfig.8 $out/share/man/man8/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/vpnc-scripts/default.nix b/pkgs/tools/networking/vpnc-scripts/default.nix index e0319ed4bf14b..45730dfcd75fc 100644 --- a/pkgs/tools/networking/vpnc-scripts/default.nix +++ b/pkgs/tools/networking/vpnc-scripts/default.nix @@ -24,8 +24,12 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp vpnc-script $out/bin + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/tools/networking/wakeonlan/default.nix b/pkgs/tools/networking/wakeonlan/default.nix index 4a9f0936f9408..d56c2d672494f 100644 --- a/pkgs/tools/networking/wakeonlan/default.nix +++ b/pkgs/tools/networking/wakeonlan/default.nix @@ -22,10 +22,14 @@ perlPackages.buildPerlPackage rec { ''; installPhase = '' + runHook preInstall + install -Dt $out/bin wakeonlan installManPage blib/man1/wakeonlan.1 '' + lib.optionalString stdenv.isDarwin '' shortenPerlShebang $out/bin/wakeonlan + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/wbox/default.nix b/pkgs/tools/networking/wbox/default.nix index dad3f374f7ae9..f93cd069913c2 100644 --- a/pkgs/tools/networking/wbox/default.nix +++ b/pkgs/tools/networking/wbox/default.nix @@ -5,7 +5,11 @@ stdenv.mkDerivation rec { version = "5"; installPhase = '' + runHook preInstall + install -vD wbox "$out/bin/wbox" + + runHook postInstall ''; src = fetchurl { diff --git a/pkgs/tools/networking/wg-friendly-peer-names/default.nix b/pkgs/tools/networking/wg-friendly-peer-names/default.nix index ebbd898576d37..37a9fb87d0a02 100644 --- a/pkgs/tools/networking/wg-friendly-peer-names/default.nix +++ b/pkgs/tools/networking/wg-friendly-peer-names/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + install -D wgg.sh $out/bin/wgg + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/wifish/default.nix b/pkgs/tools/networking/wifish/default.nix index 7f474bc984424..8c4f42885b848 100644 --- a/pkgs/tools/networking/wifish/default.nix +++ b/pkgs/tools/networking/wifish/default.nix @@ -25,11 +25,15 @@ stdenv.mkDerivation rec { dontConfigure = true; installPhase = '' + runHook preInstall + install -D -m0644 awk/wscanparse.awk ${placeholder "out"}/var/lib/wifish/wscanparse.awk install -D -m0644 awk/wlistparse.awk ${placeholder "out"}/var/lib/wifish/wlistparse.awk install -D -m0644 awk/wscan2menu.awk ${placeholder "out"}/var/lib/wifish/wscan2menu.awk install -D -m0644 awk/iwparse.awk ${placeholder "out"}/var/lib/wifish/iwparse.awk install -D -m0755 wifish ${placeholder "out"}/bin/wifish + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/networking/wolfebin/default.nix b/pkgs/tools/networking/wolfebin/default.nix index 47babc4ceb9aa..b0173f2800c1c 100644 --- a/pkgs/tools/networking/wolfebin/default.nix +++ b/pkgs/tools/networking/wolfebin/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { buildInputs = [ python3 ]; installPhase = '' + runHook preInstall + install -m 755 -d $out/bin install -m 755 wolfebin $out/bin install -m 755 wolfebin_server.py $out/bin/wolfebin_server + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/wrk/default.nix b/pkgs/tools/networking/wrk/default.nix index 082497ad7d28d..0a91a4a2b4be6 100644 --- a/pkgs/tools/networking/wrk/default.nix +++ b/pkgs/tools/networking/wrk/default.nix @@ -25,8 +25,12 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 installPhase = '' + runHook preInstall + mkdir -p $out/bin cp wrk $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/networking/wrk2/default.nix b/pkgs/tools/networking/wrk2/default.nix index 6d2988705129f..509ad972172bd 100644 --- a/pkgs/tools/networking/wrk2/default.nix +++ b/pkgs/tools/networking/wrk2/default.nix @@ -28,8 +28,12 @@ stdenv.mkDerivation rec { dontConfigure = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv ./wrk $out/bin/wrk2 + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/networking/wsl-vpnkit/default.nix b/pkgs/tools/networking/wsl-vpnkit/default.nix index b9b25747a50f5..519ff1538434a 100644 --- a/pkgs/tools/networking/wsl-vpnkit/default.nix +++ b/pkgs/tools/networking/wsl-vpnkit/default.nix @@ -40,8 +40,12 @@ resholve.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp wsl-vpnkit $out/bin + + runHook postInstall ''; solutions.wsl-vpnkit = { diff --git a/pkgs/tools/networking/zap/default.nix b/pkgs/tools/networking/zap/default.nix index e0ceade91f5ad..3ce8e11296f65 100644 --- a/pkgs/tools/networking/zap/default.nix +++ b/pkgs/tools/networking/zap/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { # Copying config and adding version tag before first use to avoid permission # issues if zap tries to copy config on it's own. installPhase = '' + runHook preInstall + mkdir -p "$out/bin" "$out/share" cp -pR . "$out/share/${pname}/" @@ -33,6 +35,8 @@ stdenv.mkDerivation rec { EOF chmod u+x "$out/bin/${pname}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/nix/info/default.nix b/pkgs/tools/nix/info/default.nix index 73c336afe045c..1fe3975f46041 100644 --- a/pkgs/tools/nix/info/default.nix +++ b/pkgs/tools/nix/info/default.nix @@ -35,8 +35,12 @@ stdenv.mkDerivation { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ./nix-info $out/bin/nix-info + + runHook postInstall ''; preferLocalBuild = true; diff --git a/pkgs/tools/package-management/appimagekit/default.nix b/pkgs/tools/package-management/appimagekit/default.nix index c540b8cfac1e0..59538134813a6 100644 --- a/pkgs/tools/package-management/appimagekit/default.nix +++ b/pkgs/tools/package-management/appimagekit/default.nix @@ -57,9 +57,13 @@ let # only static libs and header files installPhase = '' + runHook preInstall + mkdir -p $out/lib $out/include cp -v ./.libs/*.a $out/lib cp -v ./*.h $out/include + + runHook postInstall ''; }; diff --git a/pkgs/tools/package-management/cde/default.nix b/pkgs/tools/package-management/cde/default.nix index 8eefb923bcd3e..e0985fbe81555 100644 --- a/pkgs/tools/package-management/cde/default.nix +++ b/pkgs/tools/package-management/cde/default.nix @@ -34,8 +34,12 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = "-fcommon"; installPhase = '' + runHook preInstall + install -d $out/bin install -t $out/bin cde cde-exec + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/package-management/niff/default.nix b/pkgs/tools/package-management/niff/default.nix index 909aaaa9413c3..adea603454489 100644 --- a/pkgs/tools/package-management/niff/default.nix +++ b/pkgs/tools/package-management/niff/default.nix @@ -21,8 +21,12 @@ in stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp niff $out/bin/niff + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/package-management/nix-pin/default.nix b/pkgs/tools/package-management/nix-pin/default.nix index 59422ff22cc24..0d7f3bb4f3e78 100644 --- a/pkgs/tools/package-management/nix-pin/default.nix +++ b/pkgs/tools/package-management/nix-pin/default.nix @@ -12,10 +12,14 @@ let self = stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; buildInputs = [ python3 ]; installPhase = '' + runHook preInstall + mkdir "$out" cp -r bin share "$out" wrapProgram $out/bin/nix-pin \ --prefix PATH : "${lib.makeBinPath [ nix git ]}" + + runHook postInstall ''; passthru = let diff --git a/pkgs/tools/package-management/nix-prefetch-scripts/default.nix b/pkgs/tools/package-management/nix-prefetch-scripts/default.nix index aca8c2fbb4de8..80bb354511d93 100644 --- a/pkgs/tools/package-management/nix-prefetch-scripts/default.nix +++ b/pkgs/tools/package-management/nix-prefetch-scripts/default.nix @@ -11,10 +11,14 @@ let mkPrefetchScript = tool: src: deps: dontUnpack = true; installPhase = '' + runHook preInstall + install -vD ${src} $out/bin/$name; wrapProgram $out/bin/$name \ --prefix PATH : ${lib.makeBinPath (deps ++ [ gnused nix ])} \ --set HOME /homeless-shelter + + runHook postInstall ''; preferLocalBuild = true; diff --git a/pkgs/tools/package-management/nix-prefetch/default.nix b/pkgs/tools/package-management/nix-prefetch/default.nix index 8ed71d078b78c..eb268d9d6f06f 100644 --- a/pkgs/tools/package-management/nix-prefetch/default.nix +++ b/pkgs/tools/package-management/nix-prefetch/default.nix @@ -57,6 +57,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm555 -t $lib src/*.sh install -Dm444 -t $lib lib/* makeWrapper $lib/main.sh $out/bin/${pname} \ @@ -68,6 +70,8 @@ stdenv.mkDerivation rec { mkdir -p $out/share/doc/${pname}/contrib cp -r contrib/hello_rs $out/share/doc/${pname}/contrib + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/package-management/nix-serve/default.nix b/pkgs/tools/package-management/nix-serve/default.nix index 018fe9ffb89fb..0ed3c7ae26e68 100644 --- a/pkgs/tools/package-management/nix-serve/default.nix +++ b/pkgs/tools/package-management/nix-serve/default.nix @@ -28,11 +28,15 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + install -Dm0755 nix-serve.psgi $out/libexec/nix-serve/nix-serve.psgi makeWrapper ${perl.withPackages(p: [ p.DBDSQLite p.Plack p.Starman nix.perl-bindings ])}/bin/starman $out/bin/nix-serve \ --prefix PATH : "${lib.makeBinPath [ bzip2 nix ]}" \ --add-flags $out/libexec/nix-serve/nix-serve.psgi + + runHook postInstall ''; passthru.tests = { diff --git a/pkgs/tools/package-management/repro-get/default.nix b/pkgs/tools/package-management/repro-get/default.nix index 95d5902be0065..0d81c5bf362f1 100644 --- a/pkgs/tools/package-management/repro-get/default.nix +++ b/pkgs/tools/package-management/repro-get/default.nix @@ -47,8 +47,12 @@ buildGoModule rec { name = "${repro-get.pname}-${builtins.unsafeDiscardStringContext (lib.substring 0 12 (baseNameOf repro-get.drvPath))}"; subPackages = [ "pkg/version" ]; installPhase = '' + runHook preInstall + rm -rf $out touch $out + + runHook postInstall ''; preCheck = ""; outputHash = "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="; diff --git a/pkgs/tools/security/arubaotp-seed-extractor/default.nix b/pkgs/tools/security/arubaotp-seed-extractor/default.nix index cd13f891cecc7..47d80d8e08274 100644 --- a/pkgs/tools/security/arubaotp-seed-extractor/default.nix +++ b/pkgs/tools/security/arubaotp-seed-extractor/default.nix @@ -28,6 +28,8 @@ python3Packages.buildPythonApplication { ]; installPhase = '' + runHook preInstall + libdir="$out/${python3Packages.python.sitePackages}/arubaotp-seed-extractor" mkdir -p "$libdir" cp scripts/* "$libdir" @@ -35,6 +37,8 @@ python3Packages.buildPythonApplication { wrapPythonProgramsIn "$libdir" "$pythonPath" mkdir -p $out/bin ln -s "$libdir/main.py" $out/bin/arubaotp-seed-extractor + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/bash-supergenpass/default.nix b/pkgs/tools/security/bash-supergenpass/default.nix index 7bf7c36424886..b79be6898c9f6 100644 --- a/pkgs/tools/security/bash-supergenpass/default.nix +++ b/pkgs/tools/security/bash-supergenpass/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + install -m755 -D supergenpass.sh "$out/bin/supergenpass" wrapProgram "$out/bin/supergenpass" --prefix PATH : "${lib.makeBinPath [ openssl coreutils gnugrep ]}" + + runHook postInstall ''; passthru.updateScript = unstableGitUpdater { diff --git a/pkgs/tools/security/beyond-identity/default.nix b/pkgs/tools/security/beyond-identity/default.nix index 229d61be1d8aa..f5b606709a792 100644 --- a/pkgs/tools/security/beyond-identity/default.nix +++ b/pkgs/tools/security/beyond-identity/default.nix @@ -34,6 +34,8 @@ let ''; installPhase = '' + runHook preInstall + mkdir -p $out/opt/beyond-identity rm -rf usr/share/doc @@ -42,6 +44,8 @@ let cp -ar opt/beyond-identity/bin $out/opt/beyond-identity ln -s $out/opt/beyond-identity/bin/* $out/bin/ + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/security/browserpass/default.nix b/pkgs/tools/security/browserpass/default.nix index 463501a05eb06..d25743b3aee2d 100644 --- a/pkgs/tools/security/browserpass/default.nix +++ b/pkgs/tools/security/browserpass/default.nix @@ -48,6 +48,8 @@ buildGoModule rec { checkTarget = "test"; installPhase = '' + runHook preInstall + make install wrapProgram $out/bin/browserpass \ @@ -57,6 +59,8 @@ buildGoModule rec { mkdir -p $out/lib/mozilla/native-messaging-hosts # Copy ff manifests rather than linking to allow link-farming to work recursively in dependants cp $out/lib/browserpass/hosts/firefox/*.json $out/lib/mozilla/native-messaging-hosts/ + + runHook postInstall ''; passthru.tests.version = testers.testVersion { diff --git a/pkgs/tools/security/brutespray/default.nix b/pkgs/tools/security/brutespray/default.nix index f954f666def13..5cbe871494a98 100644 --- a/pkgs/tools/security/brutespray/default.nix +++ b/pkgs/tools/security/brutespray/default.nix @@ -27,6 +27,8 @@ stdenv.mkDerivation rec { buildInputs = [ python3 ]; installPhase = '' + runHook preInstall + install -Dm0755 brutespray.py $out/bin/brutespray patchShebangs $out/bin patchPythonScript $out/bin/brutespray @@ -35,6 +37,8 @@ stdenv.mkDerivation rec { mkdir -p $out/share/brutespray cp -r wordlist/ $out/share/brutespray/wordlist + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/cewl/default.nix b/pkgs/tools/security/cewl/default.nix index 833c521250792..fe27f99fd518a 100644 --- a/pkgs/tools/security/cewl/default.nix +++ b/pkgs/tools/security/cewl/default.nix @@ -19,9 +19,13 @@ stdenv.mkDerivation rec { buildInputs = [ rubyEnv.wrappedRuby ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp *.rb $out/bin/ mv $out/bin/cewl.rb $out/bin/cewl + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/chkrootkit/default.nix b/pkgs/tools/security/chkrootkit/default.nix index ad14c1cd39973..cf9254168f072 100644 --- a/pkgs/tools/security/chkrootkit/default.nix +++ b/pkgs/tools/security/chkrootkit/default.nix @@ -20,11 +20,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/sbin cp check_wtmpx chkdirs chklastlog chkproc chkrootkit chkutmp chkwtmp ifpromisc strings-static $out/sbin wrapProgram $out/sbin/chkrootkit \ --prefix PATH : "${lib.makeBinPath [ binutils-unwrapped ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/chntpw/default.nix b/pkgs/tools/security/chntpw/default.nix index 60cbed0f3d3d2..29259207baeb7 100644 --- a/pkgs/tools/security/chntpw/default.nix +++ b/pkgs/tools/security/chntpw/default.nix @@ -55,7 +55,11 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + make install PREFIX=$out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/chrome-token-signing/default.nix b/pkgs/tools/security/chrome-token-signing/default.nix index 5f9618d0f177a..8ac3554f897d1 100644 --- a/pkgs/tools/security/chrome-token-signing/default.nix +++ b/pkgs/tools/security/chrome-token-signing/default.nix @@ -23,10 +23,14 @@ mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D -t $out/bin host-linux/chrome-token-signing # TODO: wire these up install -D -t $out/etc/chromium/native-messaging-hosts host-linux/ee.ria.esteid.json install -D -t $out/lib/mozilla/native-messaging-hosts host-linux/ff/ee.ria.esteid.json + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/crackxls/default.nix b/pkgs/tools/security/crackxls/default.nix index 7ff6de5deff0c..d9b51709dc097 100644 --- a/pkgs/tools/security/crackxls/default.nix +++ b/pkgs/tools/security/crackxls/default.nix @@ -30,8 +30,12 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + mkdir -p $out/bin cp crackxls2003 $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/ctmg/default.nix b/pkgs/tools/security/ctmg/default.nix index 63c9004bcbc9f..2d02a4417e900 100644 --- a/pkgs/tools/security/ctmg/default.nix +++ b/pkgs/tools/security/ctmg/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "1i4v8sriwjrmj3yizbl1ysckb711yl9qsn9x45jq0ij1apsydhyc"; }; - installPhase = "install -D ctmg.sh $out/bin/ctmg"; + installPhase = "runHook preInstall; install -D ctmg.sh $out/bin/ctmg; runHook postInstall"; meta = with lib; { description = "Encrypted container manager for Linux using cryptsetup"; diff --git a/pkgs/tools/security/dnsenum/default.nix b/pkgs/tools/security/dnsenum/default.nix index 4fa5c0e26207e..82ce989a14283 100644 --- a/pkgs/tools/security/dnsenum/default.nix +++ b/pkgs/tools/security/dnsenum/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -vD dnsenum.pl $out/bin/dnsenum install -vD dns.txt -t $out/share + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/doona/default.nix b/pkgs/tools/security/doona/default.nix index bc890d52abb5a..d63825866a062 100644 --- a/pkgs/tools/security/doona/default.nix +++ b/pkgs/tools/security/doona/default.nix @@ -17,10 +17,14 @@ stdenv.mkDerivation rec { buildInputs = [ perl ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r ${src}/bedmod $out/bin/bedmod cp ${src}/doona.pl $out/bin/doona chmod +x $out/bin/doona + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/ecryptfs/helper.nix b/pkgs/tools/security/ecryptfs/helper.nix index e0252dac820a8..ca42ae5ed27ff 100644 --- a/pkgs/tools/security/ecryptfs/helper.nix +++ b/pkgs/tools/security/ecryptfs/helper.nix @@ -19,9 +19,13 @@ stdenv.mkDerivation { # Do not hardcode PATH to ${ecryptfs} as we need the script to invoke executables from /run/wrappers/bin installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/libexec cp $src $out/libexec/ecryptfs-helper.py makeWrapper "${python2.interpreter}" "$out/bin/ecryptfs-helper" --add-flags "$out/libexec/ecryptfs-helper.py" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/enum4linux/default.nix b/pkgs/tools/security/enum4linux/default.nix index 4703bae488db9..3f9b899d710fa 100644 --- a/pkgs/tools/security/enum4linux/default.nix +++ b/pkgs/tools/security/enum4linux/default.nix @@ -31,11 +31,15 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp enum4linux.pl $out/bin/enum4linux wrapProgram $out/bin/enum4linux \ --prefix PATH : ${lib.makeBinPath [ samba openldap ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/eschalot/default.nix b/pkgs/tools/security/eschalot/default.nix index 0c984c5d35e55..6017bfec06df5 100644 --- a/pkgs/tools/security/eschalot/default.nix +++ b/pkgs/tools/security/eschalot/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation rec { buildInputs = [ openssl ]; installPhase = '' + runHook preInstall + install -D -t $out/bin eschalot worgen + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/evil-winrm/default.nix b/pkgs/tools/security/evil-winrm/default.nix index b8e88e1db9ebd..535ee94dc06fa 100644 --- a/pkgs/tools/security/evil-winrm/default.nix +++ b/pkgs/tools/security/evil-winrm/default.nix @@ -32,8 +32,12 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp evil-winrm.rb $out/bin/evil-winrm + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/gen-oath-safe/default.nix b/pkgs/tools/security/gen-oath-safe/default.nix index 9ce87ac3bdd13..cf9277f5e80e4 100644 --- a/pkgs/tools/security/gen-oath-safe/default.nix +++ b/pkgs/tools/security/gen-oath-safe/default.nix @@ -27,10 +27,14 @@ stdenv.mkDerivation rec { ]; in '' + runHook preInstall + mkdir -p $out/bin cp gen-oath-safe $out/bin/ wrapProgram $out/bin/gen-oath-safe \ --prefix PATH : ${path} + + runHook postInstall ''; meta = with lib; { homepage = "https://github.com/mcepl/gen-oath-safe"; diff --git a/pkgs/tools/security/ghidra/default.nix b/pkgs/tools/security/ghidra/default.nix index 55f224da511b8..5ed8eba24a95a 100644 --- a/pkgs/tools/security/ghidra/default.nix +++ b/pkgs/tools/security/ghidra/default.nix @@ -49,6 +49,8 @@ stdenv.mkDerivation rec { dontStrip = true; installPhase = '' + runHook preInstall + mkdir -p "${pkg_path}" mkdir -p "${pkg_path}" "$out/share/applications" cp -a * "${pkg_path}" @@ -61,6 +63,8 @@ stdenv.mkDerivation rec { mkdir -pv "$out/share/icons/hicolor/$res/apps" mv "$f" "$out/share/icons/hicolor/$res/apps/ghidra.png" done; + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/security/gorilla-bin/default.nix b/pkgs/tools/security/gorilla-bin/default.nix index 95ca0b08bf8ef..946d7d9683239 100644 --- a/pkgs/tools/security/gorilla-bin/default.nix +++ b/pkgs/tools/security/gorilla-bin/default.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation rec { interpreter = "$(< \"$NIX_CC/nix-support/dynamic-linker\")"; libPath = lib.makeLibraryPath [ libXft libX11 freetype fontconfig libXrender libXScrnSaver libXext ]; in '' + runHook preInstall + mkdir -p $out/opt/password-gorilla mkdir -p $out/bin cp gorilla-${version} $out/opt/password-gorilla @@ -28,6 +30,8 @@ stdenv.mkDerivation rec { patchelf --set-interpreter "${interpreter}" "$out/opt/password-gorilla/gorilla-${version}" makeWrapper "$out/opt/password-gorilla/gorilla-${version}" "$out/bin/gorilla" \ --prefix LD_LIBRARY_PATH : "${libPath}" + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/security/hash-identifier/default.nix b/pkgs/tools/security/hash-identifier/default.nix index 0fe78a4a0db51..e13d331915277 100644 --- a/pkgs/tools/security/hash-identifier/default.nix +++ b/pkgs/tools/security/hash-identifier/default.nix @@ -14,7 +14,11 @@ python3Packages.buildPythonApplication rec { format = "other"; # no setup.py installPhase = '' + runHook preInstall + install -Dm0775 hash-id.py $out/bin/hash-identifier + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/hash-slinger/default.nix b/pkgs/tools/security/hash-slinger/default.nix index cb02b806a986c..35bd1a9fa7a6c 100644 --- a/pkgs/tools/security/hash-slinger/default.nix +++ b/pkgs/tools/security/hash-slinger/default.nix @@ -49,9 +49,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/man $out/${python3.sitePackages} make install wrapPythonPrograms + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/hash_extender/default.nix b/pkgs/tools/security/hash_extender/default.nix index 10f82ca77e71b..8f4277cadc8f1 100644 --- a/pkgs/tools/security/hash_extender/default.nix +++ b/pkgs/tools/security/hash_extender/default.nix @@ -22,8 +22,12 @@ stdenv.mkDerivation { env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp hash_extender $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/ibm-sw-tpm2/default.nix b/pkgs/tools/security/ibm-sw-tpm2/default.nix index 76123a7c893fb..2fa4eb053281a 100644 --- a/pkgs/tools/security/ibm-sw-tpm2/default.nix +++ b/pkgs/tools/security/ibm-sw-tpm2/default.nix @@ -49,8 +49,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp tpm_server $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/ipscan/default.nix b/pkgs/tools/security/ipscan/default.nix index f61944fe63ead..209f95223bc7d 100644 --- a/pkgs/tools/security/ipscan/default.nix +++ b/pkgs/tools/security/ipscan/default.nix @@ -26,6 +26,8 @@ stdenv.mkDerivation rec { buildInputs = [ jdk ]; installPhase = '' + runHook preInstall + mkdir -p $out/share cp usr/lib/ipscan/ipscan-linux64-${version}.jar $out/share/${pname}-${version}.jar @@ -39,6 +41,8 @@ stdenv.mkDerivation rec { mkdir -p $out/share/pixmaps cp usr/share/pixmaps/ipscan.png $out/share/pixmaps/ipscan.png + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/jd-cli/default.nix b/pkgs/tools/security/jd-cli/default.nix index d99c1e687ac38..892c85b50cd19 100644 --- a/pkgs/tools/security/jd-cli/default.nix +++ b/pkgs/tools/security/jd-cli/default.nix @@ -18,11 +18,15 @@ maven.buildMavenPackage rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/jd-cli install -Dm644 jd-cli/target/jd-cli.jar $out/share/jd-cli makeWrapper ${jre}/bin/java $out/bin/jd-cli \ --add-flags "-jar $out/share/jd-cli/jd-cli.jar" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/keybase/gui.nix b/pkgs/tools/security/keybase/gui.nix index 666425e4d3d0f..62db62f4fe3ed 100644 --- a/pkgs/tools/security/keybase/gui.nix +++ b/pkgs/tools/security/keybase/gui.nix @@ -71,6 +71,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv usr/share $out/share mv opt/keybase $out/share/ @@ -104,6 +106,8 @@ stdenv.mkDerivation rec { substituteInPlace $out/share/applications/keybase.desktop \ --replace run_keybase $out/bin/keybase-gui + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/kpcli/default.nix b/pkgs/tools/security/kpcli/default.nix index 5a3b0a75862f4..7737a73fd04e9 100644 --- a/pkgs/tools/security/kpcli/default.nix +++ b/pkgs/tools/security/kpcli/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share} cp ${src} $out/share/kpcli.pl chmod +x $out/share/kpcli.pl @@ -23,6 +25,8 @@ stdenv.mkDerivation rec { "${with perlPackages; makePerlPath ([ CaptureTiny Clipboard Clone CryptRijndael SortNaturally TermReadKey TermShellUI FileKeePass TermReadLineGnu XMLParser ] ++ lib.optional stdenv.isDarwin MacPasteboard)}" + + runHook postInstall ''; diff --git a/pkgs/tools/security/lynis/default.nix b/pkgs/tools/security/lynis/default.nix index d207e3d6e3e02..dac053bfa97d6 100644 --- a/pkgs/tools/security/lynis/default.nix +++ b/pkgs/tools/security/lynis/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -d $out/bin $out/share/lynis/plugins cp -r include db default.prf $out/share/lynis/ cp -a lynis $out/bin @@ -26,6 +28,8 @@ stdenv.mkDerivation rec { installManPage lynis.8 installShellCompletion --bash --name lynis.bash \ extras/bash_completion.d/lynis + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/metasploit/default.nix b/pkgs/tools/security/metasploit/default.nix index 3fc270533b80a..0ea1da7d35527 100644 --- a/pkgs/tools/security/metasploit/default.nix +++ b/pkgs/tools/security/metasploit/default.nix @@ -35,6 +35,8 @@ in stdenv.mkDerivation rec { dontPatchELF = true; # stay away from exploit executables installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/msf} cp -r * $out/share/msf @@ -54,6 +56,8 @@ in stdenv.mkDerivation rec { makeWrapper ${env}/bin/bundle $out/bin/msf-pattern_offset \ --add-flags "exec ${ruby}/bin/ruby $out/share/msf/tools/exploit/pattern_offset.rb" + + runHook postInstall ''; # run with: nix-shell maintainers/scripts/update.nix --argstr path metasploit diff --git a/pkgs/tools/security/mkp224o/default.nix b/pkgs/tools/security/mkp224o/default.nix index 53b0e38a0dca4..6beb8f076b745 100644 --- a/pkgs/tools/security/mkp224o/default.nix +++ b/pkgs/tools/security/mkp224o/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { inherit version src configureFlags; nativeBuildInputs = [ autoreconfHook ]; buildInputs = [ libsodium ]; - installPhase = "install -D mkp224o $out"; + installPhase = "runHook preInstall; install -D mkp224o $out; runHook postInstall"; } } $out/bin/mkp224o-${suffix} '') variants; diff --git a/pkgs/tools/security/mkpasswd/default.nix b/pkgs/tools/security/mkpasswd/default.nix index edbdfdc711c68..aaec0ee94dbb8 100644 --- a/pkgs/tools/security/mkpasswd/default.nix +++ b/pkgs/tools/security/mkpasswd/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation { inherit (whois) preConfigure; buildPhase = "make mkpasswd"; - installPhase = "make install-mkpasswd"; + installPhase = "runHook preInstall; make install-mkpasswd; runHook postInstall"; meta = with lib; { homepage = "https://packages.qa.debian.org/w/whois.html"; diff --git a/pkgs/tools/security/modsecurity-crs/default.nix b/pkgs/tools/security/modsecurity-crs/default.nix index 16e21577f78ea..cfba9fe3a359e 100644 --- a/pkgs/tools/security/modsecurity-crs/default.nix +++ b/pkgs/tools/security/modsecurity-crs/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -D -m444 -t $out/rules ${src}/rules/*.conf install -D -m444 -t $out/rules ${src}/rules/*.data install -D -m444 -t $out/share/doc/modsecurity-crs ${src}/*.md @@ -27,6 +29,8 @@ stdenv.mkDerivation rec { Include $out/rules/*.conf IncludeOptional /etc/modsecurity/crs/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf EOF + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/nasty/default.nix b/pkgs/tools/security/nasty/default.nix index 80b6a2da8e2da..be645a469a08f 100644 --- a/pkgs/tools/security/nasty/default.nix +++ b/pkgs/tools/security/nasty/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { buildInputs = [ gpgme ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp nasty $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/onesixtyone/default.nix b/pkgs/tools/security/onesixtyone/default.nix index 1ff1b0266eaf0..d1515421cdc67 100644 --- a/pkgs/tools/security/onesixtyone/default.nix +++ b/pkgs/tools/security/onesixtyone/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D onesixtyone $out/bin/onesixtyone + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/open-ecard/default.nix b/pkgs/tools/security/open-ecard/default.nix index a3f3f72bc6313..f269783f41695 100644 --- a/pkgs/tools/security/open-ecard/default.nix +++ b/pkgs/tools/security/open-ecard/default.nix @@ -37,6 +37,8 @@ in stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/share/java cp ${srcs.richclient} $out/share/java/richclient-${version}.jar cp ${srcs.cifs} $out/share/java/cifs-${version}.jar @@ -50,6 +52,8 @@ in stdenv.mkDerivation rec { --add-flags "-cp $out/share/java/cifs-${version}.jar" \ --add-flags "-jar $out/share/java/richclient-${version}.jar" \ --suffix LD_LIBRARY_PATH ':' ${lib.getLib pcsclite}/lib + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/p0f/default.nix b/pkgs/tools/security/p0f/default.nix index 84221fbd566ca..ecd1b320cb706 100644 --- a/pkgs/tools/security/p0f/default.nix +++ b/pkgs/tools/security/p0f/default.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/sbin $out/etc cp ./p0f $out/sbin @@ -27,6 +29,8 @@ stdenv.mkDerivation rec { cp ./tools/p0f-client $out/sbin cp ./tools/p0f-sendsyn $out/sbin cp ./tools/p0f-sendsyn6 $out/sbin + + runHook postInstall ''; hardeningDisable = [ "format" ]; diff --git a/pkgs/tools/security/pass/rofi-pass.nix b/pkgs/tools/security/pass/rofi-pass.nix index e204c14a234e5..9a824bde13686 100644 --- a/pkgs/tools/security/pass/rofi-pass.nix +++ b/pkgs/tools/security/pass/rofi-pass.nix @@ -43,11 +43,15 @@ stdenv.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a rofi-pass $out/bin/rofi-pass mkdir -p $out/share/doc/rofi-pass/ cp -a config.example $out/share/doc/rofi-pass/config.example + + runHook postInstall ''; wrapperPath = lib.makeBinPath ([ diff --git a/pkgs/tools/security/pass/wofi-pass.nix b/pkgs/tools/security/pass/wofi-pass.nix index ef48f335b5fdf..a26ee6b3e75a7 100644 --- a/pkgs/tools/security/pass/wofi-pass.nix +++ b/pkgs/tools/security/pass/wofi-pass.nix @@ -43,8 +43,12 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + install -Dm755 wofi-pass -t $out/bin install -Dm755 wofi-pass.conf -t $out/share/doc/wofi-pass/wofi-pass.conf + + runHook postInstall ''; fixupPhase = '' diff --git a/pkgs/tools/security/passff-host/default.nix b/pkgs/tools/security/passff-host/default.nix index d5cf2f8267e2b..9781c2bc6d11f 100644 --- a/pkgs/tools/security/passff-host/default.nix +++ b/pkgs/tools/security/passff-host/default.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + substituteInPlace bin/${version}/passff.json \ --replace PLACEHOLDER $out/share/passff-host/passff.py @@ -37,6 +39,8 @@ stdenv.mkDerivation rec { install -d $out$manifestDir ln -s $out/share/passff-host/passff.json $out$manifestDir/ done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/pcsc-safenet/default.nix b/pkgs/tools/security/pcsc-safenet/default.nix index 27d3c639ac8eb..8b15bb0abc068 100644 --- a/pkgs/tools/security/pcsc-safenet/default.nix +++ b/pkgs/tools/security/pcsc-safenet/default.nix @@ -46,6 +46,8 @@ stdenv.mkDerivation rec { ]; installPhase = '' + runHook preInstall + mv usr/* . mkdir -p pcsc/drivers @@ -76,6 +78,8 @@ stdenv.mkDerivation rec { ) || exit ln -sf ${lib.getLib openssl_1_1}/lib/libcrypto.so $out/lib/libcrypto.so.1.1.0 + + runHook postInstall ''; dontAutoPatchelf = true; diff --git a/pkgs/tools/security/pcsc-scm-scl011/default.nix b/pkgs/tools/security/pcsc-scm-scl011/default.nix index af3a95f0a2aac..b7af809450131 100644 --- a/pkgs/tools/security/pcsc-scm-scl011/default.nix +++ b/pkgs/tools/security/pcsc-scm-scl011/default.nix @@ -26,8 +26,12 @@ stdenv.mkDerivation rec { patches = [ ./eid.patch ]; installPhase = '' + runHook preInstall + mkdir -p $out/pcsc/drivers cp -r proprietary/*.bundle $out/pcsc/drivers + + runHook postInstall ''; libPath = lib.makeLibraryPath [ libusb-compat-0_1 ]; diff --git a/pkgs/tools/security/pdfcrack/default.nix b/pkgs/tools/security/pdfcrack/default.nix index ae863e1ec1f57..cb8ad4e43c8f4 100644 --- a/pkgs/tools/security/pdfcrack/default.nix +++ b/pkgs/tools/security/pdfcrack/default.nix @@ -13,7 +13,11 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + install -Dt $out/bin pdfcrack + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/pinentry/mac.nix b/pkgs/tools/security/pinentry/mac.nix index 8e808e18edd32..41fa3d7e25c53 100644 --- a/pkgs/tools/security/pinentry/mac.nix +++ b/pkgs/tools/security/pinentry/mac.nix @@ -44,11 +44,15 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-maintainer-mode" "--disable-ncurses" ]; installPhase = '' + runHook preInstall + mkdir -p $out/Applications $out/bin mv macosx/pinentry-mac.app $out/Applications # Compatibility with `lib.getExe` makeWrapper $out/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac $out/bin/pinentry-mac + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/tools/security/quill-qr/default.nix b/pkgs/tools/security/quill-qr/default.nix index 826f2e51799ca..6dfee8a6f71c9 100644 --- a/pkgs/tools/security/quill-qr/default.nix +++ b/pkgs/tools/security/quill-qr/default.nix @@ -24,6 +24,8 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a quill-qr.sh $out/bin/quill-qr.sh patchShebangs $out/bin @@ -34,6 +36,8 @@ stdenvNoCC.mkDerivation rec { jq gzip ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/snow/default.nix b/pkgs/tools/security/snow/default.nix index 5e7cb013a4edc..3b9b327ebe89f 100644 --- a/pkgs/tools/security/snow/default.nix +++ b/pkgs/tools/security/snow/default.nix @@ -14,7 +14,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dm755 snow -t $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/sonar-scanner-cli/default.nix b/pkgs/tools/security/sonar-scanner-cli/default.nix index b97a2bc3a105d..eee8962509f32 100644 --- a/pkgs/tools/security/sonar-scanner-cli/default.nix +++ b/pkgs/tools/security/sonar-scanner-cli/default.nix @@ -24,12 +24,16 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out/lib cp -r lib/* $out/lib/ mkdir -p $out/bin cp bin/* $out/bin/ mkdir -p $out/conf cp conf/* $out/conf/ + + runHook postInstall ''; fixupPhase = '' diff --git a/pkgs/tools/security/spectre-cli/default.nix b/pkgs/tools/security/spectre-cli/default.nix index 923046cdad4ae..c4bdf8b52f37d 100644 --- a/pkgs/tools/security/spectre-cli/default.nix +++ b/pkgs/tools/security/spectre-cli/default.nix @@ -58,8 +58,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv spectre $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/stricat/default.nix b/pkgs/tools/security/stricat/default.nix index b21498e009f1a..768f30e3e2888 100644 --- a/pkgs/tools/security/stricat/default.nix +++ b/pkgs/tools/security/stricat/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { buildFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv stricat $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/security/tpm-luks/default.nix b/pkgs/tools/security/tpm-luks/default.nix index 16d88c9196b80..8acbf95b8e22e 100644 --- a/pkgs/tools/security/tpm-luks/default.nix +++ b/pkgs/tools/security/tpm-luks/default.nix @@ -20,10 +20,14 @@ stdenv.mkDerivation { buildInputs = [ gawk trousers cryptsetup openssl ]; installPhase = '' + runHook preInstall + mkdir -p $out make install DESTDIR=$out mv $out/$out/sbin $out/bin rm -r $out/nix + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/security/tracee/integration-tests.nix b/pkgs/tools/security/tracee/integration-tests.nix index fd3feb69f5648..b48a9d462cdec 100644 --- a/pkgs/tools/security/tracee/integration-tests.nix +++ b/pkgs/tools/security/tracee/integration-tests.nix @@ -29,9 +29,13 @@ tracee.overrideAttrs (oa: { ''; doCheck = false; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv $GOPATH/tracee-integration/{integration.test,syscaller} $out/bin/ # cp -r ${tracee}/bin/signatures $out/bin/ + + runHook postInstall ''; doInstallCheck = false; diff --git a/pkgs/tools/system/awstats/default.nix b/pkgs/tools/system/awstats/default.nix index e1479e6192cb9..6e372114db615 100644 --- a/pkgs/tools/system/awstats/default.nix +++ b/pkgs/tools/system/awstats/default.nix @@ -42,6 +42,8 @@ perlPackages.buildPerlPackage rec { doCheck = false; installPhase = '' + runHook preInstall + mkdir "$out" mv wwwroot "$out/wwwroot" rm -r "$out/wwwroot/classes/src/" @@ -55,6 +57,8 @@ perlPackages.buildPerlPackage rec { mkdir -p "$doc/share/doc" mv README.md docs/ mv docs "$doc/share/doc/awstats" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/system/collectd/data.nix b/pkgs/tools/system/collectd/data.nix index 52e394db40b82..d6dc2578c8db7 100644 --- a/pkgs/tools/system/collectd/data.nix +++ b/pkgs/tools/system/collectd/data.nix @@ -9,6 +9,10 @@ stdenv.mkDerivation { dontFixup = true; installPhase = '' + runHook preInstall + install -Dm444 -t $out/share/collectd/ src/*.{db,conf} + + runHook postInstall ''; } diff --git a/pkgs/tools/system/das_watchdog/default.nix b/pkgs/tools/system/das_watchdog/default.nix index 141e16181cec6..987ded4d228f6 100644 --- a/pkgs/tools/system/das_watchdog/default.nix +++ b/pkgs/tools/system/das_watchdog/default.nix @@ -15,9 +15,13 @@ stdenv.mkDerivation { buildInputs = [ libgtop xmessage which ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin/ cp das_watchdog $out/bin/ cp test_rt $out/bin/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/system/ddrescueview/default.nix b/pkgs/tools/system/ddrescueview/default.nix index d3a2e46da14bf..65fefe1b7c963 100644 --- a/pkgs/tools/system/ddrescueview/default.nix +++ b/pkgs/tools/system/ddrescueview/default.nix @@ -21,10 +21,14 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -Dt $out/bin ddrescueview cd ../resources/linux mkdir -p "$out/share" cp -ar applications icons man $out/share + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/system/dell-command-configure/default.nix b/pkgs/tools/system/dell-command-configure/default.nix index cd313751c7b63..f10db21c649e9 100644 --- a/pkgs/tools/system/dell-command-configure/default.nix +++ b/pkgs/tools/system/dell-command-configure/default.nix @@ -44,8 +44,12 @@ let ''; installPhase = '' + runHook preInstall + mkdir $out cp -r . $out + + runHook postInstall ''; }; @@ -65,7 +69,11 @@ let cc -fPIC -shared lib.c -o ${wrapperLibName} ''; installPhase = '' + runHook preInstall + install -D ${wrapperLibName} -t $out/lib + + runHook postInstall ''; }; @@ -80,6 +88,8 @@ in stdenv.mkDerivation rec { src = unpacked; installPhase = '' + runHook preInstall + install -D -t $out/lib -m644 -v command-configure/opt/dell/dcc/libhapiintf.so install -D -t $out/lib -m644 -v command-configure/opt/dell/dcc/libsmbios_c.so.2 install -D -t $out/bin -m755 -v command-configure/opt/dell/dcc/cctk @@ -87,6 +97,8 @@ in stdenv.mkDerivation rec { for lib in $(find srvadmin-hapi/opt/dell/srvadmin/lib64 -type l); do install -D -t $out/lib -m644 -v $lib done + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/system/gptfdisk/default.nix b/pkgs/tools/system/gptfdisk/default.nix index 2718be70c71f1..3aad3a53b8066 100644 --- a/pkgs/tools/system/gptfdisk/default.nix +++ b/pkgs/tools/system/gptfdisk/default.nix @@ -32,6 +32,8 @@ stdenv.mkDerivation rec { buildInputs = [ libuuid popt icu ncurses ]; installPhase = '' + runHook preInstall + mkdir -p $out/sbin mkdir -p $out/share/man/man8 for prog in gdisk sgdisk fixparts cgdisk @@ -39,6 +41,8 @@ stdenv.mkDerivation rec { install -v -m755 $prog $out/sbin install -v -m644 $prog.8 $out/share/man/man8 done + + runHook postInstall ''; passthru.tests = lib.optionalAttrs stdenv.hostPlatform.isx86 { diff --git a/pkgs/tools/system/illum/default.nix b/pkgs/tools/system/illum/default.nix index 81d8bbee7b8d7..c73485a3d3787 100644 --- a/pkgs/tools/system/illum/default.nix +++ b/pkgs/tools/system/illum/default.nix @@ -28,8 +28,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv illum-d $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/system/inxi/default.nix b/pkgs/tools/system/inxi/default.nix index d32f7304ff083..398e2e45bd014 100644 --- a/pkgs/tools/system/inxi/default.nix +++ b/pkgs/tools/system/inxi/default.nix @@ -36,6 +36,8 @@ in stdenv.mkDerivation rec { buildInputs = [ perl ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp inxi $out/bin/ wrapProgram $out/bin/inxi \ @@ -43,6 +45,8 @@ in stdenv.mkDerivation rec { ${prefixPath programs} mkdir -p $out/share/man/man1 cp inxi.1 $out/share/man/man1/ + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/system/loadwatch/default.nix b/pkgs/tools/system/loadwatch/default.nix index c9ef1b541d4fd..57936c51f87e3 100644 --- a/pkgs/tools/system/loadwatch/default.nix +++ b/pkgs/tools/system/loadwatch/default.nix @@ -11,8 +11,12 @@ stdenv.mkDerivation { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin install loadwatch lw-ctl $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/system/minijail/default.nix b/pkgs/tools/system/minijail/default.nix index 05129009deee2..0ddd22fa66649 100644 --- a/pkgs/tools/system/minijail/default.nix +++ b/pkgs/tools/system/minijail/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation rec { hardeningDisable = [ "fortify3" ]; installPhase = '' + runHook preInstall + ./platform2_preinstall.sh ${version} $out/include/chromeos mkdir -p $out/lib/pkgconfig $out/include/chromeos $out/bin \ @@ -32,6 +34,8 @@ stdenv.mkDerivation rec { cp -v *.pc $out/lib/pkgconfig cp -v libminijail.h scoped_minijail.h $out/include/chromeos cp -v minijail0 $out/bin + + runHook postInstall ''; enableParallelBuilding = true; diff --git a/pkgs/tools/system/mlc/default.nix b/pkgs/tools/system/mlc/default.nix index 409738e4a353a..1df6a17a01bc9 100644 --- a/pkgs/tools/system/mlc/default.nix +++ b/pkgs/tools/system/mlc/default.nix @@ -11,7 +11,11 @@ stdenv.mkDerivation rec { sourceRoot = "Linux"; installPhase = '' + runHook preInstall + install -Dm755 mlc $out/bin/mlc + + runHook postInstall ''; nativeBuildInputs = [ patchelf ]; diff --git a/pkgs/tools/system/osquery/toolchain-bin.nix b/pkgs/tools/system/osquery/toolchain-bin.nix index d23b3ca1867c0..d3c293a3e9243 100644 --- a/pkgs/tools/system/osquery/toolchain-bin.nix +++ b/pkgs/tools/system/osquery/toolchain-bin.nix @@ -27,8 +27,12 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ autoPatchelfHook ]; installPhase = '' + runHook preInstall + mkdir $out cp -r * $out + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/system/rofi-systemd/default.nix b/pkgs/tools/system/rofi-systemd/default.nix index b8be1adea984f..2d9469fa2285b 100644 --- a/pkgs/tools/system/rofi-systemd/default.nix +++ b/pkgs/tools/system/rofi-systemd/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -a rofi-systemd $out/bin/rofi-systemd + + runHook postInstall ''; wrapperPath = with lib; makeBinPath [ diff --git a/pkgs/tools/system/rowhammer-test/default.nix b/pkgs/tools/system/rowhammer-test/default.nix index c19f7a54f0dd1..fa308ed1af55f 100644 --- a/pkgs/tools/system/rowhammer-test/default.nix +++ b/pkgs/tools/system/rowhammer-test/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation { buildPhase = "sh -e make.sh"; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp rowhammer_test double_sided_rowhammer $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/system/runit/default.nix b/pkgs/tools/system/runit/default.nix index 2553c07cd6b5c..1df0c72ec24ad 100644 --- a/pkgs/tools/system/runit/default.nix +++ b/pkgs/tools/system/runit/default.nix @@ -44,11 +44,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -t $out/bin $(< ../package/commands) mkdir -p $man/share/man cp -r ../man $man/share/man/man8 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/system/sleuthkit/default.nix b/pkgs/tools/system/sleuthkit/default.nix index 53d148a53028c..bfaa24283125e 100644 --- a/pkgs/tools/system/sleuthkit/default.nix +++ b/pkgs/tools/system/sleuthkit/default.nix @@ -44,12 +44,16 @@ stdenv.mkDerivation (finalAttrs: { ''; installPhase = '' + runHook preInstall + mkdir -m 755 -p $out/bindings/java cp -r bindings/java/lib $out/bindings/java mkdir -m 755 -p $out/case-uco/java cp -r case-uco/java/lib $out/case-uco/java cp -r $IVY_HOME/lib $out chmod -R 755 $out/lib + + runHook postInstall ''; outputHashMode = "recursive"; diff --git a/pkgs/tools/system/socklog/default.nix b/pkgs/tools/system/socklog/default.nix index 8ba9ab21b13d3..d947318518971 100644 --- a/pkgs/tools/system/socklog/default.nix +++ b/pkgs/tools/system/socklog/default.nix @@ -31,6 +31,8 @@ stdenv.mkDerivation rec { buildPhase = "package/compile"; installPhase = '' + runHook preInstall + mkdir -p $out/bin mv command"/"* $out/bin @@ -41,6 +43,8 @@ stdenv.mkDerivation rec { mkdir -p $doc/share/doc/socklog/html mv doc/*.html $doc/share/doc/socklog/html/ + + runHook postInstall ''; checkPhase = "package/check"; diff --git a/pkgs/tools/system/symlinks/default.nix b/pkgs/tools/system/symlinks/default.nix index 7ca0503676c33..ef4acfa3b3af6 100644 --- a/pkgs/tools/system/symlinks/default.nix +++ b/pkgs/tools/system/symlinks/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { buildFlags = [ "CC=${stdenv.cc}/bin/cc" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man/man8 cp symlinks $out/bin cp symlinks.8 $out/share/man/man8 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/system/tuptime/default.nix b/pkgs/tools/system/tuptime/default.nix index d92f65f78ae2c..182059d336a96 100644 --- a/pkgs/tools/system/tuptime/default.nix +++ b/pkgs/tools/system/tuptime/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "man" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -m 755 $src/src/tuptime $out/bin/ @@ -29,6 +31,8 @@ stdenv.mkDerivation rec { install -Dm 0755 $src/misc/scripts/db-tuptime-migrate-4.0-to-5.0.sh \ $out/share/tuptime/db-tuptime-migrate-4.0-to-5.0.sh + + runHook postInstall ''; preFixup = '' diff --git a/pkgs/tools/system/uefitool/common.nix b/pkgs/tools/system/uefitool/common.nix index 353cec91be98c..ef1de5854815e 100644 --- a/pkgs/tools/system/uefitool/common.nix +++ b/pkgs/tools/system/uefitool/common.nix @@ -26,8 +26,12 @@ mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out"/bin cp ${lib.concatStringsSep " " installFiles} "$out"/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/system/undaemonize/default.nix b/pkgs/tools/system/undaemonize/default.nix index 83007db867dc3..649848ccfba88 100644 --- a/pkgs/tools/system/undaemonize/default.nix +++ b/pkgs/tools/system/undaemonize/default.nix @@ -11,7 +11,11 @@ stdenv.mkDerivation { sha256 = "1fkrgj3xfhj820qagh5p0rabl8z2hpad6yp984v92h9pgbfwxs33"; }; installPhase = '' + runHook preInstall + install -D undaemonize $out/bin/undaemonize + + runHook postInstall ''; meta = { description = "Tiny helper utility to force programs which insist on daemonizing themselves to run in the foreground"; diff --git a/pkgs/tools/system/yeshup/default.nix b/pkgs/tools/system/yeshup/default.nix index 723021d0ee74a..07d24a4cb5252 100644 --- a/pkgs/tools/system/yeshup/default.nix +++ b/pkgs/tools/system/yeshup/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -v yeshup $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/text/boxes/default.nix b/pkgs/tools/text/boxes/default.nix index 68e5b9c7ddca0..0cb4d88595f9b 100644 --- a/pkgs/tools/text/boxes/default.nix +++ b/pkgs/tools/text/boxes/default.nix @@ -30,9 +30,13 @@ gccStdenv.mkDerivation rec { makeFlags = [ "CC=${gccStdenv.cc.targetPrefix}cc" ]; installPhase = '' + runHook preInstall + install -Dm755 -t $out/bin out/boxes install -Dm644 -t $out/share/boxes boxes-config install -Dm644 -t $out/share/man/man1 doc/boxes.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/text/catdocx/default.nix b/pkgs/tools/text/catdocx/default.nix index 27eb964eb3c23..b6532b269c82b 100644 --- a/pkgs/tools/text/catdocx/default.nix +++ b/pkgs/tools/text/catdocx/default.nix @@ -14,11 +14,15 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/libexec $out/bin cp catdocx.sh $out/libexec chmod +x $out/libexec/catdocx.sh wrapProgram $out/libexec/catdocx.sh --prefix PATH : "${lib.makeBinPath [ unzip catdoc ]}" ln -s $out/libexec/catdocx.sh $out/bin/catdocx + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/text/convertlit/default.nix b/pkgs/tools/text/convertlit/default.nix index 417007fbd3ba9..288d342d118ca 100644 --- a/pkgs/tools/text/convertlit/default.nix +++ b/pkgs/tools/text/convertlit/default.nix @@ -24,8 +24,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp clit $out/bin + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/text/dadadodo/default.nix b/pkgs/tools/text/dadadodo/default.nix index dc1a18ae23f2a..734de4fea5491 100644 --- a/pkgs/tools/text/dadadodo/default.nix +++ b/pkgs/tools/text/dadadodo/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp dadadodo $out/bin + + runHook postInstall ''; hardeningDisable = [ "format" ]; diff --git a/pkgs/tools/text/epubcheck/default.nix b/pkgs/tools/text/epubcheck/default.nix index abd2803508bb1..3124c18cdd822 100644 --- a/pkgs/tools/text/epubcheck/default.nix +++ b/pkgs/tools/text/epubcheck/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/lib cp -r lib/* $out/lib @@ -29,6 +31,8 @@ stdenv.mkDerivation rec { mkdir -p $out/bin makeWrapper ${jre}/bin/java $out/bin/epubcheck \ --add-flags "-classpath $classpath com.adobe.epubcheck.tool.Checker" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/text/hyx/default.nix b/pkgs/tools/text/hyx/default.nix index 3cbcac20966a2..04b984a6795b8 100644 --- a/pkgs/tools/text/hyx/default.nix +++ b/pkgs/tools/text/hyx/default.nix @@ -17,7 +17,11 @@ stdenv.mkDerivation rec { buildInputs = lib.optional (stdenv.system == "x86_64-darwin") memstreamHook; installPhase = '' + runHook preInstall + install -vD hyx $out/bin/hyx + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/text/justify/default.nix b/pkgs/tools/text/justify/default.nix index 86de7365663e1..0794bbfe955db 100644 --- a/pkgs/tools/text/justify/default.nix +++ b/pkgs/tools/text/justify/default.nix @@ -23,7 +23,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; installPhase = '' + runHook preInstall + install -D justify $out/bin/justify + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/text/l2md/default.nix b/pkgs/tools/text/l2md/default.nix index d8bb04378f070..c51f9d2454454 100644 --- a/pkgs/tools/text/l2md/default.nix +++ b/pkgs/tools/text/l2md/default.nix @@ -12,8 +12,12 @@ stdenv.mkDerivation rec { buildInputs = [ libgit2 ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp l2md $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/text/ledger2beancount/default.nix b/pkgs/tools/text/ledger2beancount/default.nix index 3852229376769..caacbafc2e5d0 100644 --- a/pkgs/tools/text/ledger2beancount/default.nix +++ b/pkgs/tools/text/ledger2beancount/default.nix @@ -33,8 +33,12 @@ in stdenv.mkDerivation rec { installFlags = [ "INSTALL=install" ]; installPhase = '' + runHook preInstall + mkdir -p $out cp -r $src/bin $out/bin + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/text/mb2md/default.nix b/pkgs/tools/text/mb2md/default.nix index 3594d4753d852..83c4aa93ac021 100644 --- a/pkgs/tools/text/mb2md/default.nix +++ b/pkgs/tools/text/mb2md/default.nix @@ -21,7 +21,11 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + install -D $sourceRoot/mb2md.pl $out/bin/mb2md + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/text/papertrail/default.nix b/pkgs/tools/text/papertrail/default.nix index 5e2b080f9852c..b7a9072c9e6ed 100644 --- a/pkgs/tools/text/papertrail/default.nix +++ b/pkgs/tools/text/papertrail/default.nix @@ -15,8 +15,12 @@ in stdenv.mkDerivation { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin ln -s ${papertrail-env}/bin/papertrail $out/bin/papertrail + + runHook postInstall ''; passthru.updateScript = bundlerUpdateScript "papertrail"; diff --git a/pkgs/tools/text/par/default.nix b/pkgs/tools/text/par/default.nix index c62df86835c0f..b859828d84b43 100644 --- a/pkgs/tools/text/par/default.nix +++ b/pkgs/tools/text/par/default.nix @@ -15,11 +15,15 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp par $out/bin mkdir -p $out/share/man/man1 cp par.1 $out/share/man/man1 + + runHook postInstall ''; diff --git a/pkgs/tools/text/popfile/default.nix b/pkgs/tools/text/popfile/default.nix index b902a75bb4767..efebf30ae4e80 100644 --- a/pkgs/tools/text/popfile/default.nix +++ b/pkgs/tools/text/popfile/default.nix @@ -30,6 +30,8 @@ stdenv.mkDerivation rec { ]); installPhase = '' + runHook preInstall + mkdir -p $out/bin # I user `cd` rather than `cp $out/* ...` b/c the * breaks syntax # highlighting in emacs for me. @@ -45,6 +47,8 @@ stdenv.mkDerivation rec { --run 'export POPFILE_USER=''${POPFILE_USER:-$HOME/.popfile}' \ --run 'test -d "$POPFILE_USER" || mkdir -m 0700 -p "$POPFILE_USER"' done + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/text/schema2ldif/default.nix b/pkgs/tools/text/schema2ldif/default.nix index fc4a2153d662d..e1b071475f680 100644 --- a/pkgs/tools/text/schema2ldif/default.nix +++ b/pkgs/tools/text/schema2ldif/default.nix @@ -22,6 +22,8 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man/man1 cp bin/{schema2ldif,ldap-schema-manager} $out/bin @@ -30,6 +32,8 @@ stdenvNoCC.mkDerivation rec { wrapProgram $out/bin/schema2ldif \ --prefix PERL5PATH : "${perlPackages.makePerlPath [ perlPackages.GetoptLong ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/text/subedit/default.nix b/pkgs/tools/text/subedit/default.nix index 9bacdc23de0db..6aa06354579be 100644 --- a/pkgs/tools/text/subedit/default.nix +++ b/pkgs/tools/text/subedit/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation { buildInputs = [ libuchardet dos2unix file ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin install -m555 subedit $out/bin/ + + runHook postInstall ''; postFixup = '' diff --git a/pkgs/tools/text/uniscribe/default.nix b/pkgs/tools/text/uniscribe/default.nix index 98b164a9d58d4..b1e9b622c5d9c 100644 --- a/pkgs/tools/text/uniscribe/default.nix +++ b/pkgs/tools/text/uniscribe/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation rec { dontUnpack = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin makeWrapper ${rubyEnv}/bin/uniscribe $out/bin/uniscribe + + runHook postInstall ''; passthru.updateScript = bundlerUpdateScript "uniscribe"; diff --git a/pkgs/tools/text/wgetpaste/default.nix b/pkgs/tools/text/wgetpaste/default.nix index 8ca014e0d5f58..e9f409c007243 100644 --- a/pkgs/tools/text/wgetpaste/default.nix +++ b/pkgs/tools/text/wgetpaste/default.nix @@ -16,8 +16,12 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin; cp wgetpaste $out/bin; + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/text/xidel/default.nix b/pkgs/tools/text/xidel/default.nix index 6a55a5d9e8b13..7cb8e23b476a1 100644 --- a/pkgs/tools/text/xidel/default.nix +++ b/pkgs/tools/text/xidel/default.nix @@ -75,9 +75,13 @@ in stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p "$out/bin" "$out/share/man/man1" cp meta/xidel.1 "$out/share/man/man1/" cp xidel "$out/bin/" + + runHook postInstall ''; # disabled, because tests require network diff --git a/pkgs/tools/text/xml/jing-trang/default.nix b/pkgs/tools/text/xml/jing-trang/default.nix index 0acc471b70174..9b0494b1d4236 100644 --- a/pkgs/tools/text/xml/jing-trang/default.nix +++ b/pkgs/tools/text/xml/jing-trang/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation rec { preBuild = "ant"; installPhase = '' + runHook preInstall + mkdir -p "$out"/{share/java,bin} cp ./build/*.jar ./lib/resolver.jar "$out/share/java/" @@ -35,6 +37,8 @@ stdenv.mkDerivation rec { done chmod +x "$out"/bin/* + + runHook postInstall ''; doCheck = true; diff --git a/pkgs/tools/text/xml/xmlformat/default.nix b/pkgs/tools/text/xml/xmlformat/default.nix index 514d691c6a32d..61969dfda9479 100644 --- a/pkgs/tools/text/xml/xmlformat/default.nix +++ b/pkgs/tools/text/xml/xmlformat/default.nix @@ -14,9 +14,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp ./xmlformat.pl $out/bin/xmlformat cp ./LICENSE $out/ + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/text/xml/xmloscopy/default.nix b/pkgs/tools/text/xml/xmloscopy/default.nix index 32162849c41d5..25fb1c1c308df 100644 --- a/pkgs/tools/text/xml/xmloscopy/default.nix +++ b/pkgs/tools/text/xml/xmloscopy/default.nix @@ -32,6 +32,8 @@ stdenv.mkDerivation rec { }; installPhase = '' + runHook preInstall + sed -i "s/hard to say/v${version}/" ./xmloscopy type -P shellcheck && shellcheck ./xmloscopy chmod +x ./xmloscopy @@ -41,6 +43,8 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/xmloscopy \ --set RNG "${docbook5}/xml/rng/docbook/docbook.rng" \ --set PATH "${spath}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/text/yaml-merge/default.nix b/pkgs/tools/text/yaml-merge/default.nix index a5113a92f7021..56d56fc9b7974 100644 --- a/pkgs/tools/text/yaml-merge/default.nix +++ b/pkgs/tools/text/yaml-merge/default.nix @@ -15,8 +15,12 @@ stdenv.mkDerivation { nativeBuildInputs = with python3Packages; [ wrapPython ]; installPhase = '' + runHook preInstall + install -Dm755 yaml-merge.py $out/bin/yaml-merge wrapPythonPrograms + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/typesetting/asciidoctorj/default.nix b/pkgs/tools/typesetting/asciidoctorj/default.nix index 2909573298214..579c3ac5e1762 100644 --- a/pkgs/tools/typesetting/asciidoctorj/default.nix +++ b/pkgs/tools/typesetting/asciidoctorj/default.nix @@ -12,10 +12,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + rm bin/asciidoctorj.bat cp -r . $out wrapProgram $out/bin/asciidoctorj \ --prefix JAVA_HOME : ${jdk} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/typesetting/biblatex-check/default.nix b/pkgs/tools/typesetting/biblatex-check/default.nix index beff041561909..bcf97fea9e9d9 100644 --- a/pkgs/tools/typesetting/biblatex-check/default.nix +++ b/pkgs/tools/typesetting/biblatex-check/default.nix @@ -16,7 +16,11 @@ stdenv.mkDerivation rec { strictDeps = true; installPhase = '' + runHook preInstall + install -Dm755 biblatex_check.py $out/bin/biblatex-check + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/typesetting/coq2html/default.nix b/pkgs/tools/typesetting/coq2html/default.nix index 69b3bc0ff2396..94497a10be2b8 100644 --- a/pkgs/tools/typesetting/coq2html/default.nix +++ b/pkgs/tools/typesetting/coq2html/default.nix @@ -14,8 +14,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ ocaml ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp coq2html $out/bin + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/typesetting/djvu2pdf/default.nix b/pkgs/tools/typesetting/djvu2pdf/default.nix index 9396d43b3962c..69cb18318ae02 100644 --- a/pkgs/tools/typesetting/djvu2pdf/default.nix +++ b/pkgs/tools/typesetting/djvu2pdf/default.nix @@ -12,12 +12,16 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -p djvu2pdf $out/bin wrapProgram $out/bin/djvu2pdf --prefix PATH : ${lib.makeBinPath [ ghostscript djvulibre which ]} mkdir -p $out/man/man1 cp -p djvu2pdf.1.gz $out/man/man1 + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/typesetting/docbook2odf/default.nix b/pkgs/tools/typesetting/docbook2odf/default.nix index 7608fb1228ed1..c84021aa2a3f0 100644 --- a/pkgs/tools/typesetting/docbook2odf/default.nix +++ b/pkgs/tools/typesetting/docbook2odf/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { buildInputs = [ perlPackages.perl ]; installPhase = '' + runHook preInstall + mkdir -p "$out/bin/" mkdir -p "$out/share/docbook2odf/" mkdir -p "$out/share/doc/docbook2odf/" @@ -30,6 +32,8 @@ stdenv.mkDerivation rec { wrapProgram "$out/bin/docbook2odf" \ --prefix PATH : "${lib.makeBinPath [ zip libxslt ]}" \ --prefix PERL5PATH : "${perlPackages.makePerlPath [ perlPackages.ImageMagick ]}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/typesetting/git-latexdiff/default.nix b/pkgs/tools/typesetting/git-latexdiff/default.nix index e7e4351a2088b..0c54fe5db0d50 100644 --- a/pkgs/tools/typesetting/git-latexdiff/default.nix +++ b/pkgs/tools/typesetting/git-latexdiff/default.nix @@ -24,9 +24,13 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $prefix/bin mv git-latexdiff $prefix/bin chmod +x $prefix/bin/git-latexdiff + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/typesetting/pdfsandwich/default.nix b/pkgs/tools/typesetting/pdfsandwich/default.nix index 8343e382c807b..930347d2a9c9d 100644 --- a/pkgs/tools/typesetting/pdfsandwich/default.nix +++ b/pkgs/tools/typesetting/pdfsandwich/default.nix @@ -14,12 +14,16 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ocaml perl ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -p pdfsandwich $out/bin wrapProgram $out/bin/pdfsandwich --prefix PATH : ${lib.makeBinPath [ imagemagick ghostscript poppler_utils unpaper tesseract ]} mkdir -p $out/man/man1 cp -p pdfsandwich.1.gz $out/man/man1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/typesetting/pdftk/default.nix b/pkgs/tools/typesetting/pdftk/default.nix index 9ecb87b86ff65..e1a287e5274fd 100644 --- a/pkgs/tools/typesetting/pdftk/default.nix +++ b/pkgs/tools/typesetting/pdftk/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { gradleBuildTask = "shadowJar"; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,share/pdftk,share/man/man1} cp build/libs/pdftk-all.jar $out/share/pdftk @@ -35,6 +37,8 @@ stdenv.mkDerivation rec { chmod a+x "$out/bin/pdftk" cp ${src}/pdftk.1 $out/share/man/man1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/typesetting/sshlatex/default.nix b/pkgs/tools/typesetting/sshlatex/default.nix index a163c934e46d1..f906fbc5ca4cb 100644 --- a/pkgs/tools/typesetting/sshlatex/default.nix +++ b/pkgs/tools/typesetting/sshlatex/default.nix @@ -16,9 +16,13 @@ stdenv.mkDerivation rec { installPhase = let binPath = lib.makeBinPath [ openssh perl gnutar bash inotify-tools ]; in '' + runHook preInstall + mkdir -p $out/bin cp sshlatex $out/bin wrapProgram $out/bin/sshlatex --prefix PATH : "${binPath}" + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/typesetting/tex/blahtexml/default.nix b/pkgs/tools/typesetting/tex/blahtexml/default.nix index 9d88ac3b0be60..3f19df51d70cf 100644 --- a/pkgs/tools/typesetting/tex/blahtexml/default.nix +++ b/pkgs/tools/typesetting/tex/blahtexml/default.nix @@ -33,8 +33,12 @@ stdenv.mkDerivation rec { else [ "blahtex-linux" "blahtexml-linux" ]); installPhase = '' + runHook preInstall + install -D -t "$out/bin" blahtex blahtexml install -m644 -D -t "$doc/share/doc/blahtexml" Documentation/manual.pdf + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/typesetting/tex/dblatex/default.nix b/pkgs/tools/typesetting/tex/dblatex/default.nix index 39069029e57c5..bd3d506b1e302 100644 --- a/pkgs/tools/typesetting/tex/dblatex/default.nix +++ b/pkgs/tools/typesetting/tex/dblatex/default.nix @@ -52,7 +52,11 @@ stdenv.mkDerivation rec { dontBuild = true; installPhase = '' + runHook preInstall + ${python311.interpreter} ./setup.py install --prefix="$out" --use-python-path --verbose + + runHook postInstall ''; passthru = { inherit tex; }; diff --git a/pkgs/tools/typesetting/tex/latexrun/default.nix b/pkgs/tools/typesetting/tex/latexrun/default.nix index 5cab85a1cc1ff..3ea42eb578c44 100644 --- a/pkgs/tools/typesetting/tex/latexrun/default.nix +++ b/pkgs/tools/typesetting/tex/latexrun/default.nix @@ -14,9 +14,13 @@ stdenvNoCC.mkDerivation { dontBuild = true; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp latexrun $out/bin/latexrun chmod +x $out/bin/latexrun + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/video/yamdi/default.nix b/pkgs/tools/video/yamdi/default.nix index 1bcfffb929036..508dd716afab1 100644 --- a/pkgs/tools/video/yamdi/default.nix +++ b/pkgs/tools/video/yamdi/default.nix @@ -17,8 +17,12 @@ stdenv.mkDerivation rec { buildFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; installPhase = '' + runHook preInstall + install -D {,$out/bin/}yamdi install -D {,$out/share/man/}man1/yamdi.1 + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/virtualization/amazon-ecs-cli/default.nix b/pkgs/tools/virtualization/amazon-ecs-cli/default.nix index cd242a56410f6..bb24d1c60f74a 100644 --- a/pkgs/tools/virtualization/amazon-ecs-cli/default.nix +++ b/pkgs/tools/virtualization/amazon-ecs-cli/default.nix @@ -21,9 +21,13 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + mkdir -p $out/bin cp $src $out/bin/ecs-cli chmod +x $out/bin/ecs-cli + + runHook postInstall ''; # */ meta = with lib; { diff --git a/pkgs/tools/virtualization/distrobuilder/generator.nix b/pkgs/tools/virtualization/distrobuilder/generator.nix index e514a7df2e082..7136d0284df7e 100644 --- a/pkgs/tools/virtualization/distrobuilder/generator.nix +++ b/pkgs/tools/virtualization/distrobuilder/generator.nix @@ -13,7 +13,11 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -D -m 0555 distrobuilder/lxc.generator $out/lib/systemd/system-generators/lxc wrapProgram $out/lib/systemd/system-generators/lxc --prefix PATH : ${lib.makeBinPath [coreutils findutils gnugrep systemd]}:${systemd}/lib/systemd + + runHook postInstall ''; } diff --git a/pkgs/tools/virtualization/dockstarter/default.nix b/pkgs/tools/virtualization/dockstarter/default.nix index 40c6858da6a85..f2ec60aa8b2c8 100644 --- a/pkgs/tools/virtualization/dockstarter/default.nix +++ b/pkgs/tools/virtualization/dockstarter/default.nix @@ -24,6 +24,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall + install -Dm755 main.sh $out/bin/ds wrapProgram $out/bin/ds --prefix PATH : ${lib.makeBinPath [ bash @@ -31,6 +33,8 @@ stdenv.mkDerivation rec { git ncurses ]} + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/tools/virtualization/ec2-ami-tools/default.nix b/pkgs/tools/virtualization/ec2-ami-tools/default.nix index 8e6d7b06d1702..5ab9d718e45ef 100644 --- a/pkgs/tools/virtualization/ec2-ami-tools/default.nix +++ b/pkgs/tools/virtualization/ec2-ami-tools/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation rec { installPhase = '' + runHook preInstall + mkdir -p $out mv * $out rm $out/*.txt @@ -33,6 +35,8 @@ stdenv.mkDerivation rec { done sed -i 's|/bin/bash|${stdenv.shell}|' $out/lib/ec2/platform/base/pipeline.rb + + runHook postInstall ''; # */ meta = { diff --git a/pkgs/tools/virtualization/ec2-api-tools/default.nix b/pkgs/tools/virtualization/ec2-api-tools/default.nix index 97545204bfd4b..25960241ad8da 100644 --- a/pkgs/tools/virtualization/ec2-api-tools/default.nix +++ b/pkgs/tools/virtualization/ec2-api-tools/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper unzip ]; installPhase = '' + runHook preInstall + d=$out/libexec/ec2-api-tools mkdir -p $d mv * $d @@ -29,6 +31,8 @@ stdenv.mkDerivation rec { --set EC2_HOME $d \ --set JAVA_HOME ${jre} done + + runHook postInstall ''; meta = { diff --git a/pkgs/tools/virtualization/google-guest-configs/default.nix b/pkgs/tools/virtualization/google-guest-configs/default.nix index 73dd3c93d2558..4a5ef3f8edb7a 100644 --- a/pkgs/tools/virtualization/google-guest-configs/default.nix +++ b/pkgs/tools/virtualization/google-guest-configs/default.nix @@ -30,6 +30,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,etc,lib} cp -r src/etc/{modprobe.d,sysctl.d} $out/etc cp -r src/lib/udev $out/lib @@ -40,6 +42,8 @@ stdenv.mkDerivation rec { wrapProgram "$i" \ --prefix "PATH" ":" "$binDeps" done + + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/top-level/emscripten-packages.nix b/pkgs/top-level/emscripten-packages.nix index f4d2fd06a90cd..33d8feaa70cd2 100644 --- a/pkgs/top-level/emscripten-packages.nix +++ b/pkgs/top-level/emscripten-packages.nix @@ -121,6 +121,8 @@ rec { outputs = [ "out" "doc" ]; installPhase = '' + runHook preInstall + mkdir -p $out/share mkdir -p $doc/share/${pname} @@ -134,6 +136,8 @@ rec { cp *.json $out/share cp *.rng $out/share cp README.md $doc/share/${pname} + + runHook postInstall ''; checkPhase = '' ''; @@ -152,7 +156,11 @@ rec { emmake make ''; installPhase = '' + runHook preInstall + emmake make install + + runHook postInstall ''; checkPhase = '' echo "================= testing zlib using node =================" diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index d5bd0f19bac23..e6c879f2a8281 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -730,7 +730,11 @@ in { ${makeTarget} ''; installPhase = '' + runHook preInstall + cp .config $out + + runHook postInstall ''; };