summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
authorLuflosi <luflosi@luflosi.de>2023-11-08 14:28:11 +0100
committerLuflosi <luflosi@luflosi.de>2023-11-08 15:21:34 +0100
commit9882bdee1eab1fc5d78eb357c4e4858fdf8a4996 (patch)
tree18cfdc319154d553939e0b14943d728e3270e061 /pkgs/applications/science
parente24783fe6faeff5d04f9bf4608fbb41bc99b08bb (diff)
downloadnixpkgs-9882bdee1eab1fc5d78eb357c4e4858fdf8a4996.tar
nixpkgs-9882bdee1eab1fc5d78eb357c4e4858fdf8a4996.tar.gz
nixpkgs-9882bdee1eab1fc5d78eb357c4e4858fdf8a4996.tar.bz2
nixpkgs-9882bdee1eab1fc5d78eb357c4e4858fdf8a4996.tar.lz
nixpkgs-9882bdee1eab1fc5d78eb357c4e4858fdf8a4996.tar.xz
nixpkgs-9882bdee1eab1fc5d78eb357c4e4858fdf8a4996.tar.zst
nixpkgs-9882bdee1eab1fc5d78eb357c4e4858fdf8a4996.zip
abc-verifier: cleanup
- Move each function argument into its own line
- Use `finalAttrs` instead of the `rec` keyword to properly handle overriding
- Run the `preInstall` and `postInstall` hooks in the `installPhase`
- Use `install` instead of `mkdir -p` and `mv` to be more concise
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/logic/abc/default.nix19
1 files changed, 13 insertions, 6 deletions
diff --git a/pkgs/applications/science/logic/abc/default.nix b/pkgs/applications/science/logic/abc/default.nix
index 1c2a54386cd..03e1ce07d8f 100644
--- a/pkgs/applications/science/logic/abc/default.nix
+++ b/pkgs/applications/science/logic/abc/default.nix
@@ -1,8 +1,11 @@
-{ lib, stdenv, fetchFromGitHub
-, readline, cmake
+{ lib
+, stdenv
+, fetchFromGitHub
+, readline
+, cmake
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname   = "abc-verifier";
   version = "unstable-2023-09-13";
 
@@ -16,10 +19,14 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ readline ];
 
-  installPhase = "mkdir -p $out/bin && mv abc $out/bin";
+  installPhase = ''
+    runHook preInstall
+    install -Dm755 'abc' "$out/bin/abc"
+    runHook postInstall
+  '';
 
   # needed by yosys
-  passthru.rev = src.rev;
+  passthru.rev = finalAttrs.src.rev;
 
   meta = with lib; {
     description = "A tool for squential logic synthesis and formal verification";
@@ -29,4 +36,4 @@ stdenv.mkDerivation rec {
     mainProgram = "abc";
     platforms   = platforms.unix;
   };
-}
+})