From patchwork Mon Sep 6 14:06:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 32670 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 A870F27BBE1; Mon, 6 Sep 2021 15:07:14 +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_H2,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 1A4F927BBE3 for ; Mon, 6 Sep 2021 15:07:14 +0100 (BST) Received: from localhost ([::1]:50184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNFHF-0000FJ-5O for patchwork@mira.cbaines.net; Mon, 06 Sep 2021 10:07:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNFH5-0000Ag-Kn for guix-patches@gnu.org; Mon, 06 Sep 2021 10:07:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNFH5-0004fv-DU for guix-patches@gnu.org; Mon, 06 Sep 2021 10:07:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNFH5-0004my-8a for guix-patches@gnu.org; Mon, 06 Sep 2021 10:07:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50317] [PATCH v2 3/4] gnu: ocaml-ppx-variants-conv: Patch for building with ocaml-ppxlib. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 14:07:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50317 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50317@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 50317-submit@debbugs.gnu.org id=B50317.163093721918366 (code B ref 50317); Mon, 06 Sep 2021 14:07:03 +0000 Received: (at 50317) by debbugs.gnu.org; 6 Sep 2021 14:06:59 +0000 Received: from localhost ([127.0.0.1]:54167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNFH1-0004mA-IX for submit@debbugs.gnu.org; Mon, 06 Sep 2021 10:06:59 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:40164 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNFH0-0004lc-5V for 50317@debbugs.gnu.org; Mon, 06 Sep 2021 10:06:58 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1630937212; bh=o5kuDj0nRdz5Hh1YrS66HqlmTGwJ/hh0c3q1zAurSoI=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=j76sAtT5QsA3kO8g6D0REYfSRFwAZdnO1xDwkZbID4ehfxuNW1NBJO1zvuTZ0K3el K+3uS9pRjdmqkD01C8rok0z/IfesVV2QLNjTzVuVls4TmA1RoQk84bHFVVZuAyYeks /xRNSKX0mTawUmlLTHi7Esxt4maYP7wECmicTjnY= In-Reply-To: References: Message-Id: Date: Mon, 06 Sep 2021 16:06:52 +0200 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches The patch will make it build when building it with ocaml-ppxlib@0.23.0. * gnu/packages/patches/ocaml-ppx-variants-ppxlib-api-change.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/ocaml.scm (ocaml-ppx-variants-conv): Apply the patch. --- gnu/local.mk | 1 + gnu/packages/ocaml.scm | 4 ++ ...ocaml-ppx-variants-ppxlib-api-change.patch | 42 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 gnu/packages/patches/ocaml-ppx-variants-ppxlib-api-change.patch diff --git a/gnu/local.mk b/gnu/local.mk index dc2e41d384..9fb068917a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1523,6 +1523,7 @@ dist_patch_DATA = \ %D%/packages/patches/ocaml-dose3-Fix-for-ocaml-4.06.patch \ %D%/packages/patches/ocaml-dose3-dont-make-printconf.patch \ %D%/packages/patches/ocaml-dose3-Install-mli-cmx-etc.patch \ + %D%/packages/patches/ocaml-ppx-variants-ppxlib-api-change.patch \ %D%/packages/patches/omake-fix-non-determinism.patch \ %D%/packages/patches/oneko-remove-nonfree-characters.patch \ %D%/packages/patches/onnx-optimizer-system-library.patch \ diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index 53305ce60f..e319fb891d 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -5340,6 +5340,10 @@ definitions.") (uri (git-reference (url "https://github.com/janestreet/ppx_variants_conv") (commit (string-append "v" version)))) + (patches + (search-patches + ;; Fix build when building with ocaml-ppxlib@0.23.0. + "ocaml-ppx-variants-ppxlib-api-change.patch")) (file-name (git-file-name name version)) (sha256 (base32 diff --git a/gnu/packages/patches/ocaml-ppx-variants-ppxlib-api-change.patch b/gnu/packages/patches/ocaml-ppx-variants-ppxlib-api-change.patch new file mode 100644 index 0000000000..b437bfb061 --- /dev/null +++ b/gnu/packages/patches/ocaml-ppx-variants-ppxlib-api-change.patch @@ -0,0 +1,42 @@ +From 6103f6fc56f978c847ba7c1f2d9f38ee93a5e337 Mon Sep 17 00:00:00 2001 +From: Sonja Heinze +Date: Tue, 9 Mar 2021 12:57:47 +0100 +Subject: [PATCH] Adapt to Ppxlib's API change + +Ppxlib is removing Lexer.keyword_table from the API in exchange for +the more lightweight Keyword.is_keyword. + +Signed-off-by: Sonja Heinze +--- +Patch from . + + ppx_variants_conv.opam | 2 +- + src/ppx_variants_conv.ml | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ppx_variants_conv.opam b/ppx_variants_conv.opam +index 7e7148d..b56040f 100644 +--- a/ppx_variants_conv.opam ++++ b/ppx_variants_conv.opam +@@ -15,7 +15,7 @@ depends: [ + "base" {>= "v0.14" & < "v0.15"} + "variantslib" {>= "v0.14" & < "v0.15"} + "dune" {>= "2.0.0"} +- "ppxlib" {>= "0.14.0"} ++ "ppxlib" {>= "0.23.0"} + ] + synopsis: "Generation of accessor and iteration functions for ocaml variant types" + description: " +diff --git a/src/ppx_variants_conv.ml b/src/ppx_variants_conv.ml +index 8d60086..112fc78 100644 +--- a/src/ppx_variants_conv.ml ++++ b/src/ppx_variants_conv.ml +@@ -66,7 +66,7 @@ end + + let variant_name_to_string v = + let s = String.lowercase v in +- if Caml.Hashtbl.mem Lexer.keyword_table s ++ if Keyword.is_keyword s + then s ^ "_" + else s +