Update flake and conventions for 24.05+

This commit is contained in:
Bryan Bennett 2024-06-18 06:52:05 -04:00
parent 33d91a5af4
commit bc779a2764
No known key found for this signature in database
GPG key ID: EE149E4215408DE9
5 changed files with 48 additions and 84 deletions

View file

@ -4,11 +4,8 @@
, buildDunePackage
, core
, core_unix
, coreutils
, findlib
, lib
, nix-filter
, ocaml
, ppx_yojson_conv
, ppx_yojson_conv_lib
, re
@ -36,14 +33,18 @@ buildDunePackage {
};
duneVersion = "3";
doCheck = true;
# We strip by hand before packing
dontStrip = true;
# patchELF can't handle UPX'd binaries
# We produce a static OCaml binary that
dontPatchELF = true;
postPatch = ''
substituteInPlace direnvrc --replace "@flake_env@" "$out/bin/flake_env"
substituteInPlace tests/spit*.sh --replace "/usr/bin/env" "${coreutils}/bin/env"
substituteInPlace direnvrc --replace-fail "@flake_env@" "$out/bin/flake_env"
'';
postInstall = ''
${bintools}/bin/strip --strip-unneeded $out/bin/flake_env
${upx}/bin/upx $out/bin/flake_env
install -m400 -D direnvrc $out/share/flake_env/direnvrc
install -m444 -D direnvrc $out/share/flake_env/direnvrc
'';
buildInputs = [
core