packages feed

cpkg 0.2.1.0 → 0.2.2.0

raw patch · 8 files changed

+180/−27 lines, 8 files

Files

CHANGELOG.md view
@@ -1,5 +1,10 @@ # cpkg +## 0.2.2.0++  * Add `printLdLibFlags` function and add functionality to CLI interface+  * `cfg.installDir` is now absolute+ ## 0.2.1.0    * Add `SymlinkManpage` command
app/Main.hs view
@@ -17,12 +17,13 @@                 | PkgConfig { _pkgGet :: String }                 | IncludePath { _pkgGet :: String }                 | LibPath { _pkgGet :: String }+                | LdLibPath { _pkgGets :: [String] }  data Command = Install { _pkgName :: String, _verbosity :: Verbosity, _target :: Maybe Platform, _static :: Bool, _global :: Bool, _packageSet :: Maybe String }              | Check { _dhallFile :: String, _verbosity :: Verbosity }              | CheckSet { _dhallFile :: String, _verbosity :: Verbosity }              | Dump { _dumpTarget :: DumpTarget, _host :: Maybe Platform }-             | DumpCabal { _pkgGets :: [String], _host :: Maybe Platform }+             | DumpCabal { _pkgGetsCabal :: [String], _host :: Maybe Platform }              | List { _packageSet :: Maybe String }              | Nuke @@ -55,7 +56,8 @@     <> command "compiler" (info (Compiler <$> package) (progDesc "Dump compiler flags for a package"))     <> command "pkg-config" (info (PkgConfig <$> package) (progDesc "Dump pkg-config path for a package")) -- TODO: make pkg-config recursive or something?     <> command "include" (info (IncludePath <$> package) (progDesc "Dump C_INCLUDE_PATH for a package"))-    <> command "library" (info (LibPath <$> package) (progDesc "Dump LD_LIBRARY_PATH or LIBRARY_PATH for a package"))+    <> command "library" (info (LibPath <$> package) (progDesc "Dump LD_LIBRARY_PATH or LIBRARY_PATH info for a package"))+    <> command "ld-path" (info (LdLibPath <$> some package) (progDesc "Dump LD_LIBRARY_PATH or LIBRARY_PATH for a package"))     )  userCmd :: Parser Command@@ -157,6 +159,7 @@ run (Dump (PkgConfig name) host) = runPkgM Normal $ printPkgConfigPath name host run (Dump (IncludePath name) host) = runPkgM Normal $ printIncludePath name host run (Dump (LibPath name) host) = runPkgM Normal $ printLibPath name host+run (Dump (LdLibPath names) host) = runPkgM Normal $ printLdLibPath names host run (DumpCabal names host) = runPkgM Normal $ printCabalFlags names host run Nuke = do     pkgDir <- globalPkgDir
cpkg.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: cpkg-version: 0.2.1.0+version: 0.2.2.0 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018-2019 Vanessa McHale
dhall/cpkg-prelude.dhall view
@@ -398,6 +398,7 @@     defaultPath cfg # [ mkPkgConfigVar (cfg.shareDirs # cfg.linkDirs)                       , mkPerlLib { libDirs = cfg.linkDirs, perlVersion = [5,30,0], cfg = cfg } -- TODO: take this as a parameter                       , mkLDPath cfg.linkDirs+                      , mkLDFlagsGeneral cfg.linkDirs ([] : List Text)                       ] in @@ -721,7 +722,8 @@   λ(cfg : types.BuildVars) →     [ mkExe "autogen.sh"     , call (defaultCall ⫽ { program = "./autogen.sh"-                          , environment = Some ( [ mkAclocalPath cfg.shareDirs ]+                          , environment = Some ( [ mkAclocalPath cfg.shareDirs+                                                 , mkPkgConfigVar (cfg.shareDirs # cfg.linkDirs) ]                                                   # defaultPath cfg)                           })     ] # defaultConfigure cfg@@ -959,6 +961,13 @@         ([] : List Text) in +let mkFRCArg =+  λ(cfg : types.BuildVars) →+    Optional/fold types.TargetTriple cfg.targetTriple (List Text)+      (λ(tgt : types.TargetTriple) → ["CC=${printTargetTriple tgt}-gcc"])+        ([] : List Text)+in+ let preloadEnv =   λ(_ : List Text) →   λ(cfg : types.BuildVars) →@@ -1104,6 +1113,15 @@     configureWithPatches [p] in +let installPrefix =+  λ(cfg : types.BuildVars) →+      [ call (defaultCall ⫽ { program = "make"+                             , arguments = [ "prefix=${cfg.installDir}", "PREFIX=${cfg.installDir}", "install" ]+                             , environment = Some (buildEnv cfg)+                             })+      ]+in+ { showVersion         = showVersion , makeGnuLibrary      = makeGnuLibrary , makeGnuExe          = makeGnuExe@@ -1190,6 +1208,7 @@ , osCfg               = osCfg , archCfg             = archCfg , mkCCArg             = mkCCArg+, mkFRCArg            = mkFRCArg , mesonCfgFile        = mesonCfgFile , python2Package      = python2Package , configEnv           = configEnv@@ -1216,4 +1235,5 @@ , mkAclocalPath       = mkAclocalPath , configureWithPatches = configureWithPatches , configureWithPatch  = configureWithPatch+, installPrefix       = installPrefix }
pkgs/pkg-set.dhall view
@@ -220,7 +220,7 @@           # [ prelude.createDir "build"             , prelude.call { program = "../configure"                            , arguments = modifyArgs [ "--prefix=${cfg.installDir}" ]-                           , environment = prelude.defaultEnv+                           , environment = prelude.configSome ([] : List Text) cfg                            , procDir = buildDir                            }             ]@@ -230,7 +230,7 @@     λ(cfg : types.BuildVars) →       [ prelude.call { program = prelude.makeExe cfg.buildOS                      , arguments = [ "-j${Natural/show cfg.cpus}" ]-                     , environment = prelude.defaultEnv+                     , environment = prelude.configSome ([] : List Text) cfg                      , procDir = buildDir                      }       ]@@ -240,7 +240,7 @@     λ(cfg : types.BuildVars) →       [ prelude.call { program = prelude.makeExe cfg.buildOS                      , arguments = [ "install" ]-                     , environment = prelude.defaultEnv+                     , environment = prelude.configSome ([] : List Text) cfg                      , procDir = buildDir                      }       ]@@ -255,7 +255,11 @@       , configureCommand = glibcConfigure       , buildCommand = glibcBuild       , installCommand = glibcInstall-      , pkgBuildDeps = [ prelude.unbounded "bison", prelude.unbounded "gawk" ]+      , pkgBuildDeps = [ prelude.unbounded "bison"+                       , prelude.unbounded "gawk"+                       , prelude.unbounded "python3"+                       , prelude.unbounded "make"+                       ]       } in @@ -280,7 +284,6 @@       { pkgUrl = "https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-${prelude.showVersion v}.tar.xz"       , pkgDeps = [ prelude.unbounded "freetype-prebuild"                   , prelude.unbounded "glib"-                  , prelude.unbounded "icu"                   ]       , pkgBuildDeps = [ prelude.unbounded "pkg-config" ]       , configureCommand = prelude.configureLinkExtraLibs [ "pcre", "z" ]@@ -581,7 +584,9 @@       , pkgVersion = v       , pkgUrl = "http://www.netlib.org/lapack/lapack-${prelude.showVersion v}.tar.gz"       , pkgSubdir = "lapack-${prelude.showVersion v}"-      , pkgBuildDeps = [ prelude.unbounded "cmake" ]+      , pkgBuildDeps = [ prelude.unbounded "cmake"+                       , prelude.unbounded "gcc"+                       ]       } in @@ -2621,18 +2626,11 @@                   , prelude.unbounded "freetype"                   , prelude.unbounded "libjpeg"                   , prelude.unbounded "libpng"+                  , prelude.unbounded "giflib"                   ]       } in -let libicu =-  λ(v : List Natural) →-    prelude.simplePackage { name = "libicu", version = v } ⫽-      { pkgUrl = "http://download.icu-project.org/files/icu4c/${prelude.showVersion v}/icu4c-${prelude.underscoreVersion v}-src.tgz"-      , pkgSubdir = "icu/source"-      }-in- let jemalloc =   λ(v : List Natural) →     let versionString = prelude.showVersion v in@@ -2799,6 +2797,7 @@       { pkgUrl = "https://download.osgeo.org/libtiff/tiff-${versionString}.tar.gz"       , pkgSubdir = "tiff-${versionString}"       , configureCommand = prelude.cmakeConfigureNinja+      , pkgBuildDeps = [ prelude.unbounded "cmake" ]       } in @@ -3280,7 +3279,8 @@                   , prelude.unbounded "libsndfile"                   , prelude.unbounded "libsamplerate"                   , prelude.unbounded "mpg123"-                  , prelude.unbounded "libjpeg"+                  , prelude.unbounded "libjpeg-turbo"+                  -- , prelude.unbounded "libjpeg"                   , prelude.unbounded "libpng"                   , prelude.unbounded "fftw"                   ]@@ -3456,18 +3456,127 @@       } in +let icu-le-hb =+  λ(v : List Natural) →+    prelude.simplePackage { name = "icu-le-hb", version = v } ⫽+      { pkgUrl = "https://github.com/harfbuzz/icu-le-hb/archive/${prelude.showVersion v}.tar.gz"+      , configureCommand = prelude.autogenConfigure+      , pkgDeps = [ prelude.unbounded "harfbuzz"+                  , prelude.unbounded "icu"+                  ]+      , pkgBuildDeps = [ prelude.unbounded "pkg-config" ]+      }+in+ let icu =   λ(v : List Natural) →     prelude.simplePackage { name = "icu", version = v } ⫽       { pkgUrl = "http://download.icu-project.org/files/icu4c/${prelude.showVersion v}/icu4c-${prelude.underscoreVersion v}-src.tgz"       , pkgSubdir = "icu/source"+      , pkgBuildDeps = [ prelude.lowerBound { name = "make", lower = [3,80] }+                       , prelude.unbounded "python3"+                       -- sed, coreutils, pkg-config?+                       ]       } in +let opencv =+  λ(v : List Natural) →+    prelude.simplePackage { name = "opencv", version = v } ⫽ prelude.cmakePackage ⫽+      { pkgUrl = "https://github.com/opencv/opencv/archive/${prelude.showVersion v}.zip"+      , pkgBuildDeps = [ prelude.lowerBound { name = "cmake", lower = [2,8,7] }+                       -- , prelude.lowerBound { name = "gcc", lower = [4,4] }+                       -- , prelude.unbounded "git"+                       , prelude.unbounded "pkg-config"+                       , prelude.unbounded "python2"+                       ]+     , pkgDeps = [ prelude.unbounded "zlib"+                 , prelude.unbounded "libjpeg-turbo"+                 , prelude.unbounded "libpng"+                 , prelude.unbounded "gtk3"+                 , prelude.unbounded "ffmpeg"+                 ]+     }+in++let libraw =+  λ(v : List Natural) →+    prelude.simplePackage { name = "libraw", version = v } ⫽+      { pkgUrl = "https://www.libraw.org/data/LibRaw-${prelude.showVersion v}.tar.gz"+      , pkgSubdir = "LibRaw-${prelude.showVersion v}"+      }+in++let quazip =+  λ(v : List Natural) →+    prelude.simplePackage { name = "quazip", version = v } ⫽ prelude.cmakePackage ⫽+      { pkgUrl = "https://github.com/stachenov/quazip/archive/v${prelude.showVersion v}.tar.gz"+      , pkgDeps = [ prelude.unbounded "zlib"+                  , prelude.unbounded "qt"+                  ]+      }+in++let eigen =+  λ(v : List Natural) →+    prelude.simplePackage { name = "eigen", version = v } ⫽ prelude.cmakePackage ⫽+      { pkgUrl = "http://bitbucket.org/eigen/eigen/get/${prelude.showVersion v}.tar.bz2"+      , pkgSubdir = "eigen-eigen-323c052e1731"+      }+in++let blas =+  λ(v : List Natural) →+    prelude.simplePackage { name = "blas", version = v } ⫽+      { pkgUrl = "http://www.netlib.org/blas/blas-${prelude.showVersion v}.tgz"+      , pkgSubdir = "BLAS-${prelude.showVersion v}"+      , pkgBuildDeps = [ prelude.unbounded "make"+                       , prelude.unbounded "gcc"+                       ]+      , configureCommand = prelude.doNothing+      , installCommand =+        λ(_ : types.BuildVars) →+          [ prelude.copyFile "blas_LINUX.a" "lib/blas.a" ]+      }+in++let openblas =+  λ(v : List Natural) →+    let versionString = prelude.showVersion v in+    prelude.simplePackage { name = "openblas", version = v } ⫽+      { pkgUrl = "https://github.com/xianyi/OpenBLAS/archive/v${versionString}.tar.gz"+      , pkgSubdir = "OpenBLAS-${versionString}"+      , pkgBuildDeps = [ prelude.unbounded "make"+                       , prelude.unbounded "gcc"+                       ]+      , pkgDeps = [ prelude.unbounded "gcc" ]+      , configureCommand = prelude.doNothing+      , installCommand = prelude.installPrefix+      }+in++let r =+  λ(v : List Natural) →+    let versionString = prelude.showVersion v in+    prelude.simplePackage { name = "r", version = v } ⫽+      { pkgUrl = "https://cran.r-project.org/src/base/R-3/R-${versionString}.tar.gz"+      , pkgSubdir = "R-${versionString}"+      , pkgStream = False+      , pkgDeps = [ prelude.unbounded "readline"+                  , prelude.unbounded "libXt"+                  ]+      , pkgBuildDeps = [ prelude.unbounded "make"+                       , prelude.unbounded "gcc"+                       ]+      , installCommand = prelude.installWithBinaries [ "bin/R", "bin/Rscript" ]+      }+in+ -- TODO: musl-ghc? -- https://hub.darcs.net/raichoo/hikari -- https://versaweb.dl.sourceforge.net/project/schilytools/schily-2019-03-29.tar.bz2 -- https://busybox.net/downloads/busybox-1.31.0.tar.bz2+-- http://www.linuxfromscratch.org/blfs/view/svn/general/unzip.html -- https://github.com/jsoftware/jsource/archive/j807-release.tar.gz  [ autoconf [2,69]@@ -3478,6 +3587,7 @@ , babl { version = [0,1], patch = 60 } , binutils [2,31] , bison [3,3,1]+, blas [3,8,0] , bzip2 [1,0,6] , cairo [1,16,0] , chickenScheme [5,0,0]@@ -3491,9 +3601,10 @@ , dbus [1,13,12] , diffutils [3,7] , dri2proto [2,8]+, eigen [3,3,7] , elfutils [0,176] , emacs [26,2]-, exiv2 [0,27,0]+, exiv2 [0,27,1] , expat [2,2,6] , feh [3,1,1] , ffmpeg [4,1,3]@@ -3513,7 +3624,7 @@ , gdk-pixbuf { version = [2,38], patch = 1 } , gegl { version = [0,4], patch = 12 } , gettext [0,20,1]-, gexiv2 { version = [0,11], patch = 0 }+, gexiv2 { version = [0,12], patch = 0 } , gperf [3,1] , gperftools [2,7] , giflib [5,1,4]@@ -3537,11 +3648,12 @@ , harfbuzz [2,5,1] , htop [2,2,0] , icu [64,2]+, icu-le-hb [1,0,3] , imageMagick [7,0,8] , imlib2 [1,5,1] , inputproto [2,3,2] , intltool [0,51,0]-, itstool [2,0,5]+, itstool [2,0,6] , jemalloc [5,2,0] , joe [4,6] , json-c { version = [0,13,1], dateStr = "20180305" }@@ -3567,7 +3679,6 @@ , libglade { version = [2,6], patch = 4 } , libgpgError [1,33] , libICE [1,0,9]-, libicu [63,1] , libjpeg [9] , libjpeg-turbo [2,0,2] , libksba [1,3,5]@@ -3579,6 +3690,7 @@ , libpthread-stubs [0,4] , libopenjpeg [2,3,1] , libotf [0,9,16]+, libraw [0,19,2] , libsamplerate [0,1,9] , libselinux [2,8] , libsndfile [1,0,28]@@ -3617,6 +3729,7 @@ , libXtst [1,2,3] , libXxf86vm [1,1,4] , llvm [8,0,0]+, llvm [7,1,0] ⫽{ pkgName = "llvm-7.1" } , lmdb [0,9,23] , lua [5,3,5] , lz4 [1,9,1]@@ -3626,6 +3739,7 @@ , mako [1,0,7] , markupSafe [1,0] , memcached [1,5,12]+, mercury , mesa [19,0,5] , meson [0,50,1] , mpc [1,1,0]@@ -3643,6 +3757,8 @@ , node [8,15,1] ⫽ { pkgName = "node8" } , npth [1,6] , nspr [4,20]+, openblas [0,3,2]+, opencv [4,1,0] , openssh [7,9] , openssl [1,1,1] , p11kit [0,23,16,1]@@ -3656,9 +3772,8 @@ , phash [0,9,6] , pixman [0,38,4] , pkg-config [0,29,2]-, postgresql [11,1] , poppler [0,77,0]-, mercury+, postgresql [11,1] , protobuf [3,8,0] , pycairo [1,18,1] , pygobject { version = [2,28], patch = 7 }@@ -3667,6 +3782,8 @@ , python [3,7,3] , qrencode [4,0,2] , qt { version = [5,13], patch = 0 }+, quazip [0,8,1]+, r [3,6,1] , ragel [6,10] , randrproto [1,5,0] , re2c [1,1,1]
src/Package/C.hs view
@@ -26,6 +26,7 @@                  , printPkgConfigPath                  , printIncludePath                  , printLibPath+                 , printLdLibPath                  , printCabalFlags                  , buildByName                  -- * Dhall functionality
src/Package/C/Build.hs view
@@ -184,15 +184,17 @@          fetchCPkg cpkg p -        let p' = p </> pkgSubdir cpkg+        pAbs <- liftIO (makeAbsolute p) +        let p' = pAbs </> pkgSubdir cpkg+         lds <- liftIO $ do             linkSubdirs <- concat <$> traverse getSubdirsWrap (linkDirs buildVars)             -- FIXME: this seems stupid             let curses = not . ("curses" `isInfixOf`)             getPreloads $ filter curses linkSubdirs -        let buildConfigured = buildVars { installDir = pkgDir, currentDir = p, preloadLibs = lds }+        let buildConfigured = buildVars { installDir = pkgDir, currentDir = pAbs, preloadLibs = lds }          configureInDir cpkg buildConfigured p' 
src/Package/C/Db/Register.hs view
@@ -12,6 +12,7 @@                              , printIncludePath                              , printLibPath                              , printCabalFlags+                             , printLdLibPath                              , packageInstalled                              , allPackages                              , parseHostIO@@ -24,6 +25,7 @@ import           Data.Binary          (encode) import qualified Data.ByteString.Lazy as BSL import           Data.Hashable        (Hashable (..))+import           Data.List            (intercalate) import qualified Data.Set             as S import           Numeric              (showHex) import           Package.C.Db.Memory@@ -82,6 +84,9 @@     case maybePackages of         Nothing -> indexError (head names)         Just ps -> f ps++printLdLibPath :: (MonadIO m, MonadDb m) => [String] -> Maybe Platform -> m ()+printLdLibPath = printMany (liftIO . putStrLn <=< (fmap (intercalate ":") . traverse buildCfgToLibPath))  printCabalFlags :: (MonadIO m, MonadDb m) => [String] -> Maybe Platform -> m () printCabalFlags = printMany (liftIO . putStrLn <=< (fmap unwords . traverse buildCfgToCabalFlag))