diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-06-21 00:06:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-21 00:06:42 +0300 |
commit | 8407b20a4e732c3f1d28d2a9524641e3899e06b8 (patch) | |
tree | e105b1e1893eb81a6ca020c44d4b63fb353ef095 /pkgs/development/libraries | |
parent | 535373e25226170c7d84f9ce16cb8d20d5f14faa (diff) | |
parent | 2a619ae20ea22ad7346b0fd2aa17dcd7fe939174 (diff) |
Merge pull request #238786 from figsoda/graphene
graphene-hardened-malloc: refactor
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r-- | pkgs/development/libraries/graphene-hardened-malloc/default.nix | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/pkgs/development/libraries/graphene-hardened-malloc/default.nix b/pkgs/development/libraries/graphene-hardened-malloc/default.nix index 65498357b5d0e..1e2eddf275195 100644 --- a/pkgs/development/libraries/graphene-hardened-malloc/default.nix +++ b/pkgs/development/libraries/graphene-hardened-malloc/default.nix @@ -7,23 +7,21 @@ , stress-ng }: -lib.fix (self: stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "graphene-hardened-malloc"; version = "11"; src = fetchFromGitHub { owner = "GrapheneOS"; repo = "hardened_malloc"; - rev = version; + rev = finalAttrs.version; sha256 = "sha256-BbjL0W12QXFmGCzFrFYY6CZZeFbUt0elCGhM+mbL/IU="; }; doCheck = true; nativeCheckInputs = [ python3 ]; # these tests cover use as a build-time-linked library - checkPhase = '' - make test - ''; + checkTarget = "test"; installPhase = '' install -Dm444 -t $out/include include/* @@ -38,8 +36,8 @@ lib.fix (self: stdenv.mkDerivation rec { passthru = { ld-preload-tests = stdenv.mkDerivation { - name = "${self.name}-ld-preload-tests"; - src = self.src; + name = "${finalAttrs.pname}-ld-preload-tests"; + inherit (finalAttrs) src; nativeBuildInputs = [ makeWrapper ]; @@ -66,13 +64,13 @@ lib.fix (self: stdenv.mkDerivation rec { ''; }; tests = { - ld-preload = runCommand "ld-preload-test-run" {} '' - ${self}/bin/preload-hardened-malloc ${self.ld-preload-tests}/bin/run-tests + ld-preload = runCommand "ld-preload-test-run" { } '' + ${finalAttrs.finalPackage}/bin/preload-hardened-malloc ${finalAttrs.passthru.ld-preload-tests}/bin/run-tests touch $out ''; # to compensate for the lack of tests of correct normal malloc operation - stress = runCommand "stress-test-run" {} '' - ${self}/bin/preload-hardened-malloc ${stress-ng}/bin/stress-ng \ + stress = runCommand "stress-test-run" { } '' + ${finalAttrs.finalPackage}/bin/preload-hardened-malloc ${stress-ng}/bin/stress-ng \ --no-rand-seed \ --malloc 8 \ --malloc-ops 1000000 \ |