$NetBSD$ Avoid needs of GNU make and invoking git. These should be needed only for development. --- makefile.orig 2024-05-20 12:59:12.000000000 +0000 +++ makefile @@ -4,8 +4,8 @@ RUNTIME = $(PREFIX)/share/nvimpager/runt VERSION = $(lastword $(shell ./nvimpager -v)) BUSTED = busted -%.configured: % - sed 's#^RUNTIME=.*$$#RUNTIME='"'$(RUNTIME)'"'#;s#version=.*$$#version=$(VERSION)#' < $< > $@ +nvimpager.configured: nvimpager + sed 's#^RUNTIME=.*$$#RUNTIME='"'$(RUNTIME)'"'#;s#version=.*$$#version=$(VERSION)#' < nvimpager > $@ chmod +x $@ install-no-man: nvimpager.configured @@ -24,9 +24,8 @@ uninstall: $(PREFIX)/share/man/man1/nvimpager.1 \ $(PREFIX)/share/zsh/site-functions/_nvimpager -nvimpager.1: SOURCE_DATE_EPOCH = $(shell git log -1 --no-show-signature --pretty="%ct" 2>/dev/null || echo 1716209952) nvimpager.1: nvimpager.md - sed '1s/$$/ "nvimpager $(VERSION)"/' $< | scdoc > $@ + sed '1s/$$/ "nvimpager $(VERSION)"/' nvimpager.md | scdoc > $@ # The patterns prefixed with "lua" are used to require our nvimpager code from # the tests with the same module names that neovim would find them. @@ -41,25 +40,6 @@ luacov.stats.out: nvimpager lua/nvimpage luacov.report.out: luacov.stats.out luacov lua/nvimpager -TYPE = minor -version: OLD_VERSION = $(patsubst v%,%,$(lastword $(shell git tag --list --sort=version:refname 'v*'))) -version: NEW_VERSION = $(shell echo $(OLD_VERSION) | awk -F . -v type=$(TYPE) \ - -e 'type == "major" { print $$1+1 ".0.0" }' \ - -e 'type == "minor" { print $$1 "." $$2+1 ".0" }' \ - -e 'type == "patch" { print $$1 "." $$2 "." $$3+1 }') -version: - [ $(TYPE) = major ] || [ $(TYPE) = minor ] || [ $(TYPE) = patch ] - git switch main - git diff --quiet HEAD - sed -i 's/version=[0-9.]*$$/version=$(NEW_VERSION)/' nvimpager - sed -i '/SOURCE_DATE_EPOCH/s/[0-9]\{10,\}/$(shell date +%s)/' $(MAKEFILE_LIST) - (printf '%s\n' 'Version $(NEW_VERSION)' '' 'Major changes:' 'Breaking changes:' 'Changes:'; \ - git log v$(OLD_VERSION)..HEAD) \ - | sed -E '/^(commit|Merge:|Author:)/d; /^Date/{N;N; s/.*\n.*\n /-/;}' \ - | git commit --edit --file - nvimpager makefile - git tag --message="$$(git show --no-patch --format=format:%s%n%n%b)" \ - v$(NEW_VERSION) - clean: $(RM) nvimpager.configured nvimpager.1 luacov.* .PHONY: clean install test uninstall version