On Fri, 13 Oct 2017 at 09:23:42 -0400, Jeremy Bicha wrote:
> On Fri, Oct 13, 2017 at 3:54 AM, Simon McVittie <[email protected]> wrote:
> > mozjs52 has an embedded code copy of libicu.
> 
> Ubuntu developers would like to update gjs/mozjs in Ubuntu LTS
> releases. Because new versions of icu bump the soname and there are a
> lot of reverse depends, it looks like Ubuntu LTS won't be able to use
> the system icu library.
> 
> I mention this because it might make sense for Debian to also update
> gjs/mozjs in stable releases.

Worst-case, those stable updates could go back to using the bundled
icu when the system icu gets too old, like Firefox does? (I'm not sure
how likely it is for Debian to hop between branches of mozjs in stable
in practice.)

With #902197 fixed and #902961 worked around with the patches attached to
those bugs, the attached patch was enough to make mozjs52 use the system
ICU, if we ever want to do that. There are some unit test failures where
strings differ slightly between the bundled ICU and the system ICU,
which would need to be addressed or worked around, so this is really
only a proof-of-concept. I haven't tried it on a real system.

    smcv
>From 1746aa4a80c3b19645e1ee898383915b18fedcea Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Fri, 18 May 2018 10:11:52 +0100
Subject: [PATCH] Build-depend on libicu-dev (>= 58.1) and use system libicu

Leave the patches and workarounds in place, but gate them behind
a WITH_SYSTEM_ICU Make variable, to facilitate backporting
as mentioned on #878362.

Closes: #878362
---
 debian/changelog  |  7 +++++++
 debian/control    |  6 +++---
 debian/control.in |  2 +-
 debian/rules      | 16 +++++++++++++++-
 4 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 6b2680fb..aac90bc0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,13 @@ mozjs52 (52.3.1-8) UNRELEASED; urgency=medium
   * Add patch to add build support for ia64:
     - ia64-support.patch (Closes: #897178)
 
+  [ Simon McVittie ]
+  * Build-depend on libicu-dev (>= 58.1) and use system libicu
+    (Closes: #878362)
+    - Leave the patches and workarounds in place, but gate them behind
+      a WITH_SYSTEM_ICU Make variable, to facilitate backporting
+      as mentioned on #878362
+
  -- Jeremy Bicha <[email protected]>  Fri, 20 Oct 2017 19:51:21 -0400
 
 mozjs52 (52.3.1-7) unstable; urgency=medium
diff --git a/debian/control b/debian/control
index ffe6f3e3..0380f928 100644
--- a/debian/control
+++ b/debian/control
@@ -1,16 +1,16 @@
 # This file is autogenerated. DO NOT EDIT!
-# 
+#
 # Modifications should be made to debian/control.in instead.
 # This file is regenerated automatically in the clean target.
 Source: mozjs52
 Section: libs
 Priority: optional
 Maintainer: Debian GNOME Maintainers <[email protected]>
-Uploaders: Iain Lane <[email protected]>, Jeremy Bicha <[email protected]>
+Uploaders: Iain Lane <[email protected]>, Jeremy Bicha <[email protected]>, Tim Lunn <[email protected]>
 Build-Depends: debhelper (>= 10.3),
                gnome-pkg-tools,
                autoconf2.13,
-               libicu-dev,
+               libicu-dev (>= 58.1),
                libreadline-dev,
                zlib1g-dev (>= 1:1.2.3),
                pkg-config,
diff --git a/debian/control.in b/debian/control.in
index f109b519..cb6de987 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -6,7 +6,7 @@ Uploaders: @GNOME_TEAM@
 Build-Depends: debhelper (>= 10.3),
                gnome-pkg-tools,
                autoconf2.13,
-               libicu-dev,
+               libicu-dev (>= 58.1),
                libreadline-dev,
                zlib1g-dev (>= 1:1.2.3),
                pkg-config,
diff --git a/debian/rules b/debian/rules
index f5944443..0876a10a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -42,6 +42,17 @@ else
 CONFIGURE_FLAGS += --enable-pie
 endif
 
+# Switch to no if backporting
+WITH_SYSTEM_ICU = yes
+
+ifeq ($(WITH_SYSTEM_ICU),yes)
+
+CONFIGURE_FLAGS += --with-system-icu
+
+else # !WITH_SYSTEM_ICU
+
+CONFIGURE_FLAGS += --without-system-icu
+
 ifeq ($(DEB_HOST_ARCH_ENDIAN),little)
 ICU_DATA_FILE = icudt58l.dat
 else
@@ -49,6 +60,8 @@ ICU_DATA_FILE = icudt58b.dat
 endif
 export ICU_DATA_FILE
 
+endif #!WITH_SYSTEM_ICU
+
 %:
 	dh $@ --sourcedirectory=$(SRCDIR) --with gnome,pkgkde-symbolshelper --without autoreconf
 
@@ -68,15 +81,16 @@ override_dh_clean:
 # The bundled copy of icu prefers clang, which we need to override to
 # use gcc because clang doesn't support our DEB_CFLAGS_MAINT_APPEND
 override_dh_auto_configure:
+ifneq ($(WITH_SYSTEM_ICU),yes)
 	CC=$${CC:-$(DEB_HOST_GNU_TYPE)-gcc} \
 	CXX=$${CXX:-$(DEB_HOST_GNU_TYPE)-g++} \
 	VERBOSE=1 python intl/icu_sources_data.py "$(CURDIR)"
+endif
 	cd $(SRCDIR) && $(SHELL) configure \
 		--host=$(DEB_HOST_GNU_TYPE) \
 		--target=$(DEB_BUILD_GNU_TYPE) \
 		--prefix=/usr \
 		--libdir=/usr/lib/${DEB_HOST_MULTIARCH}/ \
-		--without-system-icu \
 		--enable-posix-nspr-emulation \
 		--with-system-zlib \
 		--enable-tests \
-- 
2.18.0

Reply via email to