packages feed

cpkg 0.1.0.0 → 0.1.1.0

raw patch · 14 files changed

+545/−129 lines, 14 filesdep +libarchivedep ~recursionPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: libarchive

Dependency ranges changed: recursion

API changes (from Hackage documentation)

+ Package.C: EnvVar :: String -> String -> EnvVar
+ Package.C: [pkgStream] :: CPkg -> Bool
+ Package.C: [value] :: EnvVar -> String
+ Package.C: [var] :: EnvVar -> String
+ Package.C: data EnvVar
- Package.C: CPkg :: String -> Version -> String -> String -> [Dep] -> [Dep] -> (BuildVars -> [Command]) -> (BuildVars -> [Command]) -> (BuildVars -> [Command]) -> CPkg
+ Package.C: CPkg :: String -> Version -> String -> String -> Bool -> [Dep] -> [Dep] -> (BuildVars -> [Command]) -> (BuildVars -> [Command]) -> (BuildVars -> [Command]) -> CPkg

Files

CHANGELOG.md view
@@ -1,5 +1,14 @@ # cpkg +## 0.1.1.0++  * Export `EnvVar`+  * Better diagnostic output+  * Fix bug where cross dependencies' `bin/` directory was added to `PATH` for+    subsequent package builds+  * Allow use of `libarchive` for packages that cannot be handled with the `tar`+    library+ ## 0.1.0.0  Initial release
README.md view
@@ -19,13 +19,17 @@  - [Installation](#installation)   - [Shell Completions](#shell-completions)+  - [Packages](#packages) - [Example](#example)   - [Configuration](#configuration)   - [Dhall Prelude](#dhall-prelude)   - [Cabal Integration](#cabal-integration) - [Known Deficiencies](#known-deficiences)   - [Security](#security)-  - [Contents](#contents)+  - [Performance](#performance)+  - [Dependency Solver](#dependency-solver)+  - [Garbage Collection](#garbage-collection)+- [Contents](#contents)  ## Installation @@ -251,14 +255,14 @@ -------------------------------------------------------------------------------  Language             Files       Lines         Code     Comments       Blanks -------------------------------------------------------------------------------- Bash                     5          49           43            3            3- Cabal                    1         153          139            0           14+ Bash                     3          43           35            3            5+ Cabal                    1         154          140            0           14  Cabal Project            1           2            2            0            0- Dhall                    3        4147         3725            0          422- Haskell                 31        1687         1377           28          282- Markdown                 6         469          401            0           68+ Dhall                    3        4531         4073            0          458+ Haskell                 31        1707         1395           29          283+ Markdown                 3         461          391            0           70  YAML                     4         156          141            0           15 -------------------------------------------------------------------------------- Total                   51        6663         5828           31          804+ Total                   46        7054         6177           32          845 ------------------------------------------------------------------------------- ```
cpkg.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: cpkg-version: 0.1.0.0+version: 0.1.1.0 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018-2019 Vanessa McHale@@ -90,10 +90,11 @@         binary -any,         microlens -any,         composition-prelude -any,-        recursion >=2.0.0.0,+        recursion >=2.2.3.0,         filemanip -any,         network-uri -any,-        megaparsec -any+        megaparsec -any,+        libarchive -any      if (flag(development) && impl(ghc <=8.2))         ghc-options: -Werror
dhall/cpkg-prelude.dhall view
@@ -14,6 +14,9 @@ let mapOptional = https://raw.githubusercontent.com/dhall-lang/dhall-lang/master/Prelude/Optional/map in +let not = https://raw.githubusercontent.com/dhall-lang/dhall-lang/master/Prelude/Bool/not+in+ {- Imported types -} let types = ../dhall/cpkg-types.dhall in@@ -257,10 +260,10 @@  let mkStaPath =   λ(libDirs : List Text) →-    let flag = concatMapSep ":" Text (λ(dir : Text) → dir) libDirs+    let flag = concatMapText Text (λ(dir : Text) → "${dir}:") libDirs     in -    { var = "LIBRARY_PATH", value = flag }+    { var = "LIBRARY_PATH", value = flag ++ "/usr/local/lib:/lib:/usr/lib" } in  {- Get the host OS from a configuration. If we are not cross-compiling, we can@@ -308,11 +311,16 @@ in  let mkCFlags =-  λ(libDirs : List Text) →-    let flag = concatMapSep " " Text (λ(dir : Text) → "-I${dir}") libDirs+  λ(cfg : types.BuildVars) →+    let flag = concatMapSep " " Text (λ(dir : Text) → "-I${dir}") cfg.includeDirs     in+    let staFlag =+      if cfg.static+        then " -static"+        else ""+    in -    { var = "CPPFLAGS", value = flag }+    { var = "CPPFLAGS", value = flag ++ staFlag } in  let mkPkgConfigVar =@@ -356,12 +364,21 @@         mkLDPath cfg.linkDirs in +{- This is vaguely terrible, but it's needed for GLib for some reason -}+let mkLDPreload =+  λ(libs : List Text) →+    let flag = concatMapSep " " Text (λ(lib : Text) → lib) libs+    in++    { var = "LD_PRELOAD", value = flag }+in+ {- Default environment variables for a given configuration -} let configEnv =   λ(linkLibs : List Text) →   λ(cfg : types.BuildVars) →     defaultPath cfg # [ mkLDFlagsGeneral cfg.linkDirs linkLibs-                      , mkCFlags cfg.includeDirs+                      , mkCFlags cfg                       , mkPkgConfigVar (cfg.shareDirs # cfg.linkDirs)                       , libPath cfg                       , mkLDRunPath cfg.linkDirs@@ -405,9 +422,13 @@     ] in +let configWithEnv =+  λ(envVars : List Text → types.BuildVars → Optional (List types.EnvVar)) →+    generalConfigure envVars "configure" ([] : List Text) ([] : List Text)+in+ let configureWithFlags =   generalConfigure configSome "configure" ([] : List Text)- in  let defaultConfigure =@@ -421,7 +442,7 @@  let mkAclocalPath =   λ(shareDirs : List Text) →-    let flag = concatMapSep ":" Text (λ(dir : Text) → "${dir}/aclocal") shareDirs+    let flag = concatMapSep ":" Text (λ(dir : Text) → "${dir}/aclocal:${dir}/autoconf/autoconf") shareDirs     in      { var = "ACLOCAL_PATH", value = flag }@@ -475,7 +496,9 @@   λ(bins : List Text) →   λ(installVars : types.BuildVars) →     defaultInstall installVars-      # symlinkBinaries bins+      # (if not installVars.isCross+            then symlinkBinaries bins+            else [] : List types.Command) in  let unbounded =@@ -505,6 +528,7 @@   , installCommand   = defaultInstall   , pkgBuildDeps     = [] : List types.Dep   , pkgDeps          = [] : List types.Dep+  , pkgStream        = True   } in @@ -586,7 +610,10 @@  let cmakeEnv =   λ(cfg : types.BuildVars) →-    [ mkPkgConfigVar (cfg.shareDirs # cfg.linkDirs) ]+    [ mkPkgConfigVar cfg.shareDirs+    , { var = "CMAKE_INCLUDE_PATH", value = (mkIncludePath cfg.includeDirs).value }+    , { var = "CMAKE_LIBRARY_PATH", value = (libPath cfg).value }+    ]       # defaultPath cfg in @@ -677,8 +704,8 @@   λ(cfg : types.BuildVars) →     [ mkExe "autogen.sh"     , call (defaultCall ⫽ { program = "./autogen.sh"-                          -- TODO ACLOCAL_PATH ??-                          -- also binary paths+                          , environment = Some ([ mkAclocalPath cfg.shareDirs ]+                                                  # defaultPath cfg)                           })     ] # defaultConfigure cfg in@@ -732,8 +759,7 @@          , libPath cfg          , mkLDRunPath cfg.linkDirs          , mkLDFlags cfg.linkDirs-         , mkCFlags cfg.includeDirs-         , mkPkgConfigVar cfg.linkDirs+         , mkCFlags cfg          ] in @@ -775,7 +801,7 @@                                                , libPath cfg                                                , mkLDRunPath cfg.linkDirs                                                , mkLDFlagsGeneral cfg.linkDirs linkLibs-                                               , mkCFlags cfg.includeDirs+                                               , mkCFlags cfg                                                , mkPkgConfigVar cfg.linkDirs                                                ]                           , procDir = Some "build" }) ]@@ -794,7 +820,7 @@                                                , libPath cfg                                                , mkLDRunPath cfg.linkDirs                                                , mkLDFlags cfg.linkDirs-                                               , mkCFlags cfg.includeDirs+                                               , mkCFlags cfg                                                ]                           , arguments = [ "install" ]                           , procDir = Some "build"@@ -897,15 +923,6 @@   pythonPackage [2,7] in -{- This is vaguely terrible, but it's needed for GLib for some reason -}-let mkLDPreload =-  λ(libs : List Text) →-    let flag = concatMapSep " " Text (λ(lib : Text) → lib) libs-    in--    { var = "LD_PRELOAD", value = flag }-in- let mkCCVar =   λ(cfg : types.BuildVars) →     Optional/fold types.TargetTriple cfg.targetTriple (List types.EnvVar)@@ -928,7 +945,7 @@   λ(_ : List Text) →   λ(cfg : types.BuildVars) →     Some (defaultPath cfg # [ mkLDFlags cfg.linkDirs-                            , mkCFlags cfg.includeDirs+                            , mkCFlags cfg                             , mkPkgConfigVar cfg.linkDirs                             , libPath cfg                             , mkXdgDataDirs cfg.shareDirs@@ -1014,6 +1031,7 @@   λ(cfg : types.BuildVars) →     defaultInstall cfg #       concatMap Text types.Command (λ(bin : Text) → mkLDPathWrapper cfg bin) bins+      -- TODO: add to PATH for e.g. PERL interpreter in  let underscoreVersion =@@ -1151,4 +1169,6 @@ , cmakeSome           = cmakeSome , underscoreVersion   = underscoreVersion , isX64               = isX64+, configWithEnv       = configWithEnv+, buildEnv            = buildEnv }
pkgs/pkg-set.dhall view
@@ -140,6 +140,7 @@                   , prelude.unbounded "libselinux"                   ]       , configureCommand = prelude.configureLinkExtraLibs [ "pcre" ]+      , pkgBuildDeps = [ prelude.unbounded "pkg-config" ]       } in @@ -272,6 +273,7 @@       , pkgDeps = [ prelude.unbounded "freetype-prebuild"                   , prelude.unbounded "glib"                   ]+      , pkgBuildDeps = [ prelude.unbounded "pkg-config" ]       , configureCommand = prelude.configureLinkExtraLibs [ "pcre", "z" ]       , installCommand =           λ(cfg : types.BuildVars) →@@ -307,7 +309,7 @@       } in -let jpegTurbo =+let libjpeg-turbo =   λ(v : List Natural) →     prelude.cmakePackage ⫽       { pkgName = "libjpeg-turbo"@@ -334,7 +336,8 @@ let nasm =   λ(v : List Natural) →     prelude.simplePackage { name = "nasm", version = v } ⫽-      { pkgUrl = "http://www.nasm.us/pub/nasm/releasebuilds/${prelude.showVersion v}/nasm-${prelude.showVersion v}.tar.xz"+      { pkgUrl = "http://www.nasm.us/pub/nasm/releasebuilds/${prelude.showVersion v}.02/nasm-${prelude.showVersion v}.02.tar.xz"+      , pkgSubdir = "nasm-${prelude.showVersion v}.02"       , installCommand = prelude.installWithBinaries [ "bin/nasm", "bin/ndisasm" ]       } in@@ -343,9 +346,16 @@   λ(v : List Natural) →     prelude.simplePackage { name = "ncurses", version = v } ⫽       { pkgUrl = "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-${prelude.showVersion v}.tar.gz"-      , configureCommand = prelude.configureWithFlags [ "--disable-stripping", "--with-shared", "--enable-widec" ]-      -- we disable stripping because otherwise the script fails during cross-compilation-      -- enable-widec is necessary because util-linux uses libncursesw+      , configureCommand =+        λ(cfg : types.BuildVars) →+          let crossArgs =+            if cfg.isCross+              then [ "--disable-stripping" ]+              else [] : List Text+          in++          prelude.configureWithFlags ([ "--with-shared", "--enable-widec" ] # crossArgs) cfg+          -- enable-widec is necessary because util-linux uses libncursesw       } in @@ -372,7 +382,7 @@   in    λ(v : List Natural) →-    let major = Optional/fold Natural (List/head Natural v) Text (Natural/show) ""+    let major = Optional/fold Natural (List/head Natural v) Text Natural/show ""     in      prelude.simplePackage { name = "perl", version = v } ⫽@@ -503,7 +513,7 @@ let gettext =   λ(v : List Natural) →     prelude.makeGnuExe { name = "gettext", version = v } ⫽-      { installCommand = prelude.installWithBinaries [ "bin/gettext", "bin/msgfmt" ] }+      { installCommand = prelude.installWithBinaries [ "bin/gettext", "bin/msgfmt", "bin/autopoint" ] } in  let gzip =@@ -675,6 +685,7 @@                   , prelude.unbounded "gnutls"                   , prelude.unbounded "libXft"                   , prelude.unbounded "dbus"+                  , prelude.unbounded "cairo"                   ]       , configureCommand = prelude.configureMkExesExtraFlags           { bins = [ "build-aux/move-if-change", "build-aux/update-subdirs" ]@@ -684,10 +695,14 @@                          , "--with-gnutls"                          , "--with-xft"                          , "--with-dbus"+                         , "--with-cairo=yes"                          ]           }       , installCommand =-          prelude.installWithWrappers [ "emacs" ]+          λ(cfg : types.BuildVars) →+            if cfg.static+              then prelude.installWithBinaries [ "bin/emacs" ] cfg+              else prelude.installWithWrappers [ "emacs" ] cfg       } in @@ -719,18 +734,38 @@     in     let versionString = prelude.showVersion v     in+    let pyEnv =+      λ(_ : List Text) →+      λ(cfg : types.BuildVars) →+        Some (prelude.configEnv ([] : List Text) cfg+          # [ { var = "CONFIG_SITE", value = "config.site" } ])+    in      prelude.simplePackage { name = "python${major}", version = v } ⫽       { pkgUrl = "https://www.python.org/ftp/python/${versionString}/Python-${versionString}.tar.xz"       , pkgSubdir = "Python-${versionString}"       , configureCommand =         λ(cfg : types.BuildVars) →+          let config =+            ''+            ac_cv_file__dev_ptmx=yes+            ac_cv_file__dev_ptc=no+            ''+          in           let staticFlag =             if cfg.static               then [] : List Text               else [ "--enable-shared" ]           in-          prelude.configureWithFlags ([ "--build=${prelude.printArch cfg.buildArch}" ] # staticFlag) cfg+          let crossArgs =+            if cfg.isCross+              then ["--disable-ipv6"]+              else [] : List Text+          in+          [ prelude.writeFile { file = "config.site", contents = config } ]+            # prelude.generalConfigure pyEnv "configure" ([] : List Text)+                ([ "--build=${prelude.printArch cfg.buildArch}" ] # crossArgs # staticFlag) cfg+          -- disable ipv6 for cross-compiling           -- "--enable-optimizations" (takes forever)       , pkgDeps = [ prelude.unbounded "libffi" ]       , installCommand = prelude.installWithBinaries [ "bin/python${major}" ]@@ -773,7 +808,7 @@         in          let cflags =-          (prelude.mkCFlags cfg.includeDirs).value+          (prelude.mkCFlags cfg).value         in          let os =@@ -846,7 +881,7 @@   λ(v : List Natural) →     prelude.simplePackage { name = "pkg-config", version = v } ⫽       { pkgUrl = "https://pkg-config.freedesktop.org/releases/pkg-config-${prelude.showVersion v}.tar.gz"-      , installCommand = prelude.installWithBinaries [ "bin/pkg-config" ]+      , configureCommand = prelude.configureWithFlags [ "--with-internal-glib" ]       } in @@ -893,10 +928,11 @@  let freetype-prebuild =   λ(v : List Natural) →-    freetype-shared { name = "freetype-prebuild", version = v } ⫽ -- FIXME: for some reason a zlib dep here breaks harfbuzz???+    freetype-shared { name = "freetype-prebuild", version = v } ⫽       { pkgDeps = [ prelude.unbounded "zlib"                   , prelude.unbounded "libpng"                   ]+      , pkgBuildDeps = [ prelude.unbounded "pkg-config" ]       } in @@ -945,7 +981,7 @@   let gtkEnv =     λ(cfg : types.BuildVars) →       prelude.defaultPath cfg # [ { var = "LDFLAGS", value = (prelude.mkLDFlags cfg.linkDirs).value ++ " -lpcre -lfribidi" }-                                , prelude.mkCFlags cfg.includeDirs+                                , prelude.mkCFlags cfg                                 , prelude.mkPkgConfigVar cfg.linkDirs                                 , prelude.libPath cfg                                 , prelude.mkLDRunPath cfg.linkDirs@@ -1084,11 +1120,10 @@   λ(v : List Natural) →     prelude.simplePackage { name = "libxml2", version = v } ⫽      { pkgUrl = "http://xmlsoft.org/sources/libxml2-${prelude.showVersion v}.tar.gz"-     -- TODO: don't depend on python via flag or something      , pkgDeps = [ prelude.unbounded "zlib"                  , prelude.unbounded "xz"+                 , prelude.unbounded "python2"                  ]-     , pkgBuildDeps = [ prelude.unbounded "python2" ]      } in @@ -1105,6 +1140,10 @@                                                                                                 ])                                                 })           ]+     , installCommand =+        λ(cfg : types.BuildVars) →+          prelude.defaultInstall cfg+            # [ prelude.symlink "share/pkgconfig" "lib/pkgconfig" ]      , pkgDeps = [ prelude.unbounded "glib"                  , prelude.unbounded "libxml2"                  ]@@ -1151,7 +1190,7 @@                                                                    , prelude.libPath cfg                                                                    , prelude.mkLDRunPath cfg.linkDirs                                                                    , prelude.mkLDFlags cfg.linkDirs-                                                                   , prelude.mkCFlags cfg.includeDirs+                                                                   , prelude.mkCFlags cfg                                                                    ]                                               , arguments = [ "install" ]                                               , procDir = Some "build"@@ -1240,17 +1279,26 @@ in  let util-linux =-  λ(v : List Natural) →-    let versionString = prelude.showVersion v in-      prelude.simplePackage { name = "util-linux", version = v } ⫽-        { pkgUrl = "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v${versionString}/util-linux-${versionString}.tar.xz"-        , configureCommand = prelude.configureWithFlags [ "--disable-makeinstall-chown" -- otherwise we'd need sudo permissions-                                                        , "--disable-bash-completion"-                                                        , "--disable-pylibmount" -- easier for cross-compiling-                                                        , "--without-tinfo" -- can't figure out what tinfo is or how to supply it when cross compiling-                                                        ]-        , pkgDeps = [ prelude.unbounded "ncurses" ]-        }+  λ(x : { version : List Natural, patch : Natural }) →+    let versionString = prelude.showVersion x.version+    in+    let fullVersion = versionString ++ "." ++ Natural/show x.patch+    in++    prelude.simplePackage { name = "util-linux", version = prelude.fullVersion x } ⫽+      { pkgUrl = "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v${versionString}/util-linux-${fullVersion}.tar.xz"+      , configureCommand =+        λ(cfg : types.BuildVars) →+          let crossFlags =+            if cfg.isCross+              then [ "--disable-pylibmount"+                   , "--without-tinfo"+                   ]+              else [] : List Text+          in+          prelude.configureWithFlags ([ "--disable-makeinstall-chown", "--disable-bash-completion"] # crossFlags) cfg+      , pkgDeps = [ prelude.unbounded "ncurses" ]+      } in  let fribidi =@@ -1278,12 +1326,19 @@   λ(v : List Natural) →     let versionString = prelude.showVersion v     in+    let flexEnv =+      λ(_ : List Text) →+      λ(cfg : types.BuildVars) →+        Some (prelude.configEnv ([] : List Text) cfg+          # [ { var = "YFLAGS", value = "-Wno-error=yacc" } ])+    in      prelude.simplePackage { name = "flex", version = v } ⫽       { pkgUrl = "https://github.com/westes/flex/releases/download/v${versionString}/flex-${versionString}.tar.gz"       , pkgBuildDeps = [ prelude.unbounded "m4"                        , prelude.unbounded "bison"                        ]+      , configureCommand = prelude.configWithEnv flexEnv       } in @@ -1311,7 +1366,7 @@                                             , { var = "LDFLAGS", value = (prelude.mkLDFlags cfg.linkDirs).value ++ " -lpcre" }                                             , prelude.mkPy3Path cfg.linkDirs                                             , prelude.libPath cfg-                                            , prelude.mkCFlags cfg.includeDirs+                                            , prelude.mkCFlags cfg                                             , prelude.mkPkgConfigVar cfg.linkDirs                                             ]                        , procDir = Some "build"@@ -1357,12 +1412,11 @@                                                                   ]) cfg                # [ prelude.symlink "${libDir}/libglib-2.0.so" "lib/libglib-2.0.so"-                , prelude.symlink "${libDir}/libgobject-2.0.so" "lib/libgobject-2.0.so"+                , prelude.symlink "${libDir}/libglib-2.0.so.0" "lib/libglib-2.0.so.0"                 , prelude.symlink "${libDir}/libgio-2.0.so" "lib/libgio-2.0.so"+                , prelude.symlink "${libDir}/libgthread-2.0.so" "lib/libgthread-2.0.so"+                , prelude.symlink "${libDir}/libgobject-2.0.so" "lib/libgobject-2.0.so"                 , prelude.symlink "${libDir}/libgmodule-2.0.so" "lib/libgmodule-2.0.so"-                , prelude.symlink "${libDir}/libgmodule-2.0.so.0" "lib/libgmodule-2.0.so.0"-                , prelude.symlink "${libDir}/libglib-2.0.so.0" "lib/libglib-2.0.so.0"-                , prelude.symlink "${libDir}/glib-2.0/include/glibconfig.h" "include/glibconfig.h"                 , prelude.symlink "include/glib-2.0/glib" "include/glib"                 , prelude.symlink "include/glib-2.0/gobject" "include/gobject"                 , prelude.symlink "include/glib-2.0/glib.h" "include/glib.h"@@ -1649,22 +1703,6 @@       { pkgUrl = "https://www.x.org/archive/individual/xcb/libpthread-stubs-${prelude.showVersion v}.tar.bz2" } in -let libXdmcp =-  λ(v : List Natural) →-    prelude.simplePackage { name = "libXdmcp", version = v } ⫽-      { pkgUrl = "https://www.x.org/archive/individual/lib/libXdmcp-${prelude.showVersion v}.tar.bz2"-      , pkgDeps = [ prelude.unbounded "xproto" ]-      }-in--let libXau =-  λ(v : List Natural) →-    prelude.simplePackage { name = "libXau", version = v } ⫽-      { pkgUrl = "https://www.x.org/archive/individual/lib/libXau-${prelude.showVersion v}.tar.bz2"-      , pkgDeps = [ prelude.unbounded "xproto" ]-      }-in- let xorgConfigure =   prelude.configureWithFlags [ "--disable-malloc0returnsnull" ] -- necessary for cross-compilation in@@ -1675,6 +1713,7 @@     prelude.simplePackage { name = name, version = v } ⫽       { pkgUrl = "https://www.x.org/releases/individual/lib/${name}-${prelude.showVersion v}.tar.bz2"       , configureCommand = xorgConfigure+      , pkgBuildDeps = [ prelude.unbounded "pkg-config" ]       } in @@ -1685,6 +1724,14 @@       { pkgDeps = x.deps } in +let libXdmcp =+  mkXLibDeps { name = "libXdmcp", deps = [ prelude.unbounded "xproto" ] }+in++let libXau =+  mkXLibDeps { name = "libXau", deps = [ prelude.unbounded "xproto" ] }+in+ let mkXUtil =   λ(name : Text) →   λ(v : List Natural) →@@ -1829,7 +1876,7 @@ let coreutils =   λ(v : List Natural) →     prelude.makeGnuExe { name = "coreutils", version = v } ⫽-      { installCommand = prelude.installWithBinaries [ "bin/install", "bin/chmod", "bin/rm", "bin/cp", "bin/ln", "bin/mkdir", "bin/test", "bin/od" ] }+      { installCommand = prelude.installWithBinaries [ "bin/install", "bin/chmod", "bin/rm", "bin/cp", "bin/ln", "bin/mkdir", "bin/test", "bin/od", "bin/readlink" ] } in  let libsepol =@@ -1841,7 +1888,7 @@       [ prelude.call (prelude.defaultCall ⫽ { program = prelude.makeExe cfg.buildOS                                             , arguments = cc cfg # [ "PREFIX=${cfg.installDir}", "SHLIBDIR=${cfg.installDir}/lib", "CFLAGS=-Wno-error -O2", "install", "-j${Natural/show cfg.cpus}" ]                                             , environment =-                                                Some (prelude.defaultPath cfg # [ prelude.mkLDFlags cfg.linkDirs, prelude.mkCFlags cfg.includeDirs, prelude.mkPkgConfigVar cfg.linkDirs ])+                                                Some (prelude.defaultPath cfg # [ prelude.mkLDFlags cfg.linkDirs, prelude.mkCFlags cfg, prelude.mkPkgConfigVar cfg.linkDirs ])                                             })       ]   in@@ -1866,13 +1913,13 @@                                             , arguments = cc cfg                                                 # [ "PREFIX=${cfg.installDir}"                                                   , "SHLIBDIR=${cfg.installDir}/lib"-                                                  , "EXTRA_CFLAGS=-Wno-error -lpcre " ++ (prelude.mkCFlags cfg.includeDirs).value+                                                  , "EXTRA_CFLAGS=-Wno-error -lpcre " ++ (prelude.mkCFlags cfg).value                                                   , "install"                                                   , "-j${Natural/show cfg.cpus}"                                                   ]                                             , environment =                                                 Some (prelude.defaultPath cfg # [ prelude.mkLDFlags cfg.linkDirs-                                                                                , prelude.mkCFlags cfg.includeDirs+                                                                                , prelude.mkCFlags cfg                                                                                 , prelude.mkPkgConfigVar cfg.linkDirs                                                                                 , prelude.libPath cfg                                                                                 ])@@ -1889,6 +1936,7 @@       , pkgDeps = [ prelude.unbounded "pcre"                   , prelude.unbounded "libsepol"                   ]+      , pkgBuildDeps = [ prelude.unbounded "pkg-config" ]       } in @@ -1996,7 +2044,7 @@   let gtkEnv =     λ(cfg : types.BuildVars) →       prelude.defaultPath cfg # [ { var = "LDFLAGS", value = (prelude.mkLDFlags cfg.linkDirs).value ++ " -lpcre -lfribidi" }-                                , prelude.mkCFlags cfg.includeDirs+                                , prelude.mkCFlags cfg                                 , prelude.mkPkgConfigVar cfg.linkDirs                                 , prelude.libPath cfg                                 , prelude.mkLDRunPath cfg.linkDirs@@ -2103,6 +2151,8 @@     prelude.simplePackage { name = "postgresql", version = v } ⫽       { pkgUrl = "https://ftp.postgresql.org/pub/source/v${versionString}/postgresql-${versionString}.tar.bz2"       , configureCommand = prelude.configureWithFlags [ "--without-readline" ] -- TODO: set USE_DEV_URANDOM=1 or USE_WIN32_RANDOM=1 on windows+      , installCommand = prelude.installWithBinaries [ "bin/pg_config" ]+      , pkgDeps = [ prelude.unbounded "zlib" ]       } in @@ -2419,7 +2469,7 @@       , prelude.call (prelude.defaultCall ⫽ fehMake cfg ⫽                         { arguments =                             cc cfg #-                              [ "CFLAGS=${(prelude.mkCFlags cfg.includeDirs).value} -DPACKAGE=\\\"feh\\\" -DPREFIX=\\\"${cfg.installDir}\\\" -DVERSION=\\\"${prelude.showVersion v}\\\" ${(prelude.mkLDFlags cfg.linkDirs).value}"+                              [ "CFLAGS=${(prelude.mkCFlags cfg).value} -DPACKAGE=\\\"feh\\\" -DPREFIX=\\\"${cfg.installDir}\\\" -DVERSION=\\\"${prelude.showVersion v}\\\" ${(prelude.mkLDFlags cfg.linkDirs).value}"                               , "feh"                               ]                         , procDir = Some "src"@@ -2433,14 +2483,13 @@   let fehInstall =     λ(cfg : types.BuildVars) →       [ prelude.call (prelude.defaultCall ⫽ { program = prelude.makeExe cfg.buildOS-                                            , arguments = [ "CFLAGS=${(prelude.mkCFlags cfg.includeDirs).value}"+                                            , arguments = [ "CFLAGS=${(prelude.mkCFlags cfg).value}"                                                           , "-j${Natural/show cfg.cpus}"                                                           , "PREFIX=${cfg.installDir}"                                                           , "install"                                                           ]                                             })-      , prelude.symlinkBinary "bin/feh"-      ]+      ] # prelude.mkLDPathWrapper cfg "feh"   in    λ(v : List Natural) →@@ -2464,6 +2513,8 @@       { pkgUrl = "https://downloads.sourceforge.net/enlightenment/imlib2-${prelude.showVersion v}.tar.bz2"       , pkgDeps = [ prelude.unbounded "libXext"                   , prelude.unbounded "freetype"+                  , prelude.unbounded "libjpeg"+                  , prelude.unbounded "libpng"                   ]       } in@@ -2555,8 +2606,9 @@                   , prelude.lowerBound { name = "glproto", lower = [1,4,14] }                   , prelude.lowerBound { name = "dri2proto", lower = [2,8] }                   , prelude.unbounded "libXrandr"+                  , prelude.unbounded "llvm"                   ]-      , configureCommand = prelude.configureWithFlags [ "--with-gallium-drivers=nouveau,swrast" ] -- disable radeon drivers so we don't need LLVM+      -- , configureCommand = prelude.configureWithFlags [ "--with-gallium-drivers=nouveau,swrast" ] -- disable radeon drivers so we don't need LLVM       } in @@ -2684,6 +2736,295 @@       } in +let fossil =+  λ(v : List Natural) →+    prelude.simplePackage { name = "fossil", version = v } ⫽+      { pkgUrl = "https://fossil-scm.org/fossil/uv/fossil-src-${prelude.showVersion v}.tar.gz"+      , configureCommand = prelude.configureMkExes [ "autosetup/find-tclsh" ]+      , installCommand = prelude.installWithBinaries [ "bin/fossil" ]+      , pkgDeps = [ prelude.unbounded "zlib"+                  , prelude.unbounded "openssl"+                  ]+      }+in++let libcroco =+  λ(x : { version : List Natural, patch : Natural }) →+    mkGnomeSimple "libcroco" x ⫽+      { pkgDeps = [ prelude.lowerBound { name = "glib", lower = [2,0] }+                  , prelude.lowerBound { name = "libxml2", lower = [2,4,23] }+                  ]+      }+in++let libsoup =+  λ(x : { version : List Natural, patch : Natural }) →+    let libsoupCfgFile =+    ''+    option('gssapi',+      type : 'boolean',+      value : true,+      description : 'Build with GSSAPI support'+    )++    option('krb5_config',+      type : 'string',+      description : 'Where to look for krb5-config, path points to krb5-config installation (defaultly looking in PATH)'+    )++    option('ntlm',+      type : 'boolean',+      value : false,+      description : 'Build with NTLM support'+    )++    option('tls_check',+      type : 'boolean',+      value : true,+      description : 'Enable TLS support through glib-networking. If you are building a package, you can disable this to allow building libsoup anyway (since glib-networking is not actually required at compile time), but you should be sure to add a runtime dependency on it.'+    )++    option('gnome',+      type : 'boolean',+      value : true,+      description : 'Build libsoup with GNOME support'+    )++    option('introspection',+      type : 'boolean',+      value : true,+      description : 'Build GObject Introspection data'+    )++    option('vapi',+      type : 'boolean',+      value : false,+      description : 'Build Vala bindings'+    )++    option('doc',+      type: 'boolean',+      value: false,+      description: 'Enable generating the API reference'+    )++    option('tests',+      type: 'boolean',+      value: true,+      description: 'Enable unit tests compilation'+    )+    ''+    in+    mkGnomeNinja "libsoup" x ⫽+      { pkgDeps = [ prelude.unbounded "glib"+                  , prelude.unbounded "sqlite"+                  , prelude.unbounded "libxml2"+                  , prelude.unbounded "libpsl"+                  , prelude.unbounded "krb5"+                  , prelude.unbounded "gobject-introspection"+                  ]+      , pkgBuildDeps = [ prelude.unbounded "vala" ]+      , configureCommand =+          λ(cfg : types.BuildVars) →+            [ prelude.writeFile { file = "meson_options.txt", contents = libsoupCfgFile } ]+              # prelude.mesonConfigure cfg+      , installCommand =+          prelude.ninjaInstallWithPkgConfig (prelude.mesonMoves [ "libsoup-2.4.pc" ])+      }+in++let libpsl =+  λ(v : List Natural) →+    let versionString = prelude.showVersion v in+    prelude.simplePackage { name = "libpsl", version = v } ⫽+      { pkgUrl = "https://github.com/rockdaboot/libpsl/releases/download/libpsl-${versionString}/libpsl-${versionString}.tar.gz"+      , configureCommand = prelude.configureMkExes [ "src/psl-make-dafsa" ]+      }+in+++let krb5 =+  λ(v : List Natural) →+    let versionString = prelude.showVersion v in+    prelude.simplePackage { name = "krb5", version = v } ⫽+      { pkgUrl = "https://kerberos.org/dist/krb5/${versionString}/krb5-${versionString}.tar.gz"+      , pkgSubdir = "krb5-${versionString}/src"+      , configureCommand = prelude.configureMkExes [ "config/move-if-changed", "config/mkinstalldirs" ]+      , pkgBuildDeps = [ prelude.unbounded "bison" ]+      }+in++let vala =+  λ(x : { version : List Natural, patch : Natural }) →+    mkGnomeSimple "vala" x ⫽+      { pkgBuildDeps = [ prelude.unbounded "flex" ]+      , pkgDeps = [ prelude.lowerBound { name = "glib", lower = [2,40,0] }+                  , prelude.lowerBound { name = "graphviz", lower = [2,15] }+                  ]+      , configureCommand = prelude.configureMkExes [ "build-aux/git-version-gen" ]+      }+in++let htop =+  λ(v : List Natural) →+    let versionString = prelude.showVersion v in+    prelude.simplePackage { name = "htop", version = v } ⫽+      { pkgUrl = "https://hisham.hm/htop/releases/${versionString}/htop-${versionString}.tar.gz"+      , pkgDeps = [ prelude.unbounded "ncurses" ]+      , pkgBuildDeps = [ prelude.unbounded "python3" ]+      , configureCommand = prelude.configureMkExes [ "scripts/MakeHeader.py" ]+      , installCommand = prelude.installWithBinaries [ "bin/htop" ]+      }+in++let mpfr =+  λ(v : List Natural) →+    prelude.simplePackage { name = "mpfr", version = v } ⫽+      { pkgUrl = "https://www.mpfr.org/mpfr-current/mpfr-${prelude.showVersion v}.tar.xz" }+in++let libsodium =+  λ(v : List Natural) →+    prelude.simplePackage { name = "libsodium", version = v } ⫽+      { pkgUrl = "https://download.libsodium.org/libsodium/releases/libsodium-${prelude.showVersion v}.tar.gz" }+in++let libev =+  λ(v : List Natural) →+    prelude.simplePackage { name = "libev", version = v } ⫽+      { pkgUrl = "http://dist.schmorp.de/libev/Attic/libev-${prelude.showVersion v}.tar.gz" }+in++let ctags =+  λ(v : List Natural) →+    prelude.simplePackage { name = "ctags", version = v } ⫽+      { pkgUrl = "http://prdownloads.sourceforge.net/ctags/ctags-${prelude.showVersion v}.tar.gz"+      , configureCommand = prelude.configureMkExes [ "mkinstalldirs" ]+      , installCommand = prelude.installWithBinaries [ "bin/ctags" ]+      }+in++let tcc =+  λ(v : List Natural) →+    prelude.simplePackage { name = "tcc", version = v } ⫽+      { pkgUrl = "http://download.savannah.gnu.org/releases/tinycc/tcc-${prelude.showVersion v}.tar.bz2"+      , configureCommand = prelude.configureMkExes [ "texi2pod.pl" ]+      , pkgBuildDeps = [ prelude.unbounded "perl"+                       , prelude.unbounded "texinfo"+                       ]+      , installCommand = prelude.installWithBinaries [ "bin/tcc" ]+      }+in++let texinfo =+  λ(v : List Natural) →+    prelude.simplePackage { name = "texinfo", version = v } ⫽+      { pkgUrl = "https://ftp.gnu.org/gnu/texinfo/texinfo-${prelude.showVersion v}.tar.xz" }+in++let node =+  λ(v : List Natural) →+    let versionString = prelude.showVersion v in+    prelude.simplePackage { name = "node", version = v } ⫽+      { pkgUrl = "https://nodejs.org/dist/v${versionString}/node-v${versionString}.tar.gz"+      , pkgSubdir = "node-v${versionString}"+      , installCommand =+          λ(cfg : types.BuildVars) →+            prelude.installWithBinaries [ "bin/node", "bin/npm" ] cfg+              # [ prelude.mkExe "${cfg.installDir}/lib/node_modules/npm/bin/npm-cli.js" ]+      }+in++let glu =+  λ(v : List Natural) →+    prelude.simplePackage { name = "glu", version = v } ⫽+      { pkgUrl = "https://mesa.freedesktop.org/archive/glu/glu-${prelude.showVersion v}.tar.gz"+      , pkgDeps = [ prelude.unbounded "mesa" ]+      }+in++let compositeproto =+  mkXProto "compositeproto"+in++let libXcomposite =+  mkXLibDeps { name = "libXcomposite", deps = [ prelude.unbounded "libX11"+                                              , prelude.lowerBound { name = "compositeproto", lower = [0,4] }+                                              , prelude.unbounded "libXfixes"+                                              ]+             }+in++let mosh =+  λ(v : List Natural) →+    prelude.simplePackage { name = "mosh", version = v } ⫽+      { pkgUrl = "https://mosh.org/mosh-${prelude.showVersion v}.tar.gz"+      , pkgBuildDeps = [ prelude.unbounded "protobuf" ]+      , pkgDeps = [ prelude.unbounded "zlib"+                  , prelude.unbounded "protobuf"+                  , prelude.unbounded "openssl"+                  ]+      , installCommand = prelude.installWithBinaries [ "bin/mosh" ]+      }+in++let protobuf =+  λ(v : List Natural) →+    let versionString = prelude.showVersion v in+    prelude.simplePackage { name = "protobuf", version = v } ⫽+      { pkgUrl = "https://github.com/protocolbuffers/protobuf/releases/download/v${versionString}/protobuf-cpp-${versionString}.tar.gz"+      , pkgSubdir = "protobuf-${versionString}"+      }+in++let libcds =+  λ(v : List Natural) →+    let versionString = prelude.showVersion v in+    prelude.simplePackage { name = "libcds", version = v } ⫽ prelude.cmakePackage ⫽+      { pkgUrl = "https://pilotfiber.dl.sourceforge.net/project/libcds/cds-${versionString}/cds-${versionString}.tar.gz"+      , pkgSubdir = "cds-${versionString}"+      , pkgDeps = [ prelude.unbounded "libboost" ]+      }+in++let libboost =+  -- TODO: use bootstrap.bat on windows+  let boostConfigure =+    λ(cfg : types.BuildVars) →+      [ prelude.call (prelude.defaultCall ⫽ { program = "./bootstrap.sh" }) ]+  in++  let boostInstall =+    λ(cfg : types.BuildVars) →+      [ prelude.call (prelude.defaultCall ⫽ { program = "./b2"+                                            , arguments = [ "install", "--prefix=${cfg.installDir}", "--without-python" ]+                                            })+      ]+  in++  λ(v : List Natural) →+    let versionString = prelude.underscoreVersion v in+    prelude.simplePackage { name = "libboost", version = v } ⫽+      -- TODO: allow pkgUrl to depend on os+      { pkgUrl = "https://dl.bintray.com/boostorg/release/${prelude.showVersion v}/source/boost_${versionString}.tar.bz2"+      , pkgSubdir = "boost_${versionString}"+      , pkgStream = False+      , configureCommand = boostConfigure+      , buildCommand = prelude.doNothing+      , installCommand = boostInstall+      }+in++let llvm =+  λ(v : List Natural) →+    let versionString = prelude.showVersion v in+    prelude.simplePackage { name = "llvm", version = v } ⫽ prelude.cmakePackage ⫽+      { pkgUrl = "http://releases.llvm.org/${versionString}/llvm-${versionString}.src.tar.xz"+      , pkgSubdir = "llvm-${versionString}.src"+      , pkgStream = False+      }+in+ [ autoconf [2,69] , automake [1,16,1] , at-spi-atk { version = [2,30], patch = 0 }@@ -2695,8 +3036,10 @@ , bzip2 [1,0,6] , cairo [1,16,0] , chickenScheme [5,0,0]-, cmake { version = [3,13], patch = 2 }+, cmake { version = [3,13], patch = 4 }+, compositeproto [0,4] , coreutils [8,30]+, ctags [5,8] , curl [7,63,0] , damageproto [1,2,1] , dbus [1,12,10]@@ -2708,13 +3051,14 @@ , feh [3,1,1] , fixesproto [5,0] , fontconfig [2,13,1]+, fossil [2,7] , flex [2,6,3] , fltk { version = [1,3,4], patch = 2 } , freetype-prebuild [2,9,1] -- TODO: force both to have same version? , freetype [2,9,1] , fribidi [1,0,5] , gawk [4,2,1]-, gc [8,0,2]+, gc [8,0,4] , gdb [8,2] , gdk-pixbuf { version = [2,38], patch = 0 } , gegl { version = [0,4], patch = 12 }@@ -2726,37 +3070,43 @@ , git [2,19,2] , glib { version = [2,58], patch = 3 } -- TODO: bump to 2.59.0 once gobject-introspection supports it , glproto [1,4,17]+, glu [9,0,0] , json-glib { version = [1,4], patch = 4 } , glibc [2,28] , gmp [6,1,2] , gobject-introspection { version = [1,59], patch = 3 } , gnome-doc-utils { version = [0,20], patch = 10 }-, gnupg [2,2,12]-, gnutls { version = [3,6], patch = 5 }+, gnupg [2,2,13]+, gnutls { version = [3,6], patch = 6 } , graphviz [2,40,1] , gsl [2,5] , gtk2 { version = [2,24], patch = 32 } , gtk3 { version = [3,24], patch = 4 } , gzip [1,9]-, harfbuzz [2,3,0]+, harfbuzz [2,3,1]+, htop [2,2,0] , imageMagick [7,0,8] , imlib2 [1,5,1] , inputproto [2,3,2] , intltool [0,51,0] , itstool [2,0,5] , jemalloc [5,1,0]-, jpegTurbo [2,0,1] , joe [4,6] , json-c { version = [0,13,1], dateStr = "20180305" } , kbproto [1,0,7]+, krb5 [1,17] , lapack [3,8,0] , lcms2 [2,9] , libarchive [3,3,3] , libassuan [2,5,2]-, libatomic_ops [7,6,8]+, libatomic_ops [7,6,10]+, libboost [1,69,0]+, libcds [2,3,2]+, libcroco { version = [0,6], patch = 12 } , libdatrie [0,2,12] , libdrm [2,4,96] , libepoxy [1,5,3]+, libev [4,25] , libevent [2,1,8] , libexif [0,6,21] , libffi [3,2,1]@@ -2766,16 +3116,20 @@ , libICE [1,0,9] , libicu [63,1] , libjpeg [9]+, libjpeg-turbo [2,0,2] , libksba [1,3,5] , libmypaint [1,3,0] , libnettle [3,4,1] , libpciaccess [0,14] , libpng [1,6,35]+, libpsl [0,20,2] , libpthread-stubs [0,4] , libopenjpeg [2,3,0] , libotf [0,9,16] , libselinux [2,8] , libsepol [2,8]+, libsodium [1,0,17]+, libsoup { version = [2,65], patch = 2 } , libssh2 [1,8,0] , libtasn1 [4,13] , libtiff [4,0,10]@@ -2783,12 +3137,12 @@ , libuv [1,24,0] , libSM [1,2,3] , libthai [0,1,28]-, libtiff [4,0,10] , libX11 [1,6,7] , libXau [1,0,8] , libXaw [1,0,13] , libXaw3d [1,6,3] , libxcb [1,13]+, libXcomposite [0,4,4] , libXdamage [1,1,4] , libXdmcp [1,1,2] , libXext [1,3,3]@@ -2807,6 +3161,7 @@ , libXt [1,1,5] , libXtst [1,2,3] , libXxf86vm [1,1,4]+, llvm [7,0,1] , lmdb [0,9,23] , lua [5,3,5] , m17n [1,8,0]@@ -2815,14 +3170,17 @@ , markupSafe [1,0] , memcached [1,5,12] , mesa [18,3,1]-, meson [0,49,0]+, meson [0,49,2]+, mpfr [4,0,2]+, mosh [1,3,2] , motif [2,3,8] , musl [1,1,20] , nano [3,2] , nasm [2,14] , ncurses [6,1] , nginx [1,15,7]-, ninja [1,8,2]+, ninja [1,9,0]+, node [10,15,1] , npth [1,6] , nspr [4,20] , openssh [7,9]@@ -2835,6 +3193,7 @@ , pixman [0,36,0] , pkg-config [0,29,2] , postgresql [11,1]+, protobuf [3,7,0] , pycairo [1,18,0] , pygobject { version = [2,28], patch = 7 } , pygtk { version = [2,24], patch = 0 }@@ -2855,9 +3214,12 @@ , sqlite { year = 2018, version = [3,26,0] } , swig [3,0,12] , tar [1,30]+, texinfo [6,6]+, tcc [0,9,27] , unistring [0,9,10]-, util-linux [2,33]+, util-linux { version = [2,33], patch = 1 } , util-macros [1,19,2]+, vala { version = [0,43], patch = 6 } , valgrind [3,14,0] , vim [8,1] , wayland [1,16,0]
src/Package/C.hs view
@@ -12,6 +12,7 @@                  , ABI (..)                  , InstallDb (..)                  , BuildCfg (..)+                 , EnvVar (..)                  , MonadDb                  , PkgM                  , Platform
src/Package/C/Build.hs view
@@ -6,6 +6,7 @@ import           Control.Concurrent          (getNumCapabilities) import           CPkgPrelude import           Data.Maybe                  (isJust)+import qualified Data.Text                   as T import qualified Data.Text.IO                as TIO import           Package.C.Build.OS import           Package.C.Db.Register@@ -50,8 +51,10 @@     liftIO $ createDirectoryIfMissing True (takeDirectory linkAbs)     -- TODO: diagnostics for symlinks     liftIO $ createFileLink (p </> tgt') linkAbs-stepToProc dir' _ (Write out fp) =-    liftIO (TIO.writeFile (dir' </> fp) out)+stepToProc dir' _ (Write out fp) = do+    let fpAbs = dir' </> fp+    putDiagnostic ("Writing\n" ++ T.unpack out ++ "\n in file" ++ fpAbs)+    liftIO (TIO.writeFile fpAbs out) stepToProc dir' p (CopyFile src' dest') = do     let absSrc = dir' </> src'         absDest = p </> dest'@@ -98,7 +101,7 @@ fetchCPkg :: CPkg           -> FilePath -- ^ Directory for intermediate build files           -> PkgM ()-fetchCPkg cpkg = fetchUrl (pkgUrl cpkg) (pkgName cpkg)+fetchCPkg cpkg = fetchUrl (pkgUrl cpkg) (pkgName cpkg) (pkgStream cpkg)  buildCPkg :: CPkg           -> Maybe TargetTriple
src/Package/C/Build/Tree.hs view
@@ -36,6 +36,13 @@     let infixDir = show tgt'     in filter (\fp -> infixDir `isInfixOf` fp || "meson" `isInfixOf` fp || "XML-Parser" `isInfixOf` fp || "python3" `isInfixOf` fp) fps -- FIXME: more principled approach +-- filter out stuff from the path+filterCross :: Maybe TargetTriple -> [FilePath] -> [FilePath]+filterCross Nothing = id+filterCross (Just tgt') =+    let infixDir = show tgt'+    in filter (\fp -> not (infixDir `isInfixOf` fp) || "ncurses" `isInfixOf` fp)+ buildWithContext :: DepTree CPkg                  -> Maybe TargetTriple                  -> Bool -- ^ Should we build static libraries?@@ -44,7 +51,7 @@      where buildAlg :: DepTreeF CPkg (BuildDirs, ()) -> PkgM ()           buildAlg (DepNodeF c preBds) =-            buildCPkg c host sta ds (immoralFilter host ls) is bs+            buildCPkg c host sta ds (immoralFilter host ls) is (filterCross host bs)                 where (BuildDirs ls ds is bs) = getAll (fst <$> preBds)           buildAlg (BldDepNodeF c preBds) =             buildCPkg c Nothing False ds ls is bs -- don't use static libraries for build dependencies@@ -61,6 +68,7 @@                 bins = binDir : bs                 shares = dataDir : ds +            -- TODO: do this for all of them?             includeExists <- liftIO (doesDirectoryExist includeDir)             let includes = if includeExists                 then includeDir : is@@ -73,7 +81,7 @@              let bldDirs@(BuildDirs ls ds is bs) = getAll bds -            buildVars <- getVars host sta ds (immoralFilter host ls) is bs+            buildVars <- getVars host sta ds (immoralFilter host ls) is (filterCross host bs)              pkgDir <- cPkgToDir c host buildVars 
src/Package/C/Db/Register.hs view
@@ -151,7 +151,7 @@               -> Maybe TargetTriple               -> BuildVars               -> BuildCfg-pkgToBuildCfg (CPkg n v _ _ _ _ cCmd bCmd iCmd) host bVar =+pkgToBuildCfg (CPkg n v _ _ _ _ _ cCmd bCmd iCmd) host bVar =     BuildCfg n v mempty mempty host (cCmd bVar) (bCmd bVar) (iCmd bVar) -- TODO: fix pinned build deps &c.  platformString :: Maybe TargetTriple -> (FilePath -> FilePath -> FilePath)
src/Package/C/Dhall/Type.hs view
@@ -53,6 +53,7 @@                  , pkgVersion       :: [ Natural ]                  , pkgUrl           :: T.Text                  , pkgSubdir        :: T.Text+                 , pkgStream        :: Bool -- ^ Use @tar@ package to stream                  , pkgBuildDeps     :: [ Dep ] -- TODO: depend on target?                  , pkgDeps          :: [ Dep ]                  , configureCommand :: BuildVars -> [ Command ]@@ -73,4 +74,4 @@ prettyBldDeps = preDeps "build dependencies:"  instance Pretty CPkg where-    pretty (CPkg nam v url _ bds ds _ _ _) = pretty nam <##> indent 4 ("url:" <+> pretty url <##> "version:" <+> pretty (Version v) <> prettyDeps ds <> prettyBldDeps bds)+    pretty (CPkg nam v url _ _ bds ds _ _ _) = pretty nam <##> indent 4 ("url:" <+> pretty url <##> "version:" <+> pretty (Version v) <> prettyDeps ds <> prettyBldDeps bds)
src/Package/C/Fetch.hs view
@@ -34,9 +34,10 @@  fetchUrl :: String -- ^ URL          -> String -- ^ Package name+         -> Bool -- ^ Stream using @tar@ package?          -> FilePath -- ^ Directory to unpack to          -> PkgM ()-fetchUrl url name dirName = do+fetchUrl url name libArch dirName = do          let tarballName = fromJust (asFilename url)         tarballDir <- (</> tarballName) <$> cacheDir@@ -69,4 +70,4 @@          putNormal ("Unpacking " ++ name) -        liftIO $ unpackResponse compression dirName response+        liftIO $ unpackResponse compression libArch dirName response
src/Package/C/Type.hs view
@@ -47,6 +47,7 @@                  , pkgVersion       :: Version                  , pkgUrl           :: String                  , pkgSubdir        :: String+                 , pkgStream        :: Bool -- ^ Use @tar@ package to stream                  , pkgBuildDeps     :: [ Dep ]                  , pkgDeps          :: [ Dep ]                  , configureCommand :: BuildVars -> [ Command ]@@ -70,8 +71,8 @@ buildVarsToDhallBuildVars (BuildVars dir' cd tgt' cross incls prelds shr lds bins os' arch' sta nproc) = Dhall.BuildVars (T.pack dir') (T.pack cd) tgt' cross (T.pack <$> incls) (T.pack <$> prelds) (T.pack <$> shr) (T.pack <$> lds) (T.pack <$> bins) os' arch' sta (fromIntegral nproc)  cPkgDhallToCPkg :: Dhall.CPkg -> CPkg-cPkgDhallToCPkg (Dhall.CPkg n v url subdir bldDeps deps cfgCmd buildCmd installCmd) =-    CPkg (T.unpack n) (Version v) (T.unpack url) (T.unpack subdir) bldDeps deps configure build install+cPkgDhallToCPkg (Dhall.CPkg n v url subdir stream bldDeps deps cfgCmd buildCmd installCmd) =+    CPkg (T.unpack n) (Version v) (T.unpack url) (T.unpack subdir) stream bldDeps deps configure build install      where configure cfg = commandDhallToCommand <$> cfgCmd (buildVarsToDhallBuildVars cfg)           build cfg = commandDhallToCommand <$> buildCmd (buildVarsToDhallBuildVars cfg)
src/Package/C/Type/Tree.hs view
@@ -1,4 +1,6 @@+{-# LANGUAGE DeriveAnyClass    #-} {-# LANGUAGE DeriveFoldable    #-}+{-# LANGUAGE DeriveGeneric     #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE TypeFamilies      #-} @@ -8,20 +10,17 @@                            ) where  import           Control.Recursion+import           GHC.Generics      (Generic)  data DepTree p = DepNode p [DepTree p]                | BldDepNode p [DepTree p]-    deriving (Functor, Foldable, Traversable)+    deriving (Functor, Foldable, Traversable, Generic, Recursive)  data DepTreeF p x = DepNodeF { self :: p, deps :: [x] }                   | BldDepNodeF { self :: p, deps :: [x] }-                  deriving (Functor, Foldable, Traversable)+                  deriving (Functor, Foldable, Traversable, Generic)  type instance Base (DepTree a) = DepTreeF a--instance Recursive (DepTree a) where-    project (DepNode p ps)    = DepNodeF p ps-    project (BldDepNode p ps) = BldDepNodeF p ps  asBldDep :: DepTree p -> DepTree p asBldDep (DepNode p ps)    = BldDepNode p (fmap asBldDep ps)
src/Package/C/Unpack.hs view
@@ -3,12 +3,14 @@                         , TarCompress (..)                         ) where +import qualified Codec.Archive          as Archive import qualified Codec.Archive.Tar      as Tar import           Codec.Archive.Zip      (ZipOption (..), extractFilesFromArchive, toArchive) import qualified Codec.Compression.BZip as Bzip import qualified Codec.Compression.GZip as Gzip import qualified Codec.Compression.Lzma as Lzma import qualified Data.ByteString.Lazy   as BSL+import           System.Directory  data TarCompress = Gz                  | Xz@@ -25,16 +27,20 @@ getCompressor Xz   = Lzma.decompress getCompressor Bz2  = Bzip.decompress +archiveResponse :: TarCompress -> FilePath -> BSL.ByteString -> IO ()+archiveResponse compressScheme dirName =+    Archive.unpackToDir dirName . BSL.toStrict . getCompressor compressScheme+ tarResponse :: TarCompress -> FilePath -> BSL.ByteString -> IO ()-tarResponse compressScheme dirName response =-    let f = Tar.unpack dirName . Tar.read . getCompressor compressScheme-    in f response+tarResponse compressScheme dirName =+    Tar.unpack dirName . Tar.read . getCompressor compressScheme  zipResponse :: FilePath -> BSL.ByteString -> IO ()-zipResponse dirName response = do+zipResponse dirName response = withCurrentDirectory dirName $ do     let options = OptDestination dirName     extractFilesFromArchive [options] (toArchive response) -unpackResponse :: Compression -> FilePath -> BSL.ByteString -> IO ()-unpackResponse (Tar tarCmp) fp response = tarResponse tarCmp fp response-unpackResponse Zip fp response          = zipResponse fp response+unpackResponse :: Compression -> Bool -> FilePath -> BSL.ByteString -> IO ()+unpackResponse (Tar tarCmp) True fp response  = tarResponse tarCmp fp response+unpackResponse (Tar tarCmp) False fp response = archiveResponse tarCmp fp response+unpackResponse Zip _ fp response              = zipResponse fp response