proot-makefile.patch (1664B)
1 --- src/GNUmakefile 2022-04-24 22:52:11.000000000 +0200 2 +++ src/GNUmakefile 2022-07-31 13:32:15.897932149 +0200 3 @@ -119,18 +119,32 @@ 4 ###################################################################### 5 # Auto-configuration 6 7 -GIT_VERSION := $(shell git describe --tags `git rev-list --tags --max-count=1`) 8 +# Just badly written. - [SR] 9 +# - not taking into account people who build from tarball, when the directory 10 +# is not a git repository 11 +GIT_VERSION := $(shell git describe --tags \ 12 + `git rev-list --tags --max-count=1 2>/dev/null` 2>/dev/null) 13 14 -GIT_COMMIT := $(shell git rev-list --all --max-count=1 | cut -c 1-8) 15 +GIT_COMMIT := $(shell git rev-list --all --max-count=1 2>/dev/null | cut -c 1-8) 16 17 +ifneq ($(strip $(GIT_VERSION)),) 18 VERSION = $(GIT_VERSION)-$(GIT_COMMIT) 19 +else 20 +# Fallback 21 +VERSION = 5.3.1 22 +endif 23 24 -CHECK_VERSION = if [ ! -z "$(VERSION)" ]; \ 25 - then /bin/echo -e "\#undef VERSION\n\#define VERSION \"$(VERSION)\""; \ 26 - fi; 27 +# - "if ... ; \", then "then" on the next line for no reason? 28 +# - using echo with non-standard parameter -e; that's printf(1)'s job! 29 +# echo should just be a simple output of args 30 +# - using "! -z" when there is "-n"... 31 +# - just set the fallback and drop the redundant test altogether! 32 +CHECK_VERSION = printf "\#undef VERSION\n\#define VERSION \"%s\"\n" \ 33 + "$(VERSION)" 34 35 +# Again with the nonstandard echo. 36 ifneq ($(and $(HAS_SWIG),$(HAS_PYTHON_CONFIG)),) 37 - CHECK_PYTHON_EXTENSION = /bin/echo -e "\#define HAVE_PYTHON_EXTENSION" 38 + CHECK_PYTHON_EXTENSION = printf "\#define HAVE_PYTHON_EXTENSION\n" 39 endif 40 41 CHECK_FEATURES = process_vm seccomp_filter