Skip to content

Commit a115ba5

Browse files
committed
use upstreamed support in patchelf: NixOS/patchelf#459
1 parent 670f424 commit a115ba5

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

flake.lock

Lines changed: 12 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
};
1010
nixos-hardware.url = "github:nixos/nixos-hardware";
1111
home-manager.url = "github:nix-community/home-manager";
12-
patchelf-raphi.url = "git+https://git.sr.ht/~raphi/patchelf";
12+
patchelf.url = "github:nixos/patchelf/da035d6ace";
1313
eeww.url = "github:RyanGibb/eeww/nixos";
1414
aeon.url = "github:RyanGibb/aeon";
1515

@@ -42,7 +42,7 @@
4242
nixpkgs.follows = "nixpkgs";
4343
flake-utils.follows = "flake-utils";
4444
};
45-
patchelf-raphi.inputs = {
45+
patchelf.inputs = {
4646
nixpkgs.follows = "nixpkgs";
4747
};
4848
eeww.inputs = {
@@ -69,7 +69,7 @@
6969
};
7070
};
7171

72-
outputs = { self, nixpkgs, nixpkgs-unstable, eilean, home-manager, ryan-website, patchelf-raphi, twitcher, nixos-hardware, eeww, aeon, ... }@inputs: rec {
72+
outputs = { self, nixpkgs, nixpkgs-unstable, eilean, home-manager, ryan-website, patchelf, twitcher, nixos-hardware, eeww, aeon, ... }@inputs: rec {
7373

7474
nixosConfigurations =
7575
let
@@ -98,9 +98,9 @@
9898
# `twitcher.nixosModules.default` uses `pkgs.ryan-website`
9999
"twitcher" = twitcher.packages.${system}.default;
100100
# can uncomment if want to use patchelf-rafi elsewhere
101-
#"patchelf-raphi" = patchelf-raphi.packages.${system}.patchelf;
101+
#"patchelf" = patchelf.packages.${system}.patchelf;
102102
# "cctk" = final.callPackage ./pkgs/cctk/default.nix { };
103-
"cctk" = prev.callPackage ./pkgs/cctk/default.nix { patchelf-raphi = patchelf-raphi.packages.${system}.patchelf; };
103+
"cctk" = prev.callPackage ./pkgs/cctk/default.nix { patchelf = patchelf.packages.${system}.patchelf; };
104104
"eeww" = eeww.defaultPackage.${system};
105105
"aeon" = aeon.defaultPackage.${system};
106106
})
@@ -145,6 +145,6 @@
145145

146146
packages.x86_64-linux.cctk =
147147
with import nixpkgs { system = "x86_64-linux"; };
148-
(pkgs.callPackage ./pkgs/cctk/default.nix { patchelf-raphi = patchelf-raphi.packages.${system}.patchelf; });
148+
(pkgs.callPackage ./pkgs/cctk/default.nix { patchelf = patchelf.packages.${system}.patchelf; });
149149
};
150150
}

pkgs/cctk/default.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
fetchurl,
55
dpkg,
66
autoPatchelfHook,
7-
patchelf-raphi,
7+
patchelf,
88
openssl_1_1,
99
}:
1010

@@ -91,9 +91,11 @@ in stdenv.mkDerivation rec {
9191
'';
9292

9393
postFixup = ''
94-
${patchelf-raphi}/bin/patchelf \
95-
--replace-symbol fopen fopen_wrapper \
96-
--replace-symbol access access_wrapper \
94+
echo fopen fopen_wrapper > fopen_name_map
95+
echo access access_wrapper > access_name_map
96+
${patchelf}/bin/patchelf \
97+
--rename-dynamic-symbols fopen_name_map \
98+
--rename-dynamic-symbols access_name_map \
9799
--add-needed ${wrapperLibName} \
98100
--set-rpath ${lib.makeLibraryPath [ wrapperLib ]} \
99101
$out/lib/*

0 commit comments

Comments
 (0)