libpsl-with-scripts: init

psl-make-dafsa pulls in a runtime python3 dependency which seems to have
given various build configurations no end of trouble. This solves the
problem in the least subtle manner imaginable, by removing it for all
platforms and re-adding it in a new package which currently has no
dependants. Switch your dependency from libpsl to libpsl-with-scripts
if you are impacted by this.

+59 -11
+53
pkgs/by-name/li/libpsl-with-scripts/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + libpsl, 5 + python3, 6 + lzip, 7 + }: 8 + 9 + stdenv.mkDerivation { 10 + pname = "libpsl-with-scripts"; 11 + inherit (libpsl) src version patches; 12 + outputs = libpsl.outputs ++ [ "bin" ]; 13 + 14 + nativeBuildInputs = [ 15 + lzip 16 + ]; 17 + 18 + buildInputs = [ 19 + python3 20 + ]; 21 + 22 + postPatch = '' 23 + patchShebangs src/psl-make-dafsa 24 + ''; 25 + 26 + dontConfigure = true; 27 + dontBuild = true; 28 + 29 + installPhase = 30 + let 31 + linkOutput = oldOutput: newOutput: '' 32 + cd ${oldOutput} 33 + find . -type d -print0 | xargs -0 -I{} mkdir -p ${newOutput}/{} 34 + find . \( -type f -o -type l \) -print0 | xargs -0 -I{} ln -s ${oldOutput}/{} ${newOutput}/{} 35 + cd - 36 + ''; 37 + links = lib.concatMapStrings ( 38 + output: linkOutput libpsl.${output} (builtins.placeholder output) 39 + ) libpsl.outputs; 40 + in 41 + '' 42 + runHook preInstall 43 + 44 + ${links} 45 + 46 + install -D src/psl-make-dafsa $bin/bin/psl-make-dafsa 47 + install -D -m 555 src/psl-make-dafsa.1 $out/share/man/man1/psl-make-dafsa.1 48 + 49 + runHook postInstall 50 + ''; 51 + 52 + dontFixup = true; 53 + }
+6 -11
pkgs/by-name/li/libpsl/package.nix
··· 12 12 libunistring, 13 13 libxslt, 14 14 pkg-config, 15 - python3, 16 15 buildPackages, 17 16 publicsuffix-list, 18 17 }: ··· 40 39 [ 41 40 "out" 42 41 "dev" 43 - ] 44 - # bin/psl-make-dafsa brings a large runtime closure through python3 45 - ++ lib.optional (!stdenv.hostPlatform.isStatic) "bin"; 42 + ]; 46 43 47 44 nativeBuildInputs = [ 48 45 autoreconfHook ··· 58 55 libidn2 59 56 libunistring 60 57 libxslt 61 - ] ++ lib.optional ( 62 - !stdenv.hostPlatform.isStatic 63 - && !stdenv.hostPlatform.isWindows 64 - && (stdenv.hostPlatform.isDarwin -> stdenv.buildPlatform == stdenv.hostPlatform) 65 - ) python3; 58 + ]; 66 59 67 60 propagatedBuildInputs = [ 68 61 publicsuffix-list 69 62 ]; 70 63 71 - postPatch = lib.optionalString (!stdenv.hostPlatform.isStatic) '' 72 - patchShebangs src/psl-make-dafsa 64 + # bin/psl-make-dafsa brings a large runtime closure through python3 65 + # use the libpsl-with-scripts package if you need this 66 + postInstall = '' 67 + rm $out/bin/psl-make-dafsa $out/share/man/man1/psl-make-dafsa* 73 68 ''; 74 69 75 70 preAutoreconf = ''