Skip to content

Commit

Permalink
use upstreamed support in patchelf: NixOS/patchelf#459
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGibb committed Mar 4, 2023
1 parent 670f424 commit a115ba5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
23 changes: 12 additions & 11 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
};
nixos-hardware.url = "github:nixos/nixos-hardware";
home-manager.url = "github:nix-community/home-manager";
patchelf-raphi.url = "git+https://git.sr.ht/~raphi/patchelf";
patchelf.url = "github:nixos/patchelf/da035d6ace";
eeww.url = "github:RyanGibb/eeww/nixos";
aeon.url = "github:RyanGibb/aeon";

Expand Down Expand Up @@ -42,7 +42,7 @@
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
patchelf-raphi.inputs = {
patchelf.inputs = {
nixpkgs.follows = "nixpkgs";
};
eeww.inputs = {
Expand All @@ -69,7 +69,7 @@
};
};

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

nixosConfigurations =
let
Expand Down Expand Up @@ -98,9 +98,9 @@
# `twitcher.nixosModules.default` uses `pkgs.ryan-website`
"twitcher" = twitcher.packages.${system}.default;
# can uncomment if want to use patchelf-rafi elsewhere
#"patchelf-raphi" = patchelf-raphi.packages.${system}.patchelf;
#"patchelf" = patchelf.packages.${system}.patchelf;
# "cctk" = final.callPackage ./pkgs/cctk/default.nix { };
"cctk" = prev.callPackage ./pkgs/cctk/default.nix { patchelf-raphi = patchelf-raphi.packages.${system}.patchelf; };
"cctk" = prev.callPackage ./pkgs/cctk/default.nix { patchelf = patchelf.packages.${system}.patchelf; };
"eeww" = eeww.defaultPackage.${system};
"aeon" = aeon.defaultPackage.${system};
})
Expand Down Expand Up @@ -145,6 +145,6 @@

packages.x86_64-linux.cctk =
with import nixpkgs { system = "x86_64-linux"; };
(pkgs.callPackage ./pkgs/cctk/default.nix { patchelf-raphi = patchelf-raphi.packages.${system}.patchelf; });
(pkgs.callPackage ./pkgs/cctk/default.nix { patchelf = patchelf.packages.${system}.patchelf; });
};
}
10 changes: 6 additions & 4 deletions pkgs/cctk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
fetchurl,
dpkg,
autoPatchelfHook,
patchelf-raphi,
patchelf,
openssl_1_1,
}:

Expand Down Expand Up @@ -91,9 +91,11 @@ in stdenv.mkDerivation rec {
'';

postFixup = ''
${patchelf-raphi}/bin/patchelf \
--replace-symbol fopen fopen_wrapper \
--replace-symbol access access_wrapper \
echo fopen fopen_wrapper > fopen_name_map
echo access access_wrapper > access_name_map
${patchelf}/bin/patchelf \
--rename-dynamic-symbols fopen_name_map \
--rename-dynamic-symbols access_name_map \
--add-needed ${wrapperLibName} \
--set-rpath ${lib.makeLibraryPath [ wrapperLib ]} \
$out/lib/*
Expand Down

0 comments on commit a115ba5

Please sign in to comment.