aboutsummaryrefslogtreecommitdiff
path: root/srcpkgs/apr/template
blob: 3daedd9192800995a3a9cf9a9d9c58d1d84ff0c2 (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
# Template file for 'apr'
pkgname=apr
version=1.7.4
revision=1
build_style=gnu-configure
configure_args="--with-installbuilddir=/usr/share/apr-1/build"
makedepends="expat-devel libuuid-devel"
checkdepends="gdb iana-etc"
short_desc="Apache Portable Runtime Library"
maintainer="Orphaned <orphan@voidlinux.org>"
license="Apache-2.0"
homepage="https://apr.apache.org/"
distfiles="https://archive.apache.org/dist/apr/apr-${version}.tar.bz2"
checksum=fc648de983f3a2a6c9e78dea1f180639bd2fad6c06d556d4367a701fe5c35577

# Can't run test programs when cross compiling
# NOTE always diff between native and cross build!!!
if [ "$CROSS_BUILD" ]; then
	configure_args+=" apr_cv_pthreads_cflags=-pthread"
	configure_args+=" apr_cv_process_shared_works=yes"
	configure_args+=" apr_cv_mutex_robust_shared=yes"
	configure_args+=" apr_cv_tcp_nodelay_with_cork=yes"
	configure_args+=" ac_cv_func_sem_open=yes"
	configure_args+=" ac_cv_mmap__dev_zero=yes"
	configure_args+=" ac_cv_struct_rlimit=yes"
fi

# The apr package doesn't use crypt_r, however apr-util does,
# and apr-util uses the apr.h generated by apr's ./configure.
if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
	makedepends+=" libxcrypt-devel"
fi

do_check() {
	local _args
	cd test
	if [ "$XBPS_BUILD_ENVIRONMENT" = void-packages-ci ]; then
		sed -i 's/if BROKEN_IN_CI/if 0/' testsockets.c
		if [ "$XBPS_LIBC" = musl ]; then
			# unable to resolve back from 127.0.0.1
			_args="-x testsock"
		fi
	fi
	make ${makejobs}
	./testall ${_args}
}

post_install() {
	sed -i -e 's,-ffile-prefix-map=[^[:space:]]*,,' \
		"$DESTDIR/usr/share/apr-1/build/apr_rules.mk"
	if [ "$CROSS_BUILD" ]; then
		sed -i -e 's;cross_compiling=.*;cross_compiling=;' \
			"$DESTDIR/usr/bin/apr-1-config"
		sed -i -e "s,$XBPS_CROSS_BASE,,g" \
			"$DESTDIR/usr/share/apr-1/build/apr_rules.mk"
	fi
}

apr-devel_package() {
	depends="libtool libuuid-devel apr>=${version}_${revision}"
	if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
		depends+=" libxcrypt-devel"
	fi
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/bin
		vmove usr/share
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
		vmove "usr/lib/*.exp"
		vmove usr/lib/pkgconfig
		ln -sf ../../../bin/libtool "$PKGDESTDIR/usr/share/apr-1/build/"
	}
}