[arch-commits] Commit in sagemath/trunk (PKGBUILD sagemath-bliss-0.77.patch)

Antonio Rojas arojas at gemini.archlinux.org
Sun Dec 26 13:45:05 UTC 2021


    Date: Sunday, December 26, 2021 @ 13:45:05
  Author: arojas
Revision: 1083848

Bliss 0.77 rebuild

Added:
  sagemath/trunk/sagemath-bliss-0.77.patch
Modified:
  sagemath/trunk/PKGBUILD

---------------------------+
 PKGBUILD                  |    9 +-
 sagemath-bliss-0.77.patch |  183 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 190 insertions(+), 2 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-12-26 13:22:52 UTC (rev 1083847)
+++ PKGBUILD	2021-12-26 13:45:05 UTC (rev 1083848)
@@ -23,6 +23,7 @@
   'sage-numerical-backends-coin: COIN mixed integer linear programming backend'
   'coin-or-csdp: for computing Lovász theta-function of graphs'
   'buckygen: for generating fullerene graphs' 'plantri: for generating some classes of graphs' 'benzene: for generating fusenes and benzenoids'
+  'bliss: bliss backend for graph theory'
   'ffmpeg: to export animations to video' 'imagemagick: to show animations'
   'coxeter: Coxeter groups implementation'
   'rubiks: Rubiks cube algorithms'
@@ -45,7 +46,8 @@
         sagemath-lcalc2.patch
         sagemath-mpmath.patch
         sagemath-singular-4.2.1.p1.patch
