cabal2arch 0.8.0 → 1.0
raw patch · 4 files changed
+50/−95 lines, 4 filesdep ~archlinux
Dependency ranges changed: archlinux
Files
- Cabal2Arch/Util.hs +2/−1
- Main.hs +1/−55
- cabal2arch.cabal +37/−31
- data/library-providers.txt +10/−8
Cabal2Arch/Util.hs view
@@ -47,8 +47,9 @@ then throwError ("File " ++ path ++ " does not exist!") else liftIO (readFile path) --- getDefaultSystemProvides = getSystemProvidesFromPath "http://andromeda.kiwilight.com/~remy.oudompheng/arch-haskell/default"+getDefaultSystemProvides :: ErrorT String IO SystemProvides getDefaultSystemProvides = getSystemProvidesFromPath =<< (liftIO $ getDataFileName "data")+ -- getSystemProvidesFromPath "http://andromeda.kiwilight.com/~remy.oudompheng/arch-haskell/default" getSystemProvidesFromPath :: String -> IOErr SystemProvides getSystemProvidesFromPath dir
Main.hs view
@@ -17,7 +17,6 @@ -- rather than makedepends import Distribution.PackageDescription.Parse-import Distribution.PackageDescription (GenericPackageDescription) import Distribution.Simple.Utils hiding (die) import Distribution.Verbosity import Distribution.Text@@ -25,15 +24,12 @@ -- from the archlinux package: import Distribution.ArchLinux.PkgBuild import Distribution.ArchLinux.CabalTranslation-import Distribution.ArchLinux.SystemProvides-import Distribution.ArchLinux.HackageTranslation import Control.Monad import Control.Monad.Error import qualified Control.Exception as CE import Data.List-import qualified Data.ByteString.Lazy as Bytes import Text.PrettyPrint @@ -51,7 +47,6 @@ data CmdLnArgs = CmdLnConvertOne { argCabalFile :: String, argCreateTar :: Bool, argDataFiles :: String }- | CmdLnConvertMany { argPkgList :: FilePath, argTarBall :: FilePath, argRepo :: FilePath, argDataFiles :: String } deriving (Data, Typeable) cmdLnConvertOne :: CmdLnArgs@@ -61,22 +56,8 @@ , argDataFiles = "" &= name "sysinfo" &= typDir &= explicit &= help "Use custom system information files." } &= auto &= name "conv" &= help "Convert a single CABAL file." -cmdLnConvertMany :: CmdLnArgs-cmdLnConvertMany = CmdLnConvertMany- { argPkgList = def &= argPos 0 &= typFile- , argTarBall = def &= argPos 1 &= typFile- , argRepo = def &= argPos 2 &= typDir- , argDataFiles = "" &= name "sysinfo" &= typDir &= explicit &= help "Use custom system information files."- } &= name "convtar" &= help "Convert a tarball of CABAL files into an ABS tree."- &= details- [ " cabal2arch convtar list tar abs"- , "'list' is a file consisting of lines of the form \"<pkg name> <version>\"."- , "'tar' is a tar ball of package descriptions (CABAL files) like the one published on Hackage:", " http://hackage.haskell.org/packages/archive/00-index.tar.gz"- , "'abs' is a directory where the ABS tree will be created."- ]- cmdLnArgs :: CmdLnArgs-cmdLnArgs = modes [cmdLnConvertOne, cmdLnConvertMany]+cmdLnArgs = modes [cmdLnConvertOne] &= program "cabal2arch" &= summary ("cabal2arch, v. " ++ showVersion version ++ ": Convert .cabal file to ArchLinux source package") @@ -172,41 +153,6 @@ (arch_pkgname pkgbuild ++ "-" ++ (display $ arch_pkgver pkgbuild)) (arch_pkgdesc pkgbuild) (arch_url pkgbuild)) ++ "\n"--subCmd (CmdLnConvertMany pkgListLoc tarballLoc repoLoc dataFiles) = do- pkglist <- readFile pkgListLoc- tarball <- Bytes.readFile tarballLoc- repo <- canonicalizePath repoLoc- email <- do- r <- getEnvMaybe "ARCH_HASKELL"- case r of- Nothing -> do- hPutStrLn stderr "Warning: ARCH_HASKELL environment variable not set. Set this to the maintainer contact you wish to use. \n E.g. 'Arch Haskell Team <arch-haskell@haskell.org>'"- return []- Just s -> return s- maybeSysProvides <- runErrorT $ getSystemProvidesFromPath dataFiles- sysProvides <- case maybeSysProvides of- Left s -> die s- Right sp -> return sp- let cabals = getSpecifiedCabalsFromTarball tarball (lines pkglist)- mapM_ (exportPackage repo email sysProvides) cabals--exportPackage :: FilePath -> String -> SystemProvides -> GenericPackageDescription -> IO ()-exportPackage dot email sysProvides p = do- let q = preprocessCabal p sysProvides- case q of- Nothing -> return ()- Just p' -> do- let (pkg, script) = cabal2pkg p' sysProvides- pkgname = arch_pkgname (pkgBody pkg)- pkgbuild <- getMD5 pkg- let apkgbuild = pkgbuild { pkgBuiltWith = Just version }- rawpkgbuild = (render $ pkg2doc email apkgbuild) ++ "\n"- createDirectoryIfMissing True (dot </> pkgname)- writeFile (dot </> pkgname </> "PKGBUILD") rawpkgbuild- case script of- Nothing -> return ()- Just s -> writeFile (dot </> pkgname </> (install_hook_name pkgname)) s ------------------------------------------------------------------------
cabal2arch.cabal view
@@ -1,37 +1,43 @@-name: cabal2arch-version: 0.8.0-homepage: http://github.com/archhaskell/-synopsis: Create Arch Linux packages from Cabal packages.-description: Create Arch Linux packages from Cabal packages.-category: Distribution-license: BSD3-license-file: LICENSE-author: Don Stewart <dons@galois.com>-maintainer: ArchHaskell Team <arch-haskell@haskell.org>-cabal-version: >= 1.6-build-type: Simple-data-files: data/*.txt+name: cabal2arch+version: 1.0+homepage: http://github.com/archhaskell/+synopsis: Create Arch Linux packages from Cabal packages.+description: Create Arch Linux packages from Cabal packages.+category: Distribution+license: BSD3+license-file: LICENSE+author: Don Stewart <dons@galois.com>,+ Matthew William Cox <matt@mattcox.ca>,+ Adam Vogt <vogt.adam@gmail.com>,+ Asgaroth <asgaroth_@gmx.de>,+ Rémy Oudompheng <remyoudompheng@gmail.com>,+ Magnus Therning <magnus@therning.org>,+ Peter Simons <simons@cryp.to>+maintainer: ArchHaskell Team <arch-haskell@haskell.org>+cabal-version: >= 1.6+build-type: Simple+data-files: data/*.txt source-repository head- type: git- location: git://github.com/archhaskell/cabal2arch.git+ type: git+ location: git://github.com/archhaskell/cabal2arch.git executable cabal2arch- main-is: Main.hs- ghc-options: -Wall+ main-is: Main.hs+ ghc-options: -Wall - build-depends:- base >= 4 && <= 6,- pretty,- process,- directory,- containers,- bytestring,- Cabal > 1.8,- filepath,- mtl,- archlinux >= 0.3.6,- cmdargs+ build-depends:+ base >= 4 && <= 6,+ pretty,+ process,+ directory,+ containers,+ bytestring,+ Cabal > 1.8,+ filepath,+ mtl,+ archlinux >= 1 && < 2,+ cmdargs - other-modules:- Cabal2Arch.Util+ other-modules:+ Cabal2Arch.Util
data/library-providers.txt view
@@ -3,6 +3,8 @@ # providing them. # +Imlib2 imlib2+SDL sdl adns adns alut freealut asound alsa-lib@@ -18,31 +20,32 @@ cv opencv db_cxx db doublefann fann-event libevent ev libev+event libevent exif libexif ffi libffi fftw3 fftw freetype freetype2 gcc_s gcc-libs+gconf gconf gcrypt libgcrypt gdk gtk gdk-x11-2.0 gtk2 gio glib2-glib glib2 gl mesa+glib glib2 glu mesa glut freeglut gmodule glib2 gnome-vfs-module-gnutls-extra gnutls gnutls gnutls+gnutls-extra gnutls gobject glib2+gstreamer gstreamer0.10 gstreamer-audio gstreamer0.10-base gstreamer-base gstreamer0.10 gstreamer-controller gstreamer0.10 gstreamer-dataprotocol gstreamer0.10-gstreamer gstreamer0.10 gstreamer-net gstreamer0.10 gstreamer-plugins-base gstreamer0.10-base gthread glib@@ -54,7 +57,6 @@ icuuc icu idn libidn il devil-Imlib2 imlib2 jpeg libjpeg ldap libldap libgsasl gsasl@@ -68,13 +70,13 @@ ogg libogg ogremain panel ncurses-pangocairo pango pango pango+pangocairo pango pcap libpcap+pcre pcre png libpng pq postgresql pthread glibc-SDL sdl sndfile libsndfile sqlite3 sqlite3 ssl openssl@@ -94,5 +96,5 @@ xrandr libxrandr xslt libxslt xss libxss-zmq zeromq z zlib+zmq zeromq