Files
nixpkgs/pkgs/by-name/li/libpsl-with-scripts/package.nix
NAHO c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00

54 lines
1.0 KiB
Nix

{
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} (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;
}