From patchwork Wed May 15 15:51:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 64453 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 5A89427BBEB; Wed, 15 May 2024 16:53:13 +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 4337727BBE9 for ; Wed, 15 May 2024 16:53:12 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7GwG-00041j-2B; Wed, 15 May 2024 11:53:08 -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 1s7GwE-00041C-G8 for guix-patches@gnu.org; Wed, 15 May 2024 11:53:06 -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 1s7GwE-0004PL-83 for guix-patches@gnu.org; Wed, 15 May 2024 11:53:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7Gw9-0003Wt-O7; Wed, 15 May 2024 11:53:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70087] [PATCH v2 1/4] gnu: gecode: Update to 6.2.0-1.f7f0d7c. References: In-Reply-To: Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: andreas@enge.fr, bavier@posteo.net, sharlatanus@gmail.com, guix-patches@gnu.org Resent-Date: Wed, 15 May 2024 15:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70087 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70087@debbugs.gnu.org Cc: Andreas Enge , Eric Bavier , Sharlatan Hellseher X-Debbugs-Original-Xcc: Andreas Enge , Eric Bavier , Sharlatan Hellseher Received: via spool by 70087-submit@debbugs.gnu.org id=B70087.171578832913508 (code B ref 70087); Wed, 15 May 2024 15:53:01 +0000 Received: (at 70087) by debbugs.gnu.org; 15 May 2024 15:52:09 +0000 Received: from localhost ([127.0.0.1]:42815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7GvI-0003Vo-Vi for submit@debbugs.gnu.org; Wed, 15 May 2024 11:52:09 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:47759 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7GvE-0003VC-Ur for 70087@debbugs.gnu.org; Wed, 15 May 2024 11:52:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715788315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H3eEM4P9SrBSFg7Ubh8/tJzJdJg4/S/AhRxvIHTvQvA=; b=hp/40XPzWU1q2UjRmu23p0mtAZ+7RSPdLA2/IGqFbB9F7SzykFr8DkRDqSwojwnIsaToSu x2+ufW4ighxZt1xV4rXfBg6Kt6CBCfd9UuRaaUmmfUuWUHPgjn+8ocLt1m22Do7TeRnoP8 KHoozlo4p+vlD+c8RFhzG4Wx9cox9k7ZSBt3Sj2ET3ILPKCkGrLoYPsZtD7+d6Kunl/Zp/ zEEScgdw76dJLKS8rmv4q7HEl10D1eIFqLVzOnsGr5GZ+uGxs6LtD7Hypy895ry8Nfbjik ENZEPJ3R8jHSeB/L/uZ/3vVxuDjQZPtPOKG1YfCXiTnG0cl1+RIYrhu/V0BWFw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 70c139aa (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70087@debbugs.gnu.org>; Wed, 15 May 2024 15:51:55 +0000 (UTC) Date: Wed, 15 May 2024 17:51:22 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm 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 (gecode): Update to 6.2.0-1.f7f0d7c. [version]: Use version. [source]: Use commit. [arguments]: Add patch-msc-and-version phase. (minizinc)[arguments]: Copy provided gecode.msc file instead. Change-Id: I5e89105f3fef61d6aa677a4a118225679220ce5d --- gnu/packages/maths.scm | 174 +++++++++++++++++++---------------------- 1 file changed, 82 insertions(+), 92 deletions(-) base-commit: 059c9ed104c91f7a537f369c4524b91d6cf8a13e diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index d551b751e6..48f43f264b 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -63,6 +63,7 @@ ;;; Copyright © 2023 Jake Leporte ;;; Copyright © 2023 Camilo Q.S. (Distopico) ;;; Copyright © 2023 David Elsing +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -2612,73 +2613,81 @@ (define-public clp (license license:epl1.0))) (define-public gecode - (package - (name "gecode") - (version "6.2.0") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/Gecode/gecode") - (commit (string-append "release-" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0b1cq0c810j1xr2x9y9996p894571sdxng5h74py17c6nr8c6dmk")) - (modules '((guix build utils))) - (snippet - '(begin - ;; delete generated sources - (for-each delete-file - '("gecode/kernel/var-imp.hpp" - "gecode/kernel/var-type.hpp")))))) - (outputs '("out" "examples")) - (build-system gnu-build-system) - (arguments - `(#:configure-flags - (list (string-append "GLDFLAGS=-Wl,-rpath=" - (assoc-ref %outputs "out") - "/lib") - "--enable-examples=no") - #:modules ((guix build gnu-build-system) - (guix build utils) - (ice-9 rdelim) - (ice-9 popen)) - #:phases - (modify-phases %standard-phases - (add-after 'build 'build-examples - (lambda* (#:key outputs #:allow-other-keys) - (invoke "make" "compileexamples"))) - ;; The Makefile disrespects GLDFLAGS for some reason, so we have to - ;; patch it ourselves... *sigh* - (add-after 'install 'fix-rpath - (lambda* (#:key outputs #:allow-other-keys) - (let ((libdir (string-append (assoc-ref outputs "out") "/lib"))) - (for-each - (lambda (file) - (let* ((pipe (open-pipe* OPEN_READ "patchelf" - "--print-rpath" file)) - (line (read-line pipe))) - (and (zero? (close-pipe pipe)) - (invoke "patchelf" "--set-rpath" - (string-append libdir ":" line) - file)))) - (find-files libdir ".*\\.so$"))))) - (add-after 'install 'install-examples - (lambda* (#:key outputs #:allow-other-keys) - (invoke "make" "installexamples" - (string-append "bindir=" (assoc-ref outputs "examples") - "/bin")))) - ;; Tests depend on installed libraries. - (delete 'check) - (add-after 'fix-rpath 'check - (assoc-ref %standard-phases 'check))))) - (native-inputs - (list patchelf perl sed)) - (home-page "https://www.gecode.org") - (synopsis "Toolkit for developing constraint-based systems") - (description "Gecode is a C++ toolkit for developing constraint-based -systems and applications. It provides a modular and extensible solver.") - (license license:expat))) + (let* ((commit "f7f0d7c273d6844698f01cec8229ebe0b66a016a") + (version (git-version "6.2.0" "1" commit))) + (package + (name "gecode") + (version version) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Gecode/gecode") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "16gzwa64w90vifaflmii515rsrqclf2y7nziq621m4ad9cjgcixj")) + (modules '((guix build utils))) + ;; delete generated sources + (snippet '(for-each delete-file + '("gecode/kernel/var-imp.hpp" + "gecode/kernel/var-type.hpp"))))) + (outputs '("out" "examples")) + (build-system gnu-build-system) + (arguments + (list + #:configure-flags + #~(list (string-append "GLDFLAGS=-Wl,-rpath=" + (assoc-ref %outputs "out") "/lib") + "--enable-examples=no") + #:modules '((guix build gnu-build-system) + (guix build utils) + (ice-9 rdelim) + (ice-9 popen)) + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'patch-msc-and-version + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* "tools/flatzinc/gecode.msc.in" + (("\\.\\./../..") out) + (("\\.\\.") + (string-append out "/share/minizinc"))) + (substitute* "configure" + (("(PACKAGE_[^0-9]*)[0-9\\.]+" all match) + (string-append match #$version)))))) + (add-after 'build 'build-examples + (lambda _ + (invoke "make" "compileexamples"))) + ;; The Makefile disrespects GLDFLAGS for some reason, so + ;; we have to patch it ourselves... *sigh* + (add-after 'install 'fix-rpath + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (libdir (string-append out "/lib"))) + (for-each + (lambda (file) + (let* ((pipe (open-pipe* OPEN_READ "patchelf" + "--print-rpath" file)) + (line (read-line pipe))) + (and (zero? (close-pipe pipe)) + (invoke "patchelf" "--set-rpath" + (string-append libdir ":" line) + file)))) + (find-files libdir ".*\\.so$"))))) + (add-after 'install 'install-examples + (lambda* (#:key outputs #:allow-other-keys) + (let* ((examples (assoc-ref outputs "examples")) + (bindir (format #f "bindir=~a/bin" examples))) + (invoke "make" "installexamples" bindir))))))) + (native-inputs (list patchelf perl sed)) + (home-page "https://www.gecode.org") + (synopsis "Toolkit for developing constraint-based systems") + (description + "Gecode is a C++ toolkit for developing constraint-based systems +and applications. It provides a modular and extensible solver.") + (license license:expat)))) (define-public libfixmath (let ((commit "1416c9979635c69f344d3c1de84b3246001a6540") @@ -4083,31 +4092,12 @@ (define-public minizinc }" port) (newline port))) - - (mkdir-p (string-append pkgdatadir "/solvers")) - (call-with-output-file (string-append pkgdatadir - "/solvers/gecode.msc") - (lambda (port) - (format port - "\ -{ - \"id\": \"org.gecode.gecode\", - \"name\": \"Gecode\", - \"description\": \"Gecode FlatZinc executable\", - \"version\": ~s, - \"mznlib\": ~s, - \"executable\": ~s, - \"supportsMzn\": false, - \"supportsFzn\": true, - \"needsSolns2Out\": true, - \"needsMznExecutable\": false, - \"needsStdlibDir\": false, - \"isGUIApplication\": false -}" - (last (string-split gecode #\-)) - (string-append gecode "/share/gecode/mznlib") - (string-append gecode "/bin/fzn-gecode")) - (newline port))))))))) + (for-each + (lambda (solver) + (copy-recursively + (string-append solver "/share/minizinc/solvers") + (string-append pkgdatadir "/solvers"))) + (list gecode)))))))) (native-inputs (list bison flex)) (inputs