From 0951c87669338e1a0873b03d58f59f41b0da8ca8 Mon Sep 17 00:00:00 2001 From: pho Date: Mon, 23 Oct 2023 17:00:08 +0000 Subject: [PATCH] lang/ghc96: Fix some linkage issues --- lang/ghc96/Makefile | 3 ++- lang/ghc96/buildlink3.mk | 6 +++--- lang/ghc96/distinfo | 4 +++- ...ries_unix_System_Posix_Env_PosixString.hsc | 16 +++++++++++++++ ...patch-libraries_unix_System_Posix_User.hsc | 20 +++++++++++++++++++ 5 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 lang/ghc96/patches/patch-libraries_unix_System_Posix_Env_PosixString.hsc create mode 100644 lang/ghc96/patches/patch-libraries_unix_System_Posix_User.hsc diff --git a/lang/ghc96/Makefile b/lang/ghc96/Makefile index 8919a5ec42ea..e63a4a565e86 100644 --- a/lang/ghc96/Makefile +++ b/lang/ghc96/Makefile @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.1 2023/10/23 08:06:48 pho Exp $ +# $NetBSD: Makefile,v 1.2 2023/10/23 17:00:08 pho Exp $ # ----------------------------------------------------------------------------- # Package metadata # DISTNAME= ghc-9.6.3-src PKGNAME= ${DISTNAME:S/-src$//} +PKGREVISION= 1 CATEGORIES= lang MASTER_SITES= https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/ EXTRACT_SUFX= .tar.xz diff --git a/lang/ghc96/buildlink3.mk b/lang/ghc96/buildlink3.mk index 56301c981a11..639ee8a57823 100644 --- a/lang/ghc96/buildlink3.mk +++ b/lang/ghc96/buildlink3.mk @@ -1,12 +1,12 @@ -# $NetBSD: buildlink3.mk,v 1.1 2023/10/23 08:06:48 pho Exp $ +# $NetBSD: buildlink3.mk,v 1.2 2023/10/23 17:00:08 pho Exp $ BUILDLINK_TREE+= ghc .if !defined(GHC_BUILDLINK3_MK) GHC_BUILDLINK3_MK:= -BUILDLINK_API_DEPENDS.ghc+= ghc>=9.6.3 -BUILDLINK_ABI_DEPENDS.ghc+= ghc>=9.6.3 +BUILDLINK_API_DEPENDS.ghc+= ghc>=9.6.3nb1 +BUILDLINK_ABI_DEPENDS.ghc+= ghc>=9.6.3nb1 BUILDLINK_PKGSRCDIR.ghc?= ../../lang/ghc96 .include "../../converters/libiconv/buildlink3.mk" diff --git a/lang/ghc96/distinfo b/lang/ghc96/distinfo index 5ef3d4e609d7..fb9a1b79fe45 100644 --- a/lang/ghc96/distinfo +++ b/lang/ghc96/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.1 2023/10/23 08:06:48 pho Exp $ +$NetBSD: distinfo,v 1.2 2023/10/23 17:00:08 pho Exp $ BLAKE2s (ghc-9.2.1-boot-hadrian.tar.gz) = 363fea08f46524eab654b3225650be4938bd0404e8c44145381f97a0c4489dca SHA512 (ghc-9.2.1-boot-hadrian.tar.gz) = a006ab38df77bc22e51ee75808065ad75781f85eb52cae54ed8995942ba16e70f4d68d4097f2597bca09e8b7890858d0a28a0f66216e6a4b21a3c68bb8082c59 @@ -52,7 +52,9 @@ SHA1 (patch-libraries_time_lib_Data_Time_Clock_Internal_CTimespec.hsc) = 5882707 SHA1 (patch-libraries_time_lib_Data_Time_Clock_Internal_CTimeval.hs) = 68914d012a98cc4a4a245efeabcb9143dba0246a SHA1 (patch-libraries_unix_System_Posix_Env.hsc) = 414f0310793bf184cdac7546e3f81fee4821a05f SHA1 (patch-libraries_unix_System_Posix_Env_ByteString.hsc) = a579c00d7d5d7ffbb73f6499e09588d6417be123 +SHA1 (patch-libraries_unix_System_Posix_Env_PosixString.hsc) = 40d464638eb11cb832f93d9892818655f4d70e00 SHA1 (patch-libraries_unix_System_Posix_Signals.hsc) = ee59a04571881382bcfd9fc82bf196ff86a40ed5 +SHA1 (patch-libraries_unix_System_Posix_User.hsc) = b583f591838fe2d7f42241787e02c5385d336939 SHA1 (patch-m4_fptools__set__haskell__platform__vars.m4) = 8c7a7ab965f4df8a68bedb35c32ee32c59ac2c94 SHA1 (patch-rts_linker_MMap.c) = c2abd34b8d39bb8f508a54bf3db25f53e113e45b SHA1 (patch-rts_linker_MMap.h) = 8228fabcdaeb1511191da9fc614ff94d3eee8fbd diff --git a/lang/ghc96/patches/patch-libraries_unix_System_Posix_Env_PosixString.hsc b/lang/ghc96/patches/patch-libraries_unix_System_Posix_Env_PosixString.hsc new file mode 100644 index 000000000000..92d9598c2a2c --- /dev/null +++ b/lang/ghc96/patches/patch-libraries_unix_System_Posix_Env_PosixString.hsc @@ -0,0 +1,16 @@ +$NetBSD: patch-libraries_unix_System_Posix_Env_PosixString.hsc,v 1.1 2023/10/23 17:00:08 pho Exp $ + +Suppress linker warnings about compatibility symbols by using "capi" +instead of "ccall". + +--- libraries/unix/System/Posix/Env/PosixString.hsc.orig 2023-10-23 10:24:23.010158238 +0000 ++++ libraries/unix/System/Posix/Env/PosixString.hsc +@@ -146,7 +146,7 @@ putEnv (PS sbs) = do + where l = B.length sbs + + +-foreign import ccall unsafe "putenv" ++foreign import capi unsafe "HsUnix.h putenv" + c_putenv :: CString -> IO CInt + + {- |The 'setEnv' function inserts or resets the environment variable name in diff --git a/lang/ghc96/patches/patch-libraries_unix_System_Posix_User.hsc b/lang/ghc96/patches/patch-libraries_unix_System_Posix_User.hsc new file mode 100644 index 000000000000..50733fa2157e --- /dev/null +++ b/lang/ghc96/patches/patch-libraries_unix_System_Posix_User.hsc @@ -0,0 +1,20 @@ +$NetBSD: patch-libraries_unix_System_Posix_User.hsc,v 1.1 2023/10/23 17:00:08 pho Exp $ + +Suppress linker warnings about compatibility symbols by using "capi" +instead of "ccall". + +--- libraries/unix/System/Posix/User.hsc.orig 2023-10-23 10:26:54.941601450 +0000 ++++ libraries/unix/System/Posix/User.hsc +@@ -605,9 +605,9 @@ getAllUserEntries = lockpw GETALL $ brac + else do thisentry <- unpackUserEntry ppw + worker (thisentry : accum) + +-foreign import ccall safe "getpwent" c_getpwent :: IO (Ptr CPasswd) +-foreign import ccall safe "setpwent" c_setpwent :: IO () +-foreign import ccall safe "endpwent" c_endpwent :: IO () ++foreign import capi safe "HsUnix.h getpwent" c_getpwent :: IO (Ptr CPasswd) ++foreign import capi safe "HsUnix.h setpwent" c_setpwent :: IO () ++foreign import capi safe "HsUnix.h endpwent" c_endpwent :: IO () + #else + {-# WARNING getAllUserEntries "System.Posix.User.getAllUserEntries: not supported" #-} + getAllUserEntries = error "System.Posix.User.getAllUserEntries: not supported"