[arch-commits] Commit in ghc/trunk (PKGBUILD network.patch)

Vesa Kaihlavirta vesa at archlinux.org
Wed Aug 6 15:55:45 EDT 2008


    Date: Wednesday, August 6, 2008 @ 15:55:44
  Author: vesa
Revision: 8122

Add a patch to allow building ghc-6.8.2 on glibc-2.8

Added:
  ghc/trunk/network.patch
Modified:
  ghc/trunk/PKGBUILD

---------------+
 PKGBUILD      |   11 ++++---
 network.patch |   82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 89 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2008-08-06 19:22:23 UTC (rev 8121)
+++ PKGBUILD	2008-08-06 19:55:44 UTC (rev 8122)
@@ -1,8 +1,8 @@
 # $Id$
-# Maintainer: Simo Leone <simo at archlinux.org>
+# Maintainer: Vesa Kaihlavirta <vesa at archlinux.org>
 pkgname=ghc
 pkgver=6.8.2
-pkgrel=1
+pkgrel=2
 pkgdesc="A state-of-the-art, open source, compiler and interactive environment for Haskell."
 arch=(i686 x86_64)
 url="http://www.haskell.org/ghc/"
@@ -10,15 +10,18 @@
 depends=('gmp' 'perl' 'readline')
 makedepends=('ghc' 'happy')
 source=("http://www.haskell.org/ghc/dist/$pkgver/$pkgname-$pkgver-src.tar.bz2" \
-    "http://www.haskell.org/ghc/dist/$pkgver/ghc-$pkgver-src-extralibs.tar.bz2")
+    "http://www.haskell.org/ghc/dist/$pkgver/ghc-$pkgver-src-extralibs.tar.bz2"
+    network.patch)
 md5sums=('43108417594be7eba0918c459e871e40'
-         'd199c50814188fb77355d41058b8613c')
+         'd199c50814188fb77355d41058b8613c'
+         'dc94374c53aff2ab2d4f6cb75a349bb0')
 
 build() {
   #since this is a compiler, it needs itself to compile
   #installer automatically bootstraps itself, so this actually compiles twice
   #In order to compile, you need ghc installed on your system
   cd $startdir/src/$pkgname-$pkgver
+  patch -p1 -i ../network.patch || return 1
   ./configure --prefix=/usr
   make -j1 || return 1
   make DESTDIR=$startdir/pkg install

Added: network.patch
===================================================================
--- network.patch	                        (rev 0)
+++ network.patch	2008-08-06 19:55:44 UTC (rev 8122)
@@ -0,0 +1,82 @@
+diff -u -r ghc-6.8.2-orig/libraries/network/Network/Socket.hsc ghc-6.8.2/libraries/network/Network/Socket.hsc
+--- ghc-6.8.2-orig/libraries/network/Network/Socket.hsc	2007-12-10 20:25:19.000000000 +0200
++++ ghc-6.8.2/libraries/network/Network/Socket.hsc	2008-08-06 21:36:47.045962479 +0300
+@@ -95,7 +95,7 @@
+     getPeerName,	-- :: Socket -> IO SockAddr
+     getSocketName,	-- :: Socket -> IO SockAddr
+ 
+-#ifdef SO_PEERCRED
++#ifdef HAVE_STRUCT_UCRED
+ 	-- get the credentials of our domain socket peer.
+     getPeerCred,         -- :: Socket -> IO (CUInt{-pid-}, CUInt{-uid-}, CUInt{-gid-})
+ #endif
+@@ -1134,7 +1134,7 @@
+        fromIntegral `liftM` peek ptr_v
+ 
+ 
+-#ifdef SO_PEERCRED
++#ifdef HAVE_STRUCT_UCRED
+ -- | Returns the processID, userID and groupID of the socket's peer.
+ --
+ -- Only available on platforms that support SO_PEERCRED on domain sockets.
+diff -u -r ghc-6.8.2-orig/libraries/network/configure.ac ghc-6.8.2/libraries/network/configure.ac
+--- ghc-6.8.2-orig/libraries/network/configure.ac	2007-12-10 20:25:19.000000000 +0200
++++ ghc-6.8.2/libraries/network/configure.ac	2008-08-06 21:37:53.285955355 +0300
+@@ -40,6 +40,39 @@
+  AC_MSG_RESULT(no))
+ 
+ dnl --------------------------------------------------
++dnl * test for SO_PEERCRED and struct ucred
++dnl --------------------------------------------------
++AC_MSG_CHECKING(for SO_PEERCRED and struct ucred in sys/socket.h)
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
++#include <sys/socket.h>
++#ifndef SO_PEERCRED
++# error no SO_PEERCRED
++#endif
++struct ucred u;]])],ac_cv_ucred=yes,ac_cv_ucred=no)
++if test "x$ac_cv_ucred" = xno; then
++    old_CFLAGS="$CFLAGS"
++    CFLAGS="-D_GNU_SOURCE $CFLAGS"
++    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
++#include <sys/socket.h>
++#ifndef SO_PEERCRED
++# error no SO_PEERCRED
++#endif
++struct ucred u;]])],ac_cv_ucred=yes,ac_cv_ucred=no)
++    if test "x$ac_cv_ucred" = xyes; then
++        EXTRA_CPPFLAGS=-D_GNU_SOURCE
++    fi
++else
++    old_CFLAGS="$CFLAGS"
++fi
++if test "x$ac_cv_ucred" = xno; then
++    CFLAGS="$old_CFLAGS"
++    AC_MSG_RESULT(no)
++else
++    AC_DEFINE([HAVE_STRUCT_UCRED], [1], [Define to 1 if you have both SO_PEERCRED and struct ucred.])
++    AC_MSG_RESULT(yes)
++fi
++
++dnl --------------------------------------------------
+ dnl * test for getaddrinfo as proxy for IPv6 support
+ dnl --------------------------------------------------
+ AC_CHECK_FUNCS(getaddrinfo)
+@@ -84,6 +117,7 @@
+ esac
+ AC_SUBST([CALLCONV])
+ AC_SUBST([EXTRA_LIBS])
++AC_SUBST([EXTRA_CPPFLAGS])
+ AC_SUBST([EXTRA_SRCS])
+ 
+ AC_CONFIG_FILES([network.buildinfo])
+diff -u -r ghc-6.8.2-orig/libraries/network/network.buildinfo.in ghc-6.8.2/libraries/network/network.buildinfo.in
+--- ghc-6.8.2-orig/libraries/network/network.buildinfo.in	2007-12-10 20:25:19.000000000 +0200
++++ ghc-6.8.2/libraries/network/network.buildinfo.in	2008-08-06 21:38:52.255190968 +0300
+@@ -1,4 +1,4 @@
+-ghc-options: -DCALLCONV=@CALLCONV@
+-cc-options: -DCALLCONV=@CALLCONV@
++ghc-options: -DCALLCONV=@CALLCONV@ @EXTRA_CPPFLAGS@
++cc-options: -DCALLCONV=@CALLCONV@ @EXTRA_CPPFLAGS@
+ c-sources: @EXTRA_SRCS@
+ extra-libraries: @EXTRA_LIBS@




More information about the arch-commits mailing list