git: bf203e5214d0 - main - lang/ghc98: fix build on powerpc64

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Thu, 24 Sep 2026 12:54:09 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bf203e5214d056e93a113943089bf4590e365d29

commit bf203e5214d056e93a113943089bf4590e365d29
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-09-16 06:40:43 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-09-24 12:53:30 +0000

    lang/ghc98: fix build on powerpc64
    
    Needs its own hadrian bootstrap and a patch that was already
    committed for newer versions.
---
 lang/ghc/Makefile                                             |  6 ++++++
 lang/ghc/distinfo                                             |  2 ++
 .../files/patch-m4_fptools__set__haskell__platform__vars.m4   | 11 +++++++++++
 3 files changed, 19 insertions(+)

diff --git a/lang/ghc/Makefile b/lang/ghc/Makefile
index 99d883d44814..10f02c31bb4a 100644
--- a/lang/ghc/Makefile
+++ b/lang/ghc/Makefile
@@ -159,6 +159,12 @@ BOOT_GHC_VERSION=       9.6.7
 HADRIAN_BOOT_TARBALL=   hadrian-9.6.7-boot-powerpc64le.tar.gz
 .endif
 
+# 9.8.4 big-endian: the 9.8.4 hadrian boot tarball vendors os-string 2.0.2.1,
+# whose byteswap mistypes on BE; use a variant with the fixed os-string.
+.if ${ARCH} == powerpc64 && ${GHC_VERSION} == 9.8.4
+HADRIAN_BOOT_TARBALL=   hadrian-9.8.4-boot-powerpc64.tar.gz
+.endif
+
 pre-configure:
 # Call the bootstrap script
 	cd ${WRKSRC} && ./boot.source
diff --git a/lang/ghc/distinfo b/lang/ghc/distinfo
index 322d9ae75abd..1fe37fd3e1cb 100644
--- a/lang/ghc/distinfo
+++ b/lang/ghc/distinfo
@@ -13,6 +13,8 @@ SHA256 (hadrian-9.10.3-boot.tar.gz) = a1faeba153b2a6d18882e750727284cbb560ee5764
 SIZE (hadrian-9.10.3-boot.tar.gz) = 1451082
 SHA256 (hadrian-9.8.4-boot.tar.gz) = 2fb02cce43603552387a241ece60a656fb8f4c97a9001134fd1c43f37e20906e
 SIZE (hadrian-9.8.4-boot.tar.gz) = 1582315
+SHA256 (hadrian-9.8.4-boot-powerpc64.tar.gz) = af9c35771e0077fc4dab3f5146bba5028c8e7167bdd159bb84fe1c9772360ef5
+SIZE (hadrian-9.8.4-boot-powerpc64.tar.gz) = 1574275
 SHA256 (hadrian-9.6.7-boot.tar.gz) = f81dc59b4aef59c62c645da7be0b1fb8720aba338c80004963a99bc1219d3a05
 SIZE (hadrian-9.6.7-boot.tar.gz) = 1495514
 SHA256 (hadrian-9.4.8-boot.tar.gz) = 5eb060655686921b086645dcbdd6268f09bc66baf8cc76fce74dea9b8b55ab5d
diff --git a/lang/ghc98/files/patch-m4_fptools__set__haskell__platform__vars.m4 b/lang/ghc98/files/patch-m4_fptools__set__haskell__platform__vars.m4
new file mode 100644
index 000000000000..36832c982dd3
--- /dev/null
+++ b/lang/ghc98/files/patch-m4_fptools__set__haskell__platform__vars.m4
@@ -0,0 +1,11 @@
+--- m4/fptools_set_haskell_platform_vars.m4.orig	2026-09-15 00:00:00 UTC
++++ m4/fptools_set_haskell_platform_vars.m4
+@@ -15,7 +15,7 @@
+             test -z "[$]2" || eval "[$]2=ArchPPC"
+             ;;
+         powerpc64)
+-            test -z "[$]2" || eval "[$]2=\"ArchPPC_64 ELF_V1\""
++            test -z "[$]2" || eval "[$]2=\"ArchPPC_64 ELF_V2\""
+             ;;
+         powerpc64le)
+             test -z "[$]2" || eval "[$]2=\"ArchPPC_64 ELF_V2\""