summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Kolmodin <kolmodin@gentoo.org>2010-06-28 18:53:32 +0000
committerLennart Kolmodin <kolmodin@gentoo.org>2010-06-28 18:53:32 +0000
commit2e93a1702e9fac240ca4bca2481af3dbf4f6f96e (patch)
tree1a251141f7532b90a47d2daf2bc73272e64dbf76 /dev-vcs/darcs
parentRestrict test as it needs X (diff)
downloadgentoo-2-2e93a1702e9fac240ca4bca2481af3dbf4f6f96e.tar.gz
gentoo-2-2e93a1702e9fac240ca4bca2481af3dbf4f6f96e.tar.bz2
gentoo-2-2e93a1702e9fac240ca4bca2481af3dbf4f6f96e.zip
dev-vcs/darcs-2.4.4: make a -r1 that attempts to fix two issues
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'dev-vcs/darcs')
-rw-r--r--dev-vcs/darcs/ChangeLog15
-rw-r--r--dev-vcs/darcs/darcs-2.4.4-r1.ebuild135
-rw-r--r--dev-vcs/darcs/files/darcs-2.4.4-issue1770-curl_multi_perform-no-running-handles.patch38
3 files changed, 187 insertions, 1 deletions
diff --git a/dev-vcs/darcs/ChangeLog b/dev-vcs/darcs/ChangeLog
index af6b76b7d9ee..d01487395f17 100644
--- a/dev-vcs/darcs/ChangeLog
+++ b/dev-vcs/darcs/ChangeLog
@@ -1,6 +1,19 @@
# ChangeLog for dev-vcs/darcs
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-vcs/darcs/ChangeLog,v 1.5 2010/06/17 06:33:35 kolmodin Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-vcs/darcs/ChangeLog,v 1.6 2010/06/28 18:53:32 kolmodin Exp $
+
+*darcs-2.4.4-r1 (28 Jun 2010)
+
+ 28 Jun 2010; Lennart Kolmodin <kolmodin@gentoo.org>
+ +darcs-2.4.4-r1.ebuild,
+ +files/darcs-2.4.4-issue1770-curl_multi_perform-no-running-handles.patch:
+ Attempt to solve issue1770 ( http://bugs.darcs.net/issue1770 ) which stops
+ users from fetching the Gentoo Haskell overlay. The patch is taken from
+ darcs HEAD and is written by Dmitry Kurochkin
+ <dmitry.kurochkin@gmail.com>.
+
+ Also, remove test case that required hlint. If the user would have a
+ recent version of hlint installed it would break the tests. Fix by slyfox.
16 Jun 2010; Lennart Kolmodin <kolmodin@gentoo.org>
-darcs-1.1.0_pre1.ebuild, darcs-2.1.0-r1.ebuild, darcs-2.2.1.ebuild,
diff --git a/dev-vcs/darcs/darcs-2.4.4-r1.ebuild b/dev-vcs/darcs/darcs-2.4.4-r1.ebuild
new file mode 100644
index 000000000000..f0c36cfb4afe
--- /dev/null
+++ b/dev-vcs/darcs/darcs-2.4.4-r1.ebuild
@@ -0,0 +1,135 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-vcs/darcs/darcs-2.4.4-r1.ebuild,v 1.1 2010/06/28 18:53:32 kolmodin Exp $
+
+EAPI="2"
+CABAL_FEATURES="bin lib profile haddock"
+inherit haskell-cabal eutils bash-completion
+
+DESCRIPTION="a distributed, interactive, smart revision control system"
+HOMEPAGE="http://darcs.net/"
+SRC_URI="http://hackage.haskell.org/packages/archive/${PN}/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE="doc test"
+
+# Dependency notes:
+# 1) Use a cunning trick for hashed-storage, haskeline, regex-compat
+# where the min bound is the lowest version available.
+# 2) Do the opposite for zlib: highest not available.
+# 3) Prefer curl over HTTP since darcs uses an old version of HTTP.
+# 4) Use the same bounds for mmap as hashed-storage.
+
+COMMONDEPS=">=dev-lang/ghc-6.8
+ >=dev-haskell/hashed-storage-0.4.13
+ =dev-haskell/haskeline-0.6*
+ =dev-haskell/html-1.0*
+ =dev-haskell/mmap-0.4*
+ <dev-haskell/mtl-1.2
+ =dev-haskell/network-2.2*
+ dev-haskell/parsec:0
+ <dev-haskell/regex-compat-0.94
+ =dev-haskell/terminfo-0.3*
+ =dev-haskell/utf8-string-0.3*
+ <dev-haskell/zlib-0.6.0.0
+ net-misc/curl"
+
+DEPEND="${COMMONDEPS}
+ >=dev-haskell/cabal-1.6
+ doc? ( virtual/latex-base
+ dev-tex/latex2html )
+ test? ( dev-haskell/test-framework
+ dev-haskell/test-framework-hunit
+ dev-haskell/test-framework-quickcheck2 )
+ "
+
+# darcs also has a library version; we thus need $DEPEND
+RDEPEND="${COMMONDEPS}
+ virtual/mta"
+
+pkg_setup() {
+ if use doc && ! built_with_use -o dev-tex/latex2html png gif; then
+ eerror "Building darcs with USE=\"doc\" requires that"
+ eerror "dev-tex/latex2html is built with at least one of"
+ eerror "USE=\"png\" and USE=\"gif\"."
+ die "USE=doc requires dev-tex/latex2html with USE=\"png\" or USE=\"gif\""
+ fi
+}
+
+src_prepare() {
+ pushd "contrib"
+ epatch "${FILESDIR}/${PN}-1.0.9-bashcomp.patch"
+ popd
+
+ epatch "${FILESDIR}/${P}-issue1770-curl_multi_perform-no-running-handles.patch"
+
+ # Loosen dependency on hashed-storage
+ sed -i -e "s/hashed-storage == 0.4.13/hashed-storage == 0.4.*/" \
+ "${S}/${PN}.cabal" \
+ || die "Could not loosen deps on hashed-storage"
+
+ # hlint tests tend to break on every newly released hlint
+ rm "${S}/tests/haskell_policy.sh"
+}
+
+src_configure() {
+ # checking whether ghc supports -threaded flag
+ # Beware: http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#options-linker
+ # contains: 'The ability to make a foreign call that does not block all other Haskell threads.'
+ # It might have interactivity impact.
+
+ threaded_flag=""
+ if $(ghc-getghc) --info | grep "Support SMP" | grep -q "YES"; then
+ threaded_flag="--flags=threaded"
+ einfo "$P will be built with threads support"
+ else
+ threaded_flag="--flags=-threaded"
+ einfo "$P will be built without threads support"
+ fi
+
+ # Use curl for net stuff to avoid strict version dep on HTTP and network
+ cabal_src_configure \
+ --flags=curl \
+ --flags=-http \
+ --flags=curl-pipelining \
+ --flags=color \
+ --flags=terminfo \
+ --flags=mmap \
+ $threaded_flag \
+ $(cabal_flag test)
+}
+
+src_test() {
+ # run cabal test from haskell-cabal
+ haskell-cabal_src_test || die "cabal test failed"
+
+ # run the unit tests (not part of cabal test for some reason...)
+ # breaks the cabal abstraction a bit...
+ "${S}/dist/build/unit/unit" || die "unit tests failed"
+}
+
+src_install() {
+ cabal_src_install
+ dobashcompletion "${S}/contrib/darcs_completion" "${PN}"
+
+ rm "${D}/usr/bin/unit" 2> /dev/null
+
+ # fixup perms in such an an awkward way
+ mv "${D}/usr/share/man/man1/darcs.1" "${S}/darcs.1" || die "darcs.1 not found"
+ doman "${S}/darcs.1" || die "failed to register darcs.1 as a manpage"
+
+ # if tests were enabled, make sure the unit test driver is deleted
+ rm -rf "${D}/usr/bin/unit"
+}
+
+pkg_postinst() {
+ ghc-package_pkg_postinst
+ bash-completion_pkg_postinst
+
+ ewarn "NOTE: in order for the darcs send command to work properly,"
+ ewarn "you must properly configure your mail transport agent to relay"
+ ewarn "outgoing mail. For example, if you are using ssmtp, please edit"
+ ewarn "/etc/ssmtp/ssmtp.conf with appropriate values for your site."
+}
diff --git a/dev-vcs/darcs/files/darcs-2.4.4-issue1770-curl_multi_perform-no-running-handles.patch b/dev-vcs/darcs/files/darcs-2.4.4-issue1770-curl_multi_perform-no-running-handles.patch
new file mode 100644
index 000000000000..dd61a027d4d5
--- /dev/null
+++ b/dev-vcs/darcs/files/darcs-2.4.4-issue1770-curl_multi_perform-no-running-handles.patch
@@ -0,0 +1,38 @@
+Fri Apr 16 00:47:39 CEST 2010 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
+ * Fix hscurl.c when URL is downloaded during the first call to curl_multi_perform.
+ Turns out that the first call to curl_multi_perform() can fetch the URL or
+ result in error. I can easily reproduce this using HTTP server on localhost.
+ This means that situation when running_handles is zero is valid, so remove the
+ error and handle it correctly.
+diff -rN -u old-darcs.net/src/hscurl.c new-darcs.net/src/hscurl.c
+--- old-darcs.net/src/hscurl.c 2010-06-28 19:35:56.382397912 +0200
++++ new-darcs.net/src/hscurl.c 2010-06-28 19:35:57.544398155 +0200
+@@ -19,7 +19,6 @@
+ RESULT_MULTI_INIT_FAIL,
+ RESULT_EASY_INIT_FAIL,
+ RESULT_SLIST_APPEND_FAIL,
+- RESULT_NO_RUNNING_HANDLES,
+ RESULT_MULTI_INFO_READ_FAIL,
+ RESULT_UNKNOWN_MESSAGE,
+ RESULT_FILE_OPEN_FAIL
+@@ -33,7 +32,6 @@
+ "curl_multi_init() failed",
+ "curl_easy_init() failed",
+ "curl_slist_append() failed",
+- "curl_multi_perform() - no running handles",
+ "curl_multi_info_read() failed",
+ "curl_multi_info_read() returned unknown message",
+ "fopen() failed"
+@@ -67,11 +65,9 @@
+ error = curl_multi_perform(multi, &running_handles);
+ if (error != CURLM_OK && error != CURLM_CALL_MULTI_PERFORM)
+ return curl_multi_strerror(error);
+- if (running_handles == 0)
+- return error_strings[RESULT_NO_RUNNING_HANDLES];
+
+ running_handles_last = running_handles;
+- while (1)
++ while (running_handles_last > 0)
+ {
+ while (error == CURLM_CALL_MULTI_PERFORM)
+ error = curl_multi_perform(multi, &running_handles);