From patchwork Wed Sep 20 22:19:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 54103 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 00B4B27BBEA; Wed, 20 Sep 2023 23:21:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DE04527BBE2 for ; Wed, 20 Sep 2023 23:21:07 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qj5Z0-00027B-Kl; Wed, 20 Sep 2023 18:20:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qj5Yy-00026x-Sy for guix-patches@gnu.org; Wed, 20 Sep 2023 18:20:53 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qj5Yy-0000Rr-Kv for guix-patches@gnu.org; Wed, 20 Sep 2023 18:20:52 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qj5Z7-0005oi-Up for guix-patches@gnu.org; Wed, 20 Sep 2023 18:21:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64446] [PATCH v2] gnu: Add bliss. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 20 Sep 2023 22:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64446 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64446@debbugs.gnu.org Cc: David Elsing Received: via spool by 64446-submit@debbugs.gnu.org id=B64446.169524843522319 (code B ref 64446); Wed, 20 Sep 2023 22:21:01 +0000 Received: (at 64446) by debbugs.gnu.org; 20 Sep 2023 22:20:35 +0000 Received: from localhost ([127.0.0.1]:60577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qj5Yh-0005nv-11 for submit@debbugs.gnu.org; Wed, 20 Sep 2023 18:20:35 -0400 Received: from mout01.posteo.de ([185.67.36.65]:43975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qj5Yc-0005nd-LO for 64446@debbugs.gnu.org; Wed, 20 Sep 2023 18:20:34 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id CA05C240027 for <64446@debbugs.gnu.org>; Thu, 21 Sep 2023 00:20:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1695248414; bh=DwL7d5wpsylyPB9X46TYgtUYAMyHWWvxD3FlSI8EDIg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=Mw+TptQTxq6N3lXf7qG2tp5zREx0kLP8ZTrk73jDVudkSkistgL3FsV3rb+wkNvmt FqmB5oz3PA+KBSP1V1HmUfwP5uDBjvzveqer7Z1CIvvegYcDyCDe4eysIp+Co06krn 6suYy/eHZf7qaLCz5C+FMHjgn73ci60ibhMYisboZ8mf/0F5KJ5RxarHwZFuhwlI6/ DUiag0Sjd1ijhkEkjJmA/5rM9LTb5lvIfJXxrAFrU7BIfnpV0hNuJgRg1BlZsbxYy/ BLquTEvTUAbBcifG6IWgQIjNqpky5YH9yUSuJaJcAT8zGtoh+G0ZjWK2efQFmTD+ha YoR0JCmPhsMRQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RrXz22ktpz6v3k; Thu, 21 Sep 2023 00:20:14 +0200 (CEST) From: David Elsing Date: Wed, 20 Sep 2023 22:19:13 +0000 Message-ID: <324c31a7249b044ffb5578795c35961562b12c38.1695248353.git.david.elsing@posteo.net> In-Reply-To: <7y1qespk5l.fsf@posteo.net> References: <7y1qespk5l.fsf@posteo.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/maths.scm (bliss): New variable. --- gnu/packages/maths.scm | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 6141c09886..76ac34a5d9 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -8567,3 +8567,88 @@ (define-public ruy architecture.") (license license:asl2.0)))) +(define-public bliss + (package + (name "bliss") + (version "0.77") + (source (origin + (method url-fetch) + (uri (string-append + "https://users.aalto.fi/~tjunttil/bliss/downloads/bliss-" + version ".zip")) + (sha256 + (base32 + "193jb63kdwfas2cf61xj3fgkvhb6v2mnbwwpr0jas3zk6j0bkj5c")))) + (build-system cmake-build-system) + (arguments + (list + ;; There are no tests + #:tests? #f + #:configure-flags #~(list "-DUSE_GMP=ON") ; Used by igraph + #:phases + #~(modify-phases %standard-phases + ;; Ensure that GMP is used, otherwise the BigNum type changes. + (add-after 'unpack 'define-use-gmp + (lambda _ + (substitute* "src/bignum.hh" + (("#pragma once.*" all) + (string-append all "#define BLISS_USE_GMP"))))) + ;; Move headers under the bliss/ prefix. This is a Guix choice, + ;; since there are no upstream installation instructions and the + ;; header names are sufficiently generic to cause confusions with + ;; other packages (e.g. "heap.hh"). + (add-after 'define-use-gmp 'move-headers + (lambda _ + (substitute* (find-files "src") + (("#include \"(.*)\"" _ path) + (string-append "#include "))) + (mkdir-p "include/bliss") + (for-each + (lambda (file) + (rename-file file + (string-append "include/bliss/" (basename file)))) + (find-files "src" "\\.(h|hh)$")) + (substitute* "Doxyfile" + (("INPUT *=.*") "INPUT = bliss")))) + (add-after 'move-headers 'patch-cmake + (lambda _ + (let ((port (open-file "CMakeLists.txt" "a"))) + (display + (apply + string-append + ;; Install the executable and the shared library. + "install(TARGETS bliss)\n" + "install(TARGETS bliss-executable)\n" + "install(DIRECTORY include/bliss DESTINATION include)\n" + "target_link_libraries(bliss PUBLIC ${GMP_LIBRARIES})\n" + ;; Missing include directories. + (map + (lambda (name) + (string-append + "target_include_directories(" name " PUBLIC\n" + "${CMAKE_CURRENT_SOURCE_DIR}/include" + " ${GMP_INCLUDE_DIR})\n")) + '("bliss" "bliss_static" "bliss-executable"))) + port) + (close-port port)))) + (add-after 'build 'build-doc + (lambda _ + (mkdir "doc") + (with-directory-excursion "doc" + (let ((srcdir (string-append "../../bliss-" #$version))) + (copy-recursively (string-append srcdir "/include/bliss") + "bliss") + (invoke "doxygen" (string-append srcdir "/Doxyfile")))))) + (add-after 'install 'install-doc + (lambda _ + (copy-recursively + "doc/html" (string-append #$output "/share/doc/" + #$name "-" #$version "/html"))))))) + (native-inputs (list doxygen graphviz unzip)) + (propagated-inputs (list gmp)) + (home-page "https://users.aalto.fi/~tjunttil/bliss/index.html") + (synopsis "Tool for computing automorphism groups and canonical labelings of graphs") + (description "@code{bliss} is a library for computing automorphism groups ++and canonical forms of graphs. It has both a command line user interface as ++well as C++ and C programming language APIs.") + (license license:lgpl3)))