build: pass GLUON_VERSION and GLUON_SITE_VERSION to build
A helper script is introduced to get the version from `git describe`.
This commit is contained in:
parent
a6187cce70
commit
b5db6435e5
4
Makefile
4
Makefile
@ -52,6 +52,9 @@ $(eval $(call mkabspath,GLUON_PACKAGEDIR))
|
|||||||
$(eval $(call mkabspath,GLUON_TARGETSDIR))
|
$(eval $(call mkabspath,GLUON_TARGETSDIR))
|
||||||
$(eval $(call mkabspath,GLUON_PATCHESDIR))
|
$(eval $(call mkabspath,GLUON_PATCHESDIR))
|
||||||
|
|
||||||
|
GLUON_VERSION := $(shell scripts/getversion.sh '.')
|
||||||
|
GLUON_SITE_VERSION := $(shell scripts/getversion.sh '$(GLUON_SITEDIR)')
|
||||||
|
|
||||||
GLUON_MULTIDOMAIN ?= 0
|
GLUON_MULTIDOMAIN ?= 0
|
||||||
GLUON_AUTOREMOVE ?= 0
|
GLUON_AUTOREMOVE ?= 0
|
||||||
GLUON_DEBUG ?= 0
|
GLUON_DEBUG ?= 0
|
||||||
@ -64,6 +67,7 @@ src-link gluon_base ../../package
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
GLUON_VARS = \
|
GLUON_VARS = \
|
||||||
|
GLUON_VERSION GLUON_SITE_VERSION \
|
||||||
GLUON_RELEASE GLUON_REGION GLUON_MULTIDOMAIN GLUON_AUTOREMOVE GLUON_DEBUG GLUON_MINIFY GLUON_DEPRECATED \
|
GLUON_RELEASE GLUON_REGION GLUON_MULTIDOMAIN GLUON_AUTOREMOVE GLUON_DEBUG GLUON_MINIFY GLUON_DEPRECATED \
|
||||||
GLUON_DEVICES GLUON_TARGETSDIR GLUON_PATCHESDIR GLUON_TMPDIR GLUON_IMAGEDIR GLUON_PACKAGEDIR GLUON_DEBUGDIR \
|
GLUON_DEVICES GLUON_TARGETSDIR GLUON_PATCHESDIR GLUON_TMPDIR GLUON_IMAGEDIR GLUON_PACKAGEDIR GLUON_DEBUGDIR \
|
||||||
GLUON_SITEDIR GLUON_RELEASE GLUON_AUTOUPDATER_BRANCH GLUON_AUTOUPDATER_ENABLED GLUON_LANGS GLUON_BASE_FEEDS \
|
GLUON_SITEDIR GLUON_RELEASE GLUON_AUTOUPDATER_BRANCH GLUON_AUTOUPDATER_ENABLED GLUON_LANGS GLUON_BASE_FEEDS \
|
||||||
|
12
scripts/getversion.sh
Executable file
12
scripts/getversion.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo >&2 "Usage: getversion.sh <directory>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$1" || exit 1
|
||||||
|
|
||||||
|
git --git-dir=.git describe --always --abbrev=7 --dirty=+ 2>/dev/null && exit 0
|
||||||
|
|
||||||
|
echo unknown
|
@ -2,6 +2,8 @@ assert(env.GLUON_LANGS)
|
|||||||
|
|
||||||
|
|
||||||
config('GLUON_SITEDIR', env.GLUON_SITEDIR)
|
config('GLUON_SITEDIR', env.GLUON_SITEDIR)
|
||||||
|
config('GLUON_VERSION', env.GLUON_VERSION)
|
||||||
|
config('GLUON_SITE_VERSION', env.GLUON_SITE_VERSION)
|
||||||
config('GLUON_RELEASE', env.GLUON_RELEASE)
|
config('GLUON_RELEASE', env.GLUON_RELEASE)
|
||||||
|
|
||||||
try_config('GLUON_AUTOUPDATER_BRANCH', env.GLUON_AUTOUPDATER_BRANCH)
|
try_config('GLUON_AUTOUPDATER_BRANCH', env.GLUON_AUTOUPDATER_BRANCH)
|
||||||
|
Loading…
Reference in New Issue
Block a user