fix(packaging): sibling check, dist-only version, package path in README
- commit
- 7c67dfbd80482fd05e2f397362f68f77c8b7109a
- author
- brice · · 2026-09-26 06:05 UTC
- parent
- 8d7d700
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +11 -7
M Makefile +9 -5
| @@ -50,17 +50,21 @@ check: vet test arch fakes-check | |||
| 50 | 50 | # sibling purego-* modules are vendored, so the package builds offline. It | |
| 51 | 51 | # holds the working trees; the version ends in .dirty when one is not clean. | |
| 52 | 52 | SIBLINGS := github.com/bnema/purego-libwayland github.com/bnema/purego-vulkan | |
| 53 | - | SIBLING_DIRS := $(shell go list -m -f '{{.Dir}}' $(SIBLINGS)) | |
| 53 | + | SIBLING_DIRS = $(shell go list -m -f '{{.Dir}}' $(SIBLINGS)) | |
| 54 | 54 | dirty = $(shell for d in . $(SIBLING_DIRS); do git -C $$d diff --quiet HEAD && \ | |
| 55 | 55 | test -z "$$(git -C $$d ls-files -o --exclude-standard)" || { echo .dirty; break; }; done) | |
| 56 | 56 | # pacman-ordered: 0.0.0.r<commits>.g<hash>; a tag replaces 0.0.0. | |
| 57 | - | VERSION := $(or $(VERSION),$(shell t=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//; s/-/_/g'); \ | |
| 58 | - | echo "$${t:-0.0.0}.r$$(git rev-list --count HEAD).g$$(git rev-parse --short HEAD)")$(dirty)) | |
| 59 | - | DIST := dist/nefertty-$(VERSION) | |
| 57 | + | VERSION ?= $(shell t=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//; s/-/_/g'); \ | |
| 58 | + | echo "$${t:-0.0.0}.r$$(git rev-list --count HEAD).g$$(git rev-parse --short HEAD)")$(dirty) | |
| 59 | + | DIST = dist/nefertty-$(VERSION) | |
| 60 | 60 | dist: SHELL := bash | |
| 61 | 61 | dist: .SHELLFLAGS := -eo pipefail -c | |
| 62 | + | # Computed once per dist run (git and go list), not for every target. | |
| 63 | + | ifneq ($(filter dist pkg,$(MAKECMDGOALS)),) | |
| 64 | + | VERSION := $(VERSION) | |
| 65 | + | endif | |
| 62 | 66 | dist: | |
| 63 | - | @test -n "$(SIBLING_DIRS)" || { echo "sibling modules not found: $(SIBLINGS)" >&2; exit 1; } | |
| 67 | + | @for d in $(SIBLING_DIRS); do test -d $$d || { echo "sibling module not found: $$d" >&2; exit 1; }; done | |
| 64 | 68 | rm -rf $(DIST) && mkdir -p $(DIST) | |
| 65 | 69 | git ls-files -co --exclude-standard -z | tar --null -T - -c | tar -x -C $(DIST) | |
| 66 | 70 | cd $(DIST) && go mod edit $(foreach m,$(SIBLINGS),-replace=$(m)=$(shell go list -m -f '{{.Dir}}' $(m))) && go mod vendor | |
| @@ -50,17 +50,21 @@ check: vet test arch fakes-check | |||||
| 50 | # sibling purego-* modules are vendored, so the package builds offline. It | 50 | # sibling purego-* modules are vendored, so the package builds offline. It | ||
| 51 | # holds the working trees; the version ends in .dirty when one is not clean. | 51 | # holds the working trees; the version ends in .dirty when one is not clean. | ||
| 52 | SIBLINGS := github.com/bnema/purego-libwayland github.com/bnema/purego-vulkan | 52 | SIBLINGS := github.com/bnema/purego-libwayland github.com/bnema/purego-vulkan | ||
| 53 | - | SIBLING_DIRS := $(shell go list -m -f '{{.Dir}}' $(SIBLINGS)) | 53 | + | SIBLING_DIRS = $(shell go list -m -f '{{.Dir}}' $(SIBLINGS)) |
| 54 | dirty = $(shell for d in . $(SIBLING_DIRS); do git -C $$d diff --quiet HEAD && \ | 54 | dirty = $(shell for d in . $(SIBLING_DIRS); do git -C $$d diff --quiet HEAD && \ | ||
| 55 | test -z "$$(git -C $$d ls-files -o --exclude-standard)" || { echo .dirty; break; }; done) | 55 | test -z "$$(git -C $$d ls-files -o --exclude-standard)" || { echo .dirty; break; }; done) | ||
| 56 | # pacman-ordered: 0.0.0.r<commits>.g<hash>; a tag replaces 0.0.0. | 56 | # pacman-ordered: 0.0.0.r<commits>.g<hash>; a tag replaces 0.0.0. | ||
| 57 | - | VERSION := $(or $(VERSION),$(shell t=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//; s/-/_/g'); \ | 57 | + | VERSION ?= $(shell t=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//; s/-/_/g'); \ |
| 58 | - | echo "$${t:-0.0.0}.r$$(git rev-list --count HEAD).g$$(git rev-parse --short HEAD)")$(dirty)) | 58 | + | echo "$${t:-0.0.0}.r$$(git rev-list --count HEAD).g$$(git rev-parse --short HEAD)")$(dirty) |
| 59 | - | DIST := dist/nefertty-$(VERSION) | 59 | + | DIST = dist/nefertty-$(VERSION) |
| 60 | dist: SHELL := bash | 60 | dist: SHELL := bash | ||
| 61 | dist: .SHELLFLAGS := -eo pipefail -c | 61 | dist: .SHELLFLAGS := -eo pipefail -c | ||
| 62 | + | # Computed once per dist run (git and go list), not for every target. | |||
| 63 | + | ifneq ($(filter dist pkg,$(MAKECMDGOALS)),) | |||
| 64 | + | VERSION := $(VERSION) | |||
| 65 | + | endif | |||
| 62 | dist: | 66 | dist: | ||
| 63 | - | @test -n "$(SIBLING_DIRS)" || { echo "sibling modules not found: $(SIBLINGS)" >&2; exit 1; } | 67 | + | @for d in $(SIBLING_DIRS); do test -d $$d || { echo "sibling module not found: $$d" >&2; exit 1; }; done |
| 64 | rm -rf $(DIST) && mkdir -p $(DIST) | 68 | rm -rf $(DIST) && mkdir -p $(DIST) | ||
| 65 | git ls-files -co --exclude-standard -z | tar --null -T - -c | tar -x -C $(DIST) | 69 | git ls-files -co --exclude-standard -z | tar --null -T - -c | tar -x -C $(DIST) | ||
| 66 | cd $(DIST) && go mod edit $(foreach m,$(SIBLINGS),-replace=$(m)=$(shell go list -m -f '{{.Dir}}' $(m))) && go mod vendor | 70 | cd $(DIST) && go mod edit $(foreach m,$(SIBLINGS),-replace=$(m)=$(shell go list -m -f '{{.Dir}}' $(m))) && go mod vendor | ||
M README.md +2 -2
| @@ -17,8 +17,8 @@ Run: `nefertty --backend=headless --timeout 5s` | |||
| 17 | 17 | ## Install (Arch Linux) | |
| 18 | 18 | ||
| 19 | 19 | ```sh | |
| 20 | - | make pkg # builds dist/pkg/nefertty-*.pkg.tar.zst | |
| 21 | - | sudo pacman -U dist/pkg/nefertty-*.pkg.tar.zst | |
| 20 | + | make pkg # builds dist/nefertty-*.pkg.tar.zst | |
| 21 | + | sudo pacman -U dist/nefertty-*.pkg.tar.zst | |
| 22 | 22 | ``` | |
| 23 | 23 | ||
| 24 | 24 | The package installs `nefertty` and a **NeferTTY** session for display managers (Ly, GDM, SDDM). The session runs `nefertty --session`, which shares `WAYLAND_DISPLAY` and `DISPLAY` with D-Bus and systemd user services, so portals and notification daemons reach it. `make dist` alone builds the self-contained source tarball (Go modules vendored) that the package uses; its version ends in `.dirty` when this repo or a sibling module has uncommitted changes. | |
| @@ -17,8 +17,8 @@ Run: `nefertty --backend=headless --timeout 5s` | |||||
| 17 | ## Install (Arch Linux) | 17 | ## Install (Arch Linux) | ||
| 18 | 18 | ||||
| 19 | ```sh | 19 | ```sh | ||
| 20 | - | make pkg # builds dist/pkg/nefertty-*.pkg.tar.zst | 20 | + | make pkg # builds dist/nefertty-*.pkg.tar.zst |
| 21 | - | sudo pacman -U dist/pkg/nefertty-*.pkg.tar.zst | 21 | + | sudo pacman -U dist/nefertty-*.pkg.tar.zst |
| 22 | ``` | 22 | ``` | ||
| 23 | 23 | ||||
| 24 | The package installs `nefertty` and a **NeferTTY** session for display managers (Ly, GDM, SDDM). The session runs `nefertty --session`, which shares `WAYLAND_DISPLAY` and `DISPLAY` with D-Bus and systemd user services, so portals and notification daemons reach it. `make dist` alone builds the self-contained source tarball (Go modules vendored) that the package uses; its version ends in `.dirty` when this repo or a sibling module has uncommitted changes. | 24 | The package installs `nefertty` and a **NeferTTY** session for display managers (Ly, GDM, SDDM). The session runs `nefertty --session`, which shares `WAYLAND_DISPLAY` and `DISPLAY` with D-Bus and systemd user services, so portals and notification daemons reach it. `make dist` alone builds the self-contained source tarball (Go modules vendored) that the package uses; its version ends in `.dirty` when this repo or a sibling module has uncommitted changes. | ||