diff options
author | Timo Kaufmann <timokau@zoho.com> | 2018-04-24 15:40:12 +0200 |
---|---|---|
committer | Timo Kaufmann <timokau@zoho.com> | 2018-04-24 15:41:15 +0200 |
commit | cdfa85c599a2d0fbc3288e6245564c91d8ac1a92 (patch) | |
tree | 2adb95e45eb85fe1196404fe7c65d10f3b33677c | |
parent | af3565ca206831caac47758f4415ec1502e1f5d0 (diff) | |
download | nixlib-cdfa85c599a2d0fbc3288e6245564c91d8ac1a92.tar nixlib-cdfa85c599a2d0fbc3288e6245564c91d8ac1a92.tar.gz nixlib-cdfa85c599a2d0fbc3288e6245564c91d8ac1a92.tar.bz2 nixlib-cdfa85c599a2d0fbc3288e6245564c91d8ac1a92.tar.lz nixlib-cdfa85c599a2d0fbc3288e6245564c91d8ac1a92.tar.xz nixlib-cdfa85c599a2d0fbc3288e6245564c91d8ac1a92.tar.zst nixlib-cdfa85c599a2d0fbc3288e6245564c91d8ac1a92.zip |
cddlib: 0.94h -> 0.94i, add cdd_both_reps binary
-rw-r--r-- | pkgs/development/libraries/cddlib/default.nix | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/pkgs/development/libraries/cddlib/default.nix b/pkgs/development/libraries/cddlib/default.nix index 818eb6db8c69..ee56b50e1da5 100644 --- a/pkgs/development/libraries/cddlib/default.nix +++ b/pkgs/development/libraries/cddlib/default.nix @@ -1,17 +1,49 @@ -{stdenv, fetchurl, gmp}: +{ stdenv +, fetchurl +, fetchpatch +, gmp +, autoreconfHook +}: + stdenv.mkDerivation rec { name = "cddlib-${version}"; - fileVersion = "094h"; - version = "0.94h"; - src = fetchurl { + version = "0.94i"; + src = let + fileVersion = stdenv.lib.replaceStrings ["."] [""] version; + in fetchurl { + # Might switch to github in the future, see + # https://trac.sagemath.org/ticket/21952#comment:20 urls = [ "http://archive.ubuntu.com/ubuntu/pool/universe/c/cddlib/cddlib_${fileVersion}.orig.tar.gz" "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-${fileVersion}.tar.gz" ]; - name = ""; - sha256 = "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"; + sha256 = "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"; }; buildInputs = [gmp]; + nativeBuildInputs = [ + autoreconfHook + ]; + # compute reduced H and V representation of polytope + # this patch is included by most distributions (Debian, Conda, ArchLinux, SageMath) + # proposed upstream (no answer yet): https://github.com/cddlib/cddlib/pull/3 + both_reps_c = (fetchurl { + name = "cdd_both_reps.c"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-libs/cddlib/files/cdd_both_reps.c?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d"; + sha256 = "0r9yc5bgiz8i72c6vsn2y2mjk5581iw94gji9v7lg16kzzgrk9x0"; + }); + preAutoreconf = '' + # Required by sage.geometry.polyhedron + cp ${both_reps_c} src/cdd_both_reps.c + cp ${both_reps_c} src-gmp/cdd_both_reps.c + ''; + patches = [ + # add the cdd_both_reps binary + (fetchpatch { + name = "add-cdd_both_reps-binary.patch"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-libs/cddlib/files/cddlib-094h-add-cdd_both_reps-binary.patch?id=78e3a61a68c916450aa4e5ceecd20041583af901"; + sha256 = "162ni2fr7dpbdkz0b5nizxq7qr5k1i1d75g0smiylpzfb0hb761a"; + }) + ]; meta = { inherit version; description = ''An implementation of the Double Description Method for generating all vertices of a convex polyhedron''; |