-
Notifications
You must be signed in to change notification settings - Fork 291
/
build-source.sh
executable file
·40 lines (35 loc) · 1.05 KB
/
build-source.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
VERSION=$(git describe --tags --dirty)
NAME=MangoHud-${VERSION}
TAR_NAME=${NAME}-Source.tar.xz
DFSG_TAR_NAME=${NAME}-Source-DFSG.tar.xz
# remove existing files
rm -rf sourcedir
rm -rf ${NAME}
rm -f ${TAR_NAME}
rm -f ${DFSG_TAR_NAME}
# create tarball with meson
meson setup sourcedir
meson dist --formats=xztar --include-subprojects --no-tests -C sourcedir
mv sourcedir/meson-dist/*.tar.xz ${TAR_NAME}
# create DFSG compliant version
# unpack since tarball is compressed
mkdir ${NAME}
tar -xf ${TAR_NAME} --strip 1 -C ${NAME}
# nvml.h is not DFSG compliant
rm ${NAME}/include/nvml.h
# minhook not needed
rm -r ${NAME}/modules/minhook
# spdlog from system
rm -r ${NAME}/subprojects/spdlog-*
# nlohmann_json from system
rm -r ${NAME}/subprojects/nlohmann_json-*
# remove some vulkan clutter
rm -r ${NAME}/subprojects/Vulkan-Headers-*/cmake ${NAME}/subprojects/Vulkan-Headers-*/BUILD.gn
# remove some dear imgui clutter
rm -rf ${NAME}/subprojects/imgui-*/examples
# compress new sources
tar -cJf ${DFSG_TAR_NAME} ${NAME}
# cleanup
rm -r sourcedir
rm -r ${NAME}