From patchwork Wed Jun 19 10:08:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Goaziou X-Patchwork-Id: 14346 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E68461710A; Wed, 19 Jun 2019 11:09:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 2420217107 for ; Wed, 19 Jun 2019 11:09:12 +0100 (BST) Received: from localhost ([::1]:36498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdXWh-0005Za-C2 for patchwork@mira.cbaines.net; Wed, 19 Jun 2019 06:09:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50873) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdXWb-0005VS-CH for guix-patches@gnu.org; Wed, 19 Jun 2019 06:09:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdXWY-0003yt-Kc for guix-patches@gnu.org; Wed, 19 Jun 2019 06:09:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60733) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdXWY-0003yf-Dk for guix-patches@gnu.org; Wed, 19 Jun 2019 06:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hdXWY-0004N3-6F for guix-patches@gnu.org; Wed, 19 Jun 2019 06:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36289] [PATCH] Add symmetrica Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 19 Jun 2019 10:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36289 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 36289@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.156093891516763 (code B ref -1); Wed, 19 Jun 2019 10:09:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Jun 2019 10:08:35 +0000 Received: from localhost ([127.0.0.1]:46044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdXW1-0004MC-H0 for submit@debbugs.gnu.org; Wed, 19 Jun 2019 06:08:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:53611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdXVy-0004M2-B5 for submit@debbugs.gnu.org; Wed, 19 Jun 2019 06:08:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50642) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdXVv-00053D-Fy for guix-patches@gnu.org; Wed, 19 Jun 2019 06:08:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdXVs-0003D0-Bh for guix-patches@gnu.org; Wed, 19 Jun 2019 06:08:23 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:34139) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hdXVr-000386-Td for guix-patches@gnu.org; Wed, 19 Jun 2019 06:08:20 -0400 X-Originating-IP: 185.131.40.67 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id B67B840008; Wed, 19 Jun 2019 10:08:13 +0000 (UTC) From: Nicolas Goaziou Date: Wed, 19 Jun 2019 12:08:10 +0200 Message-ID: <87muidriph.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello, The following patch adds Symmetrica 2.0. It builds, but I have a few questions and remarks: - I added the package in "sagemath.scm" because its main use would be with Sage, and it is already heavily patched by Sage. Should I move it to "algebra.scm" or "maths.scm"? - The package creates a static library, because that is what Sage seems to expect (see ). - I'm not sure about the installation. Headers go into "%out/include/symmetrica" and static library into "%out/lib". Is that right? Regards, From 1220d983e9b36636094daeeed332c44411b707bc Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 19 Jun 2019 07:57:57 +0200 Subject: [PATCH] gnu: Add symmetrica. * gnu/packages/sagemath.scm (symmetrica): New variable. * gnu/packages/patches/symmetrica-bruch.patch: * gnu/packages/patches/symmetrica-int32.patch: * gnu/packages/patches/symmetrica-return_values.patch: * gnu/packages/patches/symmetrica-sort_sum_rename.patch: New files. * gnu/local.mk (dist_patch_DATA): Add patches. --- gnu/local.mk | 6 +- gnu/packages/patches/symmetrica-bruch.patch | 38 ++ gnu/packages/patches/symmetrica-int32.patch | 37 ++ .../patches/symmetrica-return_values.patch | 14 + .../patches/symmetrica-sort_sum_rename.patch | 340 ++++++++++++++++++ gnu/packages/sagemath.scm | 62 ++++ 6 files changed, 496 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/symmetrica-bruch.patch create mode 100644 gnu/packages/patches/symmetrica-int32.patch create mode 100644 gnu/packages/patches/symmetrica-return_values.patch create mode 100644 gnu/packages/patches/symmetrica-sort_sum_rename.patch diff --git a/gnu/local.mk b/gnu/local.mk index 74d2bafa8d..9d26b0b962 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1280,6 +1280,7 @@ dist_patch_DATA = \ %D%/packages/patches/sssd-curl-compat.patch \ %D%/packages/patches/steghide-fixes.patch \ %D%/packages/patches/streamlink-update-test.patch \ + %D%/packages/patches/stumpwm-fix-broken-read-one-line.patch \ %D%/packages/patches/superlu-dist-awpm-grid.patch \ %D%/packages/patches/superlu-dist-fix-mpi-deprecations.patch \ %D%/packages/patches/superlu-dist-scotchmetis.patch \ @@ -1288,7 +1289,10 @@ dist_patch_DATA = \ %D%/packages/patches/swig-guile-gc.patch \ %D%/packages/patches/swish-e-search.patch \ %D%/packages/patches/swish-e-format-security.patch \ - %D%/packages/patches/stumpwm-fix-broken-read-one-line.patch \ + %D%/packages/patches/symmetrica-bruch.patch \ + %D%/packages/patches/symmetrica-int32.patch \ + %D%/packages/patches/symmetrica-return_values.patch \ + %D%/packages/patches/symmetrica-sort_sum_rename.patch \ %D%/packages/patches/t1lib-CVE-2010-2642.patch \ %D%/packages/patches/t1lib-CVE-2011-0764.patch \ %D%/packages/patches/t1lib-CVE-2011-1552+.patch \ diff --git a/gnu/packages/patches/symmetrica-bruch.patch b/gnu/packages/patches/symmetrica-bruch.patch new file mode 100644 index 0000000000..ae88b79206 --- /dev/null +++ b/gnu/packages/patches/symmetrica-bruch.patch @@ -0,0 +1,38 @@ +--- src/bruch.c 2007-12-06 11:30:00.000000000 -0500 ++++ b/bruch.c 2013-10-22 08:37:43.000000000 -0400 +@@ -975,14 +975,16 @@ + ggterg = ggt_i(S_B_UI(bruch),S_B_OI(bruch)); + + if (ggterg == S_B_UI(bruch)) { ++ INT tmp = S_B_OI(bruch); + freeself_bruch(bruch); +- M_I_I(S_B_OI(bruch) / ggterg,bruch); ++ M_I_I(tmp / ggterg,bruch); + goto ende; + } + + if (-ggterg == S_B_UI(bruch)) { ++ INT tmp = S_B_OI(bruch); + freeself_bruch(bruch); +- M_I_I(- S_B_OI(bruch) / ggterg,bruch); ++ M_I_I(- tmp / ggterg,bruch); + goto ende; + } + +@@ -1032,12 +1034,14 @@ + + if (S_O_K(S_B_U(bruch)) == INTEGER) + if (S_B_UI(bruch) == 1) { ++ INT tmp = S_B_OI(bruch); + freeself_bruch(bruch); +- M_I_I(S_B_OI(bruch),bruch); ++ M_I_I(tmp,bruch); + goto ende; } + else if (S_B_UI(bruch) == -1) { ++ INT tmp = S_B_OI(bruch); + freeself_bruch(bruch); +- M_I_I( - S_B_OI(bruch),bruch); ++ M_I_I( - tmp,bruch); + goto ende; } + if (NEGP(S_B_O(bruch)) && NEGP(S_B_U(bruch))) + { diff --git a/gnu/packages/patches/symmetrica-int32.patch b/gnu/packages/patches/symmetrica-int32.patch new file mode 100644 index 0000000000..b64f27d51e --- /dev/null +++ b/gnu/packages/patches/symmetrica-int32.patch @@ -0,0 +1,37 @@ +diff -ru src/def.h c/def.h +--- src/def.h 2007-12-06 17:30:56.000000000 +0100 ++++ c/def.h 2013-10-19 18:42:55.118745730 +0200 +@@ -2,14 +2,9 @@ + /* INT should always be 4 byte */ + #ifndef DEF_H + +- +-#ifdef __alpha +-typedef int INT; +-typedef unsigned int UINT; +-#else /* __alpha */ +-typedef long INT; +-typedef unsigned long UINT; +-#endif /* __alpha */ ++#include ++typedef int32_t INT; ++typedef uint32_t UINT; + + #include + #include +@@ -65,10 +60,13 @@ + + + /* definitionen fuer object.c */ +-typedef INT OBJECTKIND; /* 4 byte */ ++/* NOTE: partition code assumes that there is no unused space in the ++ * object struct when an INT is stored. This requires both OBJECTKIND ++ * and OBJECTSELF to have a size equal to a machine word. */ ++typedef intptr_t OBJECTKIND; + + typedef union { +- INT ob_INT; ++ intptr_t ob_INT; + INT * ob_INTpointer; + char *ob_charpointer; + struct bruch *ob_bruch; diff --git a/gnu/packages/patches/symmetrica-return_values.patch b/gnu/packages/patches/symmetrica-return_values.patch new file mode 100644 index 0000000000..e09c389337 --- /dev/null +++ b/gnu/packages/patches/symmetrica-return_values.patch @@ -0,0 +1,14 @@ +diff -ru src/part.c b/part.c +--- src/part.c Thu May 14 06:01:00 2009 -0400 ++++ b/part.c Thu May 14 06:01:00 2009 -0400 +@@ -1767,8 +1767,8 @@ + /* to compute number of partitions */ + { + INT erg = OK; +- if (ni<0) return; +- if (not EMPTYP(S_V_I(vec,ni))) return; ++ if (ni<0) return 0; ++ if (not EMPTYP(S_V_I(vec,ni))) return 0; + else if (ni<=1) M_I_I(1,S_V_I(vec,ni)); + else { + diff --git a/gnu/packages/patches/symmetrica-sort_sum_rename.patch b/gnu/packages/patches/symmetrica-sort_sum_rename.patch new file mode 100644 index 0000000000..2d9a2dae06 --- /dev/null +++ b/gnu/packages/patches/symmetrica-sort_sum_rename.patch @@ -0,0 +1,340 @@ +diff -r 5cd656a07aa5 src/bar.c +--- a/bar.c Thu May 14 06:01:00 2009 -0400 ++++ b/bar.c Thu May 14 07:38:17 2009 -0400 +@@ -237,7 +237,7 @@ + g = callocobject(); + e = S_V_I(a,0L); + f = S_V_I(a,1L); +- erg += sum(f,g); ++ erg += sym_sum(f,g); + j=0L; + for (i=0L;iob_kind = (OBJECTKIND)(b)) +--- a/nc.c Thu May 14 06:01:00 2009 -0400 ++++ b/nc.c Thu May 14 07:38:17 2009 -0400 +@@ -204,7 +204,7 @@ + erg += mult(S_NC_C(a),S_NC_C(b),d); + erg += m_gl_co(S_NC_GL(a),e); + erg += mult_apply(e,d); +- erg += sum(d,e); ++ erg += sym_sum(d,e); + erg += m_gl_go(S_NC_GL(a),d); + erg += div(e,d,c); + erg += freeall(e); +@@ -617,7 +617,7 @@ + erg += mult_nc_kranz(c,a,e); + erg += mult(S_V_I(e,1L),f,c); + erg += div(c,g,c); +- erg += sum(c,S_V_I(S_NC_C(b),S_I_I(d))); ++ erg += sym_sum(c,S_V_I(S_NC_C(b),S_I_I(d))); + } + erg += freeall(c); + erg += freeall(d); +@@ -712,7 +712,7 @@ + for(j = 0L; j=0;j--) +diff -r 5cd656a07aa5 src/perm.c +--- a/perm.c Thu May 14 06:01:00 2009 -0400 ++++ b/perm.c Thu May 14 07:38:17 2009 -0400 +@@ -833,9 +833,9 @@ + /* s = Anzahl der spalten */ + + s = S_V_LI(S_V_I(a,0L)); +- sum(S_V_I(a,0L),summe);/* composition ist vector */ ++ sym_sum(S_V_I(a,0L),summe);/* composition ist vector */ + z = S_I_I(summe); +- FREEALL(summe); ++ FREEALL(summe); + m_ilih_nm(s,z,b); + C_O_K(b,KRANZTYPUS); + for (i=0L;i +;;; Copyright © 2019 Nicolas Goaziou ;;; ;;; This file is part of GNU Guix. ;;; @@ -17,6 +18,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages sagemath) + #:use-module (gnu packages) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system gnu) #:use-module (guix build-system python) @@ -228,3 +230,63 @@ represented as strings.") "1wfivlwp30mzdy1697w7rzb8caajim50mc8h27k82yipn2qc5n4i")))) (inputs `(("fflas-ffpack" ,fflas-ffpack-2.3.2))))) + +(define-public symmetrica + (package + (name "symmetrica") + (version "2.0") + (source (origin + (method url-fetch/tarbomb) + (uri (let ((v (string-join (string-split version #\.) "_"))) + (string-append "http://www.algorithm.uni-bayreuth.de/" + "en/research/SYMMETRICA/" + "SYM" v "_tar.gz"))) + (sha256 + (base32 + "1qhfrbd5ybb0sinl9pad64rscr08qvlfzrzmi4p4hk61xn6phlmz")) + ;; Taken from + (patches (search-patches "symmetrica-bruch.patch" + "symmetrica-int32.patch" + "symmetrica-return_values.patch" + "symmetrica-sort_sum_rename.patch")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no test + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-makefile + (lambda _ + (substitute* "makefile" + (("cc -c") "gcc -c")) + #t)) + (add-after 'fix-makefile 'turn-off-banner + (lambda _ + (substitute* "de.c" + (("(INT no_banner = )FALSE" _ pre) (string-append pre "TRUE"))) + #t)) + (delete 'configure) ;no configure script + (replace 'install ;no install target + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (inc (string-append out "/include/symmetrica")) + (doc (string-append out "/share/doc/symmetrica-" ,version)) + (static "libsymmetrica.a")) + ;; Build static library. + (apply invoke "ar" "crs" static (find-files "." "\\.o$")) + (invoke "ranlib" static) + ;; Install static library and headers. + (for-each (lambda (f) (install-file f inc)) + (find-files "." "\\.h$")) + (install-file "libsymmetrica.a" lib) + ;; Install documentation. + (for-each (lambda (f) (install-file f doc)) + (find-files "." "\\.doc$")) + #t)))))) + (home-page "http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA/") + (synopsis "Combinatoric C Library") + (description "Symmetrica is a library for combinatorics. It has support +for the representation theory of the symmetric group and related groups, +combinatorics of tableaux, symmetric functions and polynomials, Schubert +polynomials, and the representation theory of Hecke algebras of type A_n.") + (license license:public-domain))) -- 2.22.0