icu: split packages to icu and icu-debug-libs

This commit is contained in:
Ray Donnelly
2014-04-20 19:11:45 +01:00
parent 69daf8590c
commit c19181eee5
2 changed files with 81 additions and 20 deletions

View File

@@ -19,3 +19,15 @@
sprintf(cmd, "%s%s%s %s -o %s%s %s %s%s %s %s",
pkgDataFlags[GENLIB],
targetDir,
diff -urN icu/source/configure.ac.orig icu/source/configure.ac
--- icu/source/configure.ac.orig 2014-04-20 16:00:12.325064200 +0100
+++ icu/source/configure.ac 2014-04-20 16:05:49.914432600 +0100
@@ -1173,7 +1173,7 @@
if test "$ICULIBSUFFIX" != ""
then
U_HAVE_LIB_SUFFIX=1
- ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'`
+ ICULIBSUFFIXCNAME=`echo $ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'`
UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_HAVE_LIB_SUFFIX=1 -DU_LIB_SUFFIX_C_NAME=${ICULIBSUFFIXCNAME} "
else
U_HAVE_LIB_SUFFIX=0

View File

@@ -1,10 +1,11 @@
# Maintainer: Alexey Pavlov <Alexpux@gmail.com>
# Contributor: Ray Donnelly <mingw.android@gmail.com>
_realname=icu
_mingw_suff=mingw-w64-${CARCH}
pkgname=("${_mingw_suff}-${_realname}")
pkgname=("${_mingw_suff}-${_realname}" "${_mingw_suff}-${_realname}-debug-libs")
pkgver=53.1
pkgrel=3
pkgrel=4
arch=('any')
pkgdesc="International Components for Unicode library (mingw-w64)"
arch=('any')
@@ -12,6 +13,8 @@ url="http://www.icu-project.org/"
license=('custom:"icu"')
depends=("${_mingw_suff}-gcc-libs")
makedepends=("${_mingw_suff}-gcc")
# There's no point adding 'debug' to options as both
# debug and release packages are built regardless.
options=('!buildflags' 'staticlibs' 'strip')
source=("http://download.icu-project.org/files/icu4c/${pkgver}/icu4c-${pkgver//./_}-src.tgz"
0004-move-to-bin.mingw.patch
@@ -34,7 +37,7 @@ md5sums=('b73baa6fbdfef197608d1f69300919b9'
'ee93f131a132f7e65d11d15a467b7abc'
'35ece84824fc66f2833f9f4543616e8a'
'e191e78207b55da374b6a8200f48da5b'
'630eb32bd56cd97c258cb735c4a10ce0'
'd1accfbefbcd399a4a28a4a4e0737915'
'4e2272dc17e6cfd33f1dd1030f3f50ec')
prepare() {
cd "$srcdir/icu"
@@ -55,30 +58,76 @@ prepare() {
}
build() {
local -a extra_config
cd "$srcdir/icu/"
[ -d build-${CARCH} ] && rm -rf build-${CARCH}
cp -rf source build-${CARCH}
pushd build-${CARCH}
./configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--disable-rpath \
--enable-shared \
--enable-static
make
# For ICU we ignore the options for debug above and always
# build both debug and release (and static and shared).
# This is because ICU people want the debug libraries be
# suffixed with 'd' and e.g. Qt-Project go along with this
# (though only for the static variant, oddly, see:
# qtbase/config.tests/unix/icu/icu.pro
for _variant in debug release; do
[ -d build-${CARCH}-${_variant} ] && rm -rf build-${CARCH}-${_variant}
if [ "${_variant}" = "debug" ]; then
extra_config=( --enable-debug )
extra_config+=( --with-library-suffix=d )
else
extra_config=( --enable-release )
fi
cp -rf source build-${CARCH}-${_variant}
pushd build-${CARCH}-${_variant}
./configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--disable-rpath \
--enable-shared \
--enable-static \
"${extra_config[@]}"
make
popd
done
}
check() {
cd "$srcdir/icu/build-${CARCH}"
PATH=$srcdir/icu/build-${CARCH}/bin:$srcdir/icu/build-${CARCH}/lib:$PATH \
make V=1 -k check
for _variant in debug release; do
pushd "$srcdir/icu/build-${CARCH}-${_variant}"
PATH=$srcdir/icu/build-${CARCH}/bin:$srcdir/icu/build-${CARCH}/lib:$PATH \
make V=1 -k check
popd
done
}
package() {
cd "$srcdir/icu/build-${CARCH}"
package_icu() {
pushd "$srcdir/icu/build-${CARCH}-release"
make install DESTDIR="$pkgdir"
mv "${pkgdir}${MINGW_PREFIX}"/lib/*.dll "${pkgdir}${MINGW_PREFIX}"/bin/
mv "${pkgdir}${MINGW_PREFIX}"/bin/*.a "${pkgdir}${MINGW_PREFIX}"/lib/
}
package_icu-debug-libs() {
pushd "$srcdir/icu/build-${CARCH}-debug"
make install DESTDIR="$pkgdir"
mv "${pkgdir}${MINGW_PREFIX}"/lib/*.dll "${pkgdir}${MINGW_PREFIX}"/bin/
mv "${pkgdir}${MINGW_PREFIX}"/bin/*.a "${pkgdir}${MINGW_PREFIX}"/lib/
# Remove bits that are also in the main package.
# TODO :: Maybe move the pkg-config files to 'd' suffixed variants?
rm -rf "${pkgdir}${MINGW_PREFIX}"/{include,bin,sbin,share,lib/pkgconfig}
}
package_mingw-w64-i686-icu() {
package_icu
}
package_mingw-w64-i686-icu-debug-libs() {
package_icu-debug-libs
}
package_mingw-w64-x86_64-icu() {
package_icu
}
package_mingw-w64-x86_64-icu-debug-libs() {
package_icu-debug-libs
}