summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Peukert2021-02-18 17:57:24 +0100
committerDaniel Peukert2021-02-18 17:57:24 +0100
commit67408fe7791954fe605bc36a5eb0ed4b31a0759d (patch)
tree7b3ec14faa0c85a76db25cad56d9e373d4431290
parentd3106dbbe08f05110f58bc663898f96631a43e07 (diff)
downloadaur-67408fe7791954fe605bc36a5eb0ed4b31a0759d.tar.gz
Add ppxlib 0.22.0 compatibility patch to ocaml-visitors
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD15
-rw-r--r--ppxlib.diff48
3 files changed, 64 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 42e57fca5a3..ad2d2e21980 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = ocaml-visitors
pkgdesc = An OCaml syntax extension for generating visitor classes
pkgver = 20210127
- pkgrel = 1
+ pkgrel = 2
url = https://gitlab.inria.fr/fpottier/visitors
arch = x86_64
arch = i686
@@ -16,7 +16,9 @@ pkgbase = ocaml-visitors
depends = ocaml-ppxlib>=0.9.0
depends = ocaml-result
options = !strip
- source = ocaml-visitors-20210127-1.tar.gz::https://gitlab.inria.fr/fpottier/visitors/-/archive/20210127/visitors-20210127.tar.gz
+ source = ocaml-visitors-20210127-2.tar.gz::https://gitlab.inria.fr/fpottier/visitors/-/archive/20210127/visitors-20210127.tar.gz
+ source = ppxlib.diff
sha256sums = b3057bf30fe4c7767643a8511a4e15f956114bde4001e58a720540ebc467f39f
+ sha256sums = b3b55482a1840a37367fb201469992eba226984c02a1b2df7da99b1d969e25ef
pkgname = ocaml-visitors
diff --git a/PKGBUILD b/PKGBUILD
index 929ebecedeb..8a803278db4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
_projectname='visitors'
pkgname="ocaml-$_projectname"
pkgver='20210127'
-pkgrel='1'
+pkgrel='2'
pkgdesc='An OCaml syntax extension for generating visitor classes'
arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h' 'aarch64')
url="https://gitlab.inria.fr/fpottier/$_projectname"
@@ -11,11 +11,20 @@ license=('LGPL2.1')
depends=('ocaml>=4.07.0' 'ocaml-ppx_deriving>=5.0' 'ocaml-ppxlib>=0.9.0' 'ocaml-result')
makedepends=('dune>=2.0.0')
options=('!strip')
-source=("$pkgname-$pkgver-$pkgrel.tar.gz::$url/-/archive/$pkgver/$_projectname-$pkgver.tar.gz")
-sha256sums=('b3057bf30fe4c7767643a8511a4e15f956114bde4001e58a720540ebc467f39f')
+source=(
+ "$pkgname-$pkgver-$pkgrel.tar.gz::$url/-/archive/$pkgver/$_projectname-$pkgver.tar.gz"
+ "ppxlib.diff"
+)
+sha256sums=('b3057bf30fe4c7767643a8511a4e15f956114bde4001e58a720540ebc467f39f'
+ 'b3b55482a1840a37367fb201469992eba226984c02a1b2df7da99b1d969e25ef')
_sourcedirectory="$_projectname-$pkgver"
+prepare() {
+ cd "$srcdir/$_sourcedirectory/"
+ patch --forward -p1 < '../ppxlib.diff'
+}
+
build() {
cd "$srcdir/$_sourcedirectory/"
dune build --release --verbose
diff --git a/ppxlib.diff b/ppxlib.diff
new file mode 100644
index 00000000000..a36e1848748
--- /dev/null
+++ b/ppxlib.diff
@@ -0,0 +1,48 @@
+diff --git a/src/Visitors.ml b/src/Visitors.ml
+index 7139ed7..f28925f 100644
+--- a/src/Visitors.ml
++++ b/src/Visitors.ml
+@@ -1258,7 +1258,7 @@ let type_decls (decls : type_declaration list) : structure =
+ also parameterized over the type variable ['self], with a constraint
+ that this is the type of [self]. This trick allows us to omit the types
+ of the virtual methods, even if these types include type variables. *)
+- dump X.concrete X.ancestors [ ty_self, Invariant ] pself X.name ::
++ dump X.concrete X.ancestors [ ty_self, (NoVariance, NoInjectivity) ] pself X.name ::
+ floating "VISITORS.END" [] ::
+ []
+ )]
+diff --git a/src/VisitorsAnalysis.ml b/src/VisitorsAnalysis.ml
+index 65b47e4..fa910f0 100644
+--- a/src/VisitorsAnalysis.ml
++++ b/src/VisitorsAnalysis.ml
+@@ -191,7 +191,7 @@ let fix =
+ [ptype_params] of a type definition, and returns the underlying type
+ variable. *)
+
+-let type_param_to_tyvar ((ty, _) : core_type * variance) : tyvar =
++let type_param_to_tyvar ((ty, _) : core_type * (variance * injectivity)) : tyvar =
+ match ty.ptyp_desc with
+ | Ptyp_var tv ->
+ tv
+diff --git a/src/VisitorsGeneration.ml b/src/VisitorsGeneration.ml
+index 53a6b1b..a7f28ec 100644
+--- a/src/VisitorsGeneration.ml
++++ b/src/VisitorsGeneration.ml
+@@ -363,7 +363,7 @@ let with_warnings (w : string) (items : structure_item list) : structure_item =
+
+ let class1
+ (concrete : bool)
+- (params : (core_type * variance) list)
++ (params : (core_type * (variance * injectivity)) list)
+ (name : classe)
+ (self : pattern)
+ (fields : class_field list)
+@@ -497,7 +497,7 @@ module ClassFieldStore () : sig
+ val dump:
+ bool ->
+ Longident.t list ->
+- (core_type * variance) list ->
++ (core_type * (variance * injectivity)) list ->
+ pattern ->
+ classe ->
+ structure_item