Hello community, here is the log from the commit of package ghc-debian-build for openSUSE:Factory checked in at 2017-04-11 09:37:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-debian-build (Old) and /work/SRC/openSUSE:Factory/.ghc-debian-build.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-debian-build" Tue Apr 11 09:37:31 2017 rev:2 rq:483920 version:0.10.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-debian-build/ghc-debian-build.changes 2017-03-24 02:01:50.732269005 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-debian-build.new/ghc-debian-build.changes 2017-04-11 09:37:34.449404016 +0200 @@ -1,0 +2,5 @@ +Thu Sep 15 06:51:22 UTC 2016 - psim...@suse.com + +- Update to version 0.10.1.0 revision 0 with cabal2obs. + +------------------------------------------------------------------- Old: ---- debian-build-0.9.2.0.tar.gz New: ---- debian-build-0.10.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-debian-build.spec ++++++ --- /var/tmp/diff_new_pack.QKd1Bh/_old 2017-04-11 09:37:35.649234525 +0200 +++ /var/tmp/diff_new_pack.QKd1Bh/_new 2017-04-11 09:37:35.649234525 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-debian-build # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %global pkg_name debian-build Name: ghc-%{pkg_name} -Version: 0.9.2.0 +Version: 0.10.1.0 Release: 0 Summary: Debian package build sequence tools License: BSD-3-Clause @@ -58,7 +58,7 @@ %install %ghc_lib_install -%ghc_fix_dynamic_rpath odebuild +%ghc_fix_rpath %{pkg_name}-%{version} %post devel %ghc_pkg_recache ++++++ debian-build-0.9.2.0.tar.gz -> debian-build-0.10.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debian-build-0.9.2.0/debian-build.cabal new/debian-build-0.10.1.0/debian-build.cabal --- old/debian-build-0.9.2.0/debian-build.cabal 2016-06-04 18:16:31.000000000 +0200 +++ new/debian-build-0.10.1.0/debian-build.cabal 2016-07-09 09:56:46.000000000 +0200 @@ -1,5 +1,5 @@ name: debian-build -version: 0.9.2.0 +version: 0.10.1.0 synopsis: Debian package build sequence tools description: This package provides build sequence functions for debian package, and includes on-the-fly @@ -13,6 +13,11 @@ category: Debian build-type: Simple cabal-version: >=1.10 +tested-with: GHC == 8.0.1 + , GHC == 7.10.1, GHC == 7.10.2, GHC == 7.10.3 + , GHC == 7.8.1, GHC == 7.8.2, GHC == 7.8.3, GHC == 7.8.4 + , GHC == 7.6.1, GHC == 7.6.2, GHC == 7.6.3 + , GHC == 7.4.1, GHC == 7.4.2 library exposed-modules: @@ -33,7 +38,6 @@ , directory , transformers , split - , Cabal hs-source-dirs: src ghc-options: -Wall diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debian-build-0.9.2.0/mains/odebuild.hs new/debian-build-0.10.1.0/mains/odebuild.hs --- old/debian-build-0.9.2.0/mains/odebuild.hs 2016-06-04 18:16:31.000000000 +0200 +++ new/debian-build-0.10.1.0/mains/odebuild.hs 2016-07-09 09:56:46.000000000 +0200 @@ -31,6 +31,7 @@ { revision :: Maybe String , installDeps :: Bool , buildModes :: [BuildMode] -> [BuildMode] + , reuseSource :: Bool } defaultOptions :: ODebuildOptions @@ -39,6 +40,7 @@ { revision = Nothing , installDeps = False , buildModes = id + , reuseSource = False } descs :: [OptDescr (ODebuildOptions -> Either String ODebuildOptions)] @@ -55,6 +57,9 @@ return $ opts { buildModes = buildModes opts . (m : ) } ) "BUILD_MODE") "add build-mode to build-mode list to specify" + , Option ['R'] ["reuse-source"] + (NoArg $ \opts -> return $ opts { reuseSource = True }) + "not clean generated source directory, and build will reuse it" ] parseOption :: [String] @@ -82,14 +87,21 @@ clean :: Build () clean = removeBuildDir -prepare :: ODebuildOptions -> [String] -> Build ((FilePath, FilePath), Source, Maybe Hackage) -prepare opts cdArgs = do - clean - maybe (fail "Illegal state: genSources") return =<< genSources (revision opts) cdArgs +prepare :: ODebuildOptions -> [String] -> Build (FilePath, Source, Maybe Hackage) +prepare opts cdArgs + | reuseSource opts = do + (dir, src, hkg) <- maybe (fail "generated source not found") return + =<< runMaybeT findGeneratedSource + return (dir, src, Just hkg) + | otherwise = do + clean + ((_, dir), src, mayH) <- maybe (fail "Illegal state: genSources") return + =<< genSources (revision opts) cdArgs + return (dir, src, mayH) build' :: [BuildMode] -> ODebuildOptions -> [String] -> [String] -> Build (Source, Maybe Hackage) build' modes opts cdArgs debArgs = do - ((_, dir), src, mayH) <- prepare opts cdArgs + (dir, src, mayH) <- prepare opts cdArgs liftTrace $ Command.build dir modes (installDeps opts) debArgs return (src, mayH) @@ -110,17 +122,6 @@ maybe (return ()) remove' mayH install' -compile :: ODebuildOptions -> [String] -> [String] -> Build (Source, Hackage) -compile opts _ debArgs = do - (dir, src, hkg) <- maybe (fail "generated source not found") return =<< runMaybeT findGeneratedSource - liftTrace $ Command.build dir (buildModes opts []) (installDeps opts) debArgs - return (src, hkg) - -compileInstall :: ODebuildOptions -> [String] -> [String] -> Build () -compileInstall opts x debArgs = do - void $ compile opts x debArgs - install' - run :: Build a -> IO a run b = do cur <- pwd @@ -159,8 +160,6 @@ "build" -> void $ runArgs build as1 "install" -> runArgs install as1 "reinstall" -> runArgs reinstall as1 - "compile" -> void $ runArgs compile as1 - "compile-i" -> runArgs compileInstall as1 _ -> void $ runArgs build as2 [] -> run . void $ build defaultOptions [] [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debian-build-0.9.2.0/src/Debian/Package/Build/Cabal.hs new/debian-build-0.10.1.0/src/Debian/Package/Build/Cabal.hs --- old/debian-build-0.9.2.0/src/Debian/Package/Build/Cabal.hs 2016-06-04 18:16:31.000000000 +0200 +++ new/debian-build-0.10.1.0/src/Debian/Package/Build/Cabal.hs 2016-07-09 09:56:46.000000000 +0200 @@ -10,23 +10,22 @@ -- This module wraps cabal library interfaces to keep sparse dependency to it. module Debian.Package.Build.Cabal ( findDescriptionFile + , fillSetupHs , setupCmd, clean, sdist , configure, build, install, register ) where import Control.Applicative ((<$>)) -import Control.Monad (filterM) +import Control.Monad (filterM, when) import Control.Monad.Trans.Class (lift) -import Data.Maybe (listToMaybe) +import Data.Maybe (listToMaybe, isJust) import Data.List (isSuffixOf) import System.FilePath ((</>)) import System.Directory (getDirectoryContents, doesFileExist) -import System.Environment (withArgs) -import Distribution.Simple (defaultMain) - -import Debian.Package.Build.Monad (Trace, traceCommand) +import Debian.Package.Build.Monad (Trace) +import Debian.Package.Build.Command (rawSystem') -- | Find .cabal file @@ -40,10 +39,21 @@ where suf = ".cabal" fmap (dir </>) . listToMaybe <$> filterM find fs +findSetupHs :: FilePath -> IO (Maybe FilePath) +findSetupHs dir = + listToMaybe <$> + filterM (doesFileExist . (dir </>)) ["Setup.hs", "Setup.lhs"] + +fillSetupHs :: FilePath -> IO () +fillSetupHs dir = do + found <- isJust <$> findSetupHs dir + when (not found) . writeFile (dir </> "Setup.hs") $ + unlines ["import Distribution.Simple", "main = defaultMain"] + setup :: [String] -> Trace () -setup args = do - traceCommand (unwords $ "<cabal>" : args) - lift $ args `withArgs` defaultMain +setup args = do + setupHs <- maybe (fail "Setup.hs or Setup.lhs is not found.") id <$> lift (findSetupHs ".") + rawSystem' "runghc" $ setupHs : args -- | Call cabal library defaultMain like Setup.hs setupCmd :: String -> [String] -> Trace () diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debian-build-0.9.2.0/src/Debian/Package/Build/Sequence.hs new/debian-build-0.10.1.0/src/Debian/Package/Build/Sequence.hs --- old/debian-build-0.9.2.0/src/Debian/Package/Build/Sequence.hs 2016-06-04 18:16:31.000000000 +0200 +++ new/debian-build-0.10.1.0/src/Debian/Package/Build/Sequence.hs 2016-07-09 09:56:46.000000000 +0200 @@ -220,6 +220,10 @@ -> [String] -- ^ Optional arguments of cabal-debian command -> Build ((FilePath, FilePath), HaskellPackage) -- ^ Result package informations of generated source cabalAutogenSources hname mayRev cdArgs = do + {- Fill Setup.hs to make cabal-debian can detect. + Newer cabal-debian generates `DEB_SETUP_BIN_NAME = cabal' line, + which causes home directory access errors at build time. -} + liftIO . Cabal.fillSetupHs =<< askBaseDir debDir <- cabalAutogenDebianDir mayRev cdArgs pkg <- liftTrace . dpkgParseChangeLog $ debDir </> "changelog" let hpkg = haskellPackageFromPackage hname pkg