Skip to content
This repository
Browse code

Implement new "provides" policy

  • Loading branch information...
commit d4107f03211c79e2dba4304ac9dadaa7da1b06e1 1 parent 42e8873
Don Stewart authored January 19, 2010

Showing 2 changed files with 56 additions and 56 deletions. Show diff stats Hide diff stats

  1. 110  Main.hs
  2. 2  cabal2arch.cabal
110  Main.hs
@@ -213,80 +213,77 @@ removeCoreFrom (x@(Dependency n vr):xs) =
213 213
 --
214 214
 -- http://haskell.org/haskellwiki/Libraries_released_with_GHC
215 215
 --
216  
--- TODO populate this based on a dynamic check.
  216
+-- And what Arch Linux thinks GHC provides:
217 217
 --
218  
--- Check the page too.
  218
+-- http://repos.archlinux.org/wsvn/packages/ghc/repos/extra-x86_64/PKGBUILD
  219
+--
  220
+-- Note: we could just list these directly, and have yaourt solve them.
  221
+--
  222
+-- NEW POLICY:
  223
+--      We rely on all "provides" from the GHC library to be listed explicitly.
219 224
 --
220 225
 corePackages :: [Dependency]
221 226
 corePackages =
222 227
     [
223  
-     Dependency (PackageName "Cabal")            (ThisVersion (Version  [1,6,0,1] []))
224  
-    ,Dependency (PackageName "HUnit")            (ThisVersion (Version  [1,2,0,3] []))
225  
-    ,Dependency (PackageName "QuickCheck")       (ThisVersion (Version  [1,2,0,0] []))
226  
-    ,Dependency (PackageName "array")            (ThisVersion (Version  [0,2,0,0] []))
227  
-    ,Dependency (PackageName "base")             (ThisVersion (Version  [4,1,0,0] []))
228  
-    ,Dependency (PackageName "bytestring")       (ThisVersion (Version  [0,9,1,4] []))
229  
-    ,Dependency (PackageName "containers")       (ThisVersion (Version  [0,2,0,0] []))
230  
-    ,Dependency (PackageName "directory")        (ThisVersion (Version  [1,0,0,2] []))
231 228
 
  229
+-- Magic packages we have to remove
  230
+     Dependency (PackageName "base")             (ThisVersion (Version  [4,1,0,0] []))
232 231
     ,Dependency (PackageName "dph-base")           (ThisVersion (Version [ 0,3 ] [] ))
233 232
     ,Dependency (PackageName "dph-par" )           (ThisVersion (Version [ 0,3 ] [] ))
234 233
     ,Dependency (PackageName "dph-prim-interface") (ThisVersion (Version [ 0,3 ] [] ))
235 234
     ,Dependency (PackageName "dph-prim-par"   )    (ThisVersion (Version [ 0,3 ] [] ))
236 235
     ,Dependency (PackageName "dph-prim-seq"   )    (ThisVersion (Version [ 0,3 ] [] ))
237 236
     ,Dependency (PackageName "dph-seq"        )    (ThisVersion (Version [ 0,3 ] [] ))
238  
-
239  
--- removed:
240  
---    ,Dependency (PackageName "editline")         (AnyVersion)
241  
-    ,Dependency (PackageName "filepath")         (ThisVersion (Version  [1,1,0,1] []))
242 237
     ,Dependency (PackageName "ghc")              (AnyVersion)
243 238
     ,Dependency (PackageName "ghc-prim")         (AnyVersion)
244  
-    ,Dependency (PackageName "haskell-src")      (ThisVersion (Version  [1,0,1,3] []))
245  
-    ,Dependency (PackageName "haskell98")        (ThisVersion (Version  [1,0,1,0] []))
246  
-    ,Dependency (PackageName "hpc")              (ThisVersion (Version  [0,5,0,2] []))
247  
-    ,Dependency (PackageName "html")             (ThisVersion (Version  [1,0,1,2] []))
248  
-    ,Dependency (PackageName "integer")          (ThisVersion (Version  [0,1,0,0] []))
249  
-    ,Dependency (PackageName "mtl")              (ThisVersion (Version  [1,1,0,2] []))
250  
-    ,Dependency (PackageName "network")          (ThisVersion (Version  [2,2,0,1] []))
251  
-    ,Dependency (PackageName "old-locale")       (ThisVersion (Version  [1,0,0,1] []))
252  
-    ,Dependency (PackageName "old-time")         (ThisVersion (Version  [1,0,0,1] []))
253  
-    ,Dependency (PackageName "packedstring")     (ThisVersion (Version  [0,1,0,1] []))
254  
-    ,Dependency (PackageName "parallel")         (ThisVersion (Version  [1,1,0,0] []))
255  
-    ,Dependency (PackageName "parsec")           (ThisVersion (Version  [2,1,0,0] []))
256  
-    ,Dependency (PackageName "pretty")           (ThisVersion (Version  [1,0,1,0] []))
257  
-    ,Dependency (PackageName "process")          (ThisVersion (Version  [1,0,1,0] []))
258  
-    ,Dependency (PackageName "random")           (ThisVersion (Version  [1,0,0,1] []))
259  
-    ,Dependency (PackageName "regex-base")       (ThisVersion (Version  [0,72,0,2] []))
260  
-    ,Dependency (PackageName "regex-compat")     (ThisVersion (Version  [0,71,0,1] []))
261  
-    ,Dependency (PackageName "regex-posix")      (ThisVersion (Version  [0,72,0,2] []))
262  
-    ,Dependency (PackageName "stm")              (ThisVersion (Version  [2,1,1,2] []))
263  
-    ,Dependency (PackageName "syb")              (ThisVersion (Version  [0,1,0,0] []))
264  
-    ,Dependency (PackageName "template-haskell") (ThisVersion (Version  [2,3,0,0] []))
265  
---     ,Dependency (PackageName "time")             (ThisVersion (Version  [1,1,2,2] []))
266  
-    ,Dependency (PackageName "unix")             (ThisVersion (Version  [2,3,1,0] []))
267  
-    ,Dependency (PackageName "xhtml")            (ThisVersion (Version  [3000,2,0,1] []))
268  
-
269 239
 
  240
+-- Official Provides: http://repos.archlinux.org/wsvn/packages/ghc/repos/extra-x86_64/PKGBUILD
  241
+--  ,Dependency (PackageName "array")            (ThisVersion (Version  [0,3,0,0] []))
  242
+--  ,Dependency (PackageName "bytestring")       (ThisVersion (Version  [0,9,1,5] []))
  243
+--  ,Dependency (PackageName "Cabal")            (ThisVersion (Version  [1,8,0,2] []))
  244
+--  ,Dependency (PackageName "containers")       (ThisVersion (Version  [0,3,0,0] []))
  245
+--  ,Dependency (PackageName "directory")        (ThisVersion (Version  [1,0,1,0] []))
  246
+--  ,Dependency (PackageName "extensible-exceptions")         (AnyVersion)
  247
+--  ,Dependency (PackageName "filepath")         (ThisVersion (Version  [1,1,0,3] []))
  248
+--  ,Dependency (PackageName "haskell98")        (ThisVersion (Version  [1,0,1,1] []))
  249
+--  ,Dependency (PackageName "hpc")              (ThisVersion (Version  [0,5,0,4] []))
  250
+--  ,Dependency (PackageName "old-locale")       (ThisVersion (Version  [1,0,0,2] []))
  251
+--  ,Dependency (PackageName "old-time")         (ThisVersion (Version  [1,0,0,1] []))
  252
+--  ,Dependency (PackageName "pretty")           (ThisVersion (Version  [1,0,1,1] []))
  253
+--  ,Dependency (PackageName "process")          (ThisVersion (Version  [1,0,1,2] []))
  254
+--  ,Dependency (PackageName "random")           (ThisVersion (Version  [1,0,0,2] []))
  255
+--  ,Dependency (PackageName "syb")              (ThisVersion (Version  [0,1,0,2] []))
  256
+--  ,Dependency (PackageName "template-haskell") (ThisVersion (Version  [2,4,0,0] []))
  257
+--  ,Dependency (PackageName "time")             (ThisVersion (Version  [1,1,4] []))
  258
+--  ,Dependency (PackageName "unix")             (ThisVersion (Version  [2,4,0,0] []))
  259
+--  utf8-string
  260
+
  261
+
  262
+-- Removed in 6.12.x
  263
+--  ,Dependency (PackageName "html")             (ThisVersion (Version  [1,0,1,2] []))
  264
+--  ,Dependency (PackageName "integer")          (ThisVersion (Version  [0,1,0,0] []))
  265
+--  ,Dependency (PackageName "QuickCheck")       (ThisVersion (Version  [1,2,0,0] []))
  266
+--  ,Dependency (PackageName "haskell-src")      (ThisVersion (Version  [1,0,1,3] []))
  267
+--  ,Dependency (PackageName "parsec")           (ThisVersion (Version  [2,1,0,0] []))
  268
+--  ,Dependency (PackageName "packedstring")     (ThisVersion (Version  [0,1,0,1] []))
  269
+--  ,Dependency (PackageName "parallel")         (ThisVersion (Version  [1,1,0,0] []))
  270
+--  ,Dependency (PackageName "network")          (ThisVersion (Version  [2,2,0,1] []))
  271
+--  ,Dependency (PackageName "mtl")              (ThisVersion (Version  [1,1,0,2] []))
  272
+--  ,Dependency (PackageName "stm")              (ThisVersion (Version  [2,1,1,2] []))
  273
+--  ,Dependency (PackageName "HUnit")            (ThisVersion (Version  [1,2,0,3] []))
  274
+--  ,Dependency (PackageName "xhtml")            (ThisVersion (Version  [3000,2,0,1] []))
  275
+--  ,Dependency (PackageName "regex-base")       (ThisVersion (Version  [0,72,0,2] []))
  276
+--  ,Dependency (PackageName "regex-compat")     (ThisVersion (Version  [0,71,0,1] []))
  277
+--  ,Dependency (PackageName "regex-posix")      (ThisVersion (Version  [0,72,0,2] []))
  278
+
  279
+-- Removed in 6.10.x
  280
+--  ,Dependency (PackageName "editline")         (AnyVersion)
270 281
 --   Dependency (PackageName "ALUT")             (ThisVersion (Version  [2,1,0,0] []))
271 282
 --  ,Dependency (PackageName "cgi")              (ThisVersion (Version  [3001,1,5,1] []))
272  
---    ,Dependency (PackageName "extensible-exceptions")         (AnyVersion)
273 283
 --  ,Dependency (PackageName "fgl")              (ThisVersion (Version  [5,4,1,1] [])) -- gone
274 284
 --  ,Dependency (PackageName "GLUT")             (ThisVersion (Version  [2,1,1,1] []))
275  
---    ,Dependency (PackageName "OpenAL")           (ThisVersion (Version  [1,3,1,1] [])) -- gone
276  
---    ,Dependency (PackageName "readline")         (ThisVersion (Version  [1,0,1,0] []))
277  
-
278  
-{-
279  
-ALUT-2.1.0.0        cgi-3001.1.5.1       network-2.1.0.0       regex-base-0.72.0.1
280  
-Cabal-1.2.3.0       containers-0.1.0.1   old-locale-1.0.0.0    regex-compat-0.71.0.1
281  
-GLUT-2.1.1.1        directory-1.0.0.0    old-time-1.0.0.0      regex-posix-0.72.0.2
282  
-HUnit-1.2.0.0       fgl-5.4.1.1          packedstring-0.1.0.0  stm-2.1.1.0
283  
-OpenAL-1.3.1.1      filepath-1.1.0.0     parallel-1.0.0.0      template-haskell-2.2.0.0
284  
-OpenGL-2.2.1.1      haskell-src-1.0.1.1  parsec-2.1.0.0        time-1.1.2.0
285  
-QuickCheck-1.1.0.0  haskell98-1.0.1.0    pretty-1.0.0.0        unix-2.3.0.0
286  
-array-0.1.0.0       hpc-0.5.0.0          process-1.0.0.0       xhtml-3000.0.2.1
287  
-base-3.0.1.0        html-1.0.1.1         random-1.0.0.0
288  
-bytestring-0.9.0.1  mtl-1.1.0.0          readline-1.0.1.0
289  
--}
  285
+--  ,Dependency (PackageName "OpenAL")           (ThisVersion (Version  [1,3,1,1] [])) -- gone
  286
+--  ,Dependency (PackageName "readline")         (ThisVersion (Version  [1,0,1,0] []))
290 287
 
291 288
     ]
292 289
 
@@ -483,6 +480,9 @@ pkg2doc email pkg = vcat
483 480
  [ text "# Contributor:"
484 481
     <+> text email
485 482
  , text "# Package generated by cabal2arch" <+> disp version
  483
+ , text "# Note: we list all package dependencies."
  484
+ , text "# Your package tool should understand 'provides' syntax"
  485
+ , text "#"
486 486
  , text "pkgname"
487 487
     <=> text (arch_pkgname pkg)
488 488
  , text "pkgrel"
2  cabal2arch.cabal
... ...
@@ -1,5 +1,5 @@
1 1
 name:               cabal2arch
2  
-version:            0.6.1
  2
+version:            0.7
3 3
 homepage:           http://code.haskell.org/~dons/code/cabal2arch
4 4
 synopsis:           Create Arch Linux packages from Cabal packages
5 5
 description:        Create Arch Linux packages from Cabal packages

0 notes on commit d4107f0

Please sign in to comment.
Something went wrong with that request. Please try again.