diff --git a/binutils/mingw-w64-symlinks/PKGBUILD b/binutils/mingw-w64-symlinks/PKGBUILD new file mode 100644 index 00000000..6f96c330 --- /dev/null +++ b/binutils/mingw-w64-symlinks/PKGBUILD @@ -0,0 +1,65 @@ +# $Id: PKGBUILD 182460 2016-07-07 13:03:56Z spupykin $ +# Maintainer: Sergej Pupykin +# Maintainer: rubenvb vanboxem ruben gmail com + +# Same as official package but uses symlinks instead of hard links allowing +# installation when /usr/i686-w64-mingw32 and /usr/x86_64-w64-mingw32 are +# bound from another partition. + +_targets="i686-w64-mingw32 x86_64-w64-mingw32" + +pkgname=mingw-w64-binutils-symlinks +pkgver=2.27 +pkgrel=1 +pkgdesc="Cross binutils for the MinGW-w64 cross-compiler (uses symlinks instead of hard links)" +arch=('i686' 'x86_64') +url="http://www.gnu.org/software/binutils" +license=('GPL') +groups=('mingw-w64-toolchain' 'mingw-w64') +depends=('zlib') +provides=('mingw-w64-binutils') +conflicts=('mingw-w64-binutils') +options=('!libtool' '!emptydirs') +source=("http://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.gz") +md5sums=('41b053ed4fb2c6a8173ef421460fbb28') + +prepare() { + cd ${srcdir}/binutils-${pkgver} + #do not install libiberty + sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in + # hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS" + sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure +} + +build() { + for _target in $_targets; do + msg "Building ${_target} cross binutils" + mkdir -p ${srcdir}/binutils-${_target} && cd "${srcdir}/binutils-${_target}" + $srcdir/binutils-${pkgver}/configure --prefix=/usr \ + --target=${_target} \ + --infodir=/usr/share/info/${_target} \ + --enable-lto --enable-plugins \ + --disable-multilib --disable-nls \ + --disable-werror + make + done +} + +package() { + for _target in ${_targets}; do + msg "Installing ${_target} cross binutils" + cd ${srcdir}/binutils-${_target} + make DESTDIR=${pkgdir} install + done + cd "${pkgdir}/usr/bin" + for file in *; do + if [[ ! -L $file ]] && [[ ! -d $file ]]; then + local _arch="${file%*-w64-mingw32*}" + local _name="${file#*-w64-mingw32-}" + local _target="/usr/${_arch}-w64-mingw32/bin/${_name}" + if [[ -f ${pkgdir}/${_target} ]]; then + ln -sf "${_target}" "${file}" + fi + fi + done +}