From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 4OcvNSvYQmUWDAEAauVa8A:P1 (envelope-from ) for ; Wed, 01 Nov 2023 23:58:52 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4OcvNSvYQmUWDAEAauVa8A (envelope-from ) for ; Wed, 01 Nov 2023 23:58:52 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6FB0111A99 for ; Wed, 1 Nov 2023 23:58:51 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=PBhytQ4l; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698879531; a=rsa-sha256; cv=none; b=PsokLJu0RsMomKc9t8bhMGKi84BWb7z7A9hUniOZOtH+Cu5QUQYg8SS6PyIbRK40WkpJJv VQvdIw5dojanf5U6sYG/k1I3w7tT0lkZdStsrrfyM+x8XOJXQybiR/Rfsmx+bA4f8uI64U k1BsMbQXmxcSYn1L1ps0HWh3rwRfo5aZhPY00zlc1YM1wCZtTliskdDxHQkJWJdCmRjFwN Rxkguy6IfocNrjKu+dLCATH+qPBwLk9ODvIFKa6ZSmYRP6x8E31DFO7Rca8T6G+jSYTZGk OXTOvVaC1qlsutNvhgUK/KtzZPT8/+oym7Jt7qSEI3M+acFviFYyO5vSPaQfyg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=PBhytQ4l; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698879531; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=RGGl3vuyrO8TIISIDSxEUsCdlqviv/dP5Un5v60D220=; b=t//kuTtkW/0DktLrkycKliXTgo7RSVhR2KVkyNaNB6DIVS+Z3QIJ6uIQadigYx49Nr1B0V +SdgJy3VzlEh6t3ToNdOApig4ndE21RxRAUqyj6FjrvAt6B5MSanxU81UrkNcekY4wgNu5 fFH52x2t+ZTzowIttBNuoe8UBNnCtXc/ey8Gfe0hqz2jC1wINx+hcd5saxstOqvWW7/QKp M9+gawVRIkjTVR/fLPMbYckJxnJlXh7cdu2Fge58PGSfZySqqoJQ7WVbCNyD1keV2dfTMi gIio7kxWcIyC8eQLHY4CGLTEdkQZDsyDpqB7bcEGUXH55afZoZYQQ9KPc9HHiA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyKAQ-0002yb-5J; Wed, 01 Nov 2023 18:58:30 -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 1qyKAO-0002yD-5Z for guix-patches@gnu.org; Wed, 01 Nov 2023 18:58:28 -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 1qyKAN-0002en-Tg for guix-patches@gnu.org; Wed, 01 Nov 2023 18:58:27 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qyKAw-00008n-3z for guix-patches@gnu.org; Wed, 01 Nov 2023 18:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66889] [PATCH 2/2] gnu: igraph: Update to 0.10.7. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Nov 2023 22:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66889 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66889@debbugs.gnu.org Cc: David Elsing Received: via spool by 66889-submit@debbugs.gnu.org id=B66889.1698879505464 (code B ref 66889); Wed, 01 Nov 2023 22:59:02 +0000 Received: (at 66889) by debbugs.gnu.org; 1 Nov 2023 22:58:25 +0000 Received: from localhost ([127.0.0.1]:53489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyKAK-00007P-IF for submit@debbugs.gnu.org; Wed, 01 Nov 2023 18:58:25 -0400 Received: from mout02.posteo.de ([185.67.36.66]:59571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyKAF-00006p-LK for 66889@debbugs.gnu.org; Wed, 01 Nov 2023 18:58:22 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 2FA15240103 for <66889@debbugs.gnu.org>; Wed, 1 Nov 2023 23:57:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1698879459; bh=/o4UVs12vFUhemdeuf+kMxTXwYh4YLKdZLQv26RJhN8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=PBhytQ4l+zMeCRfF98TGPACfYp89P7YAVOygO0yAsRPu5T7coliQmjY0RkzzBce7Q Xx5jLzLq5BMRA0GLed2jSnGOf2ELV5bqg6QcArHzL0pvbA4iQAP5G+GuRbWxUK+9IX wcHs4StyDJatddtI3Al5TqKAmYpleO2dDes6mjsQFZI01M4eVZ6LFXe0kosvNAMr12 bublsh3+xrjowh2pjdSTTlrEfDj2zgCGueHRM0fgqm9LJ6Pmj+RXme0npDxWsQh4yg MM5pjr9mmXeCXaktBa1MhL/PjjVyr12qEsHrsWQTZxCD/bi+pCs1+Yh3FTpGRAV9Nz 4vDbKikmB12Rg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SLMpp3s7qz9rxG; Wed, 1 Nov 2023 23:57:38 +0100 (CET) From: David Elsing Date: Wed, 1 Nov 2023 22:57:15 +0000 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 6FB0111A99 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -4.21 X-Spam-Score: -4.21 X-TUID: pmYq84SVJRIY * gnu/packages/graph.scm (igraph): Update to 0.10.7. [source]: Use git-fetch. Apply patch. : Remove the entire "vendor" and "src/isomorphism/bliss" directories. Patch CMakeLists.txt to not build and use vendored dependencies. [arguments]: Add -DIGRAPH_INTEGER_SIZE=64 to #:configure-flags. Add phases to use unbundled libraries and build documentation. [native-inputs]: Add bison, docbook-xml-4.3, docbook-xsl, flex, pcg-c, python, source-highlight and xmlto. [inputs]: Remove gmp and libxml2. Add bliss and suitesparse-cxsparse. * gnu/packages/patches/igraph-fix-varargs-integer-size.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/graph.scm | 114 +++++++++++++----- .../igraph-fix-varargs-integer-size.patch | 39 ++++++ 3 files changed, 127 insertions(+), 27 deletions(-) create mode 100644 gnu/packages/patches/igraph-fix-varargs-integer-size.patch diff --git a/gnu/local.mk b/gnu/local.mk index 8d817379a7..b51d9d15e8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1428,6 +1428,7 @@ dist_patch_DATA = \ %D%/packages/patches/id3lib-CVE-2007-4460.patch \ %D%/packages/patches/id3lib-UTF16-writing-bug.patch \ %D%/packages/patches/idris-test-ffi008.patch \ + %D%/packages/patches/igraph-fix-varargs-integer-size.patch \ %D%/packages/patches/igt-gpu-tools-Use-libproc2.patch \ %D%/packages/patches/ilmbase-fix-tests.patch \ %D%/packages/patches/imagemagick-CVE-2020-27829.patch \ diff --git a/gnu/packages/graph.scm b/gnu/packages/graph.scm index 45a591b9f3..a40b580417 100644 --- a/gnu/packages/graph.scm +++ b/gnu/packages/graph.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2021 Alexandre Hannud Abdo ;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer ;;; Copyright © 2022 Marius Bakke +;;; Copyright © 2023 David Elsing ;;; ;;; This file is part of GNU Guix. ;;; @@ -40,13 +41,18 @@ (define-module (gnu packages graph) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages) #:use-module (gnu packages autotools) + #:use-module (gnu packages base) #:use-module (gnu packages bioconductor) #:use-module (gnu packages bioinformatics) + #:use-module (gnu packages bison) #:use-module (gnu packages boost) + #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages cran) #:use-module (gnu packages datastructures) + #:use-module (gnu packages docbook) + #:use-module (gnu packages flex) #:use-module (gnu packages gd) #:use-module (gnu packages graphics) #:use-module (gnu packages graphviz) @@ -55,6 +61,7 @@ (define-module (gnu packages graph) #:use-module (gnu packages multiprecision) #:use-module (gnu packages ncurses) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages pretty-print) #:use-module (gnu packages python) #:use-module (gnu packages python-build) #:use-module (gnu packages python-compression) @@ -93,49 +100,102 @@ (define-public plfit (define-public igraph (package (name "igraph") - (version "0.10.4") + (version "0.10.7") (source (origin - (method url-fetch) - (uri (string-append "https://github.com/igraph/igraph/releases/" - "download/" version "/igraph-" version ".tar.gz")) + (method git-fetch) + (uri (git-reference + (url "https://github.com/igraph/igraph") + (commit version))) + (file-name (git-file-name name version)) + (patches (search-patches "igraph-fix-varargs-integer-size.patch")) (modules '((guix build utils) (ice-9 ftw) (srfi srfi-26))) (snippet '(begin - ;; igraph insists on building its own copy of CxSparse - ;; (see: https://github.com/igraph/igraph/commit/\ - ;; 334318b7dfe46501236272ca336580f4748114b0) and the build - ;; has no support to use a system provided 'pcg'. - (define keep-libraries '("cs" "pcg")) - (define keep (append '("." ".." "CMakeLists.txt") - keep-libraries)) - (define keep? (cut member <> keep)) - (with-directory-excursion "vendor" - (for-each delete-file-recursively - (scandir "." (negate keep?)))) - (call-with-output-file "vendor/CMakeLists.txt" - (cut format <> "~{add_subdirectory(~a)~%~}" - keep-libraries)) + + (delete-file-recursively "vendor") + (delete-file-recursively "src/isomorphism/bliss") (substitute* '("src/CMakeLists.txt" "etc/cmake/benchmark_helpers.cmake") ;; Remove extraneous bundling related variables. - ((".*_IS_VENDORED.*") - "")))) + ((".*_IS_VENDORED.*") "") + ((".*add_sub.*isomorphism/bliss.*") "") + (("(.*TARGETS.*)bliss(.*)cxsparse_vendored(.*)pcg(.*)" + _ part1 part2 part3 part4) + (string-append part1 part2 part3 part4)) + (("cxsparse_vendored") "cxsparse") + ((" pcg ") " pcg_random ")) + (substitute* "CMakeLists.txt" + (("add_sub.*vendor.*") "")))) (sha256 - (base32 "1z1ay3l1h64jc2igbl2ibvi20sswy56v2yk3ykhis7jzijsh0mxa")))) + (base32 + "025f9c2jsawniqkig4l5z3v9aw3ipazmnlsf80b653mns5bvj1yn")))) (build-system cmake-build-system) - (arguments (list #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON") - #:test-target "check")) - (native-inputs (list pkg-config)) + (arguments + (list + #:configure-flags + #~(list "-DBUILD_SHARED_LIBS=ON" + ;; Use the same integer width as suitesparse-cxsparse, which + ;; uses int64_t in SuiteSparse v6.0.0 and later. + "-DIGRAPH_INTEGER_SIZE=64") + #:test-target "check" + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'version-file + (lambda _ + (let ((port (open-file "IGRAPH_VERSION" "w"))) + (display #$version port) + (close port)))) + (add-after 'unpack 'patch-suitesparse + (lambda _ + (substitute* '("src/core/sparsemat.c" + "include/igraph_sparsemat.h") + (("") "") + (("cs_igraph") "cs_dl") + (("__BEGIN_DECLS.*" all) + (string-append all "\n#define CS_LONG\n"))))) + (add-after 'unpack 'patch-pcg + (lambda _ + (substitute* '("src/random/rng_pcg32.c" + "src/random/rng_pcg64.c") + (("#include \"pcg/(.*)\"" _ name) + (string-append "#include <" name ">"))))) + (add-after 'unpack 'patch-bliss + (lambda _ + (substitute* "src/isomorphism/bliss.cc" + (("#include \"bliss.*") + (string-append + "#include \n" + "#include \n"))))) + (add-after 'build 'build-doc + (lambda _ + (invoke "cmake" "--build" "." "--target" "html"))) + (add-after 'install 'install-doc + (lambda _ + (copy-recursively + "doc/html" + (string-append #$output "/share/doc/" + #$name "-" #$version "/html"))))))) + (native-inputs + (list bison + docbook-xml-4.3 + docbook-xsl + flex + pcg-c + pkg-config + ;; For the HTML documentation. + python + source-highlight + xmlto)) (inputs (list arpack-ng - gmp + bliss glpk - libxml2 lapack openblas - plfit)) + plfit + suitesparse-cxsparse)) ;; libxml2 is in the 'Requires.private' of igraph.pc. (propagated-inputs (list libxml2)) (home-page "https://igraph.org") diff --git a/gnu/packages/patches/igraph-fix-varargs-integer-size.patch b/gnu/packages/patches/igraph-fix-varargs-integer-size.patch new file mode 100644 index 0000000000..2d7ffd7e68 --- /dev/null +++ b/gnu/packages/patches/igraph-fix-varargs-integer-size.patch @@ -0,0 +1,39 @@ +If the size of int is different from IGRAPH_INTEGER_SIZE, the integer size +passed to these vararg arguments is different from the assumed one, +leading to undefined behavior. +Submitted upstream: https://github.com/igraph/igraph/pull/2423 + + +diff -ur a/examples/simple/igraph_union.c b/examples/simple/igraph_union.c +--- a/examples/simple/igraph_union.c ++++ b/examples/simple/igraph_union.c +@@ -103,7 +103,7 @@ + igraph_vector_ptr_init(&glist, 10); + for (i = 0; i < igraph_vector_ptr_size(&glist); i++) { + VECTOR(glist)[i] = calloc(1, sizeof(igraph_t)); +- igraph_vector_int_init_int_end(&v, -1, i, i + 1, 1, 0, -1); ++ igraph_vector_int_init_int_end(&v, -1, (int) i, (int) i + 1, 1, 0, -1); + igraph_create(VECTOR(glist)[i], &v, 0, IGRAPH_DIRECTED); + igraph_vector_int_destroy(&v); + } +@@ -123,7 +123,7 @@ + igraph_vector_ptr_init(&glist, 10); + for (i = 0; i < igraph_vector_ptr_size(&glist); i++) { + VECTOR(glist)[i] = calloc(1, sizeof(igraph_t)); +- igraph_vector_int_init_int_end(&v, -1, i, i + 1, 1, 0, -1); ++ igraph_vector_int_init_int_end(&v, -1, (int) i, (int) i + 1, 1, 0, -1); + igraph_create(VECTOR(glist)[i], &v, 0, IGRAPH_UNDIRECTED); + igraph_vector_int_destroy(&v); + } +diff -ur a/src/core/matrix.pmt b/src/core/matrix.pmt +--- a/src/core/matrix.pmt ++++ b/src/core/matrix.pmt +@@ -1863,7 +1863,7 @@ + #ifdef FPRINTFUNC_ALIGNED + FPRINTFUNC_ALIGNED(file, VECTOR(column_width)[j], MATRIX(*m, i, j)); + #else +- fprintf(file, format, VECTOR(column_width)[j], MATRIX(*m, i, j)); ++ fprintf(file, format, (int) VECTOR(column_width)[j], MATRIX(*m, i, j)); + #endif + } + fprintf(file, "\n"); -- 2.41.0