lcalc: 1.23 -> 2.0.5

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