PKGBUILDs/community/glm/PKGBUILD
2019-02-25 19:31:30 +00:00

53 lines
1.8 KiB
Bash

# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Peter Hatina <phatina AT gmail.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - revert upstream commit to fix 32-bit FTBFS in dependent packages (projectm)
# https://github.com/g-truc/glm/issues/832
pkgname=glm
pkgver=0.9.9.3
pkgrel=1.1
pkgdesc="C++ mathematics library for 3D software based on the OpenGL Shading Language (GLSL) specification"
arch=('any')
license=('MIT')
url="http://glm.g-truc.net"
makedepends=('cmake' 'dos2unix')
source=("https://github.com/g-truc/glm/releases/download/${pkgver}/glm-${pkgver}.zip"
'0001-Revert-Tentative-fix-constexpr-with-GCC.patch')
sha512sums=('eb7589345eb627d9fda84771bd2cf3eb0e4e9e48bf6bb7490bd8844b66558717de5dc96cde9d66e81f7ba4e54090f18dbe1bbccb2452ed0ed8c17cdf7b6e4aa2'
'ced41fa8de18b97776aff4b53bd4d907a56af13fd412a282aaa22f067e0b65d82c62ca145257924405cfb762f446b833403767e1c5ef425c57cc7530b7c0c84d')
prepare() {
cd $pkgname
dos2unix glm/detail/setup.hpp
patch -p1 -i ../0001-Revert-Tentative-fix-constexpr-with-GCC.patch
}
package() {
cd $pkgname
mkdir build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib
make DESTDIR=$pkgdir install
cd ..
mkdir -p $pkgdir/usr/share/doc
cp -r doc $pkgdir/usr/share/doc/glm
find $pkgdir -type f -exec chmod 644 {} \;
find $pkgdir -type d -exec chmod 755 {} \;
# Fix https://bugs.archlinux.org/task/52501
sed -i \
"s/PACKAGE_VERSION_UNSUITABLE TRUE/PACKAGE_VERSION_UNSUITABLE FALSE/g" \
$pkgdir/usr/lib/cmake/glm/glmConfigVersion.cmake
# GCC 7.3 fix
sed -i "s/(__GNUC__ == 7) && (__GNUC_MINOR__ == 2)/(__GNUC__ == 7) \&\& (__GNUC_MINOR__ >= 2)/" $pkgdir/usr/include/glm/simd/platform.h
}