summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b8e03297855d6ea6fc073776d1cb38c529842c07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Maintainer: blindcrone <blindcrone@tuta.io>
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: otreblan <otreblain@gmail.com>
pkgname=mingw-w64-sfml-static
pkgver=2.6.1
pkgrel=4
pkgdesc="A simple, fast, cross-platform, and object-oriented multimedia API (mingw-w64)"
arch=(any)
url="https://www.sfml-dev.org"
license=("zlib")
depends=(mingw-w64-libsndfile mingw-w64-libjpeg-turbo mingw-w64-openal mingw-w64-glew mingw-w64-freetype2)
makedepends=(mingw-w64-cmake)
conflicts=(mingw-w64-sfml)
provides=(mingw-w64-sfml)
options=(staticlibs !strip !buildflags)
source=("https://github.com/SFML/SFML/archive/${pkgver}.tar.gz")
md5sums=('dbcd89cd92fa17050a9a1205207bd025')

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

build() {
  cd "$srcdir"/SFML-${pkgver}

  unset LDFLAGS
  for _arch in ${_architectures}; do
    mkdir -p "build-${_arch}" && pushd "build-${_arch}"
    ${_arch}-cmake --no-warn-unused-cli \
      -DCMAKE_BUILD_TYPE=Release \
      -DBUILD_SHARED_LIBS=0\
      -DSFML_USE_STATIC_STD_LIBS=1\
      -DFREETYPE_LIBRARY=/usr/${_arch}/lib/libfreetype.dll.a \
      -DGLEW_LIBRARY=/usr/${_arch}/lib/libglew32.dll.a \
      -DJPEG_LIBRARY=/usr/${_arch}/lib/libjpeg.dll.a \
      -DOPENAL_LIBRARY=/usr/${_arch}/lib/libOpenAL32.dll.a \
      -DSNDFILE_LIBRARY=/usr/${_arch}/lib/libsndfile.dll.a \
      -DSFML_INSTALL_PKGCONFIG_FILES=1\
      ..
    make
    popd
  done
}

package() {
  for _arch in ${_architectures}; do
    cd "$srcdir/SFML-${pkgver}/build-$_arch"
    make DESTDIR="$pkgdir" install
    find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
    find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' -exec ${_arch}-strip -g {} \;
    find "$pkgdir/usr/${_arch}" -name '*.txt' -delete
    rm "$pkgdir/usr/$_arch/bin/openal32.dll"
    rm "$pkgdir/usr/$_arch/lib/lib"{FLAC,freetype,ogg,openal32,vorbis,vorbisenc,vorbisfile}.a
  done
}