diff options
author | Emil Velikov <emil.l.velikov@gmail.com> | 2014-07-22 21:07:42 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2014-11-09 21:37:15 +0000 |
commit | 85c5601a7f149dfdbadbd191332870421b60de63 (patch) | |
tree | 28d305f5e5ccd6562d431de8c333c0be3fe86e7c /pkg | |
parent | ba586e7e8fcc4536d633f9ef74046474b9837856 (diff) |
pkg/archlinux: add mingw-w64-waffle package
- Remove explicit build options (waffle has autodetection).
- Correct the destination directories.
- Bump mingw64-crt requirement 3.1.0-3 (fixes the strerror_s issue).
- Build twice - once for cross-builds and second time for win32 usage.
TODO:
- Get CPack to amend the install prefix - fix the "build twice" issue.
- Strip some/all of the binaries ?
- Current package works of a local git repo. Rename to -git or
convert to a release one ?
v2:
- Use single leading underscore for local variables.
- Read user _srcroot if available.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/archlinux/mingw-w64-waffle/PKGBUILD | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/pkg/archlinux/mingw-w64-waffle/PKGBUILD b/pkg/archlinux/mingw-w64-waffle/PKGBUILD new file mode 100644 index 0000000..c563948 --- /dev/null +++ b/pkg/archlinux/mingw-w64-waffle/PKGBUILD @@ -0,0 +1,86 @@ +# Maintainer: Chad Versace <chad.versace@linux.intel.com> + +pkgname='mingw-w64-waffle' +pkgver='1.3.0' +pkgrel=1 +pkgdesc='a library for choosing window system and OpenGL API at runtime (mingw-w64)' +arch=('any') +url='http://waffle-gl.github.io' +license=('BSD') + +depends=( + 'mingw-w64-crt>=3.1.0-3' + ) +makedepends=( + 'mingw-w64-cmake' + + # For building the docs. +# XXX: Add as soon as we enable docs/manpages +# 'libxslt' +# 'docbook-xsl' + + ) + +options=('!strip' '!buildflags' 'staticlibs') +_architectures="i686-w64-mingw32 x86_64-w64-mingw32" + +if [[ ! -v _srcroot ]]; then + msg "Environment variable _srcroot is unset" + msg "Fall back to using git worktree for _srcroot ..." + _srcroot="$(git rev-parse --show-toplevel)" || exit + msg "Using _srcroot=$_srcroot" +fi + +build() { + unset LDFLAGS + cd "${_srcroot}" + msg "Building mingw-w64-waffle for cross-building" + for _arch in ${_architectures}; do + mkdir -p build-${_arch} && pushd build-${_arch} + ${_arch}-cmake .. \ + -DCMAKE_INSTALL_PREFIX=/usr/${_arch} \ + -DCMAKE_INSTALL_LIBDIR=/usr/${_arch}/lib \ + -DCMAKE_BUILD_TYPE=Release \ + \ + -Dwaffle_build_tests=0 \ + -Dwaffle_build_manpages=0 \ + -Dwaffle_build_htmldocs=0 \ + -Dwaffle_build_examples=1 + make + popd + done + + # There should be a better way to do this + msg "Building mingw-w64-waffle for native builds" + for _arch in ${_architectures}; do + mkdir -p "build-${_arch}-win" && pushd "build-${_arch}-win" + ${_arch}-cmake .. \ + -DCMAKE_INSTALL_PREFIX="" \ + -DCMAKE_INSTALL_LIBDIR="lib" \ + -DCMAKE_BUILD_TYPE=Release \ + \ + -Dwaffle_build_tests=0 \ + -Dwaffle_build_manpages=0 \ + -Dwaffle_build_htmldocs=0 \ + -Dwaffle_build_examples=1 + make + popd + done +} + +package() { + for _arch in ${_architectures}; do + cd "${_srcroot}/build-${_arch}" + make DESTDIR="${pkgdir}" install +# ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll +# ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a + done + + for _arch in ${_architectures}; do + cd "${_srcroot}/build-${_arch}-win" + # Create Windows zip archives + make package + done +} + +# vim:set ts=2 sw=2 et: |