Wed May 5 16:18:07 2021 UTC ()
Fix reference to undefined symbol "dirfd" on NetBSD


(pho)
diff -r1.1 -r1.2 pkgsrc/devel/hs-foundation/Makefile
diff -r1.1 -r1.2 pkgsrc/devel/hs-foundation/distinfo
diff -r0 -r1.1 pkgsrc/devel/hs-foundation/PLIST.Darwin
diff -r0 -r1.1 pkgsrc/devel/hs-foundation/PLIST.Linux
diff -r0 -r1.1 pkgsrc/devel/hs-foundation/patches/patch-Foundation_System_Bindings_Posix.hsc

cvs diff -r1.1 -r1.2 pkgsrc/devel/hs-foundation/Makefile (expand / switch to unified diff)

--- pkgsrc/devel/hs-foundation/Makefile 2021/05/05 11:05:56 1.1
+++ pkgsrc/devel/hs-foundation/Makefile 2021/05/05 16:18:07 1.2
@@ -1,12 +1,13 @@ @@ -1,12 +1,13 @@
1# $NetBSD: Makefile,v 1.1 2021/05/05 11:05:56 pho Exp $ 1# $NetBSD: Makefile,v 1.2 2021/05/05 16:18:07 pho Exp $
2 2
3DISTNAME= foundation-0.0.26 3DISTNAME= foundation-0.0.26
 4PKGREVISION= 1
4CATEGORIES= devel 5CATEGORIES= devel
5 6
6MAINTAINER= pho@cielonegro.org 7MAINTAINER= pho@cielonegro.org
7COMMENT= Alternative prelude with batteries and no dependencies 8COMMENT= Alternative prelude with batteries and no dependencies
8LICENSE= modified-bsd 9LICENSE= modified-bsd
9 10
10.include "../../devel/hs-basement/buildlink3.mk" 11.include "../../devel/hs-basement/buildlink3.mk"
11.include "../../mk/haskell.mk" 12.include "../../mk/haskell.mk"
12.include "../../mk/bsd.pkg.mk" 13.include "../../mk/bsd.pkg.mk"

cvs diff -r1.1 -r1.2 pkgsrc/devel/hs-foundation/distinfo (expand / switch to unified diff)

--- pkgsrc/devel/hs-foundation/distinfo 2021/05/05 11:05:56 1.1
+++ pkgsrc/devel/hs-foundation/distinfo 2021/05/05 16:18:07 1.2
@@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
1$NetBSD: distinfo,v 1.1 2021/05/05 11:05:56 pho Exp $ 1$NetBSD: distinfo,v 1.2 2021/05/05 16:18:07 pho Exp $
2 2
3SHA1 (foundation-0.0.26.tar.gz) = f68e1ff42a76270f41ec3db0b69f548d587a706b 3SHA1 (foundation-0.0.26.tar.gz) = f68e1ff42a76270f41ec3db0b69f548d587a706b
4RMD160 (foundation-0.0.26.tar.gz) = 3545c9a261e8570b0d41b809a6b4a53afe195382 4RMD160 (foundation-0.0.26.tar.gz) = 3545c9a261e8570b0d41b809a6b4a53afe195382
5SHA512 (foundation-0.0.26.tar.gz) = c85b4fc08ee92de8c7bd6e2b469762e7f101c52eebedca17ceb4073048781d309e6e62dff4d248df79f8237e293f5b38c73c94c14635ba2992bda52510e85eac 5SHA512 (foundation-0.0.26.tar.gz) = c85b4fc08ee92de8c7bd6e2b469762e7f101c52eebedca17ceb4073048781d309e6e62dff4d248df79f8237e293f5b38c73c94c14635ba2992bda52510e85eac
6Size (foundation-0.0.26.tar.gz) = 120483 bytes 6Size (foundation-0.0.26.tar.gz) = 120483 bytes
 7SHA1 (patch-Foundation_System_Bindings_Posix.hsc) = d370ea51bc337f1d9bec4f81ed065fec502eb093

File Added: pkgsrc/devel/hs-foundation/PLIST.Darwin
@comment $NetBSD: PLIST.Darwin,v 1.1 2021/05/05 16:18:07 pho Exp $
lib/${HS_PLATFORM}/${HS_PKGID}/Foundation/System/Bindings/Macos.dyn_hi
lib/${HS_PLATFORM}/${HS_PKGID}/Foundation/System/Bindings/Macos.hi
lib/${HS_PLATFORM}/${HS_PKGID}/Foundation/System/Bindings/Macos.p_hi

File Added: pkgsrc/devel/hs-foundation/PLIST.Linux
@comment $NetBSD: PLIST.Linux,v 1.1 2021/05/05 16:18:07 pho Exp $
lib/${HS_PLATFORM}/${HS_PKGID}/Foundation/System/Bindings/Linux.dyn_hi
lib/${HS_PLATFORM}/${HS_PKGID}/Foundation/System/Bindings/Linux.hi
lib/${HS_PLATFORM}/${HS_PKGID}/Foundation/System/Bindings/Linux.p_hi

File Added: pkgsrc/devel/hs-foundation/patches/patch-Foundation_System_Bindings_Posix.hsc
$NetBSD: patch-Foundation_System_Bindings_Posix.hsc,v 1.1 2021/05/05 16:18:07 pho Exp $

dirfd(3) is a macro on NetBSD. It doesn't exist as a symbol in libc.

--- Foundation/System/Bindings/Posix.hsc.orig	2021-05-05 16:09:20.261233488 +0000
+++ Foundation/System/Bindings/Posix.hsc
@@ -27,7 +27,7 @@ import Foundation.System.Bindings.PosixD
 #include <fcntl.h>
 #include <errno.h>
 
-data CDir
+data {-# CTYPE "dirent.h" "DIR" #-} CDir
 data CDirent
 
 sysPosix_E2BIG
@@ -377,5 +377,5 @@ foreign import ccall unsafe "rewinddir"
     sysPosixRewinddir :: Ptr CDir -> IO ()
 foreign import ccall unsafe "closedir"
     sysPosixClosedir :: Ptr CDir -> IO CInt
-foreign import ccall unsafe "dirfd"
+foreign import capi unsafe "dirent.h dirfd"
     sysPosixDirfd :: Ptr CDir -> IO CFd