[Pkg-haskell-commits] darcs: haskell-simple-sendfile: On kFreeBSD, the BSD implementation doesn't work since 'struct sf_hdtr' has no definition. Use the fallback conduit-based emulation of sendfile instead.

Colin Watson cjwatson at debian.org
Fri Jun 14 14:30:12 UTC 2013


Fri Jun 14 14:30:02 UTC 2013  Colin Watson <cjwatson at debian.org>
  * On kFreeBSD, the BSD implementation doesn't work since 'struct sf_hdtr' has no definition.  Use the fallback conduit-based emulation of sendfile instead.

    M ./changelog +3
    M ./control -6 +6
    A ./patches/
    A ./patches/kfreebsd.patch
    A ./patches/series
    M ./rules +5

Fri Jun 14 14:30:02 UTC 2013  Colin Watson <cjwatson at debian.org>
  * On kFreeBSD, the BSD implementation doesn't work since 'struct sf_hdtr' has no definition.  Use the fallback conduit-based emulation of sendfile instead.
diff -rN -u old-haskell-simple-sendfile/changelog new-haskell-simple-sendfile/changelog
--- old-haskell-simple-sendfile/changelog	2013-06-14 14:30:12.247036756 +0000
+++ new-haskell-simple-sendfile/changelog	2013-06-14 14:30:12.247036756 +0000
@@ -2,6 +2,9 @@
 
   * Also build-depend on profiling libraries for conduit and transformers on
     the Hurd.
+  * On kFreeBSD, the BSD implementation doesn't work since 'struct sf_hdtr'
+    has no definition.  Use the fallback conduit-based emulation of sendfile
+    instead.
 
  -- Colin Watson <cjwatson at debian.org>  Fri, 14 Jun 2013 13:46:11 +0100
 
diff -rN -u old-haskell-simple-sendfile/control new-haskell-simple-sendfile/control
--- old-haskell-simple-sendfile/control	2013-06-14 14:30:12.247036756 +0000
+++ new-haskell-simple-sendfile/control	2013-06-14 14:30:12.251036604 +0000
@@ -11,12 +11,12 @@
   , ghc-prof
   , libghc-network-dev
   , libghc-network-prof
-  , libghc-conduit-dev (>> 0.4.1) [hurd-any]
-  , libghc-conduit-dev (<< 1.1) [hurd-any]
-  , libghc-conduit-prof [hurd-any]
-  , libghc-transformers-dev (>> 0.2.2) [hurd-any]
-  , libghc-transformers-dev (<< 0.4) [hurd-any]
-  , libghc-transformers-prof [hurd-any]
+  , libghc-conduit-dev (>> 0.4.1) [hurd-any kfreebsd-any]
+  , libghc-conduit-dev (<< 1.1) [hurd-any kfreebsd-any]
+  , libghc-conduit-prof [hurd-any kfreebsd-any]
+  , libghc-transformers-dev (>> 0.2.2) [hurd-any kfreebsd-any]
+  , libghc-transformers-dev (<< 0.4) [hurd-any kfreebsd-any]
+  , libghc-transformers-prof [hurd-any kfreebsd-any]
 Build-Depends-Indep: ghc-doc
   , libghc-network-doc
 Standards-Version: 3.9.4
diff -rN -u old-haskell-simple-sendfile/patches/kfreebsd.patch new-haskell-simple-sendfile/patches/kfreebsd.patch
--- old-haskell-simple-sendfile/patches/kfreebsd.patch	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-simple-sendfile/patches/kfreebsd.patch	2013-06-14 14:30:12.259037190 +0000
@@ -0,0 +1,37 @@
+Description: Add allow-bsd flag for Debian GNU/kFreeBSD
+ On Debian GNU/kFreeBSD (FreeBSD kernel plus glibc), the BSD flavour of
+ sendfile is not usable (struct sf_hdtr is declared with -D_BSD_SOURCE=1,
+ but has no definition), and the Linux flavour doesn't work either since
+ MSG_MORE is absent.  However, the fallback version works fine.
+ .
+ Unfortunately, Cabal treats kfreebsdgnu as os(freebsd), and os(kfreebsdgnu)
+ doesn't work.  So, to make it possible to select the fallback
+ implementation on GNU/kFreeBSD, I believe a flag is necessary.
+Author: Colin Watson <cjwatson at debian.org>
+Forwarded: https://github.com/kazu-yamamoto/simple-sendfile/pull/13
+Last-Update: 2013-06-14
+
+Index: b/simple-sendfile.cabal
+===================================================================
+--- a/simple-sendfile.cabal
++++ b/simple-sendfile.cabal
+@@ -12,6 +12,10 @@
+ Cabal-Version:          >= 1.10
+ Build-Type:             Simple
+ 
++Flag allow-bsd
++  Description:          Allow use of BSD sendfile (disable on GNU/kFreeBSD)
++  Default:              True
++
+ Library
+   Default-Language:     Haskell2010
+   GHC-Options:          -Wall
+@@ -21,7 +25,7 @@
+                       , network
+                       , bytestring
+   -- NetBSD and OpenBSD don't have sendfile
+-  if os(freebsd)
++  if os(freebsd) && flag(allow-bsd)
+     CPP-Options:        -DOS_BSD
+     Other-Modules:      Network.Sendfile.BSD
+                         Network.Sendfile.IOVec
diff -rN -u old-haskell-simple-sendfile/patches/series new-haskell-simple-sendfile/patches/series
--- old-haskell-simple-sendfile/patches/series	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-simple-sendfile/patches/series	2013-06-14 14:30:12.259037190 +0000
@@ -0,0 +1 @@
+kfreebsd.patch
diff -rN -u old-haskell-simple-sendfile/rules new-haskell-simple-sendfile/rules
--- old-haskell-simple-sendfile/rules	2013-06-14 14:30:12.231037317 +0000
+++ new-haskell-simple-sendfile/rules	2013-06-14 14:30:12.259037190 +0000
@@ -1,4 +1,9 @@
 #!/usr/bin/make -f
 
+include /usr/share/cdbs/1/rules/buildvars.mk
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/hlibrary.mk
+
+ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
+	DEB_SETUP_GHC_CONFIGURE_ARGS := -f-allow-bsd
+endif




More information about the Pkg-haskell-commits mailing list