From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yLGHIRArYGHJCAEAgWs5BA (envelope-from ) for ; Fri, 08 Oct 2021 13:27:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QPpyGxArYGFhZwAAB5/wlQ (envelope-from ) for ; Fri, 08 Oct 2021 11:27: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 C841B20298 for ; Fri, 8 Oct 2021 13:27:11 +0200 (CEST) Received: from localhost ([::1]:34504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYo1u-0005BX-Ry for larch@yhetil.org; Fri, 08 Oct 2021 07:27:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYo1m-0005B8-Qg for guix-patches@gnu.org; Fri, 08 Oct 2021 07:27:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37829) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mYo1m-0001WV-Ii for guix-patches@gnu.org; Fri, 08 Oct 2021 07:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mYo1m-0006zo-CI for guix-patches@gnu.org; Fri, 08 Oct 2021 07:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#46329] [PATCH v2] Add z3 OCaml bindings References: <20210205174641.166aec6f@tachikoma.lepiller.eu> In-Reply-To: <20210205174641.166aec6f@tachikoma.lepiller.eu> Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Oct 2021 11:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46329 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46329@debbugs.gnu.org Received: via spool by 46329-submit@debbugs.gnu.org id=B46329.163369239826858 (code B ref 46329); Fri, 08 Oct 2021 11:27:02 +0000 Received: (at 46329) by debbugs.gnu.org; 8 Oct 2021 11:26:38 +0000 Received: from localhost ([127.0.0.1]:49375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYo1O-0006z8-5o for submit@debbugs.gnu.org; Fri, 08 Oct 2021 07:26:38 -0400 Received: from lepiller.eu ([89.234.186.109]:34564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYo1L-0006yw-KI for 46329@debbugs.gnu.org; Fri, 08 Oct 2021 07:26:36 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 115bb2d8 for <46329@debbugs.gnu.org>; Fri, 8 Oct 2021 11:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:mime-version:content-type; s=dkim; bh=bgd eBNs2jTvU86oJBXYq4SE5e6fFhigqL0dNKUYSc3g=; b=eHJxhRSxjnhtp9eRqUX J8tBbYPYtCwkP0cJdncEk/UIPxILw99nriYb/Vk3/krYkJoKWrQ3qJEeUJDE832n l/UCnQp6pwIUUTQd0nJC3ybc5v/sJRCQxGI5HmJuuI2SAo9GCNfYPr0DE130sOAl tTwFhfR70mnxYIW0zHjMg4e9YA/HmG01gmLR4O4CrPwPCfmsb7u+azyP6LYNr3Qj 0aDBvpk0Wyf+W62Pu4vCq1h5MODqjAFZdO3s8u64wI6mTWwtJ86o+YNzgOxLTd+N QPYxc91srzdXIva9lb9kzrhCUhlUngjgOYR0tkpZIQr9U/gMAtgZqYsuo3gWGpsm qgA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 3c27dcc1 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <46329@debbugs.gnu.org>; Fri, 8 Oct 2021 11:26:31 +0000 (UTC) Date: Fri, 8 Oct 2021 13:26:18 +0200 From: Julien Lepiller Message-ID: <20211008132618.2364711a@tachikoma.lepiller.eu> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/RXF94TmaI3hojfaD5zDuIDN" 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=1633692431; 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: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=jY9Fpym5bkCiKuvuK44LkZsPgqeOrrVD6TxB1Hv+5xI=; b=L9vrh/Tf1nMEMM9f9mW5TFzSDCtT9dncaYxM9Wtnm1oSsir9zWsiZsEaVSy4LKXxb7pk/0 GRz8PpZvjj9hewL0vHhBFBuswGvnkEkZy4c4e4le/dr+L9wFRWXaE6eUILYVKkw2l+ecz7 U3qHDrkDVelEfChsQWsbvglzkbrOwBgLZsm6FCrriWPZbP7okeWO7BM1I+A+udwyhxytwB UpZbn42r84Hjgw/6AGOweX69wEBGXQyVSCKcC3dytEaCKMZO0Ec2zuH60nT/7fmy3LFQwG d6qESIY8GcWV5LeKFGiVrthny3X2WNFPYoEKSnb0w1fcEersgHgNU3oe/xGuTA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633692431; a=rsa-sha256; cv=none; b=l4BMWMCVJSiV2NAju1+ZafOsr2etdzFL19aWcctRRAezagz7SVo+ptCG3nHgTH/8SU5uU/ xHgdA2mczOFttR4fjGBzTSv0ZEZWTUZauXc+/rciQh7JK53QC4L3ukpTa6cEaDlbJIBu7K I5+GMOPli7A0dxKzyAu8nZRRrRpZ4Hjx3vYmgJiAJCx04QqLlu8p1KWx1lOiaWc3+/CsWw ACkSjaiSNQsu/n77vnJdoyoHtXsfIWGbkkrhp4gYkIhSY6VS09oFw2NgLkqTiGN4Ygr0yW fvZAvRH9sZj19gYg/gQAmK9p+8Ugxp4ZF3WxfstFyOQu1YOen/wzok5t9nr2xw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=eHJxhRSx; 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.19 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=eHJxhRSx; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (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: C841B20298 X-Spam-Score: 0.19 X-Migadu-Scanner: scn0.migadu.com X-TUID: W7ZYq/32Aoli --MP_/RXF94TmaI3hojfaD5zDuIDN Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! I finally managed to build a separate package out of z3. It wasn't easy, because the build system wants to rebuild a z3 and doesn't let you install only the bindings. I managed to make it do just that: build the bindings and install them, and link to the existing z3 package. --MP_/RXF94TmaI3hojfaD5zDuIDN Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-gnu-Add-ocaml-z3.patch >From 48aa690abd20a4e2134e4791eee388ca9f590ee9 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 8 Oct 2021 13:23:37 +0200 Subject: [PATCH] gnu: Add ocaml-z3. * gnu/packages/maths.scm (ocaml-z3): New variable. --- gnu/packages/maths.scm | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 038ca5518c..f87cdddfa8 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -5619,6 +5619,65 @@ as equations, scalars, vectors, and matrices.") theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.") (license license:expat))) +(define-public ocaml-z3 + (package + (inherit z3) + (name "ocaml-z3") + (arguments + `(#:imported-modules ((guix build python-build-system) + ,@%gnu-build-system-modules) + #:modules (((guix build python-build-system) #:select (site-packages)) + (guix build gnu-build-system) + (guix build utils)) + #:tests? #f; no ml tests + #:phases + (modify-phases %standard-phases + (add-before 'configure 'bootstrap + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (setenv "OCAMLFIND_LDCONF" "ignore") + (setenv "OCAMLFIND_DESTDIR" (string-append out "/lib/ocaml/site-lib")) + (mkdir-p (string-append out "/lib/ocaml/site-lib")) + (substitute* "scripts/mk_util.py" + (("LIBZ3 = LIBZ3") + (string-append "LIBZ3 = LIBZ3 + ' -dllpath " out "/lib'")) + ;; Do not build z3 again, use the library passed as input + ;; instead + (("z3linkdep,") "\"\",") + (("z3linkdep)") "\"\")")) + (invoke "python" "scripts/mk_make.py")))) + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (invoke "./configure" + "--ml" + (string-append "--prefix=" (assoc-ref outputs "out"))))) + (add-after 'configure 'change-directory + (lambda _ + (chdir "build") + #t)) + (replace 'build + (lambda _ + (invoke "make" "ml"))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (invoke "ocamlfind" "install" "-destdir" + (string-append (assoc-ref outputs "out") "/lib/ocaml/site-lib") + "z3" "api/ml/META" "api/ml/z3enums.mli" "api/ml/z3enums.cmi" + "api/ml/z3enums.cmx" "api/ml/z3native.mli" + "api/ml/z3native.cmi" "api/ml/z3native.cmx" + "../src/api/ml/z3.mli" "api/ml/z3.cmi" "api/ml/z3.cmx" + "api/ml/libz3ml.a" "api/ml/z3ml.a" "api/ml/z3ml.cma" + "api/ml/z3ml.cmxa" "api/ml/z3ml.cmxs" "api/ml/dllz3ml.so")))))) + (native-inputs + `(("which" ,which) + ("python" ,python-wrapper) + ("ocaml" ,ocaml) + ("ocaml-findlib" ,ocaml-findlib))) + (propagated-inputs + `(("ocaml-zarith" ,ocaml-zarith))) + (inputs + `(("z3" ,z3))))) + (define-public elpa (package (name "elpa") -- 2.33.0 --MP_/RXF94TmaI3hojfaD5zDuIDN--