1 { lib, stdenv, fetchurl, fetchpatch, gmp }:
2 stdenv.mkDerivation rec {
7 url = "http://www.mathe2.uni-bayreuth.de/stoll/programs/ratpoints-${version}.tar.gz";
8 sha256 = "0zhad84sfds7izyksbqjmwpfw4rvyqk63yzdjd3ysd32zss5bgf4";
11 enableParallelBuilding = true;
15 url = "https://raw.githubusercontent.com/sagemath/sage/1615f58890e8f9881c4228c78a6b39b9aab1303a/build/pkgs/ratpoints/patches/sturm_and_rp_private.patch";
16 sha256 = "0q3wajncyfr3gahd8gwk9x7g56zw54lpywrl63lqk7drkf60mrcl";
20 buildInputs = [ gmp ];
22 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
23 buildFlags = lib.optionals stdenv.isDarwin ["CCFLAGS2=-lgmp -lc -lm" "CCFLAGS=-UUSE_SSE"];
24 installFlags = [ "INSTALL_DIR=$(out)" ];
26 preInstall = ''mkdir -p "$out"/{bin,share,lib,include}'';
29 description = "A program to find rational points on hyperelliptic curves";
30 mainProgram = "ratpoints";
31 license = lib.licenses.gpl2Plus;
32 maintainers = [lib.maintainers.raskin];
33 platforms = lib.platforms.unix;
34 homepage = "http://www.mathe2.uni-bayreuth.de/stoll/programs/";