From mboxrd@z Thu Jan 1 00:00:00 1970 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 Subject: [bug#36289] [PATCH] Add symmetrica Resent-Message-ID: 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 From: Nicolas Goaziou Date: Wed, 19 Jun 2019 12:08:10 +0200 Message-ID: <87muidriph.fsf@nicolasgoaziou.fr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 36289@debbugs.gnu.org --=-=-= Content-Type: text/plain 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, -- Nicolas Goaziou --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-symmetrica.patch Content-Transfer-Encoding: quoted-printable Content-Description: Add symmetrica >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 =3D \ %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 =3D \ %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/pat= ches/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 =3D ggt_i(S_B_UI(bruch),S_B_OI(bruch)); +=20 + if (ggterg =3D=3D S_B_UI(bruch)) { ++ INT tmp =3D S_B_OI(bruch); + freeself_bruch(bruch); +- M_I_I(S_B_OI(bruch) / ggterg,bruch); ++ M_I_I(tmp / ggterg,bruch); + goto ende; + } +=20 + if (-ggterg =3D=3D S_B_UI(bruch)) { ++ INT tmp =3D S_B_OI(bruch); + freeself_bruch(bruch); +- M_I_I(- S_B_OI(bruch) / ggterg,bruch); ++ M_I_I(- tmp / ggterg,bruch); + goto ende; + } +=20 +@@ -1032,12 +1034,14 @@ +=20 + if (S_O_K(S_B_U(bruch)) =3D=3D INTEGER) + if (S_B_UI(bruch) =3D=3D 1) {=20 ++ INT tmp =3D S_B_OI(bruch); + freeself_bruch(bruch); +- M_I_I(S_B_OI(bruch),bruch);=20 ++ M_I_I(tmp,bruch);=20 + goto ende; } + else if (S_B_UI(bruch) =3D=3D -1) {=20 ++ INT tmp =3D S_B_OI(bruch); + freeself_bruch(bruch); +- M_I_I( - S_B_OI(bruch),bruch);=20 ++ M_I_I( - tmp,bruch);=20 + 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/pat= ches/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 +=20 +- +-#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; +=20 + #include + #include +@@ -65,10 +60,13 @@ +=20 +=20 + /* 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; +=20 + 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/pack= ages/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 =3D 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<=3D1) M_I_I(1,S_V_I(vec,ni)); + else { +=20=20=20=20=20 diff --git a/gnu/packages/patches/symmetrica-sort_sum_rename.patch b/gnu/pa= ckages/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 =3D callocobject(); + e =3D S_V_I(a,0L); + f =3D S_V_I(a,1L); +- erg +=3D sum(f,g); ++ erg +=3D sym_sum(f,g); + j=3D0L; + for (i=3D0L;iob_kind =3D (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 +=3D mult(S_NC_C(a),S_NC_C(b),d); + erg +=3D m_gl_co(S_NC_GL(a),e); + erg +=3D mult_apply(e,d); +- erg +=3D sum(d,e); ++ erg +=3D sym_sum(d,e); + erg +=3D m_gl_go(S_NC_GL(a),d); + erg +=3D div(e,d,c); + erg +=3D freeall(e); +@@ -617,7 +617,7 @@ + erg +=3D mult_nc_kranz(c,a,e); + erg +=3D mult(S_V_I(e,1L),f,c); + erg +=3D div(c,g,c); +- erg +=3D sum(c,S_V_I(S_NC_C(b),S_I_I(d))); ++ erg +=3D sym_sum(c,S_V_I(S_NC_C(b),S_I_I(d))); + } + erg +=3D freeall(c);=20 + erg +=3D freeall(d);=20 +@@ -712,7 +712,7 @@ + for(j =3D 0L; j=3D0;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 =3D Anzahl der spalten */ +=20=20=20=20=20=20=20=20=20 + s =3D 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 =3D S_I_I(summe); +- FREEALL(summe);=20 ++ FREEALL(summe); + m_ilih_nm(s,z,b);=20 + C_O_K(b,KRANZTYPUS); + for (i=3D0L;i +;;; Copyright =C2=A9 2019 Nicolas Goaziou ;;; ;;; This file is part of GNU Guix. ;;; @@ -17,6 +18,7 @@ ;;; along with GNU Guix. If not, see . =20 (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 =3D )FALSE" _ pre) (string-append pre "TR= UE"))) + #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-" ,vers= ion)) + (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/SYMMETRIC= A/") + (synopsis "Combinatoric C Library") + (description "Symmetrica is a library for combinatorics. It has suppo= rt +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))) --=20 2.22.0 --=-=-=--