Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchpatch,
6 gmp,
7}:
8stdenv.mkDerivation rec {
9 pname = "ratpoints";
10 version = "2.1.3.p4";
11
12 src = fetchurl {
13 url = "http://www.mathe2.uni-bayreuth.de/stoll/programs/ratpoints-${version}.tar.gz";
14 sha256 = "0zhad84sfds7izyksbqjmwpfw4rvyqk63yzdjd3ysd32zss5bgf4";
15 };
16
17 enableParallelBuilding = true;
18
19 patches = [
20 (fetchpatch {
21 url = "https://raw.githubusercontent.com/sagemath/sage/1615f58890e8f9881c4228c78a6b39b9aab1303a/build/pkgs/ratpoints/patches/sturm_and_rp_private.patch";
22 sha256 = "0q3wajncyfr3gahd8gwk9x7g56zw54lpywrl63lqk7drkf60mrcl";
23 })
24 ];
25
26 buildInputs = [ gmp ];
27
28 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
29 buildFlags = lib.optionals stdenv.hostPlatform.isDarwin [
30 "CCFLAGS2=-lgmp -lc -lm"
31 "CCFLAGS=-UUSE_SSE"
32 ];
33 installFlags = [ "INSTALL_DIR=$(out)" ];
34
35 preInstall = ''mkdir -p "$out"/{bin,share,lib,include}'';
36
37 meta = {
38 description = "Program to find rational points on hyperelliptic curves";
39 mainProgram = "ratpoints";
40 license = lib.licenses.gpl2Plus;
41 maintainers = [ lib.maintainers.raskin ];
42 platforms = lib.platforms.unix;
43 homepage = "http://www.mathe2.uni-bayreuth.de/stoll/programs/";
44 };
45}