APKBUILD 6.84 KB
Newer Older
John Regan's avatar
John Regan committed
1
# Contributor: Michael Mason <ms13sp@gmail.com>
2
# Maintainer: Marlus Saraiva <marlus.saraiva@gmail.com>
John Regan's avatar
John Regan committed
3 4

pkgname=erlang
5 6
pkgver=19.1.0
_srcver=19.1
7
pkgrel=2
John Regan's avatar
John Regan committed
8 9
pkgdesc="General-purpose programming language and runtime environment"
url="http://www.erlang.org/"
10
license="ASL 2.0"
John Regan's avatar
John Regan committed
11 12
arch="all"
depends="$pkgname-kernel $pkgname-stdlib $pkgname-compiler"
13
makedepends="perl-dev zlib-dev ncurses-dev libressl-dev openjdk7 unixodbc-dev"
John Regan's avatar
John Regan committed
14 15 16 17 18 19 20
subpackages="$pkgname-dev
             $pkgname-asn1:asn
	     $pkgname-common-test:common_test
	     $pkgname-compiler:compiler
	     $pkgname-cosevent:cos_event
	     $pkgname-coseventdomain:cos_event_domain
	     $pkgname-cosfiletransfer:cos_file_transfer
21
	     $pkgname-cosnotification:cos_notification
John Regan's avatar
John Regan committed
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
	     $pkgname-cosproperty:cos_property
	     $pkgname-costime:cos_time
	     $pkgname-costransaction:cos_transactions
	     $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-gs:gs
	     $pkgname-hipe:hipe
	     $pkgname-ic:ic
	     $pkgname-inets:inets
	     $pkgname-jinterface:jinterface
	     $pkgname-kernel:kernel
	     $pkgname-megaco:megaco
	     $pkgname-mnesia:mnesia
	     $pkgname-observer:observer
	     $pkgname-odbc:odbc
	     $pkgname-orber:orber
	     $pkgname-os-mon:os_mon
	     $pkgname-otp-mibs:otp_mibs
	     $pkgname-parsetools:parsetools
	     $pkgname-percept:percept
	     $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-tools:tools
	     $pkgname-typer:typer
	     $pkgname-xmerl:xmerl"
63 64
source="http://www.erlang.org/download/otp_src_$_srcver.tar.gz
        0005-Do-not-install-nteventlog-and-related-doc-files-on-n.patch
65
        0010-fix-nteventlog-remove.patch"
John Regan's avatar
John Regan committed
66

67
builddir="$srcdir/otp_src_$_srcver"
John Regan's avatar
John Regan committed
68 69

