use git archive to build source tarballs

Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
pull/219/head
Stephan Lachnit 4 years ago committed by jackun
parent d956f60f86
commit aa4cb1a4a0

@ -1,10 +1,17 @@
#!/bin/sh
VERSION=$(git describe --tags --dirty=+)
VERSION=$(git describe --tags --dirty)
NAME=MangoHud-$VERSION-Source
FILE_PATTERN="--exclude-vcs --exclude-vcs-ignores ."
# default version
tar -czf MangoHud-$VERSION-Source.tar.gz $FILE_PATTERN
# DFSG compliant version, excludes NVML
tar -czf MangoHud-$VERSION-Source-DFSG.tar.gz --exclude=include/nvml.h $FILE_PATTERN
# ensure that submodules are present
git submodule update --init
# get everything except submodules
git archive HEAD --format=tar --prefix=${NAME}/ --output=${NAME}.tar
# add imgui submodule
tar -rf ${NAME}.tar --exclude-vcs --transform="s,^modules/ImGui/src,${NAME}/modules/ImGui/src," modules/ImGui/src
# create DFSG compliant version which excludes NVML
cp ${NAME}.tar ${NAME}-DFSG.tar
tar -f ${NAME}-DFSG.tar --delete ${NAME}/include/nvml.h
# compress archives
gzip ${NAME}.tar
gzip ${NAME}-DFSG.tar

Loading…
Cancel
Save