void-packages/srcpkgs/libhugetlbfs/patches/0001-Makefile-Fix-version-discovery.patch
2020-06-04 21:36:25 +02:00

43 lines
1.1 KiB
Diff

From: Punit Agrawal <punitagrawal@gmail.com>
Date: Sun, 3 Mar 2019 09:16:24 +0900
Subject: Makefile: Fix version discovery
Upstream uses git based discovery to generate versioning information
for release tar balls. The invocation of the version generation script
(localversion) doesn't work with packaging that lives in git
repositories.
Fix this by moving the relevant bits of versioning to the Makefile.
---
Makefile | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 51e41f0..9b8c4ea 100644
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,8 @@ SOURCE = $(shell find . -maxdepth 1 ! -name version.h -a -name '*.[h]')
SOURCE += *.c *.lds Makefile
NODEPTARGETS=<version.h> <clean>
+REL_VERSION=2.22
+
INSTALL = install
LDFLAGS += -ldl
@@ -266,11 +268,11 @@ $(OBJDIRS): %:
@mkdir -p $@
# <Version handling>
-$(VERSION): always
+$(VERSION): FORCE
@$(VECHO) VERSION
- ./localversion version $(SOURCE)
-always:
-# </Version handling>
+ printf "// %s\n" "${REL_VERSION}" > $@
+ printf "#define VERSION \"%s\"\n" "${REL_VERSION}" >> $@
+FORCE:
snapshot: $(VERSION)