From patchwork Sat Jul 24 15:08:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Prikler X-Patchwork-Id: 31587 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 BA11327BC78; Sat, 24 Jul 2021 16:13:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 76FF427BC6B for ; Sat, 24 Jul 2021 16:13:16 +0100 (BST) Received: from localhost ([::1]:44024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7JL1-0001Sb-F3 for patchwork@mira.cbaines.net; Sat, 24 Jul 2021 11:13:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7JJs-0008RF-23 for guix-patches@gnu.org; Sat, 24 Jul 2021 11:12:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35201) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m7JJq-00069H-UF for guix-patches@gnu.org; Sat, 24 Jul 2021 11:12:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m7JJq-0004DV-Qu for guix-patches@gnu.org; Sat, 24 Jul 2021 11:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49625] [PATCH 1/2] gnu: Add gecode. References: <20210718150351.12359-1-leo.prikler@student.tugraz.at> In-Reply-To: <20210718150351.12359-1-leo.prikler@student.tugraz.at> Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 24 Jul 2021 15:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49625 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49625@debbugs.gnu.org Received: via spool by 49625-submit@debbugs.gnu.org id=B49625.162713949116162 (code B ref 49625); Sat, 24 Jul 2021 15:12:02 +0000 Received: (at 49625) by debbugs.gnu.org; 24 Jul 2021 15:11:31 +0000 Received: from localhost ([127.0.0.1]:46746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7JJL-0004Cc-BR for submit@debbugs.gnu.org; Sat, 24 Jul 2021 11:11:31 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:54275) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7JJD-0004CA-JS for 49625@debbugs.gnu.org; Sat, 24 Jul 2021 11:11:28 -0400 Received: from localhost.localdomain (80-121-26-175.adsl.highway.telekom.at [80.121.26.175]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4GX8lr2qyjz3x8F for <49625@debbugs.gnu.org>; Sat, 24 Jul 2021 17:11:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1627139480; bh=M0cWcUY0/FY8RTB9OOGX7u1lv0kSpSdNxAyDli6Ftx8=; h=From:To:Subject:Date; b=cfQksickNjmKTVKawgGqn3SXLY1C/jTVywtDsuh0nLl1K4/rFyTISRMN3+DuDK4Bp fRK7aWjhvXK32M49SVNYIXgnokqpxsqPl27gegLPGYuxX5zxrP1Ox2ynee+H3x0SUo QYvK3jSPFQAd+Wp6GXVfrdUgnHLytlEwfXjzZJ54= From: Leo Prikler Date: Sat, 24 Jul 2021 17:08:51 +0200 Message-Id: <20210724150852.20873-1-leo.prikler@student.tugraz.at> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/maths.scm (gecode): New variable. --- gnu/packages/maths.scm | 71 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index eeb32d554a..c052d33214 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2008,6 +2008,77 @@ linear and quadratic objectives. There are limited facilities for nonlinear and quadratic objectives using the Simplex algorithm.") (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 + `(("patchelf" ,patchelf) + ("perl" ,perl) + ("sed" ,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 libflame (package (name "libflame")