git » sfml.git » main » tree

[main] / PKGBUILD

# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Ondrej Martinak <omartinak@gmail.com>

pkgname=sfml
pkgver=3.0.0
pkgrel=1
pkgdesc='A simple, fast, cross-platform, and object-oriented multimedia API'
arch=('x86_64')
url='http://www.sfml-dev.org/'
license=('Zlib')
depends=('libsndfile' 'libxrandr' 'glew' 'freetype2' 'libx11' 'libxcursor' 'libxi')
makedepends=('mesa' 'cmake' 'doxygen' 'systemd' 'ninja')
provides=('libsfml-window.so' 'libsfml-network.so' 'libsfml-system.so'
          'libsfml-audio.so' 'libsfml-graphics.so')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/SFML/SFML/archive/${pkgver}.tar.gz)
sha512sums=('116b934950b02639aa0924cdf6ceaf34518be7f94037e77e52f374aa0a03403487ef58384137569d930961c7d65291a7f0bbddcf1eaf4260086f49afbfae1f27')

build() {
  export CXXFLAGS+=" -ffat-lto-objects"

  cmake \
    -B build \
    -S SFML-${pkgver} \
    -G Ninja \
    -DBUILD_SHARED_LIBS=ON \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DSFML_USE_SYSTEM_DEPS=ON \
    -DSFML_BUILD_EXAMPLES=ON \
    -DSFML_BUILD_DOC=ON \
    -DSFML_INSTALL_PKGCONFIG_FILES=ON
  ninja -C build
  ninja -C build doc
}

package() {
  DESTDIR="$pkgdir/" ninja -C build install

  install -Dm644 SFML-${pkgver}/license.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}