darcs: bump stackage to lts-15.4

This commit is contained in:
slotThe 2020-04-01 16:38:54 +02:00 committed by q66
parent 9ac7d747f5
commit bc80aa2983
4 changed files with 146 additions and 3 deletions

View File

@ -1,6 +1,6 @@
resolver: lts-13.5
resolver: lts-15.4
packages:
- .
extra-deps:
- sandi-0.4.3
- graphviz-2999.20.0.3
- graphviz-2999.20.0.4

View File

@ -0,0 +1,120 @@
--- Setup.hs 2019-01-27 03:14:51.000000000 +1300
+++ Setup.hs 2019-10-18 02:41:57.000000000 +1300
@@ -11,7 +11,9 @@
, TestSuite(testBuildInfo)
, updatePackageDescription
, cppOptions, ccOptions
- , library, libBuildInfo, otherModules )
+ , library, libBuildInfo, otherModules
+ , ComponentName(CExeName)
+ )
import Distribution.Package
( packageVersion )
import Distribution.Version( Version )
@@ -21,24 +23,27 @@
import Distribution.Simple.Setup
(buildVerbosity, copyDest, copyVerbosity, fromFlag,
haddockVerbosity, installVerbosity, sDistVerbosity, replVerbosity )
-import Distribution.Simple.BuildPaths ( autogenModulesDir )
+import Distribution.Simple.BuildPaths ( autogenPackageModulesDir )
import Distribution.System
( OS(Windows), buildOS )
import Distribution.Simple.Utils
(copyFiles, createDirectoryIfMissingVerbose, rawSystemStdout,
- rewriteFile )
+ rewriteFileEx)
+import Distribution.Types.UnqualComponentName
import Distribution.Verbosity
- ( Verbosity )
+ ( Verbosity, silent )
import Distribution.Text
( display )
-import Control.Monad ( unless, void )
+import Control.Monad ( unless, when, void )
import System.Directory
( doesDirectoryExist, doesFileExist )
import System.IO
( openFile, IOMode(..) )
import System.Process (runProcess)
import Data.List( isInfixOf, lines )
+import qualified Data.Map as M
+import Data.Maybe ( isJust )
import System.FilePath ( (</>) )
import Foreign.Marshal.Utils ( with )
import Foreign.Storable ( peek )
@@ -75,8 +80,8 @@
verb = fromFlag $ sDistVerbosity flags
x <- versionPatches verb pkgVer
y <- context verb
- rewriteFile "release/distributed-version" $ show x
- rewriteFile "release/distributed-context" $ show y
+ rewriteFileEx silent "release/distributed-version" $ show x
+ rewriteFileEx silent "release/distributed-context" $ show y
putStrLn "about to hand over"
let pkg' = pkg { library = sanity (library pkg) }
sanity (Just lib) = Just $ lib { libBuildInfo = sanity' $ libBuildInfo lib }
@@ -105,8 +110,7 @@
littleEndian <- testEndianness
let args = ("-DPACKAGE_VERSION=" ++ show' version) :
[arg | (arg, True) <- -- include fst iff snd.
- [-- We have MAPI iff building on/for Windows.
- ("-DHAVE_MAPI", buildOS == Windows),
+ [
("-DLITTLEENDIAN", littleEndian),
("-DBIGENDIAN", not littleEndian)]]
bi = emptyBuildInfo { cppOptions = args, ccOptions = args }
@@ -133,20 +137,26 @@
-- man page
-- ---------------------------------------------------------------------
+hasDarcsExe :: LocalBuildInfo -> Bool
+hasDarcsExe = isJust . M.lookup darcsExe . componentNameMap where
+ darcsExe = CExeName (mkUnqualComponentName "darcs")
+
buildManpage :: LocalBuildInfo -> IO ()
-buildManpage lbi = do
- let darcs = buildDir lbi </> "darcs/darcs"
- manpage = buildDir lbi </> "darcs/darcs.1"
- manpageHandle <- openFile manpage WriteMode
- void $ runProcess darcs ["help","manpage"]
- Nothing Nothing Nothing (Just manpageHandle) Nothing
+buildManpage lbi =
+ when (hasDarcsExe lbi) $ do
+ let darcs = buildDir lbi </> "darcs/darcs"
+ manpage = buildDir lbi </> "darcs/darcs.1"
+ manpageHandle <- openFile manpage WriteMode
+ void $ runProcess darcs ["help","manpage"]
+ Nothing Nothing Nothing (Just manpageHandle) Nothing
-installManpage :: PackageDescription -> LocalBuildInfo
- -> Verbosity -> CopyDest -> IO ()
+installManpage :: PackageDescription -> LocalBuildInfo -> Verbosity -> CopyDest -> IO ()
installManpage pkg lbi verbosity copy =
- copyFiles verbosity
- (mandir (absoluteInstallDirs pkg lbi copy) </> "man1")
- [(buildDir lbi </> "darcs", "darcs.1")]
+ when (hasDarcsExe lbi) $
+ copyFiles
+ verbosity
+ (mandir (absoluteInstallDirs pkg lbi copy) </> "man1")
+ [(buildDir lbi </> "darcs", "darcs.1")]
-- ---------------------------------------------------------------------
-- version module
@@ -187,12 +197,13 @@
generateVersionModule :: Verbosity -> LocalBuildInfo
-> String -> String -> IO ()
generateVersionModule verbosity lbi version state = do
- let dir = autogenModulesDir lbi
+ let dir = autogenPackageModulesDir lbi
createDirectoryIfMissingVerbose verbosity True dir
ctx <- context verbosity
hash <- weakhash verbosity
- rewriteFile (dir </> "Version.hs") $ unlines
+ rewriteFileEx silent (dir </> "Version.hs") $ unlines
["module Version where"
+ ,"import Darcs.Prelude"
,"version, weakhash, context :: String"
,"version = \"" ++ version ++ " (" ++ state ++ ")\""
,"weakhash = " ++ case hash of

View File

@ -0,0 +1,13 @@
--- darcs.cabal.orig 2020-04-01 15:06:15.179438340 +0200
+++ darcs.cabal 2020-04-01 15:02:41.203492315 +0200
@@ -116,7 +116,9 @@
Cabal >= 1.24,
process >= 1.2.3.0 && < 1.7,
filepath >= 1.4.1 && < 1.5.0.0,
- directory >= 1.2.6.2 && < 1.4
+ directory >= 1.2.6.2 && < 1.4,
+ containers >= 0.5.6.2 && < 0.7
+
-- ----------------------------------------------------------------------
-- darcs library

View File

@ -1,7 +1,7 @@
# Template file for 'darcs'
pkgname=darcs
version=2.14.2
revision=2
revision=3
build_style=haskell-stack
hostmakedepends="unzip"
makedepends="zlib-devel libcurl-devel ncurses-devel"
@ -14,6 +14,16 @@ checksum=65d160a43874960dcba114c0b74d9c7b25d098486f515655502f42ff0c22a27e
nopie_files="/usr/bin/darcs"
nocross=yes
do_configure() {
vsed -e 's/< *0.5/<1/' -e 's/< *2.13/<3/' -e 's/< *4.13/<5/' -e 's/< *1.3/<2/' -e 's/< *2/<4/' -i ${pkgname}.cabal
vsed -e '/sDistHook = /,+14d' -i Setup.hs
vsed -e '/fail\ \ \ = failSM/i instance MonadFail SM where' -i src/Darcs/Patch/ReadMonads.hs
vsed -e 's/fail \$/error $/' -i src/Darcs/Util/Tree/Monad.hs src/Darcs/Repository/Diff.hs src/Darcs/Patch/Prim/V1/Apply.hs
vsed -e 's/Monad m => PatchInfoAnd/MonadFail m => PatchInfoAnd/' -i src/Darcs/Patch/PatchInfoAnd.hs
vsed -e 's/fail /error /' -i src/Darcs/Patch/Depends.hs src/Darcs/Patch/Match.hs src/Darcs/Repository/Match.hs
vsed -e '/fail _ /i instance MonadFail Perhaps where' -i src/Darcs/Patch/{,Prim}/V1/Commute.hs
}
post_install() {
vinstall contrib/darcs_completion 644 usr/share/bash-completion/completions