coreutils: fix cross compilation and manpages generation differently.

Rather than building a -doc subpkg that is only built in native builds,
build all utils in the host to be able to generate the manpages and then
install the result to DESTDIR.

This avoids and old and stupid issue while cross building base-system.

Close #1598
This commit is contained in:
Juan RP 2015-05-18 14:12:31 +02:00
parent bb6e956cc3
commit 2db304dc5a
2 changed files with 15 additions and 18 deletions

View file

@ -1 +0,0 @@
coreutils

View file

@ -4,7 +4,7 @@ version=8.23
revision=6
bootstrap=yes
makedepends="gmp-devel acl-devel libcap-devel"
replaces="chroot-coreutils>=0"
replaces="chroot-coreutils>=0 coreutils-doc>=0"
short_desc="The GNU core utilities"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://www.gnu.org/software/coreutils"
@ -17,6 +17,18 @@ if [ "$CHROOT_READY" ]; then
hostmakedepends="perl"
fi
pre_configure() {
# Build natively all utils for the host, we need this to generate
# the manpages via help2man.
if [ "$CROSS_BUILD" ]; then
CC=cc LD=ld AR=ar RANLIB=ranlib CFLAGS=-Os CXXFLAGS=-Os LDFLAGS= \
./configure --prefix=${wrksrc}/coreutils-${XBPS_MACHINE}
make ${makejobs}
make install
make distclean
fi
}
do_configure() {
if [ "$CROSS_BUILD" ]; then
configure_args+=" fu_cv_sys_stat_statfs2_bsize=no
@ -51,22 +63,8 @@ do_build() {
}
do_install() {
make DESTDIR=${DESTDIR} install
if [ "$CROSS_BUILD" ]; then
rm -rf ${DESTDIR}/usr/share/info
mv ${wrksrc}/coreutils-${XBPS_MACHINE}/share/man \
${DESTDIR}/usr/share
fi
}
if [ -z "$CROSS_BUILD" ]; then
coreutils-doc_package() {
noarch=yes
short_desc+=" - documentation files"
replaces="coreutils<8.20_4"
pkg_install() {
vmove usr/share/info
vmove usr/share/man
}
}
fi