From 690793792f19ec5e204b6d17872ee3f70fd7dd8b Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 23 Oct 2023 15:12:46 -0400 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20set=20TERMINFO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #1658 --- README.md | 40 +++++++++------ .../invisible-island.net/ncurses/package.yml | 50 +++++++++++++------ 2 files changed, 59 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 86f354df..488f8b02 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ $ pkg build # ^^ needs a zero permissions GITHUB_TOKEN to use the GitHub API # either set `GITHUB_TOKEN` or run `gh auth login` +$ pkgx yq .provides * `pkg build` and `pkg test` take a `-L` flag to run in a Linux Docker container -> * All commands take an optional pkg-spec eg. `pkg build zlib.net^1.1` +> * All commands take an optional pkg-spec eg. `pkg build node@19` -While inside the pantry `dev` environment you can run commands from any built -packages provided you specified their `provides:` key. -## BrewKit - -We use a special package called [`brewkit`] to build packages both here and -in CI/CD. `brewkit` provides the `pkg` command. +> We use a special package called [`brewkit`] to build packages both here and +> in CI/CD. `brewkit` provides the `pkg` command. ## GitHub Codespaces `pantry` also works in GitHub Codespaces. The default configuration -provides with the repository will install/update `pkgx` at the time -you attach, so you should be able to quickly work on or test packages +provided with the repository will install/update `pkgx` at the time +you attach, so you should be able to quickly work on test packages in a remote linux environment (or work from a device with just a web browser). ## Packaging Guide @@ -65,19 +65,29 @@ For other assistance, start a [discussion]. The best way to figure out solutions for your problems is to read other examples from the pantry. -## After Your Contribution +# After Your Contribution We build “bottles” (tar’d binaries) and upload them to our CDN. Thus your -contribution will be available at merge-time + build-time. `pkgx` should +contribution will be available at merge-time + build-time + CDN distribution +time. + +`pkgx` should automatically sync the pantry to your local machine if you ask for something it doesn’t know about, but in the case where that fails do a `pkgx --sync` first. -The pantry automatically builds new releases of packages *as soon as they are -released* (usually starting the builds within seconds). There is no need to -submit PRs for updates. +> The pantry automatically builds new releases of packages *as soon as they are +> released* (usually starting the builds within seconds). There is no need to +> submit PRs for updates. -## Working on Other People’s Pull Requests +Note that while in the pantry `dev` environment you can use your new package +if you built it. However this will not work outside the pantry `dev` unless +you either: + +1. You set `PKGX_PANTRY_PATH` +2. Get your PR merged! + +# Working on Other People’s Pull Requests Packaging can be fiddly so we all pitch in. If you want to help someone else with their pull request then you can use GitHub’s CLI: diff --git a/projects/invisible-island.net/ncurses/package.yml b/projects/invisible-island.net/ncurses/package.yml index fa3483ac..5e5974df 100644 --- a/projects/invisible-island.net/ncurses/package.yml +++ b/projects/invisible-island.net/ncurses/package.yml @@ -6,30 +6,42 @@ versions: github: mirror/ncurses/tags strip: /v/ + build: dependencies: freedesktop.org/pkg-config: ^0.29 - script: | + script: + + #FIXME because our build infra is recursive + - | + if [ -d {{prefix}}/include ]; then + rm -rf {{prefix}}/include + fi + + - | mkdir -p $PCDIR ./configure $ARGS make --jobs {{ hw.concurrency }} install - # fix up symlinks - cd {{prefix}}/lib - for lib in form menu ncurses panel curses++; do - for ii in $(find . -name lib${lib}w\*); do - # hopefully no new w's will be introduced - ln -sf $ii $(echo $ii | tr -d w) + # fix up symlinks + - run: | + for lib in form menu ncurses panel curses++; do + for ii in $(find . -name lib${lib}w\*); do + # hopefully no new w's will be introduced + ln -sf $ii $(echo $ii | tr -d w) + done done - done + working-directory: ${{prefix}}/lib - # things often expect either no namespace or namespace - cd ../include - mv ncursesw/* . - rmdir ncursesw - ln -sf . ncursesw + # things often expect either no namespace or namespace + - run: | + mv ncursesw/* . + rmdir ncursesw + ln -sf . ncursesw + working-directory: ${{prefix}}/include - # fix hardcoded paths + # fix hardcoded paths + - | sed -i.bak 's|{{prefix}}|\${pcfiledir}/../..|g' {{prefix}}/lib/pkgconfig/*.pc rm {{prefix}}/lib/pkgconfig/*.bak @@ -48,21 +60,27 @@ build: - --with-gpm=no - --without-ada - --with-pkg-config-libdir=$PCDIR + - --with-default-terminfo-dir=/usr/share/terminfo # or breaks on macOS runtime: env: - TERMINFO: /usr/share/terminfo:{{prefix}}/share/terminfo + TERMINFO_DIRS: ${{prefix}}/share/terminfo # ^^ we delegate to the system first since they may apply platform specific info test: dependencies: + github.com/tmux/tmux: ^3 freedesktop.org/pkg-config: ^0.29 - script: | + script: + - | ncursesw6-config --version | grep {{version.marketing}} ncursesw6-config --terminfo-dirs | grep '{{prefix}}' pkg-config --modversion ncursesw | grep {{version.marketing}} pkg-config --libs ncursesw | grep '{{prefix}}' + # https://github.com/pkgxdev/pantry/issues/1658 + - tmux -c ls + provides: - bin/captoinfo - bin/clear