Skip to content
Newer
Older
100644 382 lines (329 sloc) 14.1 KB
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
1 {-# OPTIONS -XPatternGuards #-}
a1730ad @kolmodin Switch to using Cabal's CLI API
kolmodin authored
2 module Merge where
3
4 import Control.Monad.Error
8135c0c @kolmodin Implement fetching and creation of digests for new ebuilds
kolmodin authored
5 import Control.Exception
a1730ad @kolmodin Switch to using Cabal's CLI API
kolmodin authored
6 import Data.Char
7 import Data.Maybe
8 import Data.List
9 import Data.Version
10 import Distribution.Package
11 import Distribution.Compiler (CompilerId(..), CompilerFlavor(GHC))
cb4a7bb @kolmodin Start on translating extra-libraries into ebuild deps
kolmodin authored
12 import Distribution.PackageDescription ( PackageDescription(..)
34e7842 @kolmodin Set --flags=-cocoa when finalizing a PackageDescription
kolmodin authored
13 , FlagName(..)
cb4a7bb @kolmodin Start on translating extra-libraries into ebuild deps
kolmodin authored
14 , libBuildInfo
15 , buildInfo
1de8047 @kolmodin Add build-tools deps as well, using a static table
kolmodin authored
16 , extraLibs
17 , buildTools )
a1730ad @kolmodin Switch to using Cabal's CLI API
kolmodin authored
18 import Distribution.PackageDescription.Configuration
19 ( finalizePackageDescription )
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
20 -- import Distribution.PackageDescription.Parse ( showPackageDescription )
a1730ad @kolmodin Switch to using Cabal's CLI API
kolmodin authored
21 import Distribution.Simple.PackageIndex (PackageIndex)
22 import Distribution.Text (display)
23
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
24 import System.Directory ( getCurrentDirectory
25 , setCurrentDirectory
26 , createDirectoryIfMissing
27 )
a1730ad @kolmodin Switch to using Cabal's CLI API
kolmodin authored
28 import System.IO
8135c0c @kolmodin Implement fetching and creation of digests for new ebuilds
kolmodin authored
29 import System.Cmd (system)
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
30 import System.FilePath ((</>))
a1730ad @kolmodin Switch to using Cabal's CLI API
kolmodin authored
31 import qualified Data.Map as Map
32
33 import qualified Cabal2Ebuild as E
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
34 import Error as E
a1730ad @kolmodin Switch to using Cabal's CLI API
kolmodin authored
35 import Overlays
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
36
37 import qualified Distribution.Package as Cabal
38 import qualified Distribution.Version as Cabal
a1730ad @kolmodin Switch to using Cabal's CLI API
kolmodin authored
39
8135c0c @kolmodin Implement fetching and creation of digests for new ebuilds
kolmodin authored
40 import Distribution.System (buildOS, buildArch)
a1730ad @kolmodin Switch to using Cabal's CLI API
kolmodin authored
41 import Distribution.Verbosity
42 import Distribution.Simple.Utils
43
44 import Network.URI
8135c0c @kolmodin Implement fetching and creation of digests for new ebuilds
kolmodin authored
45 import Network.HTTP
a1730ad @kolmodin Switch to using Cabal's CLI API
kolmodin authored
46
47 import Cabal2Ebuild
48
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
49 import Distribution.Client.IndexUtils ( getAvailablePackages )
50 import qualified Distribution.Simple.PackageIndex as Index
51 import Distribution.Client.Types
52
53 import qualified Portage.PackageId as Portage
54 import qualified Portage.Version as Portage
55 import qualified Portage.Overlay as Overlay
56
57 import Cabal2Ebuild
58
1c11ba1 @kolmodin Handle colliding package names better when looking for extra-libs
kolmodin authored
59 import Debug.Trace
60
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
61 -- This is just a hack to simplify version ranges.
62 -- Backported from Cabal HEAD to work with Cabal 1.6.
63 -- Replace this module once it's included in a cabal release.
64 import CabalDistributionVersion (simplifyVersionRange)
65
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
66 (<->) :: String -> String -> String
f56d508 @kolmodin Cleanup in merge
kolmodin authored
67 a <-> b = a ++ '-':b
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
68
69 (<.>) :: String -> String -> String
f56d508 @kolmodin Cleanup in merge
kolmodin authored
70 a <.> b = a ++ '.':b
71
22e0fbc @kolmodin Add requests for 'hackport merge'
kolmodin authored
72 {-
73 Requested features:
c2b8367 @kolmodin Update TODOs
kolmodin authored
74 * Copy the old keywords and ~arch them
22e0fbc @kolmodin Add requests for 'hackport merge'
kolmodin authored
75 * Add files to darcs?
76 * Print diff with the next latest version?
96a6477 @kolmodin Add some todos
kolmodin authored
77 BUGS:
78 * Dependencies are always expected to be in dev-haskell
22e0fbc @kolmodin Add requests for 'hackport merge'
kolmodin authored
79 -}
80
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
81 readPackageString :: [String]
82 -> Either HackPortError ( Maybe Portage.Category
83 , Cabal.PackageName
84 , Maybe Portage.Version
85 )
86 readPackageString args = do
87 packageString <-
88 case args of
7ab62d5 @kolmodin Tried hlint, nice.
kolmodin authored
89 [] -> Left (ArgumentError "Need an argument, [category/]package[-version]")
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
90 [pkg] -> return pkg
91 _ -> Left (ArgumentError ("Too many arguments: " ++ unwords args))
92 case Portage.parseFriendlyPackage packageString of
93 Just v@(_,_,Nothing) -> return v
94 -- we only allow versions we can convert into cabal versions
95 Just v@(_,_,Just (Portage.Version _ Nothing [] 0)) -> return v
96 _ -> Left (ArgumentError ("Could not parse [category/]package[-version]: " ++ packageString))
97
98 -- | If a package already exist in the overlay, find which category it has.
99 -- If it does not exist, we default to \'dev-haskell\'.
100 resolveCategory :: Verbosity -> Overlay.Overlay -> Cabal.PackageName -> IO Portage.Category
101 resolveCategory verbosity overlay pn = do
7ab62d5 @kolmodin Tried hlint, nice.
kolmodin authored
102 info verbosity "Searching for which category to use..."
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
103 case resolveCategories overlay pn of
104 [] -> do
105 info verbosity "No previous version of this package, defaulting category to dev-haskell."
106 return devhaskell
107 [cat] -> do
108 info verbosity $ "Exact match of already existing package, using category: "
109 ++ display cat
110 return cat
111 cats -> do
112 warn verbosity $ "Multiple matches of categories: " ++ unwords (map display cats)
113 if devhaskell `elem` cats
114 then do notice verbosity "Defaulting to dev-haskell"
115 return devhaskell
116 else do warn verbosity "Multiple matches and no known default. Override by specifying "
117 warn verbosity "package category like so 'hackport merge categoryname/package[-version]."
118 throwEx (ArgumentError "Specify package category and try again.")
119 where
120 devhaskell = Portage.Category "dev-haskell"
121
122 resolveCategories :: Overlay.Overlay -> Cabal.PackageName -> [Portage.Category]
123 resolveCategories overlay pn =
124 [ cat
125 | (Portage.PackageName cat pn') <- Map.keys om
126 , pn == Portage.normalizeCabalPackageName pn'
127 ]
128 where
129 om = Overlay.overlayMap overlay
130
823b6ef @kolmodin Look into portage dir when resolving extra-libraries
kolmodin authored
131 resolveFullPortageName :: Overlay.Overlay -> Cabal.PackageName -> Maybe Portage.PackageName
132 resolveFullPortageName overlay pn =
133 case resolveCategories overlay pn of
134 [] -> Nothing
1c11ba1 @kolmodin Handle colliding package names better when looking for extra-libs
kolmodin authored
135 [cat] -> ret cat
136 cats | (cat:_) <- (filter (`elem` cats) priority) -> ret cat
137 | otherwise -> trace ("Ambiguous package name: " ++ show pn ++ ", hits: " ++ show cats) Nothing
823b6ef @kolmodin Look into portage dir when resolving extra-libraries
kolmodin authored
138 where
1c11ba1 @kolmodin Handle colliding package names better when looking for extra-libs
kolmodin authored
139 ret c = return (Portage.PackageName c pn)
140 mkC = Portage.Category
141 -- if any of these categories show up in the result list, the match isn't
142 -- ambiguous, pick the first match in the list
143 priority = [ mkC "dev-haskell"
144 , mkC "sys-libs"
145 , mkC "dev-libs"
146 , mkC "x11-libs"
147 , mkC "media-libs"
148 , mkC "net-libs"
149 , mkC "sci-libs"
150 ]
823b6ef @kolmodin Look into portage dir when resolving extra-libraries
kolmodin authored
151
152
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
153 -- | Given a list of available packages, and maybe a preferred version,
154 -- return the available package with that version. Latest version is chosen
155 -- if no preference.
156 resolveVersion :: [AvailablePackage] -> Maybe Cabal.Version -> Maybe AvailablePackage
157 resolveVersion avails Nothing = Just $ maximumBy (comparing packageInfoId) avails
158 resolveVersion avails (Just ver) = listToMaybe (filter match avails)
159 where
7ab62d5 @kolmodin Tried hlint, nice.
kolmodin authored
160 match avail = ver == pkgVersion (packageInfoId avail)
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
161
162 merge :: Verbosity -> Repo -> URI -> [String] -> IO ()
163 merge verbosity repo serverURI args = do
164 (m_category, user_pName, m_version) <-
165 case readPackageString args of
166 Left err -> throwEx err
167 Right (c,p,m_v) ->
168 case m_v of
169 Nothing -> return (c,p,Nothing)
170 Just v -> case Portage.toCabalVersion v of
171 Nothing -> throwEx (ArgumentError "illegal version")
172 Just ver -> return (c,p,Just ver)
173
174 debug verbosity $ "Category: " ++ show m_category
175 debug verbosity $ "Package: " ++ show user_pName
176 debug verbosity $ "Version: " ++ show m_version
177
178 let (Cabal.PackageName user_pname_str) = user_pName
179
180 overlayPath <- getOverlayPath verbosity
181 overlay <- Overlay.loadLazy overlayPath
e203713 @trofi added support for nonstandard PORTDIR(emerge) location::gentoo(paludis)
trofi authored
182 portage_path <- Overlay.portage_dir `fmap` Overlay.getInfo
183 portage <- Overlay.loadLazy portage_path
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
184 index <- fmap packageIndex $ getAvailablePackages verbosity [ repo ]
185
186 -- find all packages that maches the user specified package name
187 availablePkgs <-
188 case Index.searchByName index user_pname_str of
189 Index.None -> throwEx (PackageNotFound user_pname_str)
190 Index.Ambiguous pkgs -> throwEx (ArgumentError ("Ambiguous name: " ++ unwords (map show pkgs)))
191 Index.Unambiguous pkg -> return pkg
192
193 -- select a single package taking into account the user specified version
194 selectedPkg <-
195 case resolveVersion availablePkgs m_version of
196 Nothing -> do
197 putStrLn "No such version for that package, available versions:"
7ab62d5 @kolmodin Tried hlint, nice.
kolmodin authored
198 forM_ availablePkgs $ \ avail ->
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
199 putStrLn (display . packageInfoId $ avail)
200 throwEx (ArgumentError "no such version for that package")
201 Just avail -> return avail
202
203 -- print some info
204 info verbosity "Selecting package:"
205 forM_ availablePkgs $ \ avail -> do
206 let match_text | packageInfoId avail == packageInfoId selectedPkg = "* "
207 | otherwise = "- "
208 info verbosity $ match_text ++ (display . packageInfoId $ avail)
209
210 let cabal_pkgId = packageInfoId selectedPkg
211 norm_pkgId = Portage.normalizeCabalPackageId cabal_pkgId
212 norm_pkgName = packageName norm_pkgId
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
213 cat <- resolveCategory verbosity overlay norm_pkgName
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
214
215 let pkgGenericDesc = packageDescription selectedPkg
216 Right (pkgDesc0, flags) =
217 finalizePackageDescription
218 [ -- XXX: common things we should enable/disable?
219 -- (FlagName "small_base", True) -- try to use small base
34e7842 @kolmodin Set --flags=-cocoa when finalizing a PackageDescription
kolmodin authored
220 (FlagName "cocoa", False)
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
221 ]
222 (Nothing :: Maybe (PackageIndex PackageIdentifier))
223 buildOS buildArch
224 (CompilerId GHC (Version [6,10,1] []))
225 [] pkgGenericDesc
226 pkgDesc = let deps = [ Dependency pn (simplifyVersionRange vr)
227 | Dependency pn vr <- buildDepends pkgDesc0
228 ]
229 in pkgDesc0 { buildDepends = deps }
1de8047 @kolmodin Add build-tools deps as well, using a static table
kolmodin authored
230
231 bt = [ Cabal.Dependency (Cabal.PackageName pkg') range
232 | Cabal.Dependency (Cabal.PackageName pkg ) range <- buildToolsDeps pkgDesc
233 , Just pkg' <- return (lookup pkg buildToolsTable)
234 ]
235
823b6ef @kolmodin Look into portage dir when resolving extra-libraries
kolmodin authored
236 packageNameResolver s = do
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
237 (Portage.PackageName (Portage.Category p_cat) (Cabal.PackageName pn))
823b6ef @kolmodin Look into portage dir when resolving extra-libraries
kolmodin authored
238 <- resolveFullPortageName portage (Cabal.PackageName s)
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
239 return $ E.AnyVersionOf (p_cat </> pn)
823b6ef @kolmodin Look into portage dir when resolving extra-libraries
kolmodin authored
240
241 extra <- findCLibs verbosity packageNameResolver pkgDesc
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
242
243 debug verbosity ("Selected flags: " ++ show flags)
cb4a7bb @kolmodin Start on translating extra-libraries into ebuild deps
kolmodin authored
244 debug verbosity ("extra-libs: ")
245 mapM_ (debug verbosity . show) extra
1de8047 @kolmodin Add build-tools deps as well, using a static table
kolmodin authored
246
247 debug verbosity ("build-tools:")
248 mapM_ (debug verbosity . show) bt
249
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
250 -- debug verbosity ("Finalized package:\n" ++ showPackageDescription pkgDesc)
251
252 -- TODO: more fixes
96a6477 @kolmodin Add some todos
kolmodin authored
253 -- * inherit keywords from previous ebuilds
cb4a7bb @kolmodin Start on translating extra-libraries into ebuild deps
kolmodin authored
254 let ebuild = fixSrc serverURI (packageId pkgDesc)
255 . addDeps extra
1de8047 @kolmodin Add build-tools deps as well, using a static table
kolmodin authored
256 . addDeps (convertDependencies bt)
cb4a7bb @kolmodin Start on translating extra-libraries into ebuild deps
kolmodin authored
257 $ E.cabal2ebuild pkgDesc
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
258 -- ebuildName = display category </> display norm_pkgId
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
259
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
260 mergeEbuild verbosity overlayPath (Portage.unCategory cat) ebuild
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
261 fetchAndDigest
262 verbosity
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
263 (overlayPath </> display cat </> display norm_pkgName)
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
264 (display cabal_pkgId <.> "tar.gz")
265 (mkUri cabal_pkgId)
266
cb4a7bb @kolmodin Start on translating extra-libraries into ebuild deps
kolmodin authored
267 addDeps :: [E.Dependency] -> EBuild -> EBuild
268 addDeps d e = e { depend = depend e ++ d }
269
36431fe @kolmodin Further cleanup
kolmodin authored
270 findCLibs :: Verbosity -> (String -> Maybe E.Dependency) -> PackageDescription -> IO [E.Dependency]
271 findCLibs verbosity portageResolver (PackageDescription { library = lib, executables = exes }) = do
823b6ef @kolmodin Look into portage dir when resolving extra-libraries
kolmodin authored
272 debug verbosity "Mapping extra-libraries into portage packages..."
cb4a7bb @kolmodin Start on translating extra-libraries into ebuild deps
kolmodin authored
273 -- for extra libs we don't find, maybe look into into installed packages?
823b6ef @kolmodin Look into portage dir when resolving extra-libraries
kolmodin authored
274 when (not . null $ notFound) $
87489f1 @kolmodin Clean up the extra-libraries resolving a bit
kolmodin authored
275 warn verbosity ("Could not find portage packages for extra-libraries: " ++ unwords notFound)
823b6ef @kolmodin Look into portage dir when resolving extra-libraries
kolmodin authored
276 when (not . null $ found) $
277 debug verbosity ("Found c-libraries deps: " ++ show found)
278 return found
cb4a7bb @kolmodin Start on translating extra-libraries into ebuild deps
kolmodin authored
279 where
87489f1 @kolmodin Clean up the extra-libraries resolving a bit
kolmodin authored
280 resolvers = [ staticTranslateExtraLib, portageResolver ]
281
282 resolved = [ chain p resolvers
283 | p <- libE ++ exeE
284 ] :: [Either String E.Dependency]
285
286 notFound = [ p | Left p <- resolved ]
287 found = [ p | Right p <- resolved ]
288
289 chain v [] = Left v
290 chain v (f:fs) = case f v of
291 Nothing -> chain v fs
292 Just x -> Right x
293
cb4a7bb @kolmodin Start on translating extra-libraries into ebuild deps
kolmodin authored
294 libE = maybe [] (extraLibs.libBuildInfo) lib
295 exeE = concatMap (extraLibs.buildInfo) exes
296
87489f1 @kolmodin Clean up the extra-libraries resolving a bit
kolmodin authored
297 staticTranslateExtraLib :: String -> Maybe E.Dependency
298 staticTranslateExtraLib lib = lookup lib m
cb4a7bb @kolmodin Start on translating extra-libraries into ebuild deps
kolmodin authored
299 where
300 m = [ ("z", E.AnyVersionOf "sys-libs/zlib")
301 , ("bz2", E.AnyVersionOf "sys-libs/bzlib")
302 ]
303
1de8047 @kolmodin Add build-tools deps as well, using a static table
kolmodin authored
304 buildToolsDeps :: PackageDescription -> [Cabal.Dependency]
305 buildToolsDeps (PackageDescription { library = lib, executables = exes }) = cabalDeps
306 where
307 cabalDeps = depL ++ depE
308 depL = maybe [] (buildTools.libBuildInfo) lib
309 depE = concatMap (buildTools.buildInfo) exes
310
311 buildToolsTable :: [(String, String)]
312 buildToolsTable =
aa7f383 @kolmodin Fix build-tools bug
kolmodin authored
313 [ ("happy", "happy") -- TODO: we would like to specify both cat and pkg name
314 , ("alex", "alex")
315 , ("c2hs", "c2hs")
1de8047 @kolmodin Add build-tools deps as well, using a static table
kolmodin authored
316 ]
317
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
318 mkUri :: Cabal.PackageIdentifier -> URI
319 mkUri pid =
320 -- example:
321 -- http://hackage.haskell.org/packages/archive/Cabal/1.4.0.2/Cabal-1.4.0.2.tar.gz
322 fromJust $ parseURI $
323 "http://hackage.haskell.org/packages/archive/"
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
324 </> p_name </> p_ver </> p_name <-> p_ver <.> "tar.gz"
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
325 where
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
326 p_ver = display (packageVersion pid)
327 p_name = display (packageName pid)
8135c0c @kolmodin Implement fetching and creation of digests for new ebuilds
kolmodin authored
328
329 fetchAndDigest :: Verbosity
330 -> FilePath -- ^ directory of ebuild
331 -> String -- ^ tarball name
332 -> URI -- ^ tarball uri
6ec3592 Hackport now uses Cabal-1.6
Ivan.Miljenovic@gmail.com authored
333 -> IO ()
7ab62d5 @kolmodin Tried hlint, nice.
kolmodin authored
334 fetchAndDigest verbosity ebuildDir tarballName tarballURI =
8135c0c @kolmodin Implement fetching and creation of digests for new ebuilds
kolmodin authored
335 withWorkingDirectory ebuildDir $ do
f56d508 @kolmodin Cleanup in merge
kolmodin authored
336 notice verbosity $ "Fetching " ++ show tarballURI
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
337 e_response <- simpleHTTP (Request tarballURI GET [] "")
338 case e_response of
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
339 Left err -> throwEx (E.DownloadFailed (show tarballURI) (show err))
8135c0c @kolmodin Implement fetching and creation of digests for new ebuilds
kolmodin authored
340 Right response -> do
830d9bb @trofi Added basic repository location discovery (currently disfiles dir via…
trofi authored
341 repo_info <- Overlay.getInfo
342 let tarDestination = (Overlay.distfiles_dir repo_info) </> tarballName
f56d508 @kolmodin Cleanup in merge
kolmodin authored
343 notice verbosity $ "Saving to " ++ tarDestination
8135c0c @kolmodin Implement fetching and creation of digests for new ebuilds
kolmodin authored
344 writeFile tarDestination (rspBody response)
7ab62d5 @kolmodin Tried hlint, nice.
kolmodin authored
345 notice verbosity "Recalculating digests..."
8135c0c @kolmodin Implement fetching and creation of digests for new ebuilds
kolmodin authored
346 system "repoman manifest"
347 return ()
348
349 withWorkingDirectory :: FilePath -> IO a -> IO a
350 withWorkingDirectory newDir action = do
351 oldDir <- getCurrentDirectory
352 bracket
353 (setCurrentDirectory newDir)
354 (\_ -> setCurrentDirectory oldDir)
355 (\_ -> action)
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
356
357 mergeEbuild :: Verbosity -> FilePath -> String -> EBuild -> IO ()
deff889 @trofi Some fixes for -Wall (name colisions, redundant imports)
trofi authored
358 mergeEbuild verbosity target cat ebuild = do
359 let edir = target </> cat </> name ebuild
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
360 elocal = name ebuild ++"-"++ version ebuild <.> "ebuild"
361 epath = edir </> elocal
362 createDirectoryIfMissing True edir
363 info verbosity $ "Writing " ++ elocal
364 writeFile epath (showEBuild ebuild)
365
366 fixSrc :: URI -> PackageIdentifier -> EBuild -> EBuild
367 fixSrc serverURI p ebuild =
368 ebuild {
369 src_uri = show $ serverURI {
370 uriPath =
7ab62d5 @kolmodin Tried hlint, nice.
kolmodin authored
371 uriPath serverURI
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
372 </> display (pkgName p)
373 </> display (pkgVersion p)
374 </> display (pkgName p) ++ "-" ++ display (pkgVersion p)
375 <.> "tar.gz"
175e753 @kolmodin Set a default homepage to hackport if none is set
kolmodin authored
376 },
377 E.homepage = case E.homepage ebuild of
378 "" -> "http://hackage.haskell.org/cgi-bin/hackage-scripts/package/"
379 ++ display (pkgName p)
380 x -> x
f309365 @kolmodin Reimplement 'hackport merge'
kolmodin authored
381 }
Something went wrong with that request. Please try again.