diff options
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 19 | ||||
-rw-r--r-- | f16c_fix.patch | 23 |
3 files changed, 42 insertions, 4 deletions
@@ -1,12 +1,14 @@ pkgbase = half pkgdesc = Half-precision floating-point library pkgver = 2.1.0 - pkgrel = 2 + pkgrel = 3 url = http://half.sourceforge.net/ arch = x86_64 license = MIT source = half-2.1.0.zip::https://sourceforge.net/projects/half/files/half/2.1.0/half-2.1.0.zip/download + source = f16c_fix.patch sha256sums = ad1788afe0300fa2b02b0d1df128d857f021f92ccf7c8bddd07812685fa07a25 + sha256sums = 2f55340a7e2f654487a0ce6467068a142e00a1fa10a118c859a3cdba6070d8c6 pkgname = half @@ -1,15 +1,28 @@ # Maintainer: acxz <akashpatel2008 at yahoo dot com> pkgname=half pkgver=2.1.0 -pkgrel=2 +pkgrel=3 pkgdesc="Half-precision floating-point library" url="http://half.sourceforge.net/" arch=(x86_64) license=('MIT') makedepends=() depends=() -source=("${pkgname}-${pkgver}.zip::https://sourceforge.net/projects/${pkgname}/files/${pkgname}/${pkgver}/${pkgname}-${pkgver}.zip/download") -sha256sums=("ad1788afe0300fa2b02b0d1df128d857f021f92ccf7c8bddd07812685fa07a25") +source=( + "${pkgname}-${pkgver}.zip::https://sourceforge.net/projects/${pkgname}/files/${pkgname}/${pkgver}/${pkgname}-${pkgver}.zip/download" + "f16c_fix.patch" +) +sha256sums=( + "ad1788afe0300fa2b02b0d1df128d857f021f92ccf7c8bddd07812685fa07a25" + "2f55340a7e2f654487a0ce6467068a142e00a1fa10a118c859a3cdba6070d8c6" +) + +prepare() { + # Fix a bug in the half.hpp include file not enabling F16C intrinsics + # correctly when the architecture supports it + # https://github.com/acxz/pkgbuilds/issues/94 + patch -p0 ${srcdir}/include/half.hpp < f16c_fix.patch +} package() { mkdir -p ${pkgdir}/usr/include/half diff --git a/f16c_fix.patch b/f16c_fix.patch new file mode 100644 index 000000000000..6cd0b5c5315e --- /dev/null +++ b/f16c_fix.patch @@ -0,0 +1,23 @@ +--- upstream/half.hpp 2020-12-22 10:47:45.583725510 +0100 ++++ f16c_fix/half.hpp 2020-12-22 10:48:21.917419594 +0100 +@@ -266,10 +266,6 @@ + #if HALF_ENABLE_CPP11_HASH
+ #include <functional>
+ #endif
+-#if HALF_ENABLE_F16C_INTRINSICS
+- #include <immintrin.h>
+-#endif
+-
+
+ #ifndef HALF_ENABLE_F16C_INTRINSICS
+ /// Enable F16C intruction set intrinsics.
+@@ -280,6 +276,9 @@ + /// Unless predefined it will be enabled automatically when the `__F16C__` symbol is defined, which some compilers do on supporting platforms.
+ #define HALF_ENABLE_F16C_INTRINSICS __F16C__
+ #endif
++#if HALF_ENABLE_F16C_INTRINSICS
++ #include <immintrin.h>
++#endif
+
+ #ifdef HALF_DOXYGEN_ONLY
+ /// Type for internal floating-point computations.
|