summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2014-02-21 19:25:26 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2014-02-21 19:25:26 +0000
commitde013ea1bf929f08f4f42d49b74198c3ceabaa1f (patch)
tree31fe8e2cfccb1c9da7beedaff29d4ca1194f50f6 /dev-vcs/darcs
parentold (diff)
downloadgentoo-2-de013ea1bf929f08f4f42d49b74198c3ceabaa1f.tar.gz
gentoo-2-de013ea1bf929f08f4f42d49b74198c3ceabaa1f.tar.bz2
gentoo-2-de013ea1bf929f08f4f42d49b74198c3ceabaa1f.zip
Add basic ghc-7.8 support.
(Portage version: 2.2.8_p51/cvs/Linux x86_64, signed Manifest commit with key 611FF3AA)
Diffstat (limited to 'dev-vcs/darcs')
-rw-r--r--dev-vcs/darcs/ChangeLog8
-rw-r--r--dev-vcs/darcs/darcs-2.8.4-r3.ebuild128
-rw-r--r--dev-vcs/darcs/files/darcs-2.8.4-ghc-7.8-part-1.patch128
3 files changed, 263 insertions, 1 deletions
diff --git a/dev-vcs/darcs/ChangeLog b/dev-vcs/darcs/ChangeLog
index 6147673c0bee..bd5d6687ad88 100644
--- a/dev-vcs/darcs/ChangeLog
+++ b/dev-vcs/darcs/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-vcs/darcs
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-vcs/darcs/ChangeLog,v 1.52 2014/01/18 19:49:39 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-vcs/darcs/ChangeLog,v 1.53 2014/02/21 19:25:26 slyfox Exp $
+
+*darcs-2.8.4-r3 (21 Feb 2014)
+
+ 21 Feb 2014; Sergei Trofimovich <slyfox@gentoo.org> +darcs-2.8.4-r3.ebuild,
+ +files/darcs-2.8.4-ghc-7.8-part-1.patch:
+ Add basic ghc-7.8 support.
18 Jan 2014; Agostino Sarubbo <ago@gentoo.org> darcs-2.8.4.ebuild:
Stable for alpha, wrt bug #485656
diff --git a/dev-vcs/darcs/darcs-2.8.4-r3.ebuild b/dev-vcs/darcs/darcs-2.8.4-r3.ebuild
new file mode 100644
index 000000000000..c888099f89a7
--- /dev/null
+++ b/dev-vcs/darcs/darcs-2.8.4-r3.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-vcs/darcs/darcs-2.8.4-r3.ebuild,v 1.1 2014/02/21 19:25:26 slyfox Exp $
+
+EAPI=5
+
+# ebuild generated by hackport 0.3.9999
+
+CABAL_FEATURES="bin lib profile haddock hoogle hscolour"
+inherit eutils haskell-cabal bash-completion-r1
+
+DESCRIPTION="a distributed, interactive, smart revision control system"
+HOMEPAGE="http://darcs.net/"
+SRC_URI="mirror://hackage/packages/archive/${PN}/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
+IUSE="doc test"
+
+RDEPEND="=dev-haskell/extensible-exceptions-0.1*:=[profile?]
+ >=dev-haskell/hashed-storage-0.5.6:=[profile?]
+ <dev-haskell/hashed-storage-0.6:=[profile?]
+ >=dev-haskell/haskeline-0.6.3:=[profile?]
+ <dev-haskell/haskeline-0.8:=[profile?]
+ =dev-haskell/html-1.0*:=[profile?]
+ =dev-haskell/mmap-0.5*:=[profile?]
+ >=dev-haskell/mtl-1.0:=[profile?]
+ <dev-haskell/mtl-2.2:=[profile?]
+ >=dev-haskell/parsec-2.0:=[profile?]
+ <dev-haskell/parsec-3.2:=[profile?]
+ =dev-haskell/random-1.0*:=[profile?]
+ >=dev-haskell/regex-compat-0.95.1:=[profile?]
+ >=dev-haskell/tar-0.3:=[profile?]
+ <dev-haskell/tar-0.5:=[profile?]
+ >=dev-haskell/terminfo-0.3:=[profile?] <dev-haskell/terminfo-0.5:=[profile?]
+ >=dev-haskell/text-0.11.0.6:=[profile?]
+ >=dev-haskell/vector-0.7:=[profile?]
+ >=dev-haskell/zlib-0.5.1.0:=[profile?]
+ <dev-haskell/zlib-0.6.0.0:=[profile?]
+ >=dev-lang/ghc-6.10.4:=
+ net-misc/curl"
+DEPEND="${RDEPEND}
+ >=dev-haskell/cabal-1.8
+ doc? ( virtual/latex-base
+ || ( dev-tex/latex2html[png]
+ dev-tex/latex2html[gif]
+ )
+ )
+ test? ( >=dev-haskell/cmdlib-0.2.1[profile?]
+ <dev-haskell/cmdlib-0.4[profile?]
+ =dev-haskell/findbin-0.0*[profile?]
+ >=dev-haskell/quickcheck-2.3
+ >=dev-haskell/shellish-0.1.3[profile?]
+ <dev-haskell/shellish-0.2[profile?]
+ >=dev-haskell/test-framework-0.4.0[profile?]
+ >=dev-haskell/test-framework-hunit-0.2.2[profile?]
+ >=dev-haskell/test-framework-quickcheck2-0.2.8[profile?]
+ )
+ "
+
+src_prepare() {
+ rm "${S}/tests/add_permissions.sh" || die "Could not rm add_permissions.sh"
+ rm "${S}/tests/send-output-v1.sh" || die "Could not rm send-output-v1.sh"
+ rm "${S}/tests/send-output-v2.sh" || die "Could not rm send-output-v2.sh"
+ rm "${S}/tests/utf8.sh" || die "Could not rm utf8.sh"
+
+ epatch "${FILESDIR}"/${P}-ghc-7.8-part-1.patch
+
+ cabal_chdeps \
+ 'text >= 0.11.0.6 && < 0.12.0.0' 'text >= 0.11.0.6' \
+ 'terminfo == 0.3.*' 'terminfo >= 0.3 && < 0.5' \
+ 'array >= 0.1 && < 0.5' 'array >= 0.1 && <0.6' \
+ 'process >= 1.0.0.0 && < 1.2.0.0' 'process >= 1.0.0.0 && < 1.3' \
+ 'unix >= 1.0 && < 2.7' 'unix >=1.0 && <2.8' \
+ 'base >= 4.5 && < 4.7' 'base >= 4.5 && < 4.8' \
+ 'ghc >= 6.10 && < 7.8' 'ghc >= 6.10 && < 7.9'
+}
+
+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=color \
+ --flags=terminfo \
+ --flags=mmap \
+ --flags=force-char8-encoding \
+ $threaded_flag \
+ $(cabal_flag test)
+}
+
+src_test() {
+ # run cabal test from haskell-cabal
+ haskell-cabal_src_test || die "cabal test failed"
+}
+
+src_install() {
+ cabal_src_install
+ newbashcomp "${S}/contrib/darcs_completion" "${PN}"
+
+ # fixup perms in such an an awkward way
+ mv "${ED}/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"
+}
+
+pkg_postinst() {
+ ghc-package_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 "${EPREFIX}/etc/ssmtp/ssmtp.conf with appropriate values for your site."
+}
diff --git a/dev-vcs/darcs/files/darcs-2.8.4-ghc-7.8-part-1.patch b/dev-vcs/darcs/files/darcs-2.8.4-ghc-7.8-part-1.patch
new file mode 100644
index 000000000000..3680c29b0440
--- /dev/null
+++ b/dev-vcs/darcs/files/darcs-2.8.4-ghc-7.8-part-1.patch
@@ -0,0 +1,128 @@
+diff --git a/src/Crypt/SHA256.hs b/src/Crypt/SHA256.hs
+index 69a8a4c..606f2ad 100644
+--- a/src/Crypt/SHA256.hs
++++ b/src/Crypt/SHA256.hs
+@@ -20,9 +20,10 @@ import Numeric (showHex)
+ import Foreign.C.String ( withCString )
+ import Data.ByteString.Unsafe (unsafeUseAsCStringLen)
+ import qualified Data.ByteString as B
++import qualified System.IO.Unsafe as U
+
+ sha256sum :: B.ByteString -> String
+-sha256sum p = unsafePerformIO $
++sha256sum p = U.unsafePerformIO $
+ withCString (take 64 $ repeat 'x') $ \digestCString ->
+ unsafeUseAsCStringLen p $ \(ptr,n) ->
+ do let digest = castPtr digestCString :: Ptr Word8
+diff --git a/src/Darcs/Commands/Get.hs b/src/Darcs/Commands/Get.hs
+index e450d28..6b51915 100644
+--- a/src/Darcs/Commands/Get.hs
++++ b/src/Darcs/Commands/Get.hs
+@@ -157,7 +157,8 @@ copyRepoAndGoToChosenVersion opts repodir rfsource = do
+ copyRepo
+ withRepository opts ((RepoJob $ \repository -> goToChosenVersion repository opts) :: RepoJob ())
+ putInfo opts $ text "Finished getting."
+- where copyRepo =
++ where copyRepo :: IO ()
++ copyRepo =
+ withRepository opts $ RepoJob $ \repository ->
+ if formatHas HashedInventory rfsource
+ then do
+diff --git a/src/Darcs/Global.hs b/src/Darcs/Global.hs
+index 9792bf0..e17f071 100644
+--- a/src/Darcs/Global.hs
++++ b/src/Darcs/Global.hs
+@@ -60,8 +60,9 @@ module Darcs.Global
+ import Control.Applicative ( (<$>), (<*>) )
+ import Control.Monad ( when )
+ import Control.Concurrent.MVar
+-import Control.Exception.Extensible ( bracket_, catch, catchJust, SomeException
+- , block, unblock
++import Control.Exception.Extensible as E
++ ( bracket_, catch, catchJust, SomeException
++ , mask
+ )
+ import Data.IORef ( IORef, newIORef, readIORef, writeIORef )
+ import Data.IORef ( modifyIORef )
+@@ -106,12 +107,12 @@ withAtexit prog =
+ exit
+ prog
+ where
+- exit = block $ do
++ exit = E.mask $ \restore -> do
+ Just actions <- swapMVar atexitActions Nothing
+ -- from now on atexit will not register new actions
+- mapM_ runAction actions
+- runAction action =
+- catch (unblock action) $ \(exn :: SomeException) -> do
++ mapM_ (runAction restore) actions
++ runAction restore action =
++ catch (restore action) $ \(exn :: SomeException) -> do
+ hPutStrLn stderr $ "Exception thrown by an atexit registered action:"
+ hPutStrLn stderr $ show exn
+
+diff --git a/src/Darcs/SignalHandler.hs b/src/Darcs/SignalHandler.hs
+index ac0f526..d0ef162 100644
+--- a/src/Darcs/SignalHandler.hs
++++ b/src/Darcs/SignalHandler.hs
+@@ -26,8 +26,8 @@ import Prelude hiding ( catch )
+ import System.IO.Error ( isUserError, ioeGetErrorString, ioeGetFileName )
+ import System.Exit ( exitWith, ExitCode ( ExitFailure ) )
+ import Control.Concurrent ( ThreadId, myThreadId )
+-import Control.Exception.Extensible
+- ( catch, throw, throwTo, block, unblock,
++import Control.Exception.Extensible as E
++ ( catch, throw, throwTo, mask,
+ Exception(..), SomeException(..), IOException )
+ import System.Posix.Files ( getFdStatus, isNamedPipe )
+ import System.Posix.IO ( stdOutput )
+@@ -128,8 +128,8 @@ catchUserErrors comp handler = catch comp handler'
+ | otherwise = throw ioe
+
+ withSignalsBlocked :: IO a -> IO a
+-withSignalsBlocked job = block (job >>= \r ->
+- unblock(return r) `catchSignal` couldnt_do r)
++withSignalsBlocked job = E.mask $ \restore -> (job >>= \r ->
++ restore (return r) `catchSignal` couldnt_do r)
+ where couldnt_do r s | s == sigINT = oops "interrupt" r
+ | s == sigHUP = oops "HUP" r
+ | s == sigABRT = oops "ABRT" r
+diff --git a/src/Darcs/Test/Patch/Info.hs b/src/Darcs/Test/Patch/Info.hs
+index fd27fb3..b35cfef 100644
+--- a/src/Darcs/Test/Patch/Info.hs
++++ b/src/Darcs/Test/Patch/Info.hs
+@@ -28,7 +28,6 @@ import Data.Maybe ( isNothing )
+ import Data.Text as T ( find, any )
+ import Data.Text.Encoding ( decodeUtf8With )
+ import Data.Text.Encoding.Error ( lenientDecode )
+-import Foreign ( unsafePerformIO )
+ import Test.QuickCheck ( Arbitrary(arbitrary), oneof, listOf, choose, shrink
+ , Gen )
+ import Test.Framework.Providers.QuickCheck2 ( testProperty )
+@@ -39,6 +38,8 @@ import Darcs.Patch.Info ( PatchInfo(..), patchinfo,
+ piLog, piAuthor, piName )
+ import ByteStringUtils ( decodeLocale, packStringToUTF8, unpackPSFromUTF8 )
+
++import qualified System.IO.Unsafe as U
++
+ testSuite :: Test
+ testSuite = testGroup "Darcs.Patch.Info"
+ [ metadataDecodingTest
+@@ -86,7 +87,7 @@ instance Arbitrary UTF8PatchInfo where
+ sa <- shrink (piAuthor pi)
+ sl <- shrink (filter (not . isPrefixOf "Ignore-this:") (piLog pi))
+ return (UTF8PatchInfo
+- (unsafePerformIO $ patchinfo sn
++ (U.unsafePerformIO $ patchinfo sn
+ (BC.unpack (_piDate pi)) sa sl))
+
+ instance Arbitrary UTF8OrNotPatchInfo where
+@@ -101,7 +102,7 @@ arbitraryUTF8Patch =
+ d <- arbitrary
+ a <- asString `fmap` arbitrary
+ l <- (lines . asString) `fmap` arbitrary
+- return $ unsafePerformIO $ patchinfo n d a l
++ return $ U.unsafePerformIO $ patchinfo n d a l
+
+ -- | Generate arbitrary patch metadata that has totally arbitrary byte strings
+ -- as its name, date, author and log.