From 361f65b860d069e97d5c47c1f1a8d10ac14cc28a Mon Sep 17 00:00:00 2001
From: Albert Graef <aggraef@gmail.com>
Date: Thu, 8 Mar 2018 23:57:41 +0100
Subject: [PATCH] Update debuild

---
 debuild/Makefile                |  4 ++--
 debuild/debian/rules            |  2 ++
 debuild/packages-Makefile.patch | 26 ++++++++------------------
 3 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/debuild/Makefile b/debuild/Makefile
index ff171f00c..9418578c3 100644
--- a/debuild/Makefile
+++ b/debuild/Makefile
@@ -90,13 +90,13 @@ deb: $(debsrc) $(addprefix debian/nwjs/, $(nwjs))
 	rm -rf $(debdist)
 
 debsrc:
-	$(MAKE) deb DEBUILD_FLAGS=-S
+	$(MAKE) deb DEBUILD_FLAGS="-S -d"
 
 deb-us:
 	$(MAKE) deb DEBUILD_FLAGS="-us -uc"
 
 debsrc-us:
-	$(MAKE) deb DEBUILD_FLAGS="-S -us -uc"
+	$(MAKE) deb DEBUILD_FLAGS="-S -d -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.
diff --git a/debuild/debian/rules b/debuild/debian/rules
index 6e2b910b6..139c20169 100755
--- a/debuild/debian/rules
+++ b/debuild/debian/rules
@@ -25,6 +25,8 @@ prefix = /opt/purr-data
 
 override_dh_auto_configure:
 
+override_dh_auto_clean:
+
 override_dh_auto_build:
 # Copy the nw.js sources to where purr-data wants them.
 	tar -xf debian/nwjs/$(nwjspkg)-$(arch).tar.gz && rm -rf pd/nw/nw && mv $(nwjspkg)-$(arch) pd/nw/nw
diff --git a/debuild/packages-Makefile.patch b/debuild/packages-Makefile.patch
index ad3e9ac7d..5d48867bc 100644
--- a/debuild/packages-Makefile.patch
+++ b/debuild/packages-Makefile.patch
@@ -1,27 +1,17 @@
 diff --git a/packages/Makefile b/packages/Makefile
-index f5c1f8c0..0a285b52 100644
+index a360dba7..b5b949b5 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.)
+@@ -377,7 +377,7 @@ doc_format:
+ # from the latter by substituting PD_BUILD_VERSION.
  
  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
+-	@cd $(pd_src)/src/ && \
++	@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.new && \
+ 	(test -f s_stuff.h && diff -q s_stuff.h s_stuff.h.new > /dev/null && rm -f s_stuff.h.new && echo s_stuff.h unchanged || (rm -f s_stuff.h && mv s_stuff.h.new s_stuff.h))
  
- set_version:
- # change Pd's version number to reflect the extended build
-@@ -421,7 +423,7 @@ distclean: cruft_clean
+@@ -422,7 +422,7 @@ distclean: cruft_clean
  	$(MAKE) -C $(abstractions_src) distclean
  	$(MAKE) -C $(extensions_src) distclean
  	$(MAKE) -C $(externals_src) distclean
-- 
GitLab