Package: src:mozc
Tags: patch

mozc's d/rules file now hard codes jobs=1, which makes the build slow
on architectures that come with many cores but not powerful enough per
core (arm, mips, etc). This patch adds the check of Debian's standard
environmental variable DEB_BUILD_OPTIONS for the numbers of concurrent
jobs to be used.

Regards,
Aron
From c53ba7d1a5865baf313a17bbd8460c3c8c9d27ba Mon Sep 17 00:00:00 2001
From: Aron Xu <a...@debian.org>
Date: Sun, 16 Aug 2015 19:52:16 +0800
Subject: [PATCH] Allow parallel building

---
 debian/rules | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/debian/rules b/debian/rules
index 719915e..19e75c7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,6 +9,11 @@ LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed
 
 DEB_BUILD_MULTIARCH :=$(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
 
+NUMJOBS=1
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+endif
+
 # clear XDG_CONFIG_DIRS for qtchooser
 unexport XDG_CONFIG_DIRS
 
@@ -28,7 +33,7 @@ CHANGELOG_VARS := $(shell dpkg-parsechangelog | \
 SOURCE_VERSION := $(call vafilt,$(CHANGELOG_VARS),Version)
 
 %:
-	dh $@ 
+	dh $@ --parallel
 
 override_dh_auto_configure:
 	GYP_DEFINES="use_libprotobuf=1" python build_mozc.py gyp \
@@ -36,7 +41,7 @@ override_dh_auto_configure:
 		--build_base=$(BUILD_DIR)
 
 override_dh_auto_build:
-	V=1 python build_mozc.py build $(TARGETS) -c Release --jobs=1
+	V=1 python build_mozc.py build $(TARGETS) -c Release --jobs=$(NUMJOBS)
 
 override_dh_auto_clean:
 	python build_mozc.py clean
-- 
2.1.4

Reply via email to