summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD38
-rw-r--r--openlibm_mingw64.patch12
3 files changed, 68 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..402238bff20
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = mingw-w64-openlibm
+ pkgdesc = High quality system independent, portable, open source libm implementation (mingw-w64)
+ pkgver = 0.7.0
+ pkgrel = 1
+ url = http://www.openlibm.org
+ arch = any
+ license = GPL
+ depends = mingw-w64-crt
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ source = https://github.com/JuliaMath/openlibm/archive/v0.7.0.tar.gz
+ source = openlibm_mingw64.patch
+ sha256sums = 1699f773198018b55b12631db9c1801fe3ed191e618a1ee1be743f4570ae06a3
+ sha256sums = c5bdddd295963c15dc67747f489c618eb107fb3877fd6987fbeed4ec2f2f44f4
+
+pkgname = mingw-w64-openlibm
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..a7fa8b07f7c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,38 @@
+# Maintainer: Bogdan Burlacu <bogdan.burlacu@pm.me>
+
+pkgname=mingw-w64-openlibm
+pkgver=0.7.0
+pkgrel=1
+pkgdesc="High quality system independent, portable, open source libm implementation (mingw-w64)"
+arch=('any')
+url="http://www.openlibm.org"
+license=('GPL')
+depends=('mingw-w64-crt')
+options=('!strip' '!buildflags' 'staticlibs')
+source=("https://github.com/JuliaMath/openlibm/archive/v${pkgver}.tar.gz" "openlibm_mingw64.patch")
+sha256sums=('1699f773198018b55b12631db9c1801fe3ed191e618a1ee1be743f4570ae06a3' 'c5bdddd295963c15dc67747f489c618eb107fb3877fd6987fbeed4ec2f2f44f4')
+
+# only x64 since the lib didn't build for other configs
+_architectures="x86_64-w64-mingw32"
+
+prepare() {
+ cd "${srcdir}/openlibm-$pkgver/"
+ patch --forward --strip=1 --input="${srcdir}/openlibm_mingw64.patch"
+ sed -e 's|/usr/local||' -i Make.inc
+}
+
+build() {
+ cd "${srcdir}/openlibm-$pkgver/"
+ for _arch in ${_architectures}; do
+ ${_arch}-make USEGCC=1
+ done
+}
+
+package() {
+ for _arch in ${_architectures}; do
+ cd "${srcdir}/openlibm-$pkgver/"
+ ${_arch}-make DESTDIR="${pkgdir}"/usr/"/${_arch}" install
+ ${_arch}-strip --strip-unneeded "$pkgdir"/usr/"${_arch}"/bin/*.dll
+ ${_arch}-strip -g "$pkgdir"/usr/"${_arch}"/lib/*.a
+ done
+}
diff --git a/openlibm_mingw64.patch b/openlibm_mingw64.patch
new file mode 100644
index 00000000000..2eeea53598c
--- /dev/null
+++ b/openlibm_mingw64.patch
@@ -0,0 +1,12 @@
+diff --unified --recursive --text --color openlibm-0.7.0/Make.inc openlibm-0.7.0.new/Make.inc
+--- openlibm-0.7.0/Make.inc 2019-12-10 03:43:44.000000000 +0100
++++ openlibm-0.7.0.new/Make.inc 2020-01-24 10:26:02.822334200 +0100
+@@ -3,7 +3,7 @@
+ # Default build rule for any Makefile in this project: all
+ default: all
+
+-OS := $(shell uname)
++OS := WINNT
+ # Do not forget to bump SOMINOR when changing VERSION,
+ # and SOMAJOR when breaking ABI in a backward-incompatible way
+ VERSION = 0.7.0