[Pkg-haskell-commits] darcs: haskell-warp: On kFreeBSD, -DSENDFILEFD doesn't work; 'struct sf_hdtr' has no definition and so simple-sendfile has to use its fallback emulation. Add a flag to disable this, and also disable the test suite on kFreeBSD as a consequence.

Colin Watson cjwatson at debian.org
Sat Jun 15 13:27:11 UTC 2013


Sat Jun 15 13:27:00 UTC 2013  Colin Watson <cjwatson at debian.org>
  * On kFreeBSD, -DSENDFILEFD doesn't work; 'struct sf_hdtr' has no definition and so simple-sendfile has to use its fallback emulation. Add a flag to disable this, and also disable the test suite on kFreeBSD as a consequence.

    M ./changelog +9
    M ./control -3 +3
    A ./patches/
    A ./patches/kfreebsd.patch
    A ./patches/series
    M ./rules -2 +7

Sat Jun 15 13:27:00 UTC 2013  Colin Watson <cjwatson at debian.org>
  * On kFreeBSD, -DSENDFILEFD doesn't work; 'struct sf_hdtr' has no definition and so simple-sendfile has to use its fallback emulation. Add a flag to disable this, and also disable the test suite on kFreeBSD as a consequence.
diff -rN -u old-haskell-warp/changelog new-haskell-warp/changelog
--- old-haskell-warp/changelog	2013-06-15 13:27:11.206039691 +0000
+++ new-haskell-warp/changelog	2013-06-15 13:27:11.206039691 +0000
@@ -1,3 +1,12 @@
+haskell-warp (1.3.7.4-4) UNRELEASED; urgency=low
+
+  * On kFreeBSD, -DSENDFILEFD doesn't work; 'struct sf_hdtr' has no
+    definition and so simple-sendfile has to use its fallback emulation.
+    Add a flag to disable this, and also disable the test suite on kFreeBSD
+    as a consequence.
+
+ -- Colin Watson <cjwatson at debian.org>  Sat, 15 Jun 2013 14:24:59 +0100
+
 haskell-warp (1.3.7.4-3) unstable; urgency=low
 
   * Move Haskell blurb to the end of the description, reduces the impact
diff -rN -u old-haskell-warp/control new-haskell-warp/control
--- old-haskell-warp/control	2013-06-15 13:27:11.206039691 +0000
+++ new-haskell-warp/control	2013-06-15 13:27:11.206039691 +0000
@@ -39,9 +39,9 @@
   , libghc-wai-dev (>> 1.3)
   , libghc-wai-dev (<< 1.5)
   , libghc-wai-prof
-  , libghc-hunit-dev
-  , libghc-quickcheck2-dev
-  , libghc-hspec-dev (>> 1.3)
+  , libghc-hunit-dev [!kfreebsd-any]
+  , libghc-quickcheck2-dev [!kfreebsd-any]
+  , libghc-hspec-dev (>> 1.3) [!kfreebsd-any]
   , netbase
 Build-Depends-Indep: ghc-doc
   , libghc-blaze-builder-doc
diff -rN -u old-haskell-warp/patches/kfreebsd.patch new-haskell-warp/patches/kfreebsd.patch
--- old-haskell-warp/patches/kfreebsd.patch	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-warp/patches/kfreebsd.patch	2013-06-15 13:27:11.210038359 +0000
@@ -0,0 +1,47 @@
+Description: Add allow-sendfilefd flag for Debian GNU/kFreeBSD
+ On Debian GNU/kFreeBSD (FreeBSD kernel plus glibc), the BSD flavour of
+ sendfile is not usable, but Cabal treats kfreebsdgnu as os(freebsd) so I
+ had to add a flag to simple-sendfile.cabal to make it possible to select
+ the fallback implementation.  See
+ https://github.com/kazu-yamamoto/simple-sendfile/pull/13 for more details.
+ .
+ warp.cabal reflects the availability of interfaces from simple-sendfile,
+ and so I believe it needs a matching flag to make it possible to forcibly
+ disable the use of -DSENDFILEFD.
+Author: Colin Watson <cjwatson at debian.org>
+Forwarded: https://github.com/yesodweb/wai/pull/164
+Last-Update: 2013-06-15
+
+Index: b/warp.cabal
+===================================================================
+--- a/warp.cabal
++++ b/warp.cabal
+@@ -20,6 +20,10 @@
+ Flag network-bytestring
+     Default: False
+ 
++Flag allow-sendfilefd
++    Description: Allow use of sendfileFd (not available on GNU/kFreeBSD)
++    Default:     True
++
+ Library
+   Build-Depends:     base                      >= 3        && < 5
+                    , blaze-builder             >= 0.2.1.4  && < 0.4
+@@ -53,7 +57,7 @@
+                      Network.Wai.Handler.Warp.Types
+                      Paths_warp
+   Ghc-Options:       -Wall
+-  if os(linux) || os(freebsd) || os(darwin)
++  if (os(linux) || os(freebsd) || os(darwin)) && flag(allow-sendfilefd)
+       Cpp-Options:   -DSENDFILEFD
+       Build-Depends: hashable
+       Other-modules: Network.Wai.Handler.Warp.FdCache
+@@ -92,7 +96,7 @@
+     -- Yes, this means that the test suite will no longer work on Windows.
+     -- Unfortunately there is a bug in older versions of cabal, and this conditional
+     -- will therefore break older systems.
+-  --if os(linux) || os(freebsd) || os(darwin)
++  --if (os(linux) || os(freebsd) || os(darwin)) && flag(allow-sendfilefd)
+     Cpp-Options:   -DSENDFILEFD
+     Build-Depends: unix
+                    , hashable
diff -rN -u old-haskell-warp/patches/series new-haskell-warp/patches/series
--- old-haskell-warp/patches/series	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-warp/patches/series	2013-06-15 13:27:11.210038359 +0000
@@ -0,0 +1 @@
+kfreebsd.patch
diff -rN -u old-haskell-warp/rules new-haskell-warp/rules
--- old-haskell-warp/rules	2013-06-15 13:27:11.194038414 +0000
+++ new-haskell-warp/rules	2013-06-15 13:27:11.210038359 +0000
@@ -1,6 +1,11 @@
 #!/usr/bin/make -f
 
-DEB_ENABLE_TESTS = yes
-
+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-sendfilefd
+else
+	DEB_ENABLE_TESTS = yes
+endif




More information about the Pkg-haskell-commits mailing list