Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions pkgs/by-name/li/libpsl-with-scripts/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
lib,
stdenv,
libpsl,
python3,
lzip,
}:

stdenv.mkDerivation {
pname = "libpsl-with-scripts";
inherit (libpsl) src version patches;
outputs = libpsl.outputs ++ [ "bin" ];

nativeBuildInputs = [
lzip
];

buildInputs = [
python3
];

postPatch = ''
patchShebangs src/psl-make-dafsa
'';

dontConfigure = true;
dontBuild = true;

installPhase =
let
linkOutput = oldOutput: newOutput: ''
cd ${oldOutput}
find . -type d -print0 | xargs -0 -I{} mkdir -p ${newOutput}/{}
find . \( -type f -o -type l \) -print0 | xargs -0 -I{} ln -s ${oldOutput}/{} ${newOutput}/{}
cd -
'';
links = lib.concatMapStrings (
output: linkOutput libpsl.${output} (builtins.placeholder output)
) libpsl.outputs;
in
''
runHook preInstall

${links}

install -D src/psl-make-dafsa $bin/bin/psl-make-dafsa
install -D -m 555 src/psl-make-dafsa.1 $out/share/man/man1/psl-make-dafsa.1

runHook postInstall
'';

dontFixup = true;
}
17 changes: 6 additions & 11 deletions pkgs/by-name/li/libpsl/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
libunistring,
libxslt,
pkg-config,
python3,
buildPackages,
publicsuffix-list,
}:
Expand Down Expand Up @@ -40,9 +39,7 @@ stdenv.mkDerivation rec {
[
"out"
"dev"
]
# bin/psl-make-dafsa brings a large runtime closure through python3
++ lib.optional (!stdenv.hostPlatform.isStatic) "bin";
];

nativeBuildInputs = [
autoreconfHook
Expand All @@ -58,18 +55,16 @@ stdenv.mkDerivation rec {
libidn2
libunistring
libxslt
] ++ lib.optional (
!stdenv.hostPlatform.isStatic
&& !stdenv.hostPlatform.isWindows
&& (stdenv.hostPlatform.isDarwin -> stdenv.buildPlatform == stdenv.hostPlatform)
) python3;
];

propagatedBuildInputs = [
publicsuffix-list
];

postPatch = lib.optionalString (!stdenv.hostPlatform.isStatic) ''
patchShebangs src/psl-make-dafsa
# bin/psl-make-dafsa brings a large runtime closure through python3
# use the libpsl-with-scripts package if you need this
postInstall = ''
rm $out/bin/psl-make-dafsa $out/share/man/man1/psl-make-dafsa*
'';

preAutoreconf = ''
Expand Down