mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 23:54:01 +00:00
bfc002e2f1
* nix-ld: 1.2.1 -> 1.2.2 Diff: https://github.com/mic92/nix-ld/compare/1.2.1...1.2.2 * Update pkgs/os-specific/linux/nix-ld/default.nix Co-authored-by: Pol Dellaiera <pol.dellaiera@protonmail.com> --------- Co-authored-by: Pol Dellaiera <pol.dellaiera@protonmail.com>
57 lines
1.2 KiB
Nix
57 lines
1.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, meson
|
|
, ninja
|
|
, nixosTests
|
|
}:
|
|
let
|
|
libDir = if builtins.elem stdenv.system [ "x86_64-linux" "mips64-linux" "powerpc64le-linux" ]
|
|
then "/lib64"
|
|
else "/lib";
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "nix-ld";
|
|
version = "1.2.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "mic92";
|
|
repo = "nix-ld";
|
|
rev = version;
|
|
hash = "sha256-+z9t7BLugZO1WhyYEq6FI38TMh2EwfgfAv3RDFSjwtc=";
|
|
};
|
|
|
|
doCheck = true;
|
|
|
|
nativeBuildInputs = [ meson ninja ];
|
|
|
|
mesonFlags = [
|
|
"-Dnix-system=${stdenv.system}"
|
|
];
|
|
|
|
hardeningDisable = [
|
|
"stackprotector"
|
|
];
|
|
|
|
postInstall = ''
|
|
mkdir -p $out/nix-support
|
|
|
|
ldpath=${libDir}/$(basename $(< ${stdenv.cc}/nix-support/dynamic-linker))
|
|
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.nix-ld = nixosTests.nix-ld;
|
|
|
|
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;
|
|
};
|
|
}
|