tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
lcalc: 1.23 -> 2.0.5
Mauricio Collares
4 years ago
56b3968b
689b76bc
+18
-187
2 changed files
expand all
collapse all
unified
split
pkgs
development
libraries
science
math
lcalc
default.nix
makefile.patch
+18
-74
pkgs/development/libraries/science/math/lcalc/default.nix
···
1
1
{ lib, stdenv
2
2
-
, fetchurl
3
3
-
, fetchpatch
2
2
+
, autoreconfHook
3
3
+
, gengetopt
4
4
+
, pkg-config
5
5
+
, fetchFromGitLab
4
6
, pari
5
7
}:
6
8
7
9
stdenv.mkDerivation rec {
8
8
-
version = "1.23";
10
10
+
version = "2.0.5";
9
11
pname = "lcalc";
10
12
11
11
-
src = fetchurl {
12
12
-
# original at http://oto.math.uwaterloo.ca/~mrubinst/L_function_public/CODE/L-${version}.tar.gz, no longer available
13
13
-
# "newer" version at google code https://code.google.com/archive/p/l-calc/source/default/source
14
14
-
url = "mirror://sageupstream/lcalc/lcalc-${version}.tar.bz2";
15
15
-
sha256 = "1c6dsdshgxhqppjxvxhp8yhpxaqvnz3d1mlh26r571gkq8z2bm43";
13
13
+
src = fetchFromGitLab {
14
14
+
owner = "sagemath";
15
15
+
repo = pname;
16
16
+
rev = version;
17
17
+
sha256 = "sha256-RxWZ7T0I9zV7jUVnL6jV/PxEoU32KY7Q1UsOL5Lonuc=";
16
18
};
17
19
18
18
-
preConfigure = "cd src";
20
20
+
nativeBuildInputs = [
21
21
+
autoreconfHook
22
22
+
gengetopt
23
23
+
pkg-config
24
24
+
];
19
25
20
26
buildInputs = [
21
27
pari
22
28
];
23
29
24
24
-
patches = [
25
25
-
# Port to newer pari
26
26
-
(fetchpatch {
27
27
-
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/pari-2.7.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
28
28
-
sha256 = "1x3aslldm8njjm7p9g9s9w2c91kphnci2vpkxkrcxfihw3ayss6c";
29
29
-
})
30
30
-
31
31
-
# Uncomment the definition of lcalc_to_double(const long double& x).
32
32
-
# (Necessary for GCC >= 4.6.0, cf. https://trac.sagemath.org/ticket/10892)
33
33
-
(fetchpatch {
34
34
-
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/Lcommon.h.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
35
35
-
sha256 = "0g4ybvsrcv48rmlh1xjnkms19jp25k58azv6ds1f2cm34hxs8fdx";
36
36
-
})
37
37
-
38
38
-
# Include also <time.h> in Lcommandline_numbertheory.h (at least required
39
39
-
# on Cygwin, cf. https://trac.sagemath.org/ticket/9845)
40
40
-
(fetchpatch {
41
41
-
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/time.h.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
42
42
-
sha256 = "1brf04n11kkc43ylagf8dm32j5r2g9zv51dp5wag1mpm4p04l7cl";
43
43
-
})
44
44
-
45
45
-
# Fix for gcc >4.6
46
46
-
(fetchpatch {
47
47
-
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/lcalc-1.23_default_parameters_1.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
48
48
-
sha256 = "0i2yvxm5fx4z0v6m4srgh8rj98kijmlvyirlxf1ky0bp2si6bpka";
49
49
-
})
50
50
-
51
51
-
# gcc 5.1
52
52
-
(fetchpatch {
53
53
-
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/lcalc-1.23_default_parameters_2.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
54
54
-
sha256 = "0dqwmxpm9wb53qbypsyfkgsvk2f8nf67sydphd4dkc2vw4yz6vlh";
55
55
-
})
56
56
-
57
57
-
# based on gentoos makefile patch -- fix paths, adhere to flags
58
58
-
./makefile.patch
59
59
-
60
60
-
# (fetchpatch {
61
61
-
# name = "default-double.patch";
62
62
-
# url = "https://github.com/dimpase/lcalc/pull/1/commits/0500c67b6aa1f492715591669f6647c8f7a3ea59.patch";
63
63
-
# sha256 = "0dqwmxpm9wb53qbypsyfkgsvk2f8nf67sydphd4dkc2vw4yz6vla";
64
64
-
# })
65
65
-
66
66
-
(fetchpatch {
67
67
-
name = "c++11.patch";
68
68
-
url = "https://raw.githubusercontent.com/archlinux/svntogit-community/3607b97df5a8c231191115b0cb5c62426b339e71/trunk/lcalc-c++11.patch";
69
69
-
sha256 = "1ccrl61lv2vvx8ggldq54m5d0n1iy6mym7qz0i8nj6yj0dshnpk3";
70
70
-
})
71
71
-
] ++ lib.optional stdenv.isDarwin
72
72
-
(fetchpatch {
73
73
-
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/clang.patch";
74
74
-
sha256 = "0bb7656z6cp6i4p2qj745cmq0lhh52v2akl9whi760dynfdxbl18";
75
75
-
});
76
76
-
77
77
-
postPatch = lib.optionalString stdenv.isDarwin ''
78
78
-
substituteInPlace src/Makefile --replace g++ c++
79
79
-
'';
80
80
-
81
81
-
installFlags = [
82
82
-
"DESTDIR=$(out)"
83
83
-
];
84
84
-
85
85
-
makeFlags = [
86
86
-
"PARI_DEFINE=-DINCLUDE_PARI"
87
87
-
"PARI_PREFIX=${pari}"
30
30
+
configureFlags = [
31
31
+
"--with-pari"
88
32
];
89
33
90
34
meta = with lib; {
91
91
-
homepage = "http://oto.math.uwaterloo.ca/~mrubinst/L_function_public/L.html";
35
35
+
homepage = "https://gitlab.com/sagemath/lcalc";
92
36
description = "A program for calculating with L-functions";
93
37
license = with licenses; [ gpl2 ];
94
38
maintainers = teams.sage.members;
-113
pkgs/development/libraries/science/math/lcalc/makefile.patch
···
1
1
-
diff --git a/src/Makefile b/src/Makefile
2
2
-
index 84e4e88..56ca676 100644
3
3
-
--- a/src/Makefile
4
4
-
+++ b/src/Makefile
5
5
-
@@ -58,7 +58,7 @@ ifeq ($(G5),TRUE)
6
6
-
#MACHINE_SPECIFIC_FLAGS = -mpowerpc -mpowerpc64 -m64
7
7
-
endif
8
8
-
9
9
-
-CCFLAGS = -Wa,-W -O3 $(OPENMP_FLAG) -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
10
10
-
+CCFLAGS = $(CXXFLAGS) $(OPENMP_FLAG) $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS)
11
11
-
#CCFLAGS = -Wa,-W -O3 $(OPENMP_FLAG) $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
12
12
-
#CCFLAGS = -Wa,-W -O2 -fno-exceptions -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
13
13
-
14
14
-
@@ -68,12 +68,12 @@ CCFLAGS = -Wa,-W -O3 $(OPENMP_FLAG) -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MA
15
15
-
16
16
-
ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
17
17
-
#location of pari.h.
18
18
-
- LOCATION_PARI_H = /usr/local/include/pari #usual location
19
19
-
+ LOCATION_PARI_H = $(PARI_PREFIX)/include/pari #usual location
20
20
-
21
21
-
#location of libpari.a or of libpari.so
22
22
-
#depending on whether static or dynamic libraries are being used.
23
23
-
#On mac os x it's the former, on linux I think usually the latter.
24
24
-
- LOCATION_PARI_LIBRARY = /usr/local/lib #usual location
25
25
-
+ LOCATION_PARI_LIBRARY = $(PARI_PREFIX)/lib #usual location
26
26
-
else
27
27
-
#supplied as a dummy so as to avoid more ifeq's below
28
28
-
LOCATION_PARI_H = .
29
29
-
@@ -89,24 +89,24 @@ INCLUDEFILES= -I../include
30
30
-
31
31
-
ifeq ($(OS_NAME),Darwin)
32
32
-
LDFLAGS2 =
33
33
-
- DYN_OPTION=dynamiclib
34
34
-
+ DYN_OPTION=-dynamiclib
35
35
-
else
36
36
-
- LDFLAGS1 = -Xlinker -export-dynamic #not sure why pari calls these when linking but on the web I found
37
37
-
+ LDFLAGS1 = #not sure why pari calls these when linking but on the web I found
38
38
-
#'Libtool provides the `-export-dynamic' link flag (see section Link mode), which does this declaration.
39
39
-
#You need to use this flag if you are linking a shared library that will be dlopened'
40
40
-
#see notes below
41
41
-
#ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
42
42
-
- LDFLAGS2 = $(LDFLAGS1) -Xlinker -rpath -Xlinker $(LOCATION_PARI_LIBRARY)
43
43
-
+ LDFLAGS2 = $(LDFLAGS)
44
44
-
#else
45
45
-
# LDFLAGS2 = $(LDFLAGS1)
46
46
-
#endif
47
47
-
- DYN_OPTION=shared
48
48
-
+ DYN_OPTION=$(LDFLAGS) -shared -Wl,-soname,libLfunction.so
49
49
-
endif
50
50
-
51
51
-
ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
52
52
-
- LDFLAGS = $(LDFLAGS2) -L$(LOCATION_PARI_LIBRARY) -lpari
53
53
-
+ MYLDFLAGS = $(LDFLAGS2) -L$(LOCATION_PARI_LIBRARY) -lpari
54
54
-
else
55
55
-
- LDFLAGS = $(LDFLAGS2)
56
56
-
+ MYLDFLAGS = $(LDFLAGS2)
57
57
-
endif
58
58
-
59
59
-
60
60
-
@@ -129,7 +129,8 @@ endif
61
61
-
#become clear which libraries the computer can find.
62
62
-
63
63
-
64
64
-
-INSTALL_DIR= /usr/local
65
65
-
+INSTALL_DIR= $(DESTDIR)
66
66
-
+LIB_DIR ?=lib
67
67
-
68
68
-
#object files for the libLfunction library
69
69
-
OBJ_L = Lglobals.o Lgamma.o Lriemannsiegel.o Lriemannsiegel_blfi.o Ldokchitser.o
70
70
-
@@ -141,9 +142,8 @@ OBJECTS = $(OBJ3)
71
71
-
72
72
-
all:
73
73
-
# make print_vars
74
74
-
- make libLfunction.so
75
75
-
- make lcalc
76
76
-
- make examples
77
77
-
+ ${MAKE} libLfunction.so
78
78
-
+ ${MAKE} lcalc
79
79
-
# make find_L
80
80
-
# make test
81
81
-
82
82
-
@@ -151,7 +151,7 @@ print_vars:
83
83
-
@echo OS_NAME = $(OS_NAME)
84
84
-
85
85
-
lcalc: $(OBJECTS)
86
86
-
- $(CC) $(CCFLAGS) $(INCLUDEFILES) $(OBJECTS) $(LDFLAGS) -o lcalc $(GMP_FLAGS)
87
87
-
+ $(CC) $(CCFLAGS) $(INCLUDEFILES) $(OBJECTS) $(MYLDFLAGS) -o lcalc $(GMP_FLAGS)
88
88
-
89
89
-
examples:
90
90
-
$(CC) $(CCFLAGS) $(INCLUDEFILES) example_programs/example.cc libLfunction.so -o example_programs/example $(GMP_FLAGS)
91
91
-
@@ -262,15 +262,18 @@ Lcommandline.o: ../include/Lcommandline_values_zeros.h
92
92
-
93
93
-
94
94
-
libLfunction.so: $(OBJ_L)
95
95
-
- g++ -$(DYN_OPTION) -o libLfunction.so $(OBJ_L)
96
96
-
+ g++ $(DYN_OPTION) -o libLfunction.so $(OBJ_L)
97
97
-
98
98
-
clean:
99
99
-
rm -f *.o lcalc libLfunction.so example_programs/example
100
100
-
101
101
-
install:
102
102
-
- cp -f lcalc $(INSTALL_DIR)/bin/.
103
103
-
- cp -f libLfunction.so $(INSTALL_DIR)/lib/.
104
104
-
- cp -rf ../include $(INSTALL_DIR)/include/Lfunction
105
105
-
+ install -d $(INSTALL_DIR)/bin
106
106
-
+ install -d $(INSTALL_DIR)/$(LIB_DIR)
107
107
-
+ install -d $(INSTALL_DIR)/include/Lfunction
108
108
-
+ install lcalc $(INSTALL_DIR)/bin
109
109
-
+ install libLfunction.so $(INSTALL_DIR)/$(LIB_DIR)
110
110
-
+ install -m 644 -t $(INSTALL_DIR)/include/Lfunction ../include/*.h
111
111
-
112
112
-
113
113
-
SRCS = Lcommandline.cc Lcommandline_elliptic.cc Lcommandline_globals.cc Lcommandline_misc.cc Lcommandline_numbertheory.cc Lcommandline_twist.cc Lcommandline_values_zeros.cc Lgamma.cc Lglobals.cc Lmisc.cc Lriemannsiegel.cc Lriemannsiegel_blfi.cc cmdline.c