summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Glidic <sardemff7+git@sardemff7.net>2017-05-04 22:26:03 +0200
committerQuentin Glidic <sardemff7+git@sardemff7.net>2017-05-04 22:26:03 +0200
commit2140c9dffbd601eac2574473c741b8b9834e3887 (patch)
tree1aa6f57d3961c996071fc814fd09e27b109a4ee1
parent27cc1a821a95ca64004cd9a8b37d4a86af22db02 (diff)
meson: Add dist target
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
-rw-r--r--Makefile.am5
-rw-r--r--meson.build2
-rwxr-xr-xscript/dist.sh21
3 files changed, 28 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 5a112cef..263e0490 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -587,3 +587,8 @@ coverage-clean:
.PHONY: .FORCE
.FORCE:
+
+EXTRA_DIST += \
+ doc/meson.build \
+ subprojects/libgwater/xcb/meson.build \
+ meson.build
diff --git a/meson.build b/meson.build
index 5016c9db..a5d33374 100644
--- a/meson.build
+++ b/meson.build
@@ -439,3 +439,5 @@ if ohcount.found()
],
)
endif
+
+run_target('dist', command: [ 'script/dist.sh' ])
diff --git a/script/dist.sh b/script/dist.sh
new file mode 100755
index 00000000..04f7dc3f
--- /dev/null
+++ b/script/dist.sh
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+NAME=`mesonintrospect ${MESON_BUILD_ROOT} --projectinfo | tr ',[' '\n\n' | sed -n 1,/subprojects/p | grep name | cut -d'"' -f4`
+VERSION=`mesonintrospect ${MESON_BUILD_ROOT} --projectinfo | tr ',[' '\n\n' | sed -n 1,/subprojects/p | grep version | cut -d'"' -f4`
+PREFIX=${NAME}-${VERSION}
+TAR=${MESON_BUILD_ROOT}/${PREFIX}.tar
+
+rm -f ${TAR} ${TAR}.xz
+git archive --prefix=${PREFIX}/ --format=tar HEAD > ${TAR}
+(
+ git submodule | \
+ while read commit path ref; do
+ (
+ cd ${path}
+ git archive --prefix=${PREFIX}/${path}/ --format=tar ${commit} > tmp.tar
+ tar -Af ${TAR} tmp.tar
+ rm -f tmp.tar
+ )
+ done
+)
+xz ${TAR}