uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
23
pkgs/development/tools/misc/patchelf/0.13.nix
Normal file
23
pkgs/development/tools/misc/patchelf/0.13.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ stdenv, fetchurl, patchelf }:
|
||||
|
||||
# Note: this package is used for bootstrapping fetchurl, and thus
|
||||
# cannot use fetchpatch! All mutable patches (generated by GitHub or
|
||||
# cgit) that are needed here should be included directly in Nixpkgs as
|
||||
# files.
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "patchelf";
|
||||
version = "0.13.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/NixOS/${pname}/releases/download/${version}/${pname}-${version}.tar.bz2";
|
||||
sha256 = "sha256-OeiuzNdJXVTfCU0rSnwIAQ/3d3A2+q8k8o4Hd30VmOI=";
|
||||
};
|
||||
|
||||
setupHook = [ ./setup-hook.sh ];
|
||||
|
||||
# fails 8 out of 24 tests, problems when loading libc.so.6
|
||||
doCheck = stdenv.name == "stdenv-linux";
|
||||
|
||||
inherit (patchelf) meta;
|
||||
}
|
||||
17
pkgs/development/tools/misc/patchelf/0.9.nix
Normal file
17
pkgs/development/tools/misc/patchelf/0.9.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ stdenv, fetchurl, patchelf }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "patchelf";
|
||||
version = "0.9";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://nixos.org/releases/patchelf/patchelf-${version}/patchelf-${version}.tar.bz2";
|
||||
sha256 = "a0f65c1ba148890e9f2f7823f4bedf7ecad5417772f64f994004f59a39014f83";
|
||||
};
|
||||
|
||||
setupHook = [ ./setup-hook.sh ];
|
||||
|
||||
doCheck = false; # fails 8 out of 24 tests, problems when loading libc.so.6
|
||||
|
||||
inherit (patchelf) meta;
|
||||
}
|
||||
32
pkgs/development/tools/misc/patchelf/default.nix
Normal file
32
pkgs/development/tools/misc/patchelf/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ lib, stdenv, fetchurl }:
|
||||
|
||||
# Note: this package is used for bootstrapping fetchurl, and thus
|
||||
# cannot use fetchpatch! All mutable patches (generated by GitHub or
|
||||
# cgit) that are needed here should be included directly in Nixpkgs as
|
||||
# files.
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "patchelf";
|
||||
version = "0.14.5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/NixOS/${pname}/releases/download/${version}/${pname}-${version}.tar.bz2";
|
||||
sha256 = "sha256-uaRvKYkyLrifpPYjfiCDbFe0VapDoyVF6gk7Qx2YL1w=";
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
setupHook = [ ./setup-hook.sh ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
# fails 8 out of 24 tests, problems when loading libc.so.6
|
||||
doCheck = stdenv.name == "stdenv-linux";
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/NixOS/patchelf";
|
||||
license = licenses.gpl3Plus;
|
||||
description = "A small utility to modify the dynamic linker and RPATH of ELF executables";
|
||||
maintainers = [ maintainers.eelco ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
22
pkgs/development/tools/misc/patchelf/setup-hook.sh
Normal file
22
pkgs/development/tools/misc/patchelf/setup-hook.sh
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# This setup hook calls patchelf to automatically remove unneeded
|
||||
# directories from the RPATH of every library or executable in every
|
||||
# output.
|
||||
|
||||
fixupOutputHooks+=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi')
|
||||
|
||||
patchELF() {
|
||||
local dir="$1"
|
||||
[ -e "$dir" ] || return 0
|
||||
|
||||
header "shrinking RPATHs of ELF executables and libraries in $dir"
|
||||
|
||||
local i
|
||||
while IFS= read -r -d $'\0' i; do
|
||||
if [[ "$i" =~ .build-id ]]; then continue; fi
|
||||
if ! isELF "$i"; then continue; fi
|
||||
echo "shrinking $i"
|
||||
patchelf --shrink-rpath "$i" || true
|
||||
done < <(find "$dir" -type f -print0)
|
||||
|
||||
stopNest
|
||||
}
|
||||
40
pkgs/development/tools/misc/patchelf/unstable.nix
Normal file
40
pkgs/development/tools/misc/patchelf/unstable.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ lib, stdenv, fetchurl, autoreconfHook, fetchFromGitHub, unstableGitUpdater }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "patchelf";
|
||||
version = "unstable-2022-02-21";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "NixOS";
|
||||
repo = "patchelf";
|
||||
rev = "a35054504293f9ff64539850d1ed0bfd2f5399f2";
|
||||
sha256 = "sha256-/hD/abmzWSkDhAWPLHiLQQ9cwJF8oFDuovNzRqs3Bho=";
|
||||
};
|
||||
|
||||
# Drop test that fails on musl (?)
|
||||
postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
substituteInPlace tests/Makefile.am \
|
||||
--replace "set-rpath-library.sh" ""
|
||||
'';
|
||||
|
||||
setupHook = [ ./setup-hook.sh ];
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook ];
|
||||
buildInputs = [ ];
|
||||
|
||||
doCheck = !stdenv.isDarwin;
|
||||
|
||||
passthru = {
|
||||
updateScript = unstableGitUpdater {
|
||||
url = "https://github.com/NixOS/patchelf.git";
|
||||
};
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/NixOS/patchelf";
|
||||
license = licenses.gpl3;
|
||||
description = "A small utility to modify the dynamic linker and RPATH of ELF executables";
|
||||
maintainers = [ maintainers.eelco ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue