diff --git a/packages/capy/build.ncl b/packages/capy/build.ncl index b4b84364..ab87affc 100644 --- a/packages/capy/build.ncl +++ b/packages/capy/build.ncl @@ -6,7 +6,7 @@ let ca-certificates = import "../ca-certificates/build.ncl" in let git = import "../git/build.ncl" in let node-lts = import "../node-lts/build.ncl" in -let version = "0.9.0" in +let version = "0.9.1" in { name = "capy", build_deps = [ @@ -16,7 +16,7 @@ let version = "0.9.0" in # into this registry. { url = "https://github.com/capysc/capy-cli/archive/refs/tags/v%{version}.tar.gz", - sha256 = "3257d7d0652d1df2e5d61cc1ed0e7313ac1e4d45a9ce62df4d2bc5e558f2de6a", + sha256 = "42b4debf7a8d0b6aa64631dec05f4fa6347df1aa721681c079cb360ea4222a0c", extract = true, strip_prefix = "capy-cli-%{version}", } | Source, diff --git a/packages/happy/build.ncl b/packages/happy/build.ncl index 8a4e1e96..d8417e3e 100644 --- a/packages/happy/build.ncl +++ b/packages/happy/build.ncl @@ -1,11 +1,11 @@ -let { BuildSpec, Local, OutputBin, OutputData, Source, .. } = import "minimal.ncl" in +let { BuildSpec, Local, OutputBin, OutputData, Source, Test, .. } = import "minimal.ncl" in let base = import "../base/build.ncl" in let bash = import "../bash/build.ncl" in let ghc-bootstrap = import "../ghc-bootstrap/build.ncl" in let gmp = import "../gmp/build.ncl" in let toolchain = import "../toolchain/build.ncl" in -let version = "1.20.1.1" in +let version = "2.1.6" in { name = "happy", @@ -13,7 +13,14 @@ let version = "1.20.1.1" in { file = "build.sh" } | Local, { url = "https://hackage.haskell.org/package/happy-%{version}/happy-%{version}.tar.gz", - sha256 = "8b4e7dc5a6c5fd666f8f7163232931ab28746d0d17da8fa1cbd68be9e878881b", + sha256 = "9b473961010cb5673510f4133d914b9d5ad667b16aafe4a5555d9962dbf05b19", + extract = true, + } | Source, + # Since 2.0 the executable is a thin driver over happy-lib, which also ships + # the code templates the generated parsers are built from. + { + url = "https://hackage.haskell.org/package/happy-lib-%{version}/happy-lib-%{version}.tar.gz", + sha256 = "b0a130901562fd2b338baeb5b508cd8aed914b300f51c30b0ba8935995b2c2cd", extract = true, } | Source, base, @@ -46,4 +53,27 @@ let version = "1.20.1.1" in }, license_spdx = "BSD-2-Clause", }, + + tests = { + version_check = + { + class = 'Standalone, + test_deps = [base], + cmds = [ + ["/bin/bash", "-c", "/usr/bin/happy --version | grep -q 'Happy Version %{version}'"], + ], + } | Test, + # Generating a parser is what proves the package is whole: happy reads its + # code templates out of happy-lib's data directory at runtime, so this fails + # if those files are missing from the outputs or installed under a path the + # binary wasn't compiled to look in. + generates_a_parser = + { + class = 'Standalone, + test_deps = [base], + cmds = [ + ["/bin/bash", "-c", "set -euo pipefail\ncat > calc.y <<'EOF'\n{\nmodule Calc where\n}\n%name calc\n%tokentype { Token }\n%error { parseError }\n%token int { TInt $$ }\n%%\nExp : int { $1 }\n{\ndata Token = TInt Int\nparseError :: [Token] -> a\nparseError _ = error \"parse error\"\n}\nEOF\n/usr/bin/happy --ghc calc.y -o calc.hs\n# happyParse comes from HappyTemplate.hs, so finding it means the template\n# was located and inlined rather than the parser being generated empty.\ngrep -q happyParse calc.hs"], + ], + } | Test, + }, } | BuildSpec diff --git a/packages/happy/build.sh b/packages/happy/build.sh index debbc31d..39e1b90c 100755 --- a/packages/happy/build.sh +++ b/packages/happy/build.sh @@ -1,19 +1,45 @@ #!/bin/bash set -euo pipefail -cd "happy-$MINIMAL_ARG_VERSION" +VERSION="$MINIMAL_ARG_VERSION" -# Determine setup file -SETUP_FILE="Setup.hs" -if [ -f Setup.lhs ]; then - SETUP_FILE="Setup.lhs" -elif [ ! -f Setup.hs ]; then - echo "import Distribution.Simple" > Setup.hs - echo "main = defaultMain" >> Setup.hs - SETUP_FILE="Setup.hs" -fi +build_setup() { + # Determine setup file + local setup_file="Setup.hs" + if [ -f Setup.lhs ]; then + setup_file="Setup.lhs" + elif [ ! -f Setup.hs ]; then + echo "import Distribution.Simple" > Setup.hs + echo "main = defaultMain" >> Setup.hs + fi + ghc --make "$setup_file" +} -ghc --make "$SETUP_FILE" -./Setup configure --prefix=/usr +# happy 2.x splits the parser generator into happy-lib plus a thin executable, so +# happy-lib has to be built and registered into a build-local package database +# before the executable can be configured. +PKG_DB="$PWD/package.conf.d" +ghc-pkg init "$PKG_DB" + +( + cd "happy-lib-$VERSION" + build_setup + ./Setup configure --prefix=/usr --package-db="$PKG_DB" + ./Setup build + # Register the build tree rather than the install location: the templates are + # already baked in with the /usr prefix from configure, but /usr/lib does not + # exist yet while the executable is being linked. + ./Setup register --inplace + ./Setup copy --destdir="$PWD/../stage" +) + +# Only happy-lib's templates are needed at runtime; its Haskell libraries are +# statically linked into the executable. +mkdir -p "$OUTPUT_DIR/usr" +cp -a stage/usr/share "$OUTPUT_DIR/usr/" + +cd "happy-$VERSION" +build_setup +./Setup configure --prefix=/usr --package-db="$PKG_DB" ./Setup build ./Setup copy --destdir="$OUTPUT_DIR" diff --git a/packages/hunk/build.ncl b/packages/hunk/build.ncl index 2414fbcf..a6b8178f 100644 --- a/packages/hunk/build.ncl +++ b/packages/hunk/build.ncl @@ -5,14 +5,14 @@ let bun = import "../bun/build.ncl" in let git = import "../git/build.ncl" in let glibc = import "../glibc/build.ncl" in -let version = "0.17.4" in +let version = "0.17.7" in { name = "hunk", build_deps = [ { file = "build.sh" } | Local, { url = "https://github.com/modem-dev/hunk/archive/refs/tags/v%{version}.tar.gz", - sha256 = "f37c7e7c492a60f8b4a49cf99581de2dcb6e1c5ba120703790ae55bc596072d5", + sha256 = "147a23fc72aa6f76704dba08b8847d25dacec4857440f5579db57dd068f23921", extract = true, strip_prefix = "hunk-%{version}", } | Source, diff --git a/packages/lazygit/build.ncl b/packages/lazygit/build.ncl index bc8ccf99..5b01c291 100644 --- a/packages/lazygit/build.ncl +++ b/packages/lazygit/build.ncl @@ -5,14 +5,14 @@ let base = import "../base/build.ncl" in let go = import "../go/build.ncl" in let toolchain = import "../toolchain/build.ncl" in let glibc = import "../glibc/build.ncl" in -let version = "0.63.1" in +let version = "0.64.0" in { name = "lazygit", build_deps = [ { file = "build.sh" } | Local, { url = "gs://minimal-staging-archives/jesseduffield/lazygit/v%{version}.tar.gz", - sha256 = "227ff262138440ff68e893f6c95c4e586e954c46913106d84fff78d220e18b6c", + sha256 = "2d41928fd3c6355022f0876ac5b8abc89ece40bf3ab9b8353f254d420d938201", extract = true, strip_prefix = "lazygit-%{version}", } | Source, diff --git a/packages/pnpm/build.ncl b/packages/pnpm/build.ncl index 51d38973..a6936a30 100644 --- a/packages/pnpm/build.ncl +++ b/packages/pnpm/build.ncl @@ -5,14 +5,14 @@ let tar = import "../tar/build.ncl" in let node-lts = import "../node-lts/build.ncl" in -let version = "11.19.0" in +let version = "11.20.0" in { name = "pnpm", build_deps = [ { file = "build.sh" } | Local, { url = "https://registry.npmjs.org/pnpm/-/pnpm-%{version}.tgz", - sha256 = "b9e49603540d04107b98e93917a30e6114970d403c23e40309a44ea9c2bca7fd" + sha256 = "34e198cb1e43237517ecedfd31f9ae26a6c0a3e5366ce58a2d05f4b21fb5f19a" } | Source, base, tar, diff --git a/packages/py-packaging/build.ncl b/packages/py-packaging/build.ncl index fe53fbfa..c418ce80 100644 --- a/packages/py-packaging/build.ncl +++ b/packages/py-packaging/build.ncl @@ -4,13 +4,13 @@ let base = import "../base/build.ncl" in let python = import "../python/build.ncl" in let pyproject-hooks = import "../pyproject-hooks/build.ncl" in -let version = "26.2" in +let version = "26.3" in { name = "py-packaging", build_deps = [ { url = "https://files.pythonhosted.org/packages/source/p/packaging/packaging-%{version}.tar.gz", - sha256 = "ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", + sha256 = "94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", extract = true, strip_prefix = "packaging-%{version}", } | Source,