unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Xinglu Chen <public@yoctocell.xyz>
To: 50317@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#50317] [PATCH v2 3/4] gnu: ocaml-ppx-variants-conv: Patch for building with ocaml-ppxlib.
Date: Mon, 06 Sep 2021 16:06:52 +0200	[thread overview]
Message-ID: <de584d9ad104d099e0b72d0c5ad7f4b8b0958493.1630936967.git.public@yoctocell.xyz> (raw)
In-Reply-To: <cover.1630936967.git.public@yoctocell.xyz>

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 <sonjaleaheinze@gmail.com>
+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 <sonjaleaheinze@gmail.com>
+---
+Patch from <https://github.com/janestreet/ppx_variants_conv/pull/9>.
+
+ 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
+ 
-- 
2.33.0







  parent reply	other threads:[~2021-09-06 14:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01 12:58 [bug#50317] [PATCH 0/2] Update ‘ocaml-ppxlib’ Xinglu Chen
2021-09-01 13:13 ` [bug#50317] [PATCH 1/2] gnu: ocaml-ppxlib: Update to 0.23.0 Xinglu Chen
2021-09-01 13:13 ` [bug#50317] [PATCH 2/2] gnu: ocaml-ppx-optcomp: Update to 0.14.3 Xinglu Chen
2021-09-03 20:37 ` [bug#50317] [PATCH 0/2] Update ‘ocaml-ppxlib’ Ludovic Courtès
2021-09-04 10:56   ` Xinglu Chen
2021-09-06  8:07     ` Ludovic Courtès
2021-09-06 13:49       ` Xinglu Chen
2021-09-06 14:06 ` [bug#50317] [PATCH v2 0/4] " Xinglu Chen
2021-09-06 14:06   ` [bug#50317] [PATCH v2 1/4] gnu: ocaml-ppx-optcomp: Update to 0.14.3 Xinglu Chen
2021-09-06 14:06   ` [bug#50317] [PATCH v2 2/4] gnu: ocamlformat: Update to 0.19.0 Xinglu Chen
2021-09-06 14:06   ` Xinglu Chen [this message]
2021-09-06 14:06   ` [bug#50317] [PATCH v2 4/4] gnu: ocaml-ppxlib: Update to 0.23.0 Xinglu Chen
2021-09-06 21:36   ` bug#50317: [PATCH 0/2] Update ‘ocaml-ppxlib’ Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=de584d9ad104d099e0b72d0c5ad7f4b8b0958493.1630936967.git.public@yoctocell.xyz \
    --to=public@yoctocell.xyz \
    --cc=50317@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).