-        sagemath-linbox-1.7.patch)
+        sagemath-linbox-1.7.patch
+        sagemath-bliss-0.77.patch)
 sha256sums=('47190f37e679c2483dadc13112595bacb399dfe4c4a0cde18d3627f5b2db0ea5'
             '665fc76fa57b1c50f122a8d1874e187afc97a9120921706176b63da3d9d30651'
             '88e944f23c3b2391dc2e9f9be8e1131152d837dc8c829dfc714663869a272e81'
@@ -54,7 +56,8 @@
             '791b3f2c6e5529b09c3abf2f9703b6cf754d633a7a4177645b70b72ea014135a'
             'be1c871fe6306a053169dce3edbb8bc78a96254ae7c83b2b741257ef3445b6eb'
             'e3cdfe730d0b0f422fe837e465ecde3419b16de50bef3dd2b674f275f528ed97'
-            'eacea27b214d32cb886a75695153dfc36b5bad2fd2517e8e4eee18e74220e9e3')
+            'eacea27b214d32cb886a75695153dfc36b5bad2fd2517e8e4eee18e74220e9e3'
+            '49ede468b8e1e7b8d7a390aab9ff1a6e899a0c5e487632cbf76902d80c637505')
 
 prepare(){
   cd sage-$pkgver
@@ -70,6 +73,8 @@
   patch -p1 -i ../sagemath-singular-4.2.1.p1.patch
 # Fix build with linbox 1.7 https://trac.sagemath.org/ticket/32959
   patch -p1 -i ../sagemath-linbox-1.7.patch
+# Fix build with bliss 0.77 https://trac.sagemath.org/ticket/33010
+  patch -p1 -i ../sagemath-bliss-0.77.patch
 
 # Arch-specific patches
 # assume all optional packages are installed

Added: sagemath-bliss-0.77.patch
===================================================================
--- sagemath-bliss-0.77.patch	                        (rev 0)
+++ sagemath-bliss-0.77.patch	2021-12-26 13:45:05 UTC (rev 1083848)
@@ -0,0 +1,183 @@
+diff --git a/build/pkgs/bliss/checksums.ini b/build/pkgs/bliss/checksums.ini
+index e97d89587b..0c1ebf647b 100644
+--- a/build/pkgs/bliss/checksums.ini
++++ b/build/pkgs/bliss/checksums.ini
+@@ -1,4 +1,5 @@
+-tarball=bliss-VERSION.tar.gz
+-sha1=1da8f098046824fbfff4c64c337e28b2a082f74f
+-md5=452aea8737d3c4ad0d8ff39180be8004
+-cksum=2193930007
++tarball=bliss-VERSION.zip
++sha1=c91c9dcbc11d66ffbcf6415e09ebe793df37be2a
++md5=5707cbfd9fd00980571c64ab3584c505
++cksum=1626493724
++upstream_url=https://users.aalto.fi/~tjunttil/bliss/downloads/bliss-VERSION.zip
+diff --git a/build/pkgs/bliss/dependencies b/build/pkgs/bliss/dependencies
+index 3546cda461..66d6773d90 100644
+--- a/build/pkgs/bliss/dependencies
++++ b/build/pkgs/bliss/dependencies
+@@ -1,4 +1,4 @@
+-# no dependencies
++| cmake
+ 
+ ----------
+ All lines of this file are ignored except the first.
+diff --git a/build/pkgs/bliss/package-version.txt b/build/pkgs/bliss/package-version.txt
+index e93ee1376f..9e1e206c41 100644
+--- a/build/pkgs/bliss/package-version.txt
++++ b/build/pkgs/bliss/package-version.txt
+@@ -1 +1 @@
+-0.73+debian-1+sage-2016-08-02.p0
++0.77
+diff --git a/build/pkgs/bliss/spkg-install.in b/build/pkgs/bliss/spkg-install.in
+index aaf4c3037b..ad1fe8176c 100644
+--- a/build/pkgs/bliss/spkg-install.in
++++ b/build/pkgs/bliss/spkg-install.in
+@@ -1,4 +1,6 @@
+ cd src
+-sdh_configure --disable-gmp
++sdh_cmake -DUSE_GMP=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
+ sdh_make
+-sdh_make_install
++sdh_install src/*.hh $SAGE_LOCAL/include/bliss/
++sdh_install libbliss.so $SAGE_LOCAL/lib/
++sdh_install bliss $SAGE_LOCAL/bin/
+diff --git a/build/pkgs/bliss/spkg-src b/build/pkgs/bliss/spkg-src
+deleted file mode 100755
+index 90073233b7..0000000000
+--- a/build/pkgs/bliss/spkg-src
++++ /dev/null
+@@ -1,28 +0,0 @@
+-#!/bin/sh
+-#
+-# creates the tarball in the current dir, to be moved to ../../../upstream
+-#
+-# adapted from cliquer/spkg-src
+-
+-die () {
+-    echo >&2 "$@"
+-    exit 1
+-}
+-
+-rm -rf bliss/
+-git clone -b sage_package https://github.com/mkoeppe/bliss.git  || die "Failed to git clone"
+-cd bliss/
+-
+-VERSION=`autoconf --trace='AC_INIT:$2'`
+-libtoolize || die "Failed to autoreconf"
+-autoreconf -fi || die "Failed to autoreconf"
+-automake --add-missing --copy || die "automake failed"
+-./configure || die "configure failed"
+-
+-rm -f bliss-$VERSION.tar.gz
+-make dist || die "make dist failed"
+-mv bliss-$VERSION.tar.gz ../
+-cd ..
+-rm -rf bliss/
+-
+-
+diff --git a/src/sage/graphs/bliss.pyx b/src/sage/graphs/bliss.pyx
+index 22e861a587..fa426e3d11 100644
+--- a/src/sage/graphs/bliss.pyx
++++ b/src/sage/graphs/bliss.pyx
+@@ -47,22 +47,27 @@ cdef extern from "bliss/graph.hh" namespace "bliss":
+     cdef cppclass Graph(AbstractGraph):
+         Graph(const unsigned int)
+         void add_edge(const unsigned int, const unsigned int)
+-        void find_automorphisms(Stats&, void (*)(void* , unsigned int,
+-                    const unsigned int*), void*)
++        #void find_automorphisms(Stats&, void (*)(void* , unsigned int,
++                    #const unsigned int*), void*)
+         void change_color(const unsigned int, const unsigned int);
+-        const unsigned int* canonical_form(Stats&, void (*)(void*,unsigned int,
+-                    const unsigned int*), void*)
++        const unsigned int* canonical_form(Stats&)
++
++cdef extern from "bliss/digraph.hh" namespace "bliss":
+ 
+     cdef cppclass Digraph(AbstractGraph):
+         Digraph(const unsigned int)
+         void add_edge(const unsigned int, const unsigned int)
+-        void find_automorphisms(Stats&, void (*)(void* , unsigned int,
+-                    const unsigned int*), void*)
++        #void find_automorphisms(Stats&, void (*)(void* , unsigned int,
++                    #const unsigned int*), void*)
+         void change_color(const unsigned int, const unsigned int);
+-        const unsigned int* canonical_form(Stats&, void (*)(void*,unsigned int,
+-                    const unsigned int*), void*)
++        const unsigned int* canonical_form(Stats&)
+         unsigned int get_hash()
+ 
++cdef extern from "bliss_find_automorphisms.h":
++
++    void bliss_find_automorphisms(Graph*, void (*)(void*, unsigned int, const unsigned int*), void*, Stats&)
++    void bliss_find_automorphisms(Digraph*, void (*)(void*, unsigned int, const unsigned int*), void*, Stats&)
++
+ 
+ cdef int encoding_numbits(int n):
+     r"""
+@@ -124,9 +129,6 @@ cdef void add_gen(void *user_param, unsigned int n, const unsigned int *aut):
+ 
+     sig_free(done)
+ 
+-cdef void empty_hook(void *user_param , unsigned int n, const unsigned int *aut):
+-    return
+-
+ #####################################################
+ # constructing bliss graphs from edge lists
+ #####################################################
+@@ -345,10 +347,10 @@ cdef canonical_form_from_edge_list(int Vnr, list Vout, list Vin, int Lnr=1, list
+ 
+     if directed:
+         d = bliss_digraph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition)
+-        aut = d.canonical_form(s, empty_hook, NULL)
++        aut = d.canonical_form(s)
+     else:
+         g = bliss_graph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition)
+-        aut = g.canonical_form(s, empty_hook, NULL)
++        aut = g.canonical_form(s)
+ 
+     for i in range(len(Vout)):
+         x = Vout[i]
+@@ -640,11 +642,11 @@ cdef automorphism_group_gens_from_edge_list(int Vnr, Vout, Vin, int Lnr=1, label
+ 
+     if directed:
+         d = bliss_digraph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition)
+-        d.find_automorphisms(s, add_gen, <void*>data)
++        bliss_find_automorphisms(d, add_gen, <void*>data, s)
+         del d
+     else:
+         g = bliss_graph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition)
+-        g.find_automorphisms(s, add_gen, <void*>data)
++        bliss_find_automorphisms(g, add_gen, <void*>data, s)
+         del g
+ 
+     return [[cyc for cyc in gen if cyc[0] is not None] for gen in gens]
+diff --git a/src/sage/graphs/bliss_find_automorphisms.h b/src/sage/graphs/bliss_find_automorphisms.h
+new file mode 100644
+index 0000000000..a2c084a163
+--- /dev/null
++++ b/src/sage/graphs/bliss_find_automorphisms.h
+@@ -0,0 +1,22 @@
++#include <bliss/graph.hh>
++#include <bliss/digraph.hh>
++
++inline void bliss_find_automorphisms(bliss::Graph *graph, void (*hook)(void *user_param, unsigned int n, const unsigned int *aut), void *hook_user_param, bliss::Stats s)
++{
++  auto report_aut = [&](unsigned int n, const unsigned int *aut) -> void {
++    if(hook)
++      (*hook)(hook_user_param, n, aut);
++  };
++
++  graph->find_automorphisms(s, report_aut);
++}
++
++inline void bliss_find_automorphisms(bliss::Digraph *graph, void (*hook)(void *user_param, unsigned int n, const unsigned int *aut), void *hook_user_param, bliss::Stats s)
++{
++  auto report_aut = [&](unsigned int n, const unsigned int *aut) -> void {
++    if(hook)
++      (*hook)(hook_user_param, n, aut);
++  };
++
++  graph->find_automorphisms(s, report_aut);
++}



More information about the arch-commits mailing list