nixpkgs/pkgs/by-name/ni/nix-ld/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1 KiB
Nix
Raw Normal View History

2022-05-14 17:02:37 +02:00
{ lib
, stdenv
, fetchFromGitHub
, meson
, ninja
, nixosTests
}:
2022-05-14 17:02:37 +02:00
stdenv.mkDerivation rec {
pname = "nix-ld";
2023-12-17 07:26:46 +01:00
version = "1.2.3";
2022-05-14 17:02:37 +02:00
src = fetchFromGitHub {
owner = "mic92";
repo = "nix-ld";
rev = version;
2023-12-17 07:26:46 +01:00
hash = "sha256-h+odOVyiGmEERMECoFOj5P7FPiMR8IPRzroFA4sKivg=";
2022-05-14 17:02:37 +02:00
};
doCheck = true;
nativeBuildInputs = [ meson ninja ];
mesonFlags = [
"-Dnix-system=${stdenv.system}"
];
hardeningDisable = [
"stackprotector"
];
postInstall = ''
mkdir -p $out/nix-support
ldpath=/${stdenv.hostPlatform.libDir}/$(basename ${stdenv.cc.bintools.dynamicLinker})
2022-05-14 17:02:37 +02:00
echo "$ldpath" > $out/nix-support/ldpath
mkdir -p $out/lib/tmpfiles.d/
cat > $out/lib/tmpfiles.d/nix-ld.conf <<EOF
L+ $ldpath - - - - $out/libexec/nix-ld
EOF
'';
2024-03-24 08:51:02 +01:00
passthru.tests = nixosTests.nix-ld;
2022-05-14 17:02:37 +02:00
meta = with lib; {
description = "Run unpatched dynamic binaries on NixOS";
homepage = "https://github.com/Mic92/nix-ld";
license = licenses.mit;
maintainers = with maintainers; [ mic92 ];
platforms = platforms.linux;
2022-03-15 13:22:18 +01:00
};
2022-05-14 17:02:37 +02:00
}