mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-12 05:04:45 +08:00
60 lines
1.6 KiB
Bash
60 lines
1.6 KiB
Bash
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
|
|
# Contributor: Peter Hatina <phatina AT gmail.com>
|
|
pkgname=glm
|
|
pkgver=0.9.8.5
|
|
pkgrel=2
|
|
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' 'clang')
|
|
source=("https://github.com/g-truc/glm/releases/download/${pkgver}/glm-${pkgver}.zip")
|
|
md5sums=('456c9f54cf9da189733a74c173b840b5')
|
|
|
|
prepare() {
|
|
cd $pkgname
|
|
[[ ! -d build ]] && rm -rf build
|
|
mkdir build
|
|
}
|
|
|
|
build() {
|
|
export CXX=clang++
|
|
export CC=clang
|
|
cd $pkgname/build
|
|
|
|
cmake .. \
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
|
-DGLM_TEST_ENABLE=ON \
|
|
-DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON \
|
|
-DGLM_TEST_ENABLE_SIMD_SSE2=ON \
|
|
-DGLM_TEST_ENABLE_SIMD_SSE3=ON \
|
|
-DGLM_TEST_ENABLE_SIMD_AVX=ON \
|
|
-DGLM_TEST_ENABLE_SIMD_AVX2=ON
|
|
|
|
make
|
|
}
|
|
|
|
package() {
|
|
cd $pkgname/build
|
|
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 {} \;
|
|
|
|
install -Dm644 copying.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE
|
|
|
|
# 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
|
|
}
|