packages feed

cabal-debian 4.24.5 → 4.24.6

raw patch · 15 files changed

+72/−43 lines, 15 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Debian.Debianize.DebInfo: noTestSuite :: Lens' DebInfo Bool
- Debian.Debianize.DebInfo: noTestSuiteRun :: Lens' DebInfo Bool
+ Debian.Debianize.DebInfo: enableTests :: Lens' DebInfo Bool
+ Debian.Debianize.DebInfo: runTests :: Lens' DebInfo Bool
+ Debian.Debianize.Monad: ifM :: Monad m => m Bool -> m a -> m a -> m a
+ Debian.Debianize.Monad: unlessM :: Monad m => m Bool -> m () -> m ()
+ Debian.Debianize.Monad: whenM :: Monad m => m Bool -> m () -> m ()

Files

cabal-debian.cabal view
@@ -1,5 +1,5 @@ Name:           cabal-debian-Version:        4.24.5+Version:        4.24.6 Copyright:      Copyright (c) 2007-2014, David Fox, Jeremy Shaw License:        BSD3 License-File:   LICENSE
changelog view
@@ -1,3 +1,13 @@+haskell-cabal-debian (4.24.5) unstable; urgency=low++  * Patch from Dmitry Bogatov for filling in debian/copyright fields+  * Patch from Dmitry Bogatov for debhelper and haskell-devscripts build deps+  * Patch from Dmitry Bogatov for default changelog message+  * Add a --no-run-tests flag to control the nocheck option+  * Compatibility with different GHC versions++ -- David Fox <dsf@seereason.com>  Sat, 21 Mar 2015 10:14:48 -0700+ haskell-cabal-debian (4.24.3) unstable; urgency=low    * Always include the test suite build dependencies in debian/control,
debian/changelog view
@@ -1,3 +1,11 @@+haskell-cabal-debian (4.24.6) unstable; urgency=low++  * Use build dependency haskell-devscripts >= 0.8 for unofficial, >= 0.9+    for official.+  * Straighten out the test suite options: --no-tests, --no-run-tests++ -- David Fox <dsf@seereason.com>  Mon, 23 Mar 2015 11:31:14 -0700+ haskell-cabal-debian (4.24.5) unstable; urgency=low    * Patch from Dmitry Bogatov for filling in debian/copyright fields
src/Debian/Debianize/BuildDependencies.hs view
@@ -74,13 +74,14 @@  -- |Debian packages don't have per binary package build dependencies, -- so we just gather them all up here.-allBuildDepends :: Monad m => Bool -> PackageDescription -> CabalT m [Dependency_]-allBuildDepends noTestSuite pkgDesc =+allBuildDepends :: Monad m => PackageDescription -> CabalT m [Dependency_]+allBuildDepends pkgDesc =+    access (A.debInfo . D.enableTests) >>= \ testsEnabled ->     allBuildDepends'       (mergeCabalDependencies $        Cabal.buildDepends pkgDesc ++             concatMap (Cabal.targetBuildDepends . Cabal.buildInfo) (Cabal.executables pkgDesc) ++-            (if noTestSuite then [] else concatMap (Cabal.targetBuildDepends . Cabal.testBuildInfo) $ {-filter Cabal.testEnabled-} (Cabal.testSuites pkgDesc)))+            (if testsEnabled then concatMap (Cabal.targetBuildDepends . Cabal.testBuildInfo) $ {-filter Cabal.testEnabled-} (Cabal.testSuites pkgDesc) else []))       (mergeCabalDependencies $ concatMap buildTools $ allBuildInfo pkgDesc)       (mergeCabalDependencies $ concatMap pkgconfigDepends $ allBuildInfo pkgDesc)       (concatMap extraLibs . allBuildInfo $ pkgDesc) >>=@@ -115,13 +116,13 @@        let hcTypePairs =                fold union empty $                   Set.map (\ hc' -> Set.map (hc',) $ hcPackageTypes hc') hcs-       noTestSuite <- access (A.debInfo . D.noTestSuite)-       cDeps <- allBuildDepends noTestSuite pkgDesc >>= mapM (buildDependencies hcTypePairs) >>= return . {-nub .-} concat+       cDeps <- allBuildDepends pkgDesc >>= mapM (buildDependencies hcTypePairs) >>= return . {-nub .-} concat        bDeps <- access (A.debInfo . D.control . S.buildDepends)        prof <- not <$> access (A.debInfo . D.noProfilingLibrary)+       official <- access (A.debInfo . D.official)        compat <- access (A.debInfo . D.compat)        let xs = nub $ [maybe [] (\ n -> [D.Rel (D.BinPkgName "debhelper") (Just (D.GRE (parseDebianVersion (show n)))) Nothing]) compat,-                       [D.Rel (D.BinPkgName "haskell-devscripts") (Just (D.GRE (parseDebianVersion ("0.9" :: String)))) Nothing],+                       [D.Rel (D.BinPkgName "haskell-devscripts") (Just $ D.GRE $ parseDebianVersion $ if official then "0.9" else "0.8" :: String) Nothing],                        anyrel "cdbs"] ++                       (if member GHC hcs                        then [anyrel' (compilerPackageName GHC B.Development)] ++ if prof then [anyrel' (compilerPackageName GHC B.Profiling)] else []@@ -146,9 +147,8 @@     do hc <- access (A.debInfo . D.flags . compilerFlavor)        let hcs = singleton hc -- vestigial        doc <- not <$> access (A.debInfo . D.noDocumentationLibrary)-       noTestSuite <- access (A.debInfo . D.noTestSuite)        bDeps <- access (A.debInfo . D.control . S.buildDependsIndep)-       cDeps <- allBuildDepends noTestSuite pkgDesc >>= mapM docDependencies+       cDeps <- allBuildDepends pkgDesc >>= mapM docDependencies        let xs = nub $ if doc                       then (if member GHC hcs then [anyrel' (compilerPackageName GHC B.Documentation)] else []) ++ #if MIN_VERSION_Cabal(1,22,0)
src/Debian/Debianize/CabalInfo.hs view
@@ -30,7 +30,7 @@ import Data.Monoid (Monoid(..)) import Data.Text as Text (null, pack, strip) import Debian.Debianize.BasicInfo (Flags)-import Debian.Debianize.DebInfo as D (control, copyright, DebInfo, makeDebInfo, noTestSuite, noTestSuiteRun, rulesSettings)+import Debian.Debianize.DebInfo as D (control, copyright, DebInfo, makeDebInfo, enableTests, runTests, rulesSettings) import Debian.Debianize.BinaryDebDescription (Canonical(canonical)) import Debian.Debianize.CopyrightDescription (defaultCopyrightDescription) import Debian.Debianize.InputCabal (inputCabalization)@@ -95,13 +95,7 @@     (do (debInfo . copyright) ~= Just copyrt         (debInfo . control . S.homepage) ~= case strip (pack (Cabal.homepage pkgDesc)) of                                               x | Text.null x -> Nothing-                                              x -> Just x-        noTests <- access (debInfo . noTestSuite)-        unless (List.null (Cabal.testSuites pkgDesc) || noTests)-               (do (debInfo . rulesSettings) %= (++ ["DEB_ENABLE_TESTS = yes"])-                   noRun <- access (debInfo . noTestSuiteRun)-                   when noRun $ (debInfo . rulesSettings) %= (++ ["DEB_BUILD_OPTIONS += nocheck"])-               ))+                                              x -> Just x)     (makeCabalInfo flags' pkgDesc)  makeCabalInfo :: Flags -> PackageDescription -> CabalInfo
src/Debian/Debianize/DebInfo.hs view
@@ -67,8 +67,8 @@     , backups     , extraDevDeps     , official-    , noTestSuite-    , noTestSuiteRun+    , enableTests+    , runTests     , allowDebianSelfBuildDeps      , binaryDebDescription@@ -252,9 +252,9 @@       -- reason to use this is because we don't yet know the name of the dev library package.       , _official :: Bool       -- ^ Whether this packaging is created by the Debian Haskell Group-      , _noTestSuite :: Bool-      -- ^ Force omission of the test suites from the debianization-      , _noTestSuiteRun :: Bool+      , _enableTests :: Bool+      -- ^ Include the test suites in the debianization if they exists+      , _runTests :: Bool       -- ^ Prevent the test suite from being run during the package build       , _allowDebianSelfBuildDeps :: Bool       -- ^ Normally self dependencies are filtered out of the debian@@ -368,8 +368,8 @@     , _backups = mempty     , _extraDevDeps = mempty     , _official = False-    , _noTestSuite = False-    , _noTestSuiteRun = False+    , _enableTests = True+    , _runTests = True     , _allowDebianSelfBuildDeps = False     } 
src/Debian/Debianize/Finalize.hs view
@@ -23,20 +23,20 @@ import Data.Set as Set (difference, filter, fold, fromList, insert, map, null, Set, singleton, toList, union, unions) import Data.Set.Extra as Set (mapM_) import Data.Text as Text (intercalate, pack, Text, unlines, unpack)-import Data.Version (showVersion) import Debian.Changes (ChangeLog(..), ChangeLogEntry(..)) import Debian.Debianize.BasicInfo (cabalFlagAssignments, compilerFlavor, verbosity)+import qualified Debian.Debianize.BinaryDebDescription as B import Debian.Debianize.BuildDependencies (debianBuildDeps, debianBuildDepsIndep)+import qualified Debian.Debianize.CabalInfo as A import Debian.Debianize.Changelog (dropFutureEntries) import qualified Debian.Debianize.DebInfo as D import Debian.Debianize.DebianName (debianName, debianNameBase)+import Debian.Debianize.DebInfo (rulesSettings) import Debian.Debianize.Goodies (backupAtoms, describe, execAtoms, serverAtoms, siteAtoms, watchAtom) import Debian.Debianize.InputDebian (dataTop, dataDest, inputChangeLog)-import Debian.Debianize.Monad as Monad (CabalT, liftCabal)+import Debian.Debianize.Monad as Monad (CabalT, liftCabal, unlessM) import Debian.Debianize.Options (compileCommandlineArgs, compileEnvironmentArgs) import Debian.Debianize.Prelude ((%=), (+=), (~=), (~?=))-import qualified Debian.Debianize.CabalInfo as A-import qualified Debian.Debianize.BinaryDebDescription as B import qualified Debian.Debianize.SourceDebDescription as S import Debian.Debianize.VersionSplits (DebBase(DebBase)) import Debian.Orphans ()@@ -52,10 +52,8 @@ import Distribution.Compiler (CompilerFlavor(GHCJS)) #endif import Distribution.Package (Dependency(..), PackageIdentifier(..), PackageName(PackageName))-import Distribution.PackageDescription (FlagName(FlagName), PackageDescription)-import Distribution.PackageDescription as Cabal (allBuildInfo, author, BuildInfo(buildable, extraLibs), Executable(buildInfo, exeName), maintainer)+import Distribution.PackageDescription as Cabal (allBuildInfo, author, BuildInfo(buildable, extraLibs), Executable(buildInfo, exeName), FlagName(FlagName), maintainer, PackageDescription(testSuites)) import qualified Distribution.PackageDescription as Cabal (PackageDescription(dataFiles, executables, library, package))-import Paths_cabal_debian (version) import Prelude hiding ((.), init, log, map, unlines, unlines, writeFile) import System.Environment (getProgName) import System.FilePath ((<.>), (</>), makeRelative, splitFileName, takeDirectory, takeFileName)@@ -96,10 +94,17 @@ finalizeDebianization' date debhelperCompat =     do -- In reality, hcs must be a singleton or many things won't work.  But some day...        hc <- access (A.debInfo . D.flags . compilerFlavor)+       pkgDesc <- access A.packageDescription++       testsEnabled <- access (A.debInfo . D.enableTests)+       let testsExist = not $ List.null $ Cabal.testSuites pkgDesc+       when (testsExist && testsEnabled) $+            do (A.debInfo . rulesSettings) %= (++ ["DEB_ENABLE_TESTS = yes"])+               unlessM (access (A.debInfo . D.runTests)) $ (A.debInfo . D.rulesSettings) %= (++ ["DEB_BUILD_OPTIONS += nocheck"])+        finalizeSourceName B.HaskellSource        checkOfficialSettings hc        addExtraLibDependencies hc-       pkgDesc <- access A.packageDescription        (A.debInfo . D.watch) ~?= Just (watchAtom (pkgName $ Cabal.package $ pkgDesc))        (A.debInfo . D.control . S.section) ~?= Just (MainSection "haskell")        (A.debInfo . D.control . S.priority) ~?= Just Extra@@ -280,7 +285,6 @@        -- pkgDesc <- access T.packageDescription >>= return . maybe Nothing (either Nothing Just . parseMaintainer . Cabal.maintainer)        cmts <- access (A.debInfo . D.comments)        (A.debInfo . D.changelog) %= fmap (dropFutureEntries ver)-       prog <- liftIO getProgName        let msg = "Initial release (Closes: #nnnn)"        (A.debInfo . D.changelog) %= fixLog src ver cmts debianMaintainer msg     where
src/Debian/Debianize/Monad.hs view
@@ -19,6 +19,10 @@     , evalDebianT     , execDebianT     , liftCabal++    , ifM+    , whenM+    , unlessM     ) where  import OldLens (focus)@@ -60,3 +64,12 @@  liftCabal :: Monad m => StateT DebInfo m a -> StateT CabalInfo m a liftCabal = focus debInfo++ifM :: Monad m => m Bool -> m a -> m a -> m a+ifM m t f = m >>= \ b -> if b then t else f++whenM :: Monad m => m Bool -> m () -> m ()+whenM m r = m >>= \ b -> if b then r else return ()++unlessM :: Monad m => m Bool -> m () -> m ()+unlessM m r = m >>= \ b -> if b then return () else r
src/Debian/Debianize/Options.hs view
@@ -183,10 +183,10 @@              (unlines [ "Subdirectory where cabal does its build, dist/build by default, dist-ghc when"                       , "run by haskell-devscripts.  The build subdirectory is added to match the"                       , "behavior of the --builddir option in the Setup script."]),-      Option "" ["no-test-suite"] (NoArg ((A.debInfo . D.noTestSuite) ~= True))-             "Don't build the test suite.",-      Option "" ["no-test-suite-run"] (NoArg ((A.debInfo . D.noTestSuiteRun) ~= True))-             "Don't run the test suite during the build.",+      Option "" ["no-tests"] (NoArg ((A.debInfo . D.enableTests) ~= False))+             "Build the test suite.",+      Option "" ["no-run-tests"] (NoArg ((A.debInfo . D.runTests) ~= False))+             "Run the test suite during the build.",       Option "" ["allow-debian-self-build-deps"] (NoArg ((A.debInfo . D.allowDebianSelfBuildDeps) ~= True))              (unlines [ "Set this to allow self dependencies in the debian package build dependencies."                       , "This may occasionally be necessary for a package that relies on an older"
test-data/alex/output/debian/control view
@@ -3,7 +3,7 @@ Section: haskell Maintainer: Simon Marlow <marlowsd@gmail.com> Build-Depends: debhelper (>= 9),-               haskell-devscripts (>= 0.9),+               haskell-devscripts (>= 0.8),                cdbs,                ghc,                ghc-prof,
test-data/archive/output/debian/control view
@@ -3,7 +3,7 @@ Maintainer: David Fox <dsf@seereason.com> Section: haskell Build-Depends: debhelper (>= 9)-               , haskell-devscripts (>= 0.9)+               , haskell-devscripts (>= 0.8)                , cdbs                , ghc 	       , ghc-prof
test-data/artvaluereport-data/output/debian/control view
@@ -3,7 +3,7 @@ Section: haskell Maintainer: David Fox <dsf@seereason.com> Build-Depends: debhelper (>= 9)-               , haskell-devscripts (>= 0.9)+               , haskell-devscripts (>= 0.8)                , cdbs                , ghc                , ghc-prof
test-data/artvaluereport2/output/debian/control view
@@ -3,7 +3,7 @@ Section: haskell Maintainer: Clifford Beshers <beshers@seereason.com> Build-Depends: debhelper (>= 9)-               , haskell-devscripts (>= 0.9)+               , haskell-devscripts (>= 0.8)                , cdbs                , ghc                , ghc-prof
test-data/clckwrks-dot-com/output/debian/control view
@@ -3,7 +3,7 @@ Priority: extra Section: haskell Build-Depends: debhelper (>= 9)-               , haskell-devscripts (>= 0.9)+               , haskell-devscripts (>= 0.8)                , cdbs                , ghc                , ghc-prof
test-data/creativeprompts/output/debian/control view
@@ -3,7 +3,7 @@ Priority: extra Section: haskell Build-Depends: debhelper (>= 9)-	       , haskell-devscripts (>= 0.9)+	       , haskell-devscripts (>= 0.8) 	       , cdbs                , ghc                , ghc-prof