From fac81a866f86b95b0ff81a567f4d37501af338a7 Mon Sep 17 00:00:00 2001
From: Celeste <20312-Celeste@users.gitlab.alpinelinux.org>
Date: Tue, 26 Mar 2024 14:43:19 +0000
Subject: [PATCH] community/ocaml-cppo: remove virtual package from makedepends

replace ocaml-ocamlbuild-dev by the concrete
ocaml-ocamlbuild that provides it.

lua-aports does not see provides in subpackages,
and so will not guarantee that ocaml-ocamlbuild-dev
is built before ocaml-cppo, which sometimes results
in ocaml-cppo being built against an old version of
ocamlbuild; using the concrete package prevents this.

Bump pkgrel to solve the error seen in 7e5b7375ffae0a92228995c856ddb105abc10e6d
(ocaml-cppo was built against old ocamlbuild for aarch64 and ppc64le)

While here, solve a few more issues with this aport:
  - remove explicit depends for -ocamlbuild subpackage

  - also, remove provides, as this will cause the same
    issue as ocaml-ocamlbuild-dev with build order not
    being guaranteed (no aport depends on ocaml-cppo-dev)

  - add --build-dir=.testenv to `dune runtest` as a
    preventive measure to avoid clobbering _build
---
 community/ocaml-cppo/APKBUILD | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/community/ocaml-cppo/APKBUILD b/community/ocaml-cppo/APKBUILD
index 76cd3cac0e14..2ae537d0d1a9 100644
--- a/community/ocaml-cppo/APKBUILD
+++ b/community/ocaml-cppo/APKBUILD
@@ -2,12 +2,12 @@
 # Maintainer: rubicon <rubicon@mailo.com>
 pkgname=ocaml-cppo
 pkgver=1.6.9
-pkgrel=4
+pkgrel=5
 pkgdesc="C-style preprocessor for OCaml"
 url="https://github.com/ocaml-community/cppo"
 arch="all !riscv64" # restricted by ocaml
 license="BSD-3-Clause"
-makedepends="dune ocaml ocaml-ocamlbuild-dev"
+makedepends="dune ocaml ocaml-ocamlbuild"
 subpackages="$pkgname-doc $pkgname-ocamlbuild"
 source="$pkgname-$pkgver.tar.gz::https://github.com/ocaml-community/cppo/archive/v$pkgver.tar.gz"
 builddir="$srcdir/cppo-$pkgver"
@@ -29,7 +29,7 @@ build() {
 }
 
 check() {
-	dune runtest --verbose
+	dune runtest --build-dir=.testenv --verbose
 }
 
 package() {
@@ -42,8 +42,7 @@ package() {
 
 ocamlbuild() {
 	pkgdesc="$pkgdesc (Ocamlbuild plugin)"
-	depends="$pkgname=$pkgver-r$pkgrel ocaml-runtime ocaml-ocamlbuild"
-	provides="$pkgname-dev=$pkgver-r$pkgrel"
+	depends="$pkgname=$pkgver-r$pkgrel"
 
 	amove usr/lib/ocaml/cppo_ocamlbuild
 }
-- 
GitLab