prepare() {
70 71 72
	default_prepare || return 1

	cd "$builddir"
73
	rm lib/os_mon/ebin/*
John Regan's avatar
John Regan committed
74 75 76
}

build() {
77
	cd "$builddir"
John Regan's avatar
John Regan committed
78 79 80 81 82 83 84 85 86 87 88
	export CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
	export PATH="/usr/lib/jvm/java-1.7-openjdk/bin:$PATH"
	./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 \
Marlus Saraiva's avatar
Marlus Saraiva committed
89
		--disable-hipe \
John Regan's avatar
John Regan committed
90 91 92 93 94
		|| return 1
	make -j1 || return 1
}

package() {
95
	cd "$builddir"
John Regan's avatar
John Regan committed
96 97 98 99 100 101
	make -j1 DESTDIR="$pkgdir" install || return 1
	rm -rf "$pkgdir"/usr/lib/erlang/lib/wx-*
}

_mv_erlang_lib() {
	local lib=$1
102 103 104 105
	case "$depends" in
	*$subpkgname*)	depends="";;
	*)		depends="$pkgname=$pkgver-r$pkgrel";;
	esac
John Regan's avatar
John Regan committed
106 107

	mkdir -p "$subpkgdir"/usr/lib/erlang/lib
108
        rm -f "$pkgdir"/usr/lib/erlang/lib/$lib-*/src/*.erl
109
	mv "$pkgdir"/usr/lib/erlang/lib/$lib-* "$subpkgdir"/usr/lib/erlang/lib/
John Regan's avatar
John Regan committed
110 111
}

112 113 114 115 116 117
asn() { _mv_erlang_lib asn1; }
common_test() { _mv_erlang_lib common_test; }
compiler() { _mv_erlang_lib compiler; }
cos_event() { _mv_erlang_lib cosEvent; }
cos_event_domain() { _mv_erlang_lib cosEventDomain; }
cos_file_transfer() { _mv_erlang_lib cosFileTransfer; }
118
cos_notification() { _mv_erlang_lib cosNotification; }
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
cos_property() { _mv_erlang_lib cosProperty; }
cos_time() { _mv_erlang_lib cosTime; }
cos_transactions() { _mv_erlang_lib cosTransactions; }
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; }
gs() { _mv_erlang_lib gs; }
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; }
otp_mibs() { _mv_erlang_lib otp_mibs; }
parsetools() { _mv_erlang_lib parsetools; }
percept() { _mv_erlang_lib percept; }
public_key() { _mv_erlang_lib public_key; }
reltool() { _mv_erlang_lib reltool; }
runtime_tools() { _mv_erlang_lib runtime_tools; }
sasl() { _mv_erlang_lib sasl; }
snmp() { _mv_erlang_lib snmp; }
ssh() { _mv_erlang_lib ssh; }
ssl() { _mv_erlang_lib ssl; }
stdlib() { _mv_erlang_lib stdlib; }
syntax_tools() { _mv_erlang_lib syntax_tools; }
tools() { _mv_erlang_lib tools; }
typer() { _mv_erlang_lib typer; }
xmerl() { _mv_erlang_lib xmerl; }
John Regan's avatar
John Regan committed
160 161

dev() {
162
	set -x
John Regan's avatar
John Regan committed
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
	local i= j=
	depends="$pkgname=$pkgver-r$pkgrel $depends_dev"
	pkgdesc="$pkgdesc (development files)"

	cd "$pkgdir" || return 0
	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"
183
			rmdir "$pkgdir/${i%/*}" 2>/dev/null || true
John Regan's avatar
John Regan committed
184 185 186 187 188 189 190 191 192 193 194
		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" || return 1
		fi
	done
	return 0
}
195

John Regan's avatar
John Regan committed
196

197
md5sums="19dfbc2042e6dd40bf281e7ca2d49d43  otp_src_19.1.tar.gz
198
f4aa0cc27dc57ea4dcd57191b1948a4d  0005-Do-not-install-nteventlog-and-related-doc-files-on-n.patch
199 200
0dd300003ff68fc46dc3c839c2541d53  0010-fix-nteventlog-remove.patch"
sha256sums="fed4cbbc1ee5cc8efc2b8f14c3db97bfde1de967703f5f9a95f8ab6852737e23  otp_src_19.1.tar.gz
201
71c8a55fe036d5a04ba2c008b51d8950c3f18d83edaffb9bef2a9d19dd2f79f3  0005-Do-not-install-nteventlog-and-related-doc-files-on-n.patch
202 203
019c62ea3fee60068caa8c3152d7f96e76591fc5dc096abfcea48ec1593eb758  0010-fix-nteventlog-remove.patch"
sha512sums="bd1c243393c867c91768367613aedb40d56889add149390c81f22e022e76b716d6e9a4d5db7e6477ceb1216c26c18c962abdfd8215a87420758f5ef2063b9714  otp_src_19.1.tar.gz
204
923addcb1f6472829ba13ccc91ad3cef161f269478404f0a19bc4997118e06edd7459011a60769eb393eac930f30d4bd6c5526301382a5f9815862237f4664d3  0005-Do-not-install-nteventlog-and-related-doc-files-on-n.patch
205
b7387f92f8c27a0565c7885bba4b357183c62d422616e073bc5ffad338a0e22cb5165dcb3b95bf0b920ba00831599f2216027883f4be255aa6f6150b68b7a37c  0010-fix-nteventlog-remove.patch"