about summary refs log tree commit diff
path: root/pkgs/tools/misc/hdf4
diff options
context:
space:
mode:
authorSteve Purcell <steve@sanityinc.com>2021-06-16 16:47:18 +1200
committerSteve Purcell <steve@sanityinc.com>2021-06-16 16:47:18 +1200
commit23e15940bcc59c7f00297d1c0f12e4c0210bee7b (patch)
tree12e694929d2e1d9de7d5e2b6d2c18cb0852b8c3d /pkgs/tools/misc/hdf4
parentca35dfd337d4bca2e3704953bfa081dbddf97034 (diff)
hdf4: fix build on aarch64-darwin
This resolves #126156 by preventing the headers from confusing Linux
aarch64 with Apple. The package's own tests work fine without further
changes.
Diffstat (limited to 'pkgs/tools/misc/hdf4')
-rw-r--r--pkgs/tools/misc/hdf4/darwin-aarch64.patch11
-rw-r--r--pkgs/tools/misc/hdf4/default.nix1
2 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/tools/misc/hdf4/darwin-aarch64.patch b/pkgs/tools/misc/hdf4/darwin-aarch64.patch
new file mode 100644
index 0000000000000..cff81e5811768
--- /dev/null
+++ b/pkgs/tools/misc/hdf4/darwin-aarch64.patch
@@ -0,0 +1,11 @@
+--- a/hdf/src/hdfi.h	2021-06-16 16:31:31.000000000 +1200
++++ b/hdf/src/hdfi.h	2021-06-16 16:42:26.000000000 +1200
+@@ -1343,7 +1343,7 @@
+ #endif /* IA64 */
+ 
+ /* Linux AArch64 */
+-#if defined __aarch64__
++#if defined __aarch64__ && !defined __APPLE__
+ 
+ #ifdef GOT_MACHINE
+ If you get an error on this line more than one machine type has been defined.
diff --git a/pkgs/tools/misc/hdf4/default.nix b/pkgs/tools/misc/hdf4/default.nix
index 5373c64d647c3..99acda6b78830 100644
--- a/pkgs/tools/misc/hdf4/default.nix
+++ b/pkgs/tools/misc/hdf4/default.nix
@@ -44,6 +44,7 @@ stdenv.mkDerivation rec {
       url = "https://src.fedoraproject.org/rpms/hdf/raw/edbe5f49646b609f5bc9aeeee5a2be47e9556e8c/f/hdf-aarch64.patch";
       sha256 = "112svcsilk16ybbsi8ywnxfl2p1v44zh3rfn4ijnl8z08vfqrvvs";
     })
+    ./darwin-aarch64.patch
   ];
 
   nativeBuildInputs = [