mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
autoPatchelfHook: expose script as top level package (#340162)
This commit is contained in:
commit
ced27bf29e
@ -71,7 +71,7 @@ autoPatchelf() {
|
||||
fi
|
||||
done
|
||||
|
||||
@pythonInterpreter@ @autoPatchelfScript@ \
|
||||
auto-patchelf \
|
||||
${norecurse:+--no-recurse} \
|
||||
--ignore-missing "${ignoreMissingDepsArray[@]}" \
|
||||
--paths "$@" \
|
||||
|
@ -425,7 +425,7 @@ interpreter_arch: str = None # type: ignore
|
||||
libc_lib: Path = None # type: ignore
|
||||
|
||||
if __name__ == "__main__":
|
||||
nix_support = Path(os.environ['NIX_BINTOOLS']) / 'nix-support'
|
||||
nix_support = Path(os.environ.get('NIX_BINTOOLS', os.environ['DEFAULT_BINTOOLS'])) / 'nix-support'
|
||||
interpreter_path = Path((nix_support / 'dynamic-linker').read_text().strip())
|
||||
libc_lib = Path((nix_support / 'orig-libc').read_text().strip()) / 'lib'
|
||||
|
41
pkgs/by-name/au/auto-patchelf/package.nix
Normal file
41
pkgs/by-name/au/auto-patchelf/package.nix
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication {
|
||||
pname = "auto-patchelf";
|
||||
version = "0-unstable-2024-08-14";
|
||||
pyproject = false;
|
||||
|
||||
src = lib.fileset.toSource {
|
||||
root = ./.;
|
||||
fileset = lib.fileset.unions [
|
||||
./auto-patchelf.py
|
||||
];
|
||||
};
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
pyelftools
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm755 auto-patchelf.py $out/bin/auto-patchelf
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
makeWrapperArgs = [
|
||||
"--set DEFAULT_BINTOOLS $NIX_BINTOOLS"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Automatically patch ELF binaries using patchelf";
|
||||
mainProgram = "auto-patchelf";
|
||||
license = lib.licenses.mit;
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ Scrumplex ];
|
||||
};
|
||||
}
|
@ -185,11 +185,7 @@ with pkgs;
|
||||
|
||||
autoPatchelfHook = makeSetupHook {
|
||||
name = "auto-patchelf-hook";
|
||||
propagatedBuildInputs = [ bintools ];
|
||||
substitutions = {
|
||||
pythonInterpreter = "${python3.withPackages (ps: [ ps.pyelftools ])}/bin/python";
|
||||
autoPatchelfScript = ../build-support/setup-hooks/auto-patchelf.py;
|
||||
};
|
||||
propagatedBuildInputs = [ auto-patchelf bintools ];
|
||||
} ../build-support/setup-hooks/auto-patchelf.sh;
|
||||
|
||||
appflowy = callPackage ../applications/office/appflowy { };
|
||||
|
Loading…
Reference in New Issue
Block a user