Skip to content

Instantly share code, notes, and snippets.

@ant32
Created July 3, 2013 23:29
Show Gist options
  • Save ant32/5923758 to your computer and use it in GitHub Desktop.
Save ant32/5923758 to your computer and use it in GitHub Desktop.
mingw-w64-qt5-serialport PKGBUILD
# Maintainer: Philip A Reimer <antreimer@gmail.com>
_qt_module=qtserialport
pkgname="mingw-w64-qt5-serialport"
pkgver="5.1.0"
pkgrel=1
arch=('any')
pkgdesc="Qt5 for Windows -- QtSerialPort module (mingw-w64)"
depends=('mingw-w64-qt5-qtbase')
makedepends=('mingw-w64-gcc')
options=('!strip' '!buildflags')
license=('LGPL')
url="http://qt-project.org/wiki/QtSerialPort"
_pkgfqn="${_qt_module}-opensource-src-$pkgver"
source=("http://download.qt-project.org/official_releases/qt/5.1/$pkgver/submodules/qtserialport-opensource-src-$pkgver.tar.gz")
md5sums=('02185870d798c7fc3cfcb65152af3142')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
build() {
cd ${srcdir}/${_pkgfqn}
for _arch in ${_architectures}; do
mkdir -p build-${_arch}/include/QtSerialPort && pushd build-${_arch}
${_arch}-qmake-qt5 ../${_qt_module}.pro
make
popd
done
}
package() {
cd ${srcdir}/${_pkgfqn}
for _arch in ${_architectures}; do
pushd build-${_arch}
make INSTALL_ROOT=$pkgdir install
# Rename the .a files to .dll.a as they're actually import libraries and not static libraries
for FN in ${pkgdir}/usr/${_arch}/lib/*.a
do
FN_NEW=$(echo $FN | sed s/'.a$'/'.dll.a'/)
mv $FN $FN_NEW
done
# The .dll's are installed in both bindir and libdir
# One copy of the .dll's is sufficient
rm -f ${pkgdir}/usr/${_arch}/lib/*.dll
${_arch}-strip --strip-unneeded ${pkgdir}/usr/${_arch}/bin/*.dll
${_arch}-strip --strip-unneeded ${pkgdir}/usr/${_arch}/lib/*.dll.a
popd
done
# .prl files aren't interesting for us
find ${pkgdir} -name "*.prl" -delete
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment