aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ocaml-ppx_deriving/APKBUILD
blob: ee6056fd4b15eb18845ce29eef5e5d6e35884f5d (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
78
79
80
81
82
83
84
85
86
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ocaml-ppx_deriving
_pkgname=ppx_deriving
pkgver=4.2.1
pkgrel=2
pkgdesc="Type-driven code generation for OCaml"
url="https://github.com/ocaml-ppx/ppx_deriving"
arch="all !x86 !armhf !armv7 !s390x"  # limited by ocaml aport
license="MIT"
depends="
	ocaml-migrate-parsetree
	ocaml-ppx_derivers
	ocaml-ppx_tools
	ocaml-result
	ocaml-runtime
	"
depends_dev="$pkgname=$pkgver-r$pkgrel"
checkdepends="ocaml-ounit"
makedepends="
	grep
	ocaml
	ocaml-compiler-libs
	ocaml-cppo-dev
	ocaml-cppo-ocamlbuild
	ocaml-findlib-dev
	ocaml-migrate-parsetree-dev
	ocaml-ocamlbuild-dev
	ocaml-ppx_derivers-dev
	ocaml-ppx_tools-dev
	ocaml-result-dev
	ocamlbuild
	opam
	"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/ocaml-ppx/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	cd "$builddir"
	make
}

check() {
	cd "$builddir"
	make test
}

package() {
	cd "$builddir"

	opam-installer -i \
		--prefix="$pkgdir/usr" \
		--libdir="$pkgdir/usr/lib/ocaml" \
		--docdir="$builddir/.omit" \
		$_pkgname.install

	cd "$pkgdir"

	# Move executable to /usr/bin.
	mkdir -p usr/bin
	mv usr/lib/$_pkgname/ppx_deriving usr/bin/
	rmdir usr/lib/$_pkgname

	# Remove annotation files.
	rm -Rf "$pkgdir"/usr/lib/ocaml/$_pkgname/*.cmt*
}

dev() {
	local sitelib="usr/lib/ocaml/$_pkgname"
	default_dev

	cd "$pkgdir"

	mkdir -p "$subpkgdir"/usr
	mv usr/bin "$subpkgdir"/usr/

	ln -s ../../../bin/ppx_deriving \
		"$subpkgdir"/usr/lib/ocaml/$_pkgname/ppx_deriving

	cd "$pkgdir"/$sitelib
	mkdir -p "$subpkgdir"/$sitelib
	mv *.cmx *.cmxa *.mli "$subpkgdir"/$sitelib/
}

sha512sums="306cd62a5a2906782789967c9df3efd0f9fc31c4f59e39d3f678a0a24a5c48a210af8a28c9483a0f6ae174a36f79a00a2b1a0d547006c84fcc7a91101c2cd41b  ocaml-ppx_deriving-4.2.1.tar.gz"