From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCsY4-00078L-E0 for guix-patches@gnu.org; Wed, 17 Oct 2018 16:36:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCsY1-00038Q-41 for guix-patches@gnu.org; Wed, 17 Oct 2018 16:36:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51552) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCsY0-00038H-Ud for guix-patches@gnu.org; Wed, 17 Oct 2018 16:36:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gCsY0-0006sp-S0 for guix-patches@gnu.org; Wed, 17 Oct 2018 16:36:04 -0400 Subject: [bug#33079] [PATCH 06/34] guix: ocaml: Add package-with-ocaml4.02. Resent-Message-ID: From: Julien Lepiller Date: Wed, 17 Oct 2018 22:34:14 +0200 Message-Id: <20181017203442.7075-6-julien@lepiller.eu> In-Reply-To: <20181017203442.7075-1-julien@lepiller.eu> References: <20181017223130.775b25fc@lepiller.eu> <20181017203442.7075-1-julien@lepiller.eu> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 33079@debbugs.gnu.org * guix/build-system/ocaml.scm (default-ocaml4.02, default-ocaml4.02-findlib, package-with-ocaml4.02, strip-ocaml4.02-variant): New variables. --- guix/build-system/ocaml.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/guix/build-system/ocaml.scm b/guix/build-system/ocaml.scm index 34a22ecff..560be0e25 100644 --- a/guix/build-system/ocaml.scm +++ b/guix/build-system/ocaml.scm @@ -28,7 +28,9 @@ #:use-module (srfi srfi-1) #:export (%ocaml-build-system-modules package-with-ocaml4.01 + package-with-ocaml4.02 strip-ocaml4.01-variant + strip-ocaml4.02-variant ocaml-build ocaml-build-system)) @@ -82,6 +84,14 @@ (let ((module (resolve-interface '(gnu packages ocaml)))) (module-ref module 'ocaml4.01-findlib))) +(define (default-ocaml4.02) + (let ((ocaml (resolve-interface '(gnu packages ocaml)))) + (module-ref ocaml 'ocaml-4.02))) + +(define (default-ocaml4.02-findlib) + (let ((module (resolve-interface '(gnu packages ocaml)))) + (module-ref module 'ocaml4.02-findlib))) + (define* (package-with-explicit-ocaml ocaml findlib old-prefix new-prefix #:key variant-property) "Return a procedure of one argument, P. The procedure creates a package @@ -139,12 +149,24 @@ pre-defined variants." "ocaml-" "ocaml4.01-" #:variant-property 'ocaml4.01-variant)) +(define package-with-ocaml4.02 + (package-with-explicit-ocaml (delay (default-ocaml4.02)) + (delay (default-ocaml4.02-findlib)) + "ocaml-" "ocaml4.02-" + #:variant-property 'ocaml4.02-variant)) + (define (strip-ocaml4.01-variant p) "Remove the 'ocaml4.01-variant' property from P." (package (inherit p) (properties (alist-delete 'ocaml4.01-variant (package-properties p))))) +(define (strip-ocaml4.02-variant p) + "Remove the 'ocaml4.02-variant' property from P." + (package + (inherit p) + (properties (alist-delete 'ocaml4.02-variant (package-properties p))))) + (define* (lower name #:key source inputs native-inputs outputs system target (ocaml (default-ocaml)) -- 2.18.0