Skip to content
Snippets Groups Projects
Commit 9f49209b authored by Albert Gräf's avatar Albert Gräf
Browse files

debuild fixes

parent 56b46be1
No related branches found
No related tags found
No related merge requests found
......@@ -98,6 +98,10 @@ deb-us:
debsrc-us:
$(MAKE) deb DEBUILD_FLAGS="-S -us -uc"
# Determine the build version which needs git to be computed, so we can't do
# it in a stand-alone build from a tarball.
PD_BUILD_VERSION := $(shell git log -1 --format=%cd --date=short | sed -e 's/-//g')-rev.$(shell git rev-parse --short HEAD)
$(debsrc):
rm -rf $(debdist)
# Make sure that the submodules are initialized.
......@@ -106,6 +110,12 @@ $(debsrc):
git -C .. archive --format=tar.gz --prefix=$(debdist)/ HEAD | tar xfz -
# Grab the submodules.
for x in $(submodules); do (cd $(debdist) && rm -rf $$x && git -C ../../$$x archive --format=tar.gz --prefix=$$x/ HEAD | tar xfz -); done
# Pre-generate and put s_stuff.h into the tarball (see above; the build
# version is generated using git which can't be done outside the git repo).
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' ../pd/src/s_stuff.h.in > $(debdist)/pd/src/s_stuff.h
# Patch packages/Makefile so that we do *not* try to regenerate s_stuff.h
# during the build.
cd $(debdist) && patch -p1 < ../packages-Makefile.patch
# Create the source tarball.
tar cfz $(debsrc) $(debdist)
rm -rf $(debdist)
......
diff --git a/packages/Makefile b/packages/Makefile
index f5c1f8c0..0a285b52 100644
--- a/packages/Makefile
+++ b/packages/Makefile
@@ -373,12 +373,14 @@ doc_format:
# AG: The set_version target is broken since it modifies m_pd.h in-place
# during the build, which is a bad thing to do to files which are supposed to
# be kept in a source code repository. Instead, we create s_stuff.h from
-# s_stuff.h.in, where the latter is kept in the repo and the former gets created
-# from the latter by substituting PD_BUILD_VERSION.
+# s_stuff.h.in, where the latter is kept in the repo and the former gets
+# created from the latter by substituting PD_BUILD_VERSION. (Only try to do
+# this if we're actually in the git repo, otherwise we'll get an empty
+# revision number.)
git_version: $(pd_src)/src/s_stuff.h.in
- cd $(pd_src)/src/ && \
- sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' s_stuff.h.in > s_stuff.h
+ test -d $(cvs_root_dir)/.git && cd $(pd_src)/src/ && \
+ sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' s_stuff.h.in > s_stuff.h || true
set_version:
# change Pd's version number to reflect the extended build
@@ -421,7 +423,7 @@ distclean: cruft_clean
$(MAKE) -C $(abstractions_src) distclean
$(MAKE) -C $(extensions_src) distclean
$(MAKE) -C $(externals_src) distclean
- -$(MAKE) -C $(pd_src) distclean
+ -$(MAKE) -C $(pd_src) clean
test_locations:
@echo "PD_VERSION: $(PD_VERSION)"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment