aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-tyxml/APKBUILD
blob: 254a8c7e9a566402a09f2db4f9c4a596851185ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ocaml-tyxml
_pkgname=tyxml
pkgver=4.2.0
pkgrel=1
pkgdesc="OCaml library for building statically correct HTML and SVG documents"
url="https://ocsigen.org/tyxml/"
arch="all !x86 !armhf !armv7 !s390x"  # limited by ocaml aport
license="LGPL-2.1-or-later"
depends="ocaml-runtime ocaml-re ocaml-uchar ocaml-uutf"
depends_dev="$pkgname=$pkgver-r$pkgrel $pkgname-ppx=$pkgver-r$pkgrel"
makedepends="
	ocaml
	ocaml-compiler-libs
	ocaml-ocamldoc
	ocaml-findlib
	ocaml-markup-dev
	ocaml-migrate-parsetree-dev
	ocaml-ocamlbuild-dev
	ocaml-ppx_tools_versioned-dev
	ocaml-re-dev
	ocaml-uchar-dev
	ocaml-uutf-dev
	ocamlbuild
	"
options="!check"  # requires additional dependencies
subpackages="$pkgname-dev $pkgname-ppx"
source="$pkgname-$pkgver.tar.gz::https://github.com/ocsigen/$_pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

_sitelib="usr/lib/ocaml/$_pkgname"

build() {
	cd "$builddir"

	# --disable-syntax - Camlp4-based syntax is deprecated
	./configure \
		--destdir="$pkgdir" \
		--prefix=/usr \
		--disable-syntax \
		--disable-tests
	make
}

package() {
	cd "$builddir"

	mkdir -p "$pkgdir"/usr/lib/ocaml
	make install OCAMLFIND_DESTDIR="$pkgdir/usr/lib/ocaml"

	# Remove annotation files and sources.
	cd "$pkgdir"/usr/lib/ocaml/$_pkgname
	rm -f *.annot *.cmt* *.ml
}

dev() {
	default_dev

	cd "$pkgdir"/$_sitelib
	_mv *.cmx *.cmxa *.mli "$subpkgdir"/$_sitelib/
}

ppx() {
	pkgdesc="$pkgdesc (ppx syntax extension)"
	depends="$pkgname=$pkgver-r$pkgrel ocaml-markup ocaml-ppx_tools_versioned"

	_mv "$pkgdir"/$_sitelib/ppx_* "$subpkgdir"/$_sitelib/
}

_mv() {
	local dest; for dest; do true; done  # get last argument
	mkdir -p "$dest"
	mv "$@"
}

sha512sums="555df1fdf5eb30592a3bd93b7d08345964b1cd6e16c2f746ef777cb3c5fc9a31dddf316432e0457d317eaf7728c5d1156982956169a7b1eb9b660eedcf89ca58  ocaml-tyxml-4.2.0.tar.gz"