From 47aa6abe96d26b116dae9615e0a37cdb32446dcf Mon Sep 17 00:00:00 2001 From: Jake Waksbaum Date: Tue, 14 Aug 2018 00:43:38 -0400 Subject: [PATCH] ratpoints: 2.1.3 -> 2.1.3.p4; add darwin support --- .../science/math/ratpoints/default.nix | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/science/math/ratpoints/default.nix b/pkgs/applications/science/math/ratpoints/default.nix index 82a6836bd6233..2dd4778234dfa 100644 --- a/pkgs/applications/science/math/ratpoints/default.nix +++ b/pkgs/applications/science/math/ratpoints/default.nix @@ -1,20 +1,36 @@ -{stdenv, fetchurl, gmp}: +{ stdenv, fetchurl, fetchpatch, gmp }: stdenv.mkDerivation rec { name = "ratpoints-${version}"; - version = "2.1.3"; + version = "2.1.3.p4"; + src = fetchurl { url = "http://www.mathe2.uni-bayreuth.de/stoll/programs/ratpoints-${version}.tar.gz"; sha256 = "0zhad84sfds7izyksbqjmwpfw4rvyqk63yzdjd3ysd32zss5bgf4"; }; - buildInputs = [gmp]; - makeFlags = "INSTALL_DIR=$(out)"; + + enableParallelBuilding = true; + + patches = [ + (fetchpatch { + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/ratpoints/patches/sturm_and_rp_private.patch?id=1615f58890e8f9881c4228c78a6b39b9aab1303a"; + sha256 = "0q3wajncyfr3gahd8gwk9x7g56zw54lpywrl63lqk7drkf60mrcl"; + }) + ]; + + buildInputs = [ gmp ]; + + makeFlags = [ "CC=cc" ]; + buildFlags = stdenv.lib.optional stdenv.isDarwin ["CCFLAGS2=-lgmp -lc -lm" "CCFLAGS=-UUSE_SSE"]; + installFlags = [ "INSTALL_DIR=$(out)" ]; + preInstall = ''mkdir -p "$out"/{bin,share,lib,include}''; + meta = { inherit version; description = ''A program to find rational points on hyperelliptic curves''; license = stdenv.lib.licenses.gpl2Plus; maintainers = [stdenv.lib.maintainers.raskin]; - platforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.unix; homepage = http://www.mathe2.uni-bayreuth.de/stoll/programs/; updateWalker = true; };