summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorPatrick Northon2021-04-28 09:00:01 -0400
committerPatrick Northon2021-04-28 09:00:01 -0400
commit2fae4f454933f4548e4c45e0f95adfc06271bf1f (patch)
tree6fb92715fa5b46105510b101bddec7c715309361 /PKGBUILD
downloadaur-2fae4f454933f4548e4c45e0f95adfc06271bf1f.tar.gz
Initial commit.
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD45
1 files changed, 45 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c5e5d086cd65
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: Patrick Northon <northon_patrick3@yahoo.ca>
+
+pkgname=mingw-w64-imath
+pkgver=3.0.1
+pkgrel=1
+pkgdesc="Imath is a basic, light-weight, and efficient C++ representation of 2D and 3D vectors and matrices and other simple but useful mathematical objects, functions and data types (mingw-w64)"
+url="https://github.com/AcademySoftwareFoundation/Imath"
+arch=(any)
+license=('BSD')
+depends=('mingw-w64-crt')
+makedepends=('mingw-w64-cmake' 'wine')
+options=('staticlibs' '!buildflags' '!strip')
+source=("https://github.com/AcademySoftwareFoundation/Imath/archive/refs/tags/v${pkgver}.tar.gz")
+sha256sums=("9cd984bb6b0a9572dd4a373b1fab60bc4c992a52ec5c68328fe0f48f194ba3c0")
+
+_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+_flags=( -Wno-dev -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG" )
+
+prepare() {
+ cd "Imath-${pkgver}"
+ sed -i -r 's/\$<TARGET_FILE:ImathTest>/\${CMAKE_CROSSCOMPILING_EMULATOR} \$<TARGET_FILE:ImathTest>/' 'src/ImathTest/CMakeLists.txt'
+}
+
+build() {
+ for _arch in ${_architectures}; do
+ ${_arch}-cmake -S "Imath-${pkgver}" -B "build-${_arch}" "${_flags[@]}" -DBUILD_TESTING=OFF
+ cmake --build "build-${_arch}"
+ done
+}
+
+check() {
+ for _arch in ${_architectures}; do
+ ${_arch}-cmake -S "Imath-${pkgver}" -B "build-${_arch}" "${_flags[@]}" -DBUILD_TESTING=ON
+ cmake --build "build-${_arch}"
+ cmake --build "build-${_arch}" --target test
+ done
+}
+
+package() {
+ for _arch in ${_architectures}; do
+ DESTDIR="${pkgdir}" cmake --install "build-${_arch}"
+ ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
+ ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
+ done
+}