cpkg 0.1.2.1 → 0.1.3.0
raw patch · 10 files changed
+55/−3 lines, 10 files
Files
- CHANGELOG.md +4/−0
- cpkg.cabal +2/−1
- dhall/cpkg-prelude.dhall +6/−0
- dhall/cpkg-types.dhall +1/−0
- pkgs/patches/xextproto.patch +11/−0
- pkgs/patches/xproto.patch +11/−0
- pkgs/pkg-set.dhall +14/−2
- src/Package/C/Build.hs +3/−0
- src/Package/C/Dhall/Type.hs +1/−0
- src/Package/C/Type.hs +2/−0
CHANGELOG.md view
@@ -1,5 +1,9 @@ # cpkg +## 0.1.3.0++ * Add ability to patch libraries+ ## 0.1.2.1 * Add `--global` flag
cpkg.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: cpkg-version: 0.1.2.1+version: 0.1.3.0 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018-2019 Vanessa McHale@@ -16,6 +16,7 @@ dhall/cpkg-prelude.dhall dhall/cpkg-types.dhall pkgs/pkg-set.dhall+ pkgs/patches/*.patch extra-doc-files: README.md CHANGELOG.md
dhall/cpkg-prelude.dhall view
@@ -159,6 +159,11 @@ types.Command.Write in +let patch =+ λ(x : Text) →+ types.Command.Patch { patchContents = x }+in+ let defaultEnv = None (List types.EnvVar) in@@ -1171,4 +1176,5 @@ , isX64 = isX64 , configWithEnv = configWithEnv , buildEnv = buildEnv+, patch = patch }
dhall/cpkg-types.dhall view
@@ -103,6 +103,7 @@ | Symlink : { tgt : Text, linkName : Text } | Write : { file : Text, contents : Text } | CopyFile : { src : Text, dest : Text }+ | Patch : { patchContents : Text } > in
+ pkgs/patches/xextproto.patch view
@@ -0,0 +1,11 @@+--- config.sub 2019-04-27 17:01:47.137694014 -0500++++ config.sub 2019-04-27 17:02:05.329622757 -0500+@@ -249,7 +249,7 @@+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \+ | am33_2.0 \+- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \++ | arc | aarch64 | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \+ | bfin \+ | c4x | clipper \+ | d10v | d30v | dlx | dsp16xx \
+ pkgs/patches/xproto.patch view
@@ -0,0 +1,11 @@+--- config.sub 2019-04-27 16:40:36.266089495 -0500++++ config.sub 2019-04-27 16:41:44.593275058 -0500+@@ -240,7 +240,7 @@+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \+ | am33_2.0 \+- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \++ | arc | aarch64 | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \+ | bfin \+ | c4x | clipper \+ | d10v | d30v | dlx | dsp16xx \
pkgs/pkg-set.dhall view
@@ -1035,8 +1035,20 @@ { pkgUrl = "https://www.x.org/releases/individual/proto/${name}-${prelude.showVersion v}.tar.bz2" } in +let mkXProtoWithPatch =+ λ(name : Text) →+ λ(patch : Text) →+ λ(v : List Natural) →+ mkXProto name v ⫽+ { configureCommand =+ λ(cfg : types.BuildVars) →+ [ prelude.patch patch ]+ # prelude.defaultConfigure cfg+ }+in+ let xproto =- mkXProto "xproto"+ mkXProtoWithPatch "xproto" (./patches/xproto.patch as Text) in let renderproto =@@ -1829,7 +1841,7 @@ in let xextproto =- mkXProto "xextproto"+ mkXProtoWithPatch "xextproto" (./patches/xextproto.patch as Text) in let fixesproto =
src/Package/C/Build.hs view
@@ -61,6 +61,9 @@ putDiagnostic ("Copying file " ++ absSrc ++ " to " ++ absDest ++ "...") liftIO $ createDirectoryIfMissing True (takeDirectory absDest) liftIO $ copyFileWithMetadata absSrc absDest+stepToProc dir' _ (Patch contents) = do+ liftIO $ TIO.writeFile (dir' </> "step.patch") contents+ waitProcess $ (proc "patch" ["-i", "step.patch"]) { cwd = Just dir' } processSteps :: (Traversable t) => FilePath -- ^ Build directory
src/Package/C/Dhall/Type.hs view
@@ -47,6 +47,7 @@ | Symlink { tgt :: T.Text, linkName :: T.Text } | Write { contents :: T.Text, file :: T.Text } | CopyFile { src :: T.Text, dest :: T.Text }+ | Patch { patchContents :: T.Text } deriving (Generic, Interpret) data CPkg = CPkg { pkgName :: T.Text
src/Package/C/Type.hs view
@@ -39,6 +39,7 @@ | Symlink { tgt :: String, linkName :: String } | Write { contents :: T.Text, file :: FilePath } | CopyFile { src :: FilePath, dest :: FilePath }+ | Patch { patchContents :: T.Text } deriving (Eq, Ord, Generic, Binary, Hashable) -- TODO: build script should take OS as an argument?@@ -66,6 +67,7 @@ commandDhallToCommand (Dhall.Write out fp) = Write out (T.unpack fp) commandDhallToCommand (Dhall.CopyFile src' dest') = CopyFile (T.unpack src') (T.unpack dest') commandDhallToCommand (Dhall.Symlink t l) = Symlink (T.unpack t) (T.unpack l)+commandDhallToCommand (Dhall.Patch c) = Patch c buildVarsToDhallBuildVars :: BuildVars -> Dhall.BuildVars 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)