From 88f913e8ad71309ff0c0793b74e4c704489b104f Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 20 Jun 2019 22:59:12 +0200 Subject: gnu: lrcalc: Add a patch for identifying include files. * gnu/packages/patches/lrcalc-includes.patch: New file. * gnu/packages/algebra.scm (lrcalc): Use patch. * gnu/local.mk (dist_patch_DATA): Register patch. --- gnu/local.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 649d901bf3..17acef9b15 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1044,6 +1044,7 @@ dist_patch_DATA = \ %D%/packages/patches/llvm-3.5-fix-clang-build-with-gcc5.patch \ %D%/packages/patches/llvm-for-extempore.patch \ %D%/packages/patches/lm-sensors-hwmon-attrs.patch \ + %D%/packages/patches/lrcalc-includes.patch \ %D%/packages/patches/lrzip-CVE-2017-8842.patch \ %D%/packages/patches/lua-CVE-2014-5461.patch \ %D%/packages/patches/lua-pkgconfig.patch \ -- cgit v1.2.3 From fedb9571eb423bff0f806ae3fcb106e16e1e56e9 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 20 Jun 2019 18:36:13 +0200 Subject: gnu: Add lcalc. * gnu/packages/sagemath.scm (lcalc): New variable. * gnu/packages/patches/lcalc-default-parameters-1.patch, gnu/packages/patches/lcalc-default-parameters-2.patch, gnu/packages/patches/lcalc-lcommon-h.patch, gnu/packages/patches/lcalc-using-namespace-std.patch: New files. * gnu/local.mk (dist_patch_DATA): Register patches. --- gnu/local.mk | 4 ++ .../patches/lcalc-default-parameters-1.patch | 26 +++++++++ .../patches/lcalc-default-parameters-2.patch | 58 +++++++++++++++++++ gnu/packages/patches/lcalc-lcommon-h.patch | 13 +++++ .../patches/lcalc-using-namespace-std.patch | 43 ++++++++++++++ gnu/packages/sagemath.scm | 65 ++++++++++++++++++++++ 6 files changed, 209 insertions(+) create mode 100644 gnu/packages/patches/lcalc-default-parameters-1.patch create mode 100644 gnu/packages/patches/lcalc-default-parameters-2.patch create mode 100644 gnu/packages/patches/lcalc-lcommon-h.patch create mode 100644 gnu/packages/patches/lcalc-using-namespace-std.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 17acef9b15..4c54f024e0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -973,6 +973,10 @@ dist_patch_DATA = \ %D%/packages/patches/kodi-set-libcurl-ssl-parameters.patch \ %D%/packages/patches/kodi-skip-test-449.patch \ %D%/packages/patches/laby-make-install.patch \ + %D%/packages/patches/lcalc-default-parameters-1.patch \ + %D%/packages/patches/lcalc-default-parameters-2.patch \ + %D%/packages/patches/lcalc-lcommon-h.patch \ + %D%/packages/patches/lcalc-using-namespace-std.patch \ %D%/packages/patches/lcms-CVE-2018-16435.patch \ %D%/packages/patches/ldc-bootstrap-disable-tests.patch \ %D%/packages/patches/ldc-disable-phobos-tests.patch \ diff --git a/gnu/packages/patches/lcalc-default-parameters-1.patch b/gnu/packages/patches/lcalc-default-parameters-1.patch new file mode 100644 index 0000000000..19b0776320 --- /dev/null +++ b/gnu/packages/patches/lcalc-default-parameters-1.patch @@ -0,0 +1,26 @@ +Patch taken from the Sage packaging system. + +diff -Naur lcalc-1.23-vanilla/include/Ldirichlet_series.h lcalc-1.23-fixed-gcc.4.9/include/Ldirichlet_series.h +--- lcalc-1.23-vanilla/include/Ldirichlet_series.h 2012-08-08 23:21:55.000000000 +0200 ++++ lcalc-1.23-fixed-gcc.4.9/include/Ldirichlet_series.h 2014-04-21 14:37:59.027464849 +0200 +@@ -43,7 +43,7 @@ + //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + template + Complex L_function :: +-dirichlet_series(Complex s, long long N=-1) ++dirichlet_series(Complex s, long long N) + { + Complex z=0.; + long long m,n; +diff -Naur lcalc-1.23-vanilla/include/L.h lcalc-1.23-fixed-gcc.4.9/include/L.h +--- lcalc-1.23-vanilla/include/L.h 2012-08-08 23:21:55.000000000 +0200 ++++ lcalc-1.23-fixed-gcc.4.9/include/L.h 2014-04-21 14:32:04.003467348 +0200 +@@ -491,7 +491,7 @@ + + //#include "Ldirichlet_series.h" //for computing Dirichlet series + Complex partial_dirichlet_series(Complex s, long long N1, long long N2); +- Complex dirichlet_series(Complex s, long long N); ++ Complex dirichlet_series(Complex s, long long N=-1LL); + + //#include "Ltaylor_series.h" //for computing taylor series for Dirichlet series + //void compute_taylor_series(int N, int K, Complex s_0, Complex *series); diff --git a/gnu/packages/patches/lcalc-default-parameters-2.patch b/gnu/packages/patches/lcalc-default-parameters-2.patch new file mode 100644 index 0000000000..1d881ee0c4 --- /dev/null +++ b/gnu/packages/patches/lcalc-default-parameters-2.patch @@ -0,0 +1,58 @@ +Patch taken from the Sage packaging system. + +--- lcalc-1.23/include/Lgamma.h 2012-08-08 23:21:55.000000000 +0200 ++++ lcalc-1.23/include/Lgamma.h 2014-05-18 21:15:27.786889718 +0200 +@@ -77,7 +77,7 @@ + //n=0 should just give log_GAMMA(z)... thus making log_GAMMA + //code obsolete. But leave log_GAMMA intact anyways. + template +-precise(ttype) log_GAMMA (ttype z,int n=0) ++precise(ttype) log_GAMMA (ttype z,int n) + { + int M; + precise(ttype) log_G,r,r2,y; +@@ -230,7 +230,7 @@ + //value exp_w which holds exp(-w) + //computes G(z,w), so there's an extra w^(-z) factor. + template +-Complex inc_GAMMA (ttype z,ttype w, const char *method="temme", ttype exp_w = 0, bool recycle=false) ++Complex inc_GAMMA (ttype z,ttype w, const char *method, ttype exp_w, bool recycle) + { + + Complex G; +@@ -334,7 +334,7 @@ + + + template +-ttype cfrac_GAMMA (ttype z,ttype w, ttype exp_w=0, bool recycle=false) //computes G(z,w) via continued fraction ++ttype cfrac_GAMMA (ttype z,ttype w, ttype exp_w, bool recycle) //computes G(z,w) via continued fraction + { + + ttype G; +@@ -424,7 +424,7 @@ + } + + template +-ttype asympt_GAMMA (ttype z,ttype w, ttype exp_w = 0, bool recycle=false) //computes G(z,w) via asymptotic series ++ttype asympt_GAMMA (ttype z,ttype w, ttype exp_w, bool recycle) //computes G(z,w) via asymptotic series + { + + if(my_verbose>3) cout << "called asympt_GAMMA("< +-ttype comp_inc_GAMMA (ttype z,ttype w,ttype exp_w = 0, bool recycle=false) //computes g(z,w) ++ttype comp_inc_GAMMA (ttype z,ttype w,ttype exp_w, bool recycle) //computes g(z,w) + { + + ttype g; +@@ -604,7 +604,7 @@ + } + + template +-Complex gamma_sum(Complex s, int what_type, ttype *coeff, int N, Double g, Complex l, Double Q, Long Period, Complex delta=1, const char *method="temme") ++Complex gamma_sum(Complex s, int what_type, ttype *coeff, int N, Double g, Complex l, Double Q, Long Period, Complex delta, const char *method) + { + Complex SUM=0; + diff --git a/gnu/packages/patches/lcalc-lcommon-h.patch b/gnu/packages/patches/lcalc-lcommon-h.patch new file mode 100644 index 0000000000..897956de64 --- /dev/null +++ b/gnu/packages/patches/lcalc-lcommon-h.patch @@ -0,0 +1,13 @@ +Patch taken from the Sage packaging system. + +--- src/include/Lcommon.h 2010-01-31 15:16:45.000000000 +0000 ++++ src/include/Lcommon.h 2011-03-08 21:19:11.849443238 +0000 +@@ -25,7 +25,7 @@ + #ifdef USE_MPFR + inline double lcalc_to_double(const double& x) { return x; } + #endif +-//inline double lcalc_to_double(const long double& x) { return x; } ++inline double lcalc_to_double(const long double& x) { return x; } + inline double lcalc_to_double(const int& x) { return x; } + inline double lcalc_to_double(const long long& x) { return x; } + inline double lcalc_to_double(const short& x) { return x; } diff --git a/gnu/packages/patches/lcalc-using-namespace-std.patch b/gnu/packages/patches/lcalc-using-namespace-std.patch new file mode 100644 index 0000000000..6e0075fdc8 --- /dev/null +++ b/gnu/packages/patches/lcalc-using-namespace-std.patch @@ -0,0 +1,43 @@ +Patch taken from the Sage packaging system. + +diff --git a/include/Lcommon.h b/include/Lcommon.h +index 1b3be43..bf40532 100644 +--- a/include/Lcommon.h ++++ b/include/Lcommon.h +@@ -48,7 +48,7 @@ const bool outputSeries=true; // Whether to output the coefficients or just th + + // Loop i from m to n + // Useful in tidying up most for loops +-#define loop(i,m,n) for(typeof(m) i=(m); i!=(n); i++) ++#define loop(i,m,n) for(auto i=(m); i!=(n); i++) + + // A class for calculations involving polynomials of small degree + // Not efficient enough for huge polynomials +diff --git a/include/Lcommon_ld.h b/include/Lcommon_ld.h +index 86ae4df..33c560c 100644 +--- a/include/Lcommon_ld.h ++++ b/include/Lcommon_ld.h +@@ -53,7 +53,7 @@ const bool outputSeries=true; // Whether to output the coefficients or just th + + // Loop i from m to n + // Useful in tidying up most for loops +-#define loop(i,m,n) for(typeof(m) i=(m); i!=(n); i++) ++#define loop(i,m,n) for(auto i=(m); i!=(n); i++) + + // A class for calculations involving polynomials of small degree + // Not efficient enough for huge polynomials +diff --git a/include/Lglobals.h b/include/Lglobals.h +index 60002e4..ca2606c 100644 +--- a/include/Lglobals.h ++++ b/include/Lglobals.h +@@ -24,9 +24,9 @@ + #ifndef Lglobals_H + #define Lglobals_H + ++#include + using namespace std; + +-#include + #ifdef USE_MPFR + #include "Lgmpfrxx.h" + typedef mpfr_class Double; diff --git a/gnu/packages/sagemath.scm b/gnu/packages/sagemath.scm index 63d1281668..7517b55175 100644 --- a/gnu/packages/sagemath.scm +++ b/gnu/packages/sagemath.scm @@ -24,6 +24,7 @@ #:use-module (guix git-download) #:use-module (guix packages) #:use-module (guix utils) + #:use-module (gnu packages) #:use-module (gnu packages algebra) #:use-module (gnu packages autotools) #:use-module (gnu packages bdw-gc) @@ -353,3 +354,67 @@ Boolean variables. As a unique approach, binary decision diagrams are used as internal storage type for polynomial structures.") (license license:gpl2+) (home-page "https://gitlab.com/sagemath/zn_poly"))) + +(define-public lcalc + (package + (name "lcalc") + (version "1.23") + ;; The original home page of the project has disappeared, as well as + ;; code hosted by the original author on Google Code. The latter has + ;; been copied to gitlab.com/sagemath and purportedly contains patches + ;; for a never released version 1.3, that supposedly follows 1.23. + ;; We use the tarball as well as the patches hosted inside the sage + ;; package system distributed with the sage tarball. + (source + (origin + (method url-fetch) + (uri (string-append "ftp://ftp.fu-berlin.de/unix/misc/sage/spkg/" + "upstream/lcalc/lcalc-1.23.tar.bz2")) + (sha256 + (base32 + "1c6dsdshgxhqppjxvxhp8yhpxaqvnz3d1mlh26r571gkq8z2bm43")) + (patches (search-patches "lcalc-lcommon-h.patch" + "lcalc-default-parameters-1.patch" + "lcalc-default-parameters-2.patch" + "lcalc-using-namespace-std.patch")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no tests + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'prepare-build + (lambda* (#:key outputs #:allow-other-keys) + (chdir "src") + (let ((out (assoc-ref outputs "out"))) + (substitute* "Makefile" + (("^INSTALL_DIR= /usr/local") + (string-append "INSTALL_DIR=" out)) + ;; Sage renames the include directory, so we do it also. + (("include/Lfunction") + "include/libLfunction") + ;; Add --std=c++11 to be compatible with the "auto" keyword + ;; introduced by lcalc-using-namespace-std.patch. + (("^#EXTRA= -pg") + "EXTRA=--std=c++11"))) + #t)) + (add-before 'install 'make-output-dirs + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (lib (string-append out "/lib")) + (include (string-append out "/include"))) + (mkdir-p bin) + (mkdir-p lib) + (mkdir-p include)) + #t))))) + ;; FIXME: + ;; We need to add pari-gp and probably pari related patches from the + ;; sage project, as well as uncomment the line setting PARI_DEFINE in + ;; the Makefile to get the full functionality of this package. + ;; For the time being, we hope that sage can be compiled without. + (synopsis "C++ library for L-functions") + (description "Lcalc computes L-functions, in particular the Riemann +zeta function and its twists by quadratic characters.") + (license license:gpl2+) + (home-page "https://gitlab.com/sagemath/sage"))) -- cgit v1.2.3 From b556abe416a3e79b7f3b8cf491d8a3179c3d31c8 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 21 Jun 2019 11:39:25 +0200 Subject: gnu: khmer: Update to 3.0.0a3. * gnu/packages/bioinformatics.scm (khmer): Update to 3.0.0a3. [source]: Remove patch; remove seqan in snippet. [inputs]: Add seqan-1. * gnu/packages/patches/khmer-use-libraries.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/bioinformatics.scm | 12 +++++++++--- gnu/packages/patches/khmer-use-libraries.patch | 16 ---------------- 3 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 gnu/packages/patches/khmer-use-libraries.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 4c54f024e0..a467501f50 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -951,7 +951,6 @@ dist_patch_DATA = \ %D%/packages/patches/java-xerces-xjavac_taskdef.patch \ %D%/packages/patches/jbig2dec-ignore-testtest.patch \ %D%/packages/patches/kdbusaddons-kinit-file-name.patch \ - %D%/packages/patches/khmer-use-libraries.patch \ %D%/packages/patches/libziparchive-add-includes.patch \ %D%/packages/patches/localed-xorg-keyboard.patch \ %D%/packages/patches/kiki-level-selection-crash.patch \ diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index f1a73bca7e..4f4d3d9839 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -4168,7 +4168,7 @@ command, or queried for specific k-mers with @code{jellyfish query}.") (define-public khmer (package (name "khmer") - (version "2.1.2") + (version "3.0.0a3") (source (origin (method git-fetch) @@ -4178,8 +4178,7 @@ command, or queried for specific k-mers with @code{jellyfish query}.") (file-name (git-file-name name version)) (sha256 (base32 - "02x38d9jw2r58y8dmnj4hffy9wxv1yc1jwbvdbhby9dxndv94r9m")) - (patches (search-patches "khmer-use-libraries.patch")) + "01l4jczglkl7yfhgvzx8j0df7k54bk1r8sli9ll16i1mis0d8f37")) (modules '((guix build utils))) (snippet '(begin @@ -4192,6 +4191,12 @@ command, or queried for specific k-mers with @code{jellyfish query}.") ;; https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00977.html (delete-file-recursively "third-party/zlib") (delete-file-recursively "third-party/bzip2") + (delete-file-recursively "third-party/seqan") + (substitute* "setup.cfg" + (("# libraries = z,bz2") + "libraries = z,bz2") + (("include:third-party/zlib:third-party/bzip2") + "include:")) #t)))) (build-system python-build-system) (arguments @@ -4208,6 +4213,7 @@ command, or queried for specific k-mers with @code{jellyfish query}.") (inputs `(("zlib" ,zlib) ("bzip2" ,bzip2) + ("seqan" ,seqan-1) ("python-screed" ,python-screed) ("python-bz2file" ,python-bz2file))) (home-page "https://khmer.readthedocs.org/") diff --git a/gnu/packages/patches/khmer-use-libraries.patch b/gnu/packages/patches/khmer-use-libraries.patch deleted file mode 100644 index 47d163a99a..0000000000 --- a/gnu/packages/patches/khmer-use-libraries.patch +++ /dev/null @@ -1,16 +0,0 @@ -Change setup.cfg so that the bundled zlib and bzip2 are not used. This cannot -currently be achieved using "--library z,bz2" as instructed in the setup.py. - -diff --git a/setup.cfg b/setup.cfg -index c054092..080992e 100644 ---- a/setup.cfg -+++ b/setup.cfg -@@ -1,7 +1,7 @@ - [build_ext] - define = SEQAN_HAS_BZIP2,SEQAN_HAS_ZLIB - undef = NO_UNIQUE_RC --# libraries = z,bz2 -+libraries = z,bz2 - ## if using system libraries - include-dirs = lib:third-party/zlib:third-party/bzip2:third-party/seqan/core/include:third-party/smhasher - # include-dirs = lib -- cgit v1.2.3 From b95af3f6ab6a55641260b8f9743496ec12992717 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 22 Jun 2019 17:17:06 +0200 Subject: gnu: python-pyatspi: Fix loading libraries. * gnu/package/gnome.scm (python-pyatspi): Fix loading dependencies. --- gnu/local.mk | 1 + gnu/packages/gnome.scm | 15 +++- .../patches/python-pyatspi-python-37.patch | 82 ++++++++++++++++++++++ 3 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-pyatspi-python-37.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index a467501f50..8be4d74dce 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1218,6 +1218,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-mox3-python3.6-compat.patch \ %D%/packages/patches/python-testtools.patch \ %D%/packages/patches/python-paste-remove-timing-test.patch \ + %D%/packages/patches/python-pyatspi-python-37.patch \ %D%/packages/patches/python-pycrypto-CVE-2013-7459.patch \ %D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \ %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \ diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index ad6b9203b9..2820be0022 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -7397,8 +7397,21 @@ kill/reinice processes.") "/pyatspi-" version ".tar.xz")) (sha256 (base32 - "0xdnix7gxzgf75xy9ris4dd6b05mqwicw190b98xqmypydyf95n6")))) + "0xdnix7gxzgf75xy9ris4dd6b05mqwicw190b98xqmypydyf95n6")) + ;; Patch from upstream, fixed in newer versions. + (patches (search-patches "python-pyatspi-python-37.patch")))) (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-before 'build 'fix-atk-load + (lambda _ + (substitute* "pyatspi/__init__.py" + (("from gi.repository import Atspi") + "gi.require_version('Gtk', '3.0') +from gi.repository import Gtk +from gi.repository import Atspi")) + #t))))) (native-inputs `(("pkg-config" ,pkg-config))) (inputs diff --git a/gnu/packages/patches/python-pyatspi-python-37.patch b/gnu/packages/patches/python-pyatspi-python-37.patch new file mode 100644 index 0000000000..caa6aea39e --- /dev/null +++ b/gnu/packages/patches/python-pyatspi-python-37.patch @@ -0,0 +1,82 @@ +From 29a7b929f7f1160b643dc5f5911533887173fcff Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Thu, 28 Jun 2018 17:10:33 +0200 +Subject: [PATCH] Rename async to asynchronous, keep backwards comaptibility + +async is a keyword in Python 3.7 and keeping it results in SyntaxError. + +Fixes https://gitlab.gnome.org/GNOME/pyatspi2/issues/1 +--- + pyatspi/registry.py | 35 +++++++++++++++++++++++++++-------- + 1 file changed, 27 insertions(+), 8 deletions(-) + +diff --git a/pyatspi/registry.py b/pyatspi/registry.py +index cb28395..f73ee16 100644 +--- a/pyatspi/registry.py ++++ b/pyatspi/registry.py +@@ -50,9 +50,9 @@ class Registry(object): + reference to the Accessibility.Registry singleton. Doing so is harmless and + has no point. + +- @@ivar async: Should event dispatch to local listeners be decoupled from event +- receiving from the registry? +- @@type async: boolean ++ @@ivar asynchronous: Should event dispatch to local listeners be decoupled ++ from event receiving from the registry? ++ @@type asynchronous: boolean + @@ivar reg: Reference to the real, wrapped registry object + @@type reg: Accessibility.Registry + @@ivar dev: Reference to the device controller +@@ -111,25 +111,44 @@ class Registry(object): + + self.has_implementations = True + +- self.async = False # not fully supported yet ++ self.asynchronous = False # not fully supported yet + self.started = False + self.event_listeners = dict() + ++ def __getattr__(self, name): ++ """ ++ For backwards compatibility with old API ++ """ ++ if name == 'async': ++ return self.asynchronous ++ return object.__getattr__(self, name) ++ ++ def __setattr__(self, name, value): ++ """ ++ For backwards compatibility with old API ++ """ ++ if name == 'async': ++ self.asynchronous = value ++ object.__setattr__(self, name, value) ++ + def _set_default_registry (self): + self._set_registry (MAIN_LOOP_GLIB) + +- def start(self, async=False, gil=True): ++ def start(self, asynchronous=False, gil=True, **kwargs): + """ + Enter the main loop to start receiving and dispatching events. + +- @@param async: Should event dispatch be asynchronous (decoupled) from +- event receiving from the AT-SPI registry? +- @@type async: boolean ++ @@param asynchronous: Should event dispatch be asynchronous ++ (decoupled) from event receiving from the AT-SPI registry? ++ @@type asynchronous: boolean + @@param gil: Add an idle callback which releases the Python GIL for a few + milliseconds to allow other threads to run? Necessary if other threads + will be used in this process. + @@type gil: boolean + """ ++ if 'async' in kwargs: ++ # support previous API ++ asynchronous = kwargs['async'] + if not self.has_implementations: + self._set_default_registry () + self.started = True +-- +2.22.0 + -- cgit v1.2.3 From fbfc07bd867ce3f63be99332ef97a7b765a9d33f Mon Sep 17 00:00:00 2001 From: Guillaume LE VAILLANT Date: Wed, 5 Jun 2019 18:11:20 +0200 Subject: gnu: Add leela-zero. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/games.scm (leela-zero): New variable. * gnu/packages/patches/leela-zero-gtest.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 2 ++ gnu/packages/games.scm | 51 +++++++++++++++++++++++++++++ gnu/packages/patches/leela-zero-gtest.patch | 40 ++++++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 gnu/packages/patches/leela-zero-gtest.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 8be4d74dce..0c7a9ec198 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -20,6 +20,7 @@ # Copyright © 2018, 2019 Oleg Pykhalov # Copyright © 2018 Stefan Stefanović # Copyright © 2018 Maxim Cournoyer +# Copyright © 2019 Guillaume Le Vaillant # # This file is part of GNU Guix. # @@ -979,6 +980,7 @@ dist_patch_DATA = \ %D%/packages/patches/lcms-CVE-2018-16435.patch \ %D%/packages/patches/ldc-bootstrap-disable-tests.patch \ %D%/packages/patches/ldc-disable-phobos-tests.patch \ + %D%/packages/patches/leela-zero-gtest.patch \ %D%/packages/patches/liba52-enable-pic.patch \ %D%/packages/patches/liba52-link-with-libm.patch \ %D%/packages/patches/liba52-set-soname.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 304ef45024..240b1d33df 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -42,6 +42,7 @@ ;;; Copyright © 2019 Julien Lepiller ;;; Copyright © 2019 Jesse Gibbons ;;; Copyright © 2019 Dan Frumin +;;; Copyright © 2019 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; @@ -130,6 +131,7 @@ #:use-module (gnu packages netpbm) #:use-module (gnu packages networking) #:use-module (gnu packages ocaml) + #:use-module (gnu packages opencl) #:use-module (gnu packages pcre) #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) @@ -7580,3 +7582,52 @@ remake of that series or any other game.") ;; released under both gpl2 and cc-by-sa3.0. Bundled Gigi library is ;; released under lgpl2.1+. (license (list license:gpl2 license:cc-by-sa3.0 license:lgpl2.1+)))) + +(define-public leela-zero + (package + (name "leela-zero") + (version "0.17") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/leela-zero/leela-zero.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "17px5iny8mql5c01bymcli7zfssswkzvb2i8gnsmjcck6i2n8srl")) + (patches (search-patches "leela-zero-gtest.patch")))) + (build-system cmake-build-system) + (native-inputs + `(("googletest" ,googletest))) + (inputs + `(("boost" ,boost) + ("ocl-icd" ,ocl-icd) + ("openblas" ,openblas) + ("opencl-headers" ,opencl-headers) + ("qtbase" ,qtbase) + ("zlib" ,zlib))) + (arguments + '(#:configure-flags '("-DUSE_BLAS=YES") + #:phases (modify-phases %standard-phases + (add-before 'configure 'fix-tests + (lambda* (#:key outputs #:allow-other-keys) + (let ((home (getcwd))) + (setenv "HOME" home) + (substitute* "src/tests/gtests.cpp" + (("\\.\\./src/tests/0k\\.txt") + (string-append home "/src/tests/0k.txt")) + (("cfg_gtp_mode = true;") + "cfg_gtp_mode = true; cfg_cpu_only = true;"))) + #t)) + (replace 'check + (lambda _ + (invoke "./tests")))))) + (home-page "https://github.com/leela-zero/leela-zero") + (synopsis "Program playing the game of Go") + (description + "Leela-zero is a Go engine with no human-provided knowledge, modeled after +the AlphaGo Zero paper. The current best network weights file for the engine +can be downloaded from @url{https://zero.sjeng.org/best-network}.") + (license license:gpl3+))) diff --git a/gnu/packages/patches/leela-zero-gtest.patch b/gnu/packages/patches/leela-zero-gtest.patch new file mode 100644 index 0000000000..7291b4ab72 --- /dev/null +++ b/gnu/packages/patches/leela-zero-gtest.patch @@ -0,0 +1,40 @@ +Use shared gtest instead of submodule + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 617e4b2..2857875 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -18,7 +18,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") + include(GNUInstallDirs) + + project(leelaz) +-add_subdirectory(gtest EXCLUDE_FROM_ALL) # We don't want to install gtest, exclude it from `all` + + # Required Packages + set(Boost_MIN_VERSION "1.58.0") +@@ -27,6 +26,7 @@ find_package(Boost 1.58.0 REQUIRED program_options filesystem) + find_package(Threads REQUIRED) + find_package(ZLIB REQUIRED) + find_package(OpenCL REQUIRED) ++find_package(GTest REQUIRED) + # We need OpenBLAS for now, because we make some specific + # calls. Ideally we'd use OpenBLAS is possible and fall back to + # not doing those calls if it's not present. +@@ -93,6 +93,7 @@ include_directories(${IncludePath}) + include_directories(${Boost_INCLUDE_DIRS}) + include_directories(${OpenCL_INCLUDE_DIRS}) + include_directories(${ZLIB_INCLUDE_DIRS}) ++include_directories(${GTEST_INCLUDE_DIRS}) + + if((UNIX AND NOT APPLE) OR WIN32) + include_directories(${BLAS_INCLUDE_DIRS}) +@@ -141,7 +142,8 @@ target_link_libraries(tests ${Boost_LIBRARIES}) + target_link_libraries(tests ${BLAS_LIBRARIES}) + target_link_libraries(tests ${OpenCL_LIBRARIES}) + target_link_libraries(tests ${ZLIB_LIBRARIES}) +-target_link_libraries(tests gtest_main ${CMAKE_THREAD_LIBS_INIT}) ++target_link_libraries(tests ${GTEST_BOTH_LIBRARIES}) ++target_link_libraries(tests ${CMAKE_THREAD_LIBS_INIT}) + + include(GetGitRevisionDescription) + git_describe(VERSION --tags) -- cgit v1.2.3 From 072e986ec808690db991e018d6ceee868b5b5f4a Mon Sep 17 00:00:00 2001 From: Guillaume LE VAILLANT Date: Fri, 14 Jun 2019 19:27:51 +0200 Subject: gnu: Add gramps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/genealogy.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + gnu/packages/genealogy.scm | 112 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 gnu/packages/genealogy.scm (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 0c7a9ec198..f5d53b49b8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -196,6 +196,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/gcc.scm \ %D%/packages/gd.scm \ %D%/packages/gdb.scm \ + %D%/packages/genealogy.scm \ %D%/packages/genimage.scm \ %D%/packages/geo.scm \ %D%/packages/gettext.scm \ diff --git a/gnu/packages/genealogy.scm b/gnu/packages/genealogy.scm new file mode 100644 index 0000000000..2db3fdb918 --- /dev/null +++ b/gnu/packages/genealogy.scm @@ -0,0 +1,112 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Guillaume Le Vaillant +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages genealogy) + #:use-module (guix build-system python) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (gnu packages fonts) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages geo) + #:use-module (gnu packages gettext) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages graphviz) + #:use-module (gnu packages gtk) + #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages version-control)) + +(define-public gramps + (package + (name "gramps") + (version "5.0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/gramps-project/gramps.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1jz1fbjj6byndvir7qxzhd2ryirrd5h2kwndxpp53xdc05z1i8g7")))) + (build-system python-build-system) + (native-inputs + `(("gettext" ,gettext-minimal) + ("intltool" ,intltool))) + (inputs + `(("font-gnu-freefont-ttf" ,font-gnu-freefont-ttf) + ("geocode-glib" ,geocode-glib) + ("gexiv2" ,gexiv2) + ("ghostscript" ,ghostscript) + ("gobject-introspection" ,gobject-introspection) + ("gtk+" ,gtk+) + ("gtkspell3" ,gtkspell3) + ("graphviz" ,graphviz) + ("librsvg" ,librsvg) + ("osm-gps-map" ,osm-gps-map) + ("pango" ,pango) + ("python-bsddb3" ,python-bsddb3) + ("python-pillow" ,python-pillow) + ("python-pycairo" ,python-pycairo) + ("python-pygobject" ,python-pygobject) + ("python-pyicu" ,python-pyicu) + ("rcs" ,rcs) + ("sqlite" ,sqlite) + ("xdg-utils" ,xdg-utils))) + (arguments + `(#:imported-modules ((guix build glib-or-gtk-build-system) + ,@%python-build-system-modules) + #:modules ((ice-9 match) + (guix build python-build-system) + ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:) + (guix build utils)) + #:phases + (modify-phases %standard-phases + (add-before 'check 'set-home-for-tests + (lambda _ + (setenv "HOME" (getenv "TMPDIR")) + #t)) + (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (paths (map (match-lambda + ((output . directory) + (let ((girepodir (string-append + directory + "/lib/girepository-1.0"))) + (if (file-exists? girepodir) + girepodir + #f)))) + inputs))) + (wrap-program (string-append out "/bin/gramps") + `("GI_TYPELIB_PATH" ":" prefix ,(filter identity paths)))) + #t)) + (add-after 'wrap 'glib-or-gtk-wrap + (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))))) + (home-page "https://gramps-project.org") + (synopsis "Genealogical research software") + (description + "Gramps is a free software project and community striving to produce +a genealogy program that is both intuitive for hobbyists and feature-complete +for professional genealogists.") + (license license:gpl2+))) -- cgit v1.2.3