Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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