aboutsummaryrefslogtreecommitdiffstats
path: root/community/erlang/APKBUILD
blob: 216600165e125375776f156ff40c3c72f8db948d (plain) (blame)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# Contributor: Michael Mason <ms13sp@gmail.com>
# Contributor: Gabriele Santomaggio <g.santomaggio@gmail.com>
# Contributor: Marlus Saraiva <marlus.saraiva@gmail.com>
# Maintainer: Daniel Isaksen <d@duniel.no>
pkgname=erlang
pkgver=22.2.7
pkgrel=0
pkgdesc="General-purpose programming language and runtime environment"
url="https://www.erlang.org/"
license="Apache-2.0"
arch="all"
depends="$pkgname-kernel $pkgname-stdlib $pkgname-compiler"
makedepends="perl-dev perl zlib-dev ncurses-dev openssl-dev openjdk8
	unixodbc-dev autoconf wxgtk-dev glu-dev"
subpackages="$pkgname-dev
	$pkgname-asn1:asn
	$pkgname-common-test:common_test
	$pkgname-compiler:compiler
	$pkgname-crypto:crypto
	$pkgname-debugger:debugger
	$pkgname-dialyzer:dialyzer
	$pkgname-diameter:diameter
	$pkgname-edoc:edoc
	$pkgname-eldap:eldap
	$pkgname-erl-docgen:erl_docgen
	$pkgname-erl-interface:erl_interface
	$pkgname-erts:erts
	$pkgname-et:et
	$pkgname-eunit:eunit
	$pkgname-hipe:hipe
	$pkgname-inets:inets
	$pkgname-jinterface:jinterface
	$pkgname-kernel:kernel
	$pkgname-megaco:megaco
	$pkgname-mnesia:mnesia
	$pkgname-observer:observer
	$pkgname-odbc:odbc
	$pkgname-os-mon:os_mon
	$pkgname-parsetools:parsetools
	$pkgname-public-key:public_key
	$pkgname-reltool:reltool
	$pkgname-runtime-tools:runtime_tools
	$pkgname-sasl:sasl
	$pkgname-snmp:snmp
	$pkgname-ssh:ssh
	$pkgname-ssl:ssl
	$pkgname-stdlib:stdlib
	$pkgname-syntax-tools:syntax_tools
	$pkgname-tftp:tftp
	$pkgname-tools:tools
	$pkgname-wx:wx
	$pkgname-xmerl:xmerl"
source="https://github.com/erlang/otp/archive/OTP-$pkgver.tar.gz
	0005-Do-not-install-nteventlog-and-related-doc-files-on-n.patch
	0010-fix-nteventlog-remove.patch"

builddir="$srcdir/otp-OTP-$pkgver"

build() {
	export CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
	export PATH="/usr/lib/jvm/java-1.8-openjdk/bin:$PATH"

	./otp_build autoconf
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--host="$CHOST" \
		--build="$CBUILD" \
		--enable-threads \
		--enable-shared-zlib \
		--enable-ssl=dynamic-ssl-lib
	make
}

check() {
	ERL_TOP="$builddir" make release_tests
}

package() {
	make DESTDIR="$pkgdir" install
}

_mv_erlang_lib() {
	local lib=$1
	case "$depends" in
		*$subpkgname*)  depends="";;
		*)      depends="$pkgname=$pkgver-r$pkgrel";;
	esac

	mkdir -p "$subpkgdir"/usr/lib/erlang/lib
	rm -f "$pkgdir"/usr/lib/erlang/lib/$lib-*/src/*.erl
	mv "$pkgdir"/usr/lib/erlang/lib/$lib-* "$subpkgdir"/usr/lib/erlang/lib/
}

asn() { _mv_erlang_lib asn1; depends="$depends erlang-crypto"; }
common_test() { _mv_erlang_lib common_test; depends="$depends erlang-xmerl"; }
compiler() { _mv_erlang_lib compiler; depends="$depends erlang-syntax-tools erlang-parsetools erlang-erl-interface"; }
crypto() { _mv_erlang_lib crypto; }
debugger() { _mv_erlang_lib debugger; }
dialyzer() { _mv_erlang_lib dialyzer; }
diameter() { _mv_erlang_lib diameter; }
edoc() { _mv_erlang_lib edoc; }
eldap() { _mv_erlang_lib eldap; }
erl_docgen() { _mv_erlang_lib erl_docgen; }
erl_interface() { _mv_erlang_lib erl_interface; }
erts() { _mv_erlang_lib erts; }
et() { _mv_erlang_lib et; }
eunit() { _mv_erlang_lib eunit; depends="$depends erlang-common-test"; }
hipe() { _mv_erlang_lib hipe; }
ic() { _mv_erlang_lib ic; }
inets() { _mv_erlang_lib inets; }
jinterface() { _mv_erlang_lib jinterface; }
kernel() { _mv_erlang_lib kernel; }
megaco() { _mv_erlang_lib megaco; }
mnesia() { _mv_erlang_lib mnesia; }
observer() { _mv_erlang_lib observer; }
odbc() { _mv_erlang_lib odbc; }
orber() { _mv_erlang_lib orber; }
os_mon() { _mv_erlang_lib os_mon; }
parsetools() { _mv_erlang_lib parsetools; }
public_key() { _mv_erlang_lib public_key; depends="$depends erlang-asn1"; }
reltool() { _mv_erlang_lib reltool; }
runtime_tools() { _mv_erlang_lib runtime_tools; }
sasl() { _mv_erlang_lib sasl; depends="$depends erlang-inets"; }
snmp() { _mv_erlang_lib snmp; depends="$depends erlang-inets"; }
ssh() { _mv_erlang_lib ssh; depends="$depends erlang-public-key erlang-inets"; }
ssl() { _mv_erlang_lib ssl; depends="$depends erlang-public-key erlang-inets"; }
stdlib() { _mv_erlang_lib stdlib; }
syntax_tools() { _mv_erlang_lib syntax_tools; }
tftp() { _mv_erlang_lib tftp; }
tools() { _mv_erlang_lib tools; }
wx() { _mv_erlang_lib wx; }
xmerl() { _mv_erlang_lib xmerl; }

dev() {
	set -x
	local i=''
	depends="$pkgname=$pkgver-r$pkgrel $depends_dev"
	pkgdesc="$pkgdesc (development files)"

	cd "$pkgdir"
	local libdirs=usr/
	[ -d lib/ ] && libdirs="lib/ $libdirs"
	for i in usr/include usr/lib/pkgconfig usr/share/aclocal\
		usr/share/gettext usr/bin/*-config		\
		usr/share/vala/vapi usr/share/gir-[0-9]*	\
		usr/share/qt*/mkspecs				\
		usr/lib/qt*/mkspecs				\
		usr/lib/cmake					\
		$(find . -name include -type d)			\
		$(find $libdirs -name '*.[acho]'		\
		-o -name '*.prl' 2>/dev/null); do
			if [ -e "$pkgdir/$i" ] || [ -L "$pkgdir/$i" ]; then
				d="$subpkgdir/${i%/*}"  # dirname $i
				mkdir -p "$d"
				mv "$pkgdir/$i" "$d"
				rmdir "$pkgdir/${i%/*}" 2>/dev/null || true
			fi
		done

		# move *.so links needed when linking the apps to -dev packages
		for i in lib/*.so usr/lib/*.so; do
			if [ -L "$i" ]; then
				mkdir -p "$subpkgdir"/"${i%/*}"
				mv "$i" "$subpkgdir/$i"
			fi
		done
	}


sha512sums="1746acd526eda37c769b70bba1ad0f73ee1e658d05d0cbbe4063f34c11f8061932b2cde04df725537f5c5b81b537897ada2f0f9b6b18b7554b0f7596c492906b  OTP-22.2.7.tar.gz
6a711e25b55816527c0a793e45dafb9a95b0a20fa537f8e03fb918e0137f1b1f60e414861a7005b8230a72e3e2f5e0caedb054a6c492b6f6f859ddbad47d2175  0005-Do-not-install-nteventlog-and-related-doc-files-on-n.patch
dbbc05908cd4b1a3842ff32afcef8a0621b1ec532e83d70fed4ee9263b3f82afc0d173c7a7c776196c8f54c2ab2bca3c9ce35da676dedd5802dbc23111525577  0010-fix-nteventlog-remove.patch"