New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Libabc: add new libabc package #30566
Conversation
Existing abc-verifier installs only the binary; this parallel package installs the library under the name that matches the existing conventions for library/package name association.
cc @thoughtpolice for review |
sha256 = "09yvhj53af91nc54gmy7cbp7yljfcyj68a87494r5xvdfnsj11gy"; | ||
}; | ||
|
||
buildInputs = [ ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I was being explicit, but I can remove that and update this pull request shortly.
@vyp: extraneous line removed. |
what do you think about the following approach (building library and verifier in one go)? From 847e8076b56db66dd61354e8e4c1bd44cd24624a Mon Sep 17 00:00:00 2001
From: Joerg Thalheim <joerg@thalheim.io>
Date: Thu, 19 Oct 2017 12:05:42 +0100
Subject: [PATCH] abc: build verifier and library in one package
Signed-off-by: Joerg Thalheim <joerg@thalheim.io>
---
pkgs/applications/science/logic/abc/default.nix | 23 +++++++------
pkgs/applications/science/logic/abc/libabc.nix | 40 ----------------------
.../science/logic/abc/shared-library.patch | 11 ++++++
pkgs/top-level/all-packages.nix | 3 +-
4 files changed, 25 insertions(+), 52 deletions(-)
delete mode 100644 pkgs/applications/science/logic/abc/libabc.nix
create mode 100644 pkgs/applications/science/logic/abc/shared-library.patch
diff --git a/pkgs/applications/science/logic/abc/default.nix b/pkgs/applications/science/logic/abc/default.nix
index bab9b302d7d..b95d6963652 100644
--- a/pkgs/applications/science/logic/abc/default.nix
+++ b/pkgs/applications/science/logic/abc/default.nix
@@ -1,7 +1,7 @@
-{ fetchhg, stdenv, readline }:
+{ fetchhg, stdenv, cmake, readline }:
stdenv.mkDerivation rec {
- name = "abc-verifier-${version}";
+ name = "abc-${version}";
version = "20160818";
src = fetchhg {
@@ -10,21 +10,24 @@ stdenv.mkDerivation rec {
sha256 = "09yvhj53af91nc54gmy7cbp7yljfcyj68a87494r5xvdfnsj11gy";
};
- buildInputs = [ readline ];
- preBuild = ''
- export buildFlags="CC=$CC CXX=$CXX LD=$CXX"
+ buildInputs = [ cmake readline ];
+
+ patches = [ ./shared-library.patch ];
+
+ postBuild = ''
+ make libabc
'';
- enableParallelBuilding = true;
+
installPhase = ''
- mkdir -p $out/bin
- mv abc $out/bin
+ install -D abc $out/bin/abc
+ install -D libabc.so $out/lib/libabc.so
'';
meta = {
- description = "A tool for squential logic synthesis and formal verification";
+ description = "A library for sequential logic synthesis and formal verification";
homepage = "https://people.eecs.berkeley.edu/~alanmi/abc/abc.htm";
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.unix;
- maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+ maintainers = [ stdenv.lib.maintainers.kquick ];
};
}
diff --git a/pkgs/applications/science/logic/abc/libabc.nix b/pkgs/applications/science/logic/abc/libabc.nix
deleted file mode 100644
index 9b2efd1b5ab..00000000000
--- a/pkgs/applications/science/logic/abc/libabc.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ fetchhg, stdenv, pkgs }:
-
-stdenv.mkDerivation rec {
-
- # Note that this derivation provides only the library, but under the
- # "abc" name, to associate with libabc, which conforms to the
- # standard library dependency referencing nomenclature. The binary
- # is available as a separate package with the "abc-verifier" naming.
-
- name = "abc-${version}";
- version = "20160818";
-
- src = fetchhg {
- url = "https://bitbucket.org/alanmi/abc";
- rev = "a2e5bc66a68a72ccd267949e5c9973dd18f8932a";
- sha256 = "09yvhj53af91nc54gmy7cbp7yljfcyj68a87494r5xvdfnsj11gy";
- };
-
- preBuild = ''
- export buildFlags="CC=$CC CXX=$CXX LD=$CXX ABC_USE_NO_READLINE=1 libabc.a"
- '';
-
- # n.b. the following are documented, but libabc.so is not a valid make target:
- # ABC_USE_PIC=1 libabc.so
-
- enableParallelBuilding = true;
- installPhase = ''
- mkdir -p $out/lib
- mv libabc.a $out/lib
- # mv libabc.so $out/lib
- '';
-
- meta = {
- description = "A library for sequential logic synthesis and formal verification";
- homepage = "https://people.eecs.berkeley.edu/~alanmi/abc/abc.htm";
- license = stdenv.lib.licenses.mit;
- platforms = stdenv.lib.platforms.unix;
- maintainers = [ stdenv.lib.maintainers.kquick ];
- };
-}
diff --git a/pkgs/applications/science/logic/abc/shared-library.patch b/pkgs/applications/science/logic/abc/shared-library.patch
new file mode 100644
index 00000000000..8954c36b560
--- /dev/null
+++ b/pkgs/applications/science/logic/abc/shared-library.patch
@@ -0,0 +1,11 @@
+--- hg-archive-org/CMakeLists.txt 2017-10-19 11:25:32.940200041 +0100
++++ hg-archive/CMakeLists.txt 2017-10-19 11:32:20.239750726 +0100
+@@ -93,7 +93,7 @@
+
+ list(REMOVE_ITEM ABC_SRC src/base/main/main.c)
+
+-add_library(libabc EXCLUDE_FROM_ALL ${ABC_SRC})
++add_library(libabc SHARED EXCLUDE_FROM_ALL ${ABC_SRC})
+ abc_properties(libabc PUBLIC)
+ set_property(TARGET libabc PROPERTY OUTPUT_NAME abc)
+
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 12d57f556b2..2e2d8d0ceb2 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -18481,8 +18481,7 @@ with pkgs;
### SCIENCE/LOGIC
- abc = callPackage ../applications/science/logic/abc/libabc.nix {};
- abc-verifier = callPackage ../applications/science/logic/abc {};
+ abc = callPackage ../applications/science/logic/abc {};
abella = callPackage ../applications/science/logic/abella {};
--
2.14.2 |
@Mic92, my preference would be for the original form for the following reasons:
While my preference is still for the original, divided form, I would be amenable to updates if you are strongly disposed to a version of your combined form (although I would like to hear from @thoughtpolice on this as well). |
I prefer the combined version since the project is otherwise build twice. |
OK, thanks for the feedback. |
So you no longer want to add this library? |
I can locally build the static library which meets the needs I have for the moment. I originally submitted this in July, and since there's been no interest from anyone else expressed in that period, I'm assuming I'm the only user. I will probably work on this again sometime in the future when I have time to address your input and submit updates to the upstream package to allow building both the static and shared versions of the library. |
Hi @kquick, I apologize for getting back to you late. I had way too many Nixpkgs notifications, so I ignored them for a time. Thank you for the manual ping, I'm back in action now! I agree with @Mic92 actually that having them both in the same place would be ideal, using the new shared output functionality. The main reason is: it's simply a lot easier to maintain for everyone when I won't have to go through and maintain multiple copies. (The However, In any case, if you have something that works for you now, I might be able to test @Mic92's changes and write up a patch and have you test it, if that's OK. Also: The reason I named the |
@thoughtpolice, thanks for the response. Both you and @Mic92 have much more experience with Nixpkg maintenance, so I think it would be fine to go forward with @Mic92's version for the general support if neither of you have any significant concerns. I agree about the build system, which is why I'm not eager to spend the time at the moment to resolve the static/shared issue... it may be better and easier for me to see if I can evolve my local use case to be able to use the shared library once I have some time to address it. I figured there was some conflict on the original name. My initial approach was intended to minimally conflict with any existing setup to avoid problems; I'm happy to defer to the two of you, I just don't have any additional bandwidth to work on the nixpkg for a couple of weeks. |
Motivation for this change
Adds new package to provide the libabc library for other applications to link against.
Replaces pull request #27198
Depends on pull request #30565
Things done
build-use-sandbox
innix.conf
on non-NixOS)N/A
nix-shell -p nox --run "nox-review wip"
N/A
./result/bin/
)N/A