aboutsummaryrefslogtreecommitdiffstats
path: root/community/unison/APKBUILD
blob: 42cc4d334fae87a40fc705ac02e6aa0e9392b06f (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
# Contributor: Jean-Louis Fuchs <ganwell@fangorn.ch>
# Maintainer: Jean-Louis Fuchs <ganwell@fangorn.ch>
pkgname=unison
# Note: unison breaks compatibility between minor (major.minor) versions.
pkgver=2.48.15_p4
_pkgver=${pkgver/_p/v}
_majorver=${_pkgver%.*}  # x.y
pkgrel=0
pkgdesc="Efficient file-synchronization tool"
url="https://www.cis.upenn.edu/~bcpierce/unison/"
# ocaml is not built for x86, armhf, s390x
# ocaml-lablgtk is not built for aarch64
arch="all !x86 !armhf !armv7 !aarch64 !s390x"
license="GPL-3.0+"
makedepends="ocaml ocaml-lablgtk-dev linux-headers emacs-nox bash"
subpackages="$pkgname-gui"
source="$pkgname-$_pkgver.tar.gz::https://github.com/bcpierce00/$pkgname/archive/v$_pkgver.tar.gz
	fix-inotify-check.patch
	makefile-fix-clean.patch
	fix-for-lablgtk-2.18.6.patch
	ocaml-4.08.patch"
# TODO: Enable check once this issue is fixed:
# https://github.com/bcpierce00/unison/issues/73
options="!check"
builddir="$srcdir/$pkgname-$_pkgver/src"

build() {
	cd "$builddir"

	# ocamlopt is a front-end for gcc which will create optimized ocaml
	# binaries. It will call gcc, but it hasn't implemented all gcc options.
	# -ccopt is the way to pass arbitrary options.
	local _cflags=''
	local i; for i in $CFLAGS; do
		_cflags="$_cflags -ccopt $i"
	done
	export CFLAGS="$_cflags"

	local ui; for ui in text gtk2; do
		make -j1 clean
		make -j1 mkProjectInfo
		make -j1 UISTYLE="$ui" DEBUGGING=false THREADS=true
		mv unison unison-$ui
	done
}

package() {
	cd "$builddir"
	install -m 755 -D unison-text \
		"$pkgdir"/usr/bin/unison-text-$_majorver
	install -m 755 -D unison-fsmonitor \
		"$pkgdir"/usr/bin/unison-fsmonitor-$_majorver

	cd "$pkgdir"/usr/bin
	ln -s unison-text-$_majorver unison-text
	ln -s unison-text unison
}

gui() {
	pkgdesc="$pkgdesc (GTK+2 GUI)"
	depends="$pkgname=$pkgver-r$pkgrel"
	install_if="$pkgname=$pkgver-r$pkgrel gtk+2.0"

	cd "$builddir"
	install -m 755 -D unison-gtk2 \
		"$subpkgdir"/usr/bin/unison-gtk2-$_majorver
	ln -s unison-gtk2-$_majorver "$subpkgdir"/usr/bin/unison-gtk2
}

sha512sums="658b37fd18d8dee517e88ad707f7e80c1731542a0e07e6a8d56e6598e38bcf405cdb8db224274bf9b3319ed87efc45057d1f79e6437c4ca53afe9cec4afe6c78  unison-2.48.15v4.tar.gz
53ef0b9bd5632509cad69d60924da36836017574a59cd373aa44710c2d82b1329ab406753f430c98be8527428bd9a4847dde372dc5074781eb4a83de4e300d77  fix-inotify-check.patch
cd8b9b6edc22c586f8f3fa566224c465a007b46b86766c25c2348f1a8eadb8faf28d6a8e4747611f8550f938ed52cb62de00cd9ca175e27b57cd81d6c286229a  makefile-fix-clean.patch
b7ffd449ff54f03f4f7ca11dfeb1cd4ebb757f60bd924797c4fb48e63bbc99188e353b53e240043e99d4915bf1c2ed54444bfe7c4b0393c5ad010b8ac16249e2  fix-for-lablgtk-2.18.6.patch
302d070003e396982c35260ee8dd1569b272a5c17f21eabd92ae41bd6fe8570a117e769f5e26a26bf9f4a7a418c016a73c1edf8a11f552c7b8eaf9dadd4113ac  ocaml-4.08.patch"