From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wJePLIzk/WAEoAAAgWs5BA (envelope-from ) for ; Mon, 26 Jul 2021 00:24:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GGpLKIzk/WBBFQAAB5/wlQ (envelope-from ) for ; Sun, 25 Jul 2021 22:24:12 +0000 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 DE659C193 for ; Mon, 26 Jul 2021 00:24:11 +0200 (CEST) Received: from localhost ([::1]:42996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7mXb-0005oZ-1K for larch@yhetil.org; Sun, 25 Jul 2021 18:24:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7mXS-0005o7-Td for guix-patches@gnu.org; Sun, 25 Jul 2021 18:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m7mXS-0007DR-M2 for guix-patches@gnu.org; Sun, 25 Jul 2021 18:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m7mXS-0002ry-FA for guix-patches@gnu.org; Sun, 25 Jul 2021 18:24:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49625] [PATCH v2 2/2] gnu: Add minizinc. Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 25 Jul 2021 22:24: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.162725183811013 (code B ref 49625); Sun, 25 Jul 2021 22:24:02 +0000 Received: (at 49625) by debbugs.gnu.org; 25 Jul 2021 22:23:58 +0000 Received: from localhost ([127.0.0.1]:49552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7mXN-0002rY-Ry for submit@debbugs.gnu.org; Sun, 25 Jul 2021 18:23:58 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:51287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7mXL-0002rJ-Jl for 49625@debbugs.gnu.org; Sun, 25 Jul 2021 18:23:56 -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 4GXyJS71Y6z3xRf for <49625@debbugs.gnu.org>; Mon, 26 Jul 2021 00:23:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1627251833; bh=m0fLCJ71dB8Zda2wM0Y/pon/awqV4AgzNvMBZ0aoTPc=; h=From:To:Subject:Date:In-Reply-To:References; b=P5E1OqqbbpZxs03TaYtjWNs8N9xTpb2lI6Zlfb+ch5Y1e735m3TMrAo8ncVwxe+Yh qBrgYcl+PPGQMoIUqerLhUyx70RpNays8b1FSrn7g5/6kInoXztJOLzxbRZx18db77 CuK3d9HMERt0hhQthp5MTxbI+UU6Ip2Kk8kmYDuY= From: Leo Prikler Date: Mon, 26 Jul 2021 00:23:41 +0200 Message-Id: <20210725222341.30622-2-leo.prikler@student.tugraz.at> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210725222341.30622-1-leo.prikler@student.tugraz.at> References: <20210725222341.30622-1-leo.prikler@student.tugraz.at> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627251852; h=from:from:sender:sender: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: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=m0fLCJ71dB8Zda2wM0Y/pon/awqV4AgzNvMBZ0aoTPc=; b=ICV+h0Pbqjxxs/372jnv4Sz0Qwd+wslFO2Ie4h96/wV6OvVINdEPd7qL7SpC2LvclMU1aW 8LXZ2wXHf7v1dx2+Lj0OJndDslNJAMofpzI8hN9/4arx836wsUFuG+FQVjR2djxxCN2DWp xtu7XPxlbc4g6kPCG8o7jJXr3uUmWd+IKIAWMwJB+rcEb1ANNgx0LIe0fhOqcc9ROGUoau P1XJnJqpQhddc8tfXkZDXn5pqR1hyfXnd/G1iBmdcPRFn1dBq5pNxt329pvT8rqWT6vatz mN8xvqPulHwa3prap3cbu28MSJYHgjAbx0q+FWtT+7oMpOQ7VXLzzSSmtAFd3Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627251852; a=rsa-sha256; cv=none; b=Q49gbsOhybgWxPnvpYAVQnZ4MCsVATm9eC5j6Mh/fu3xe5dvNSIhp91k1vj6c9NGWMsQ3a MrdLxyOQbZXZVYwClAdOeY7lYc+9mhJdD4fy3Qwbdzt4uANuIGmpN0N/BNcBmudkj/t6c6 7qzYDPXLhEK7WL2/J7ct/8Bn0nQM6QpCFZ1mtRkWsRUpf2uEyM90o57QHobPHy3Sx5ofI0 defI9EjjwVA/ABqvWQ+7EPcjt3vlLKHhKCqoNSX7mD4iwQFUkutTzE+wR/9nwY2O4zZy/6 PpY2HM2QPM51Y9QE88Ae5oWeFN4tdCUIaVQ+8G4+djLog7zu86yoNiDQbw2Z3g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=P5E1Oqqb; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=P5E1Oqqb; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: DE659C193 X-Spam-Score: -0.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: N+UB6EyPCkH4 * gnu/packages/maths.scm (minizinc): New variable. --- gnu/packages/maths.scm | 130 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index c052d33214..d72a534f30 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -3057,6 +3057,136 @@ the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath book.") (license license:gpl2+))) +(define-public minizinc + (package + (name "minizinc") + (version "2.5.5") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/MiniZinc/libminizinc") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "10b2hsl1fx9psh0iagmp8ki3f60f3qg5hmvra5aczjlfmbl88ggp")) + (modules '((guix build utils) + (ice-9 ftw) + (srfi srfi-1))) + (snippet + '(begin + ;; Do not advertise proprietary solvers + (with-directory-excursion "cmake/targets" + (let ((targets '("libminizinc_fzn.cmake" + "libminizinc_gecode.cmake" + "libminizinc_mip.cmake" + "libminizinc_nl.cmake" + "libminizinc_osicbc.cmake" + "libminizinc_parser.cmake" + "libmzn.cmake" + "minizinc.cmake" + "mzn2doc.cmake"))) + (for-each delete-file + (remove + (lambda (file) + (member file (cons* "." ".." targets))) + (scandir "."))) + (substitute* "libmzn.cmake" + (("include\\(cmake/targets/(.*)\\)" all target) + (if (member target targets) all ""))))) + (with-directory-excursion "include/minizinc/solvers/MIP" + (for-each delete-file + (remove + (lambda (file) + (member file '("." ".." + "MIP_osicbc_solverfactory.hh" + "MIP_osicbc_wrap.hh" + "MIP_solverinstance.hh" + "MIP_solverinstance.hpp" + "MIP_wrap.hh"))) + (scandir ".")))) + (with-directory-excursion "solvers/MIP" + (for-each delete-file + (remove + (lambda (file) + (member file '("." ".." + "MIP_osicbc_solverfactory.cpp" + "MIP_osicbc_wrap.cpp" + "MIP_solverinstance.cpp" + "MIP_wrap.cpp"))) + (scandir ".")))) + (substitute* "CMakeLists.txt" + (("find_package\\(([^ ]*).*\\)" all pkg) + (if (member pkg '("Gecode" "OsiCBC" "Threads")) + all + ""))) + ;; TODO: swap out miniz for zlib + #t)))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ; no ‘check’ target + #:modules ((guix build cmake-build-system) + (guix build utils) + (srfi srfi-1)) + #:phases + (modify-phases %standard-phases + (add-after 'install 'install-solver-configs + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((gecode (assoc-ref inputs "gecode")) + (pkgdatadir (string-append (assoc-ref outputs "out") + "/share/minizinc"))) + (call-with-output-file (string-append pkgdatadir + "/Preferences.json") + (lambda (port) + (display "\ +{ + \"tagDefaults\": [ + [\"\", \"org.gecode.gecode\"], + [\"gecode\", \"org.gecode.gecode\"] + ], + \"solverDefaults\": [] +}" + 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))))))))) + (native-inputs + `(("bison" ,bison) + ("flex" ,flex))) + (inputs + `(("cbc" ,cbc) + ("gecode" ,gecode) + ("zlib" ,zlib))) + (home-page "https://www.minizinc.org") + (synopsis "High-level constraint modeling language") + (description "MiniZinc is a high-level modeling language for constraint +satisfaction and optimization problems. Models are compiled to FlatZinc, a +language understood by many solvers.") + (license license:mpl2.0))) + (define-public mumps (package (name "mumps") -- 2.32.0