hackport 0.8.2.2 → 0.8.3.0
raw patch · 8 files changed
+361/−60 lines, 8 files
Files
- CHANGELOG.md +297/−0
- hackport.cabal +1/−1
- src/Merge.hs +20/−14
- src/Merge/Dependencies.hs +1/−1
- src/Merge/Utils.hs +0/−8
- src/Portage/EBuild.hs +1/−1
- src/Portage/EMeta.hs +26/−21
- src/Util.hs +15/−14
+ CHANGELOG.md view
@@ -0,0 +1,297 @@+## v0.8.3.0 (2023-05-06)++Release v0.8.3.0++- Add `[profile?]` by default to dev-lang/ghc in RDEPEND++ Packages that require profiling and depend on the 'base' library+ (e.g. all of them) will need USE=profile on ghc.++- Only add current ARCH to KEYWORDS++ No longer pass KEYWORDS forward from previous ebuilds. Only add+ current ARCH by default.++## v0.8.2.2 (2023-04-29)++v0.8.2.2++Set modern defaults for LocalInfo in Portage.Host (this will help in+the event that askPortageq fails, such as on a clean stage3 chroot)++## v0.8.2.1 (2023-04-02)++v0.8.2.1++Allow Setup.hs to work without cabal-doctest++## v0.8.2.0 (2023-03-03)++v0.8.2.0++Update GHCCore dependency list:++- Mark 'stm' as non-upgradeable, 'parsec' and 'text' as upgradeable+- Update bundled version of 'process'+- Add `ghc-9.2.*` entries+- Remove ancient `<ghc-8.8` entries++## v0.8.1.0 (2023-02-16)++v0.8.1.0++- Revert change that adds dev-haskell/process to ebuilds++## v0.8.0.0 (2022-12-25)++v0.8.0.0++- Switch 'cabal' submodule to new 3.8 branch+- Use new updateAction from cabal-install+- Builds on ghc-9.2+- Make process an upgradeable package++Thanks-to: Miezhiko <Miezhiko@gmail.com>++## v0.7.3.1 (2022-12-07)++Bump to v0.7.3.1++- Support optparse-applicative-0.17++## v0.7.3.0 (2022-08-26)++Add remote-id support for metadata.xml++## v0.7.2.1 (2022-07-23)++Release v0.7.2.1++## v0.7.2 (2022-07-19)++Release v0.7.2++Main change is automated hackage revision+handling when using 'hackport merge'.++## v0.7.1.2 (2022-07-17)++Release version 0.7.1.2++Main user-facing change is the removal of repoman.++## v0.7.1.1 (2022-02-19)++Tag version 0.7.1.1: minor .cabal file fixes++## v0.7.1 (2022-02-19)++Tag version 0.7.1. Main changes include:++- ghc-9.0.2 library detection and bundled library changes+- bumped and patched submodules for compatibility with newer deps+- miscellaneous changes to test-suite, http-only websites list, docs+ and .cabal file.++## v0.7 (2021-07-10)++release 0.7++## v0.6.7 (2020-12-18)++release v0.6.7++## v0.6.6 (2020-07-27)++Release v0.6.6++Changes:++* Add `Hspec` test suite, migrating older `HUnit` tests to `Hspec`.++ There are currently 55 tests validating parsers, `metadata.xml`+ generators, licence converters and more to mitigate against+ unintended regressions++* Add `doctest` test suite to validate code comments.++ Although hackport is not a library, code comments are still+ important. Where we have code examples, let's make sure they are+ correct++* Comment the code in many places++* Refactor code, such as splitting `Merge.hs` between itself and+ `Merge/Utils.hs`, applying some hlint suggestions, and addressing+ some compiler warnings++* Fix a bug in the `Suffix` parser++* Raise `base` lower bound to 4.9 (hackport has not been able to build+ on `base-4.8` for many versions)++* Add GitHub CI for the GHC versions 8.0 -> 8.10 inclusive++* Set licence to GPL-3 in `.cabal` file, which it always was++* Rebase onto `Cabal-3.4` and `hackage-security-0.6.0.1` submodules++* Improve licence handling to more accurately generate the correct+ licence string where possible. This also fixes a regression which+ snuck in after a previous `Cabal` submodule upgrade, which would+ generate invalid GPL licence strings if the package's `.cabal` file+ used a `SPDX` licence identifier such as `GPL-<v>-or-later`++* Automate the addition of new USE flags into an existing+ `metadata.xml`.++ This new functionality alerts the user to the new `USE` flags (if+ any), and overwrites the existing `metadata.xml` with the union of+ the existing and new `USE` flags. This also updates any `USE` flag+ descriptions, as well as any other updated `metadata.xml` elements++* Add `GHC-8.8.4` library detection.++## v0.6.5 (2020-07-01)++Release 0.6.5++## v0.6.4 (2020-01-31)++Release 0.6.4++## v0.6.3 (2020-01-19)++hackport.cabal: release 0.6.3++Signed-off-by: Jack Todaro <jack.todaro@posteo.net>++## v0.6.2 (2020-01-04)++release v0.6.2++## v0.6.1 (2019-10-07)++Release v0.6.1++## v0.6 (2019-02-04)++New in 0.6:++* Builds with GHC 8.6+* Generates EAPI 7-compliant ebuilds+* Generates USE flags in the metadata.xml if the file does not yet exist.++## v0.5.6 (2018-05-30)++release 0.5.6++## v0.5.5 (2018-03-15)++release v0.5.5++## v0.5.4 (2017-09-23)++Release v0.5.4++## v0.5.3 (2017-05-24)++release v0.5.3++## v0.5.2 (2017-02-25)++tag v0.5.2++## v0.5.1 (2016-11-12)++release v0.5.1++## v0.5 (2016-04-20)++release 0.5++## v0.4.7 (2016-02-06)++release 0.4.6++## v0.4.6 (2015-08-12)++release 0.4.6++## v0.4.5 (2015-03-28)++release 0.4.5++## v0.4.4 (2014-09-26)++release v0.4.4++## v0.4.3 (2014-07-24)++release 0.4.3++## v0.4.2 (2014-05-29)++release 0.4.2++## v0.4.1 (2014-05-29)++release 0.4.1++## v0.4 (2014-04-05)++release v0.4++## v0.3.6 (2014-01-07)++tag release v0.3.6++## v0.3.5 (2013-11-28)++hackport.cabal: tag 0.3.5++Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>++## v0.3.4 (2013-09-14)++release 0.3.4++## v0.3.3 (2013-07-31)++release 0.3.3++## v0.3.2 (2013-01-01)++release v0.3.2++## v0.3.1 (2012-11-28)++release 0.3.1++## v0.3 (2012-10-17)++release 0.3++## v0.2.19 (2012-09-24)++release 0.2.19++## v0.2.18 (2012-05-29)++release 0.2.18++## v0.2.17 (2012-02-29)++release 0.2.17++## v0.2.16 (2012-02-16)++release 0.2.16++## v0.2.15 (2012-02-05)++release 0.2.15++## v0.2.14 (2011-11-28)++release 0.2.13
hackport.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: hackport-version: 0.8.2.2+version: 0.8.3.0 license: GPL-3.0-or-later license-file: LICENSE author: Henning Günther, Duncan Coutts, Lennart Kolmodin
src/Merge.hs view
@@ -14,6 +14,7 @@ , mergeGenericPackageDescription ) where +import Control.Applicative import Control.Monad import Control.Exception.Lifted import qualified Data.Text as T@@ -211,7 +212,7 @@ merged_PN = Portage.cabal_pn_to_PN merged_cabal_pkg_name pkgdir = overlayPath </> Portage.unCategory cat </> merged_PN existing_meta <- liftIO $ EM.findExistingMeta pkgdir- let requested_cabal_flags = Merge.first_just_of [users_cabal_flags, EM.cabal_flags existing_meta]+ let requested_cabal_flags = users_cabal_flags <|> EM.cabal_flags existing_meta -- accepts things, like: "cabal_flag:iuse_name", "+cabal_flag", "-cabal_flag" read_fas :: Maybe String -> (CabalFlags, [(String, String)])@@ -402,6 +403,12 @@ forM_ ghc_packages $ \name -> info $ "Excluded packages (comes with ghc): " ++ Cabal.unPackageName name + -- We only add the current arch to KEYWORDS+ thisArch <- run_cmd "portageq envvar ARCH" >>=+ maybe+ (die "Error running 'portageq envvar ARCH'")+ (pure . head . lines)+ let pp_fn (cabal_fn, yesno) = b yesno ++ Cabal.unFlagName cabal_fn where b True = "" b False = "-"@@ -430,17 +437,19 @@ p = if Cabal.flagDefault x then "+" else "" in p ++ cfn_to_iuse fn - ebuild = (\e -> e { E.depend = Merge.dep tdeps} )- . (\e -> e { E.depend_extra = S.toList $ Merge.dep_e tdeps } )- . (\e -> e { E.rdepend = Merge.rdep tdeps} )- . (\e -> e { E.rdepend_extra = S.toList $ Merge.rdep_e tdeps } )- . (\e -> e { E.src_configure = build_configure_call $- selected_flags (active_flags, user_specified_fas) } )- . (\e -> e { E.iuse = E.iuse e ++ map to_iuse active_flag_descs })+ ebuild = (\e -> e { E.iuse = E.iuse e ++ map to_iuse active_flag_descs }) . ( case requested_cabal_flags of Nothing -> id Just ucf -> (\e -> e { E.used_options = E.used_options e ++ [("flags", ucf)] }))- $ C2E.cabal2ebuild cat (Merge.packageDescription pkgDesc)+ $ (C2E.cabal2ebuild cat (Merge.packageDescription pkgDesc))+ { E.depend = Merge.dep tdeps+ , E.depend_extra = S.toList $ Merge.dep_e tdeps+ , E.rdepend = Merge.rdep tdeps+ , E.rdepend_extra = S.toList $ Merge.rdep_e tdeps+ , E.src_configure = build_configure_call $+ selected_flags (active_flags, user_specified_fas)+ , E.keywords = [ '~' : thisArch ]+ } let active_flag_descs_renamed = (\f -> f { Cabal.flagName = Cabal.mkFlagName . cfn_to_iuse . Cabal.unFlagName@@ -539,19 +548,16 @@ liftIO $ createDirectoryIfMissing True edir now <- liftIO $ TC.getCurrentTime - let (existing_keywords, existing_license) = (EM.keywords existing_meta, EM.license existing_meta)- new_keywords = maybe (E.keywords ebuild) (map Merge.to_unstable) existing_keywords+ let existing_license = EM.license existing_meta new_license = either (\err -> maybe (Left err) Right existing_license) Right (E.license ebuild)- ebuild' = ebuild { E.keywords = new_keywords- , E.license = new_license+ ebuild' = ebuild { E.license = new_license } s_ebuild' = E.showEBuild now ebuild' - notice $ "Current keywords: " ++ show existing_keywords ++ " -> " ++ show new_keywords notice $ "Current license: " ++ show existing_license ++ " -> " ++ show new_license notice $ "Writing " ++ elocal
src/Merge/Dependencies.hs view
@@ -125,7 +125,7 @@ cabal_dep :: Portage.Dependency cabal_dep = cabalDependency overlay (packageDescription pkg) compiler_info ghc_dep :: Portage.Dependency- ghc_dep = compilerInfoToDependency compiler_info+ ghc_dep = add_profile $ compilerInfoToDependency compiler_info extra_libs :: Portage.Dependency extra_libs = Portage.DependAllOf $ findCLibs (packageDescription pkg) pkg_config_libs :: [Portage.Dependency]
src/Merge/Utils.hs view
@@ -8,7 +8,6 @@ module Merge.Utils ( readPackageString , getPreviousPackageId- , first_just_of , drop_prefix , squash_debug , convert_underscores@@ -21,7 +20,6 @@ ) where import qualified Control.Applicative as A-import qualified Control.Monad as M import qualified Data.Char as C import Data.Maybe (catMaybes, mapMaybe) import qualified Data.List as L@@ -80,12 +78,6 @@ case pkgIds of x:_ -> Just x _ -> Nothing---- | Alias for 'msum'.--- --- prop> \a -> first_just_of a == M.msum a-first_just_of :: [Maybe a] -> Maybe a-first_just_of = M.msum -- | Remove @with@ or @use@ prefixes from flag names. --
src/Portage/EBuild.hs view
@@ -82,7 +82,7 @@ homepage = "https://hackage.haskell.org/package/${HACKAGE_N}", license = Left "unassigned license?", slot = "0",- keywords = ["~amd64","~x86"],+ keywords = [], iuse = [], depend = empty_dependency, depend_extra = [],
src/Portage/EMeta.hs view
@@ -13,6 +13,7 @@ ) where import Control.Monad+import Control.Monad.IO.Class import Data.Char (isSpace) import qualified Data.List as L @@ -84,24 +85,28 @@ } -- | Find the existing package metadata from the last available ebuild.-findExistingMeta :: FilePath -> IO EMeta-findExistingMeta pkgdir =- do ebuilds <- filter (L.isSuffixOf ".ebuild") `fmap` do b <- doesDirectoryExist pkgdir- if b then getDirectoryContents pkgdir- else return []- -- TODO: version sort- e_metas <- forM ebuilds $ \e ->- do let e_path = pkgdir </> e- e_conts <- readFile e_path- return EMeta { keywords = extractKeywords e e_conts- , license = extractLicense e e_conts- , cabal_flags = extractCabalFlags e e_conts- , description = extractDescription e e_conts- }- let get_latest candidates = last (Nothing : filter (/= Nothing) candidates)- aggregated_meta = EMeta { keywords = get_latest $ map keywords e_metas- , license = get_latest $ map license e_metas- , cabal_flags = get_latest $ map cabal_flags e_metas- , description = get_latest $ map description e_metas- }- return aggregated_meta+findExistingMeta :: MonadIO m => FilePath -> m EMeta+findExistingMeta pkgdir = liftIO $ do+ ebuilds <- filter (L.isSuffixOf ".ebuild") <$> do+ b <- doesDirectoryExist pkgdir+ if b+ then getDirectoryContents pkgdir+ else pure []+ -- TODO: version sort+ eMetas <- forM ebuilds $ \e -> do+ let ePath = pkgdir </> e+ eConts <- readFile ePath+ pure EMeta+ { keywords = extractKeywords e eConts+ , license = extractLicense e eConts+ , cabal_flags = extractCabalFlags e eConts+ , description = extractDescription e eConts+ }+ let get_latest candidates = last (Nothing : filter (/= Nothing) candidates)+ aggregated_meta = EMeta+ { keywords = get_latest $ map keywords eMetas+ , license = get_latest $ map license eMetas+ , cabal_flags = get_latest $ map cabal_flags eMetas+ , description = get_latest $ map description eMetas+ }+ pure aggregated_meta
src/Util.hs view
@@ -14,27 +14,28 @@ , die ) where +import Control.Monad.IO.Class import System.IO import System.Process import System.Exit (ExitCode(..)) import qualified Distribution.Simple.Utils as Cabal import Hackport.Env --- 'run_cmd' executes command and returns it's standard output--- as 'String'.--run_cmd :: String -> IO (Maybe String)-run_cmd cmd = do (hI, hO, hE, hProcess) <- runInteractiveCommand cmd- hClose hI- output <- hGetContents hO- errors <- hGetContents hE -- TODO: propagate error to caller- length output `seq` hClose hO- length errors `seq` hClose hE+-- | 'run_cmd' executes command and returns it's standard output+-- as 'String'.+run_cmd :: MonadIO m => String -> m (Maybe String)+run_cmd cmd = liftIO $ do+ (hI, hO, hE, hProcess) <- runInteractiveCommand cmd+ hClose hI+ output <- hGetContents hO+ errors <- hGetContents hE -- TODO: propagate error to caller+ length output `seq` hClose hO+ length errors `seq` hClose hE - exitCode <- waitForProcess hProcess- return $ if (output == "" || exitCode /= ExitSuccess)- then Nothing- else Just output+ exitCode <- waitForProcess hProcess+ return $ if (output == "" || exitCode /= ExitSuccess)+ then Nothing+ else Just output debug :: (HasGlobalEnv m, MonadIO m) => String -> m () debug s = askGlobalEnv >>= \(GlobalEnv v _ _) -> liftIO $ Cabal.debug v s