Don’t set TERMINFO

Refs #1658
This commit is contained in:
Max Howell 2023-10-23 15:12:46 -04:00
parent 5575c5d788
commit 690793792f
2 changed files with 59 additions and 31 deletions

View file

@ -26,6 +26,10 @@ $ pkg build
# ^^ needs a zero permissions GITHUB_TOKEN to use the GitHub API # ^^ needs a zero permissions GITHUB_TOKEN to use the GitHub API
# either set `GITHUB_TOKEN` or run `gh auth login` # either set `GITHUB_TOKEN` or run `gh auth login`
$ pkgx yq .provides <projects/$(pkg status | tr -d '[:space:]')/package.yml
- bin/foo
# ^^ purely demonstrative for the next step
$ foo $ foo
# ^^ anything in the `provides:` key will now run # ^^ anything in the `provides:` key will now run
@ -39,21 +43,17 @@ $ gh pr create
``` ```
> * `pkg build` and `pkg test` take a `-L` flag to run in a Linux Docker container > * `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 ## GitHub Codespaces
`pantry` also works in GitHub Codespaces. The default configuration `pantry` also works in GitHub Codespaces. The default configuration
provides with the repository will install/update `pkgx` at the time provided with the repository will install/update `pkgx` at the time
you attach, so you should be able to quickly work on or test packages 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). in a remote linux environment (or work from a device with just a web browser).
## Packaging Guide ## 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 The best way to figure out solutions for your problems is to read other
examples from the pantry. examples from the pantry.
## After Your Contribution # After Your Contribution
We build “bottles” (tard binaries) and upload them to our CDN. Thus your We build “bottles” (tard 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 automatically sync the pantry to your local machine if you ask for something
it doesnt know about, but in the case where that fails do a `pkgx --sync` it doesnt know about, but in the case where that fails do a `pkgx --sync`
first. first.
The pantry automatically builds new releases of packages *as soon as they are > 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 > released* (usually starting the builds within seconds). There is no need to
submit PRs for updates. > submit PRs for updates.
## Working on Other Peoples 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 Peoples Pull Requests
Packaging can be fiddly so we all pitch in. If you want to help someone else Packaging can be fiddly so we all pitch in. If you want to help someone else
with their pull request then you can use GitHubs CLI: with their pull request then you can use GitHubs CLI:

View file

@ -6,30 +6,42 @@ versions:
github: mirror/ncurses/tags github: mirror/ncurses/tags
strip: /v/ strip: /v/
build: build:
dependencies: dependencies:
freedesktop.org/pkg-config: ^0.29 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 mkdir -p $PCDIR
./configure $ARGS ./configure $ARGS
make --jobs {{ hw.concurrency }} install make --jobs {{ hw.concurrency }} install
# fix up symlinks # fix up symlinks
cd {{prefix}}/lib - run: |
for lib in form menu ncurses panel curses++; do for lib in form menu ncurses panel curses++; do
for ii in $(find . -name lib${lib}w\*); do for ii in $(find . -name lib${lib}w\*); do
# hopefully no new w's will be introduced # hopefully no new w's will be introduced
ln -sf $ii $(echo $ii | tr -d w) ln -sf $ii $(echo $ii | tr -d w)
done
done done
done working-directory: ${{prefix}}/lib
# things often expect either no namespace or namespace # things often expect either no namespace or namespace
cd ../include - run: |
mv ncursesw/* . mv ncursesw/* .
rmdir ncursesw rmdir ncursesw
ln -sf . 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 sed -i.bak 's|{{prefix}}|\${pcfiledir}/../..|g' {{prefix}}/lib/pkgconfig/*.pc
rm {{prefix}}/lib/pkgconfig/*.bak rm {{prefix}}/lib/pkgconfig/*.bak
@ -48,21 +60,27 @@ build:
- --with-gpm=no - --with-gpm=no
- --without-ada - --without-ada
- --with-pkg-config-libdir=$PCDIR - --with-pkg-config-libdir=$PCDIR
- --with-default-terminfo-dir=/usr/share/terminfo # or breaks on macOS
runtime: runtime:
env: 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 # ^^ we delegate to the system first since they may apply platform specific info
test: test:
dependencies: dependencies:
github.com/tmux/tmux: ^3
freedesktop.org/pkg-config: ^0.29 freedesktop.org/pkg-config: ^0.29
script: | script:
- |
ncursesw6-config --version | grep {{version.marketing}} ncursesw6-config --version | grep {{version.marketing}}
ncursesw6-config --terminfo-dirs | grep '{{prefix}}' ncursesw6-config --terminfo-dirs | grep '{{prefix}}'
pkg-config --modversion ncursesw | grep {{version.marketing}} pkg-config --modversion ncursesw | grep {{version.marketing}}
pkg-config --libs ncursesw | grep '{{prefix}}' pkg-config --libs ncursesw | grep '{{prefix}}'
# https://github.com/pkgxdev/pantry/issues/1658
- tmux -c ls
provides: provides:
- bin/captoinfo - bin/captoinfo
- bin/clear - bin/clear