Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
55 lines
1.2 KiB
Nix
55 lines
1.2 KiB
Nix
{
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
nixosTests,
|
|
rustPlatform,
|
|
lib,
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "nix-ld";
|
|
version = "2.0.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "nix-community";
|
|
repo = "nix-ld";
|
|
rev = version;
|
|
hash = "sha256-I9cEWy07pUNsOfBPG7qMYHx/YmE1uxaadP3ObHu7ALQ=";
|
|
};
|
|
|
|
cargoHash = "sha256-8mkMq16CfEc/RHH3msXEnoiDHGGRjr2Omp2TVd07ObE=";
|
|
|
|
hardeningDisable = [ "stackprotector" ];
|
|
|
|
NIX_SYSTEM = stdenv.system;
|
|
RUSTC_BOOTSTRAP = "1";
|
|
|
|
preCheck = ''
|
|
export NIX_LD=${stdenv.cc.bintools.dynamicLinker}
|
|
'';
|
|
|
|
postInstall = ''
|
|
mkdir -p $out/libexec
|
|
ln -s $out/bin/nix-ld $out/libexec/nix-ld
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
ldpath=/${stdenv.hostPlatform.libDir}/$(basename ${stdenv.cc.bintools.dynamicLinker})
|
|
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
|
|
'';
|
|
|
|
passthru.tests = nixosTests.nix-ld;
|
|
|
|
meta = {
|
|
description = "Run unpatched dynamic binaries on NixOS";
|
|
homepage = "https://github.com/nix-community/nix-ld";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ mic92 ];
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
}
|