From ff189fca9beb16e0547e43c52b6095da8363b5b1 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Tue, 25 Feb 2014 13:25:03 -0800 Subject: [PATCH 1/5] Build Fontconfig 2.11 in-tree on Linux After applying this patch, on Linux you will need to ../configure make clean-rust-azure clean-fontconfig clean-rust-fontconfig Fixes #1752. --- .gitmodules | 3 +++ README.md | 4 ++-- configure | 10 +++++++++- mk/sub.mk | 10 ++++++++++ src/platform/linux/fontconfig | 1 + src/platform/linux/rust-fontconfig | 2 +- src/support/azure/rust-azure | 2 +- 7 files changed, 27 insertions(+), 5 deletions(-) create mode 160000 src/platform/linux/fontconfig diff --git a/.gitmodules b/.gitmodules index 55b0809a06c..8c8d64585b4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -61,6 +61,9 @@ [submodule "src/platform/linux/rust-xlib"] path = src/platform/linux/rust-xlib url = https://github.com/mozilla-servo/rust-xlib.git +[submodule "src/platform/linux/fontconfig"] + path = src/platform/linux/fontconfig + url = https://github.com/mozilla-servo/fontconfig.git [submodule "src/support/skia/skia"] path = src/support/skia/skia url = https://github.com/mozilla-servo/skia.git diff --git a/README.md b/README.md index 6443b1a017d..b4f578da493 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ On Debian-based Linuxes: ``` sh sudo apt-get install autoconf2.13 curl freeglut3-dev libtool \ - libfreetype6-dev libfontconfig1-dev libgl1-mesa-dri libglib2.0-dev \ - xorg-dev msttcorefonts + libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \ + msttcorefonts gperf ``` On Debian-based Linuxes (cross-compilation for Android): diff --git a/configure b/configure index cf5d5e8bdd2..0011fbab8b8 100755 --- a/configure +++ b/configure @@ -524,6 +524,7 @@ if [ $CFG_OSTYPE = "unknown-linux-gnu" ] then CFG_SUBMODULES="\ platform/linux/rust-xlib \ + platform/linux/fontconfig \ support/glfw/glfw \ support/glfw/glfw-rs \ platform/linux/rust-fontconfig \ @@ -621,7 +622,7 @@ then cd ${CFG_BUILD_DIR} fi -#fontconfig expects to use an installed freetype, but we want to override that behavior to use our version +# fontconfig expects to use an installed freetype, but we want to use our version on Android if [ $CFG_OSTYPE = "linux-androideabi" ] then export FREETYPE_CFLAGS="-I${CFG_SRC_DIR}src/platform/android/libfreetype2/include -I${CFG_BUILD_DIR}src/platform/android/libfreetype2/include" @@ -681,6 +682,13 @@ do CONFIGURE_ARGS="${CONFIGURE_ARGS} --without-zlib" CONFIGURE_ARGS="${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS}" ;; + platform/linux/fontconfig) + CONFIGURE_SCRIPT="${CFG_SRC_DIR}src/${i}/autogen.sh" + CONFIGURE_ARGS="${CONFIGURE_ARGS} --sysconfdir=/etc" + CONFIGURE_ARGS="${CONFIGURE_ARGS} --localstatedir=/var" + CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-shared" # work around Rust #12557 + CONFIGURE_ARGS="${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS}" + ;; platform/android/fontconfig) CONFIGURE_SCRIPT="${CFG_SRC_DIR}src/${i}/autogen.sh" CONFIGURE_ARGS="${CONFIGURE_ARGS} --host=arm-linux-androideabi" diff --git a/mk/sub.mk b/mk/sub.mk index f2fc995a970..361dd465a15 100644 --- a/mk/sub.mk +++ b/mk/sub.mk @@ -156,6 +156,7 @@ ifeq ($(CFG_OSTYPE),unknown-linux-gnu) DEPS_rust-azure += \ rust-freetype \ rust-fontconfig \ + fontconfig \ rust-xlib \ rust \ $(NULL) @@ -167,6 +168,15 @@ DEPS_rust-layers += \ rust-xlib \ rust \ $(NULL) + +DEPS_rust-fontconfig += \ + fontconfig \ + rust \ + $(NULL) + +NATIVE_BUILD += \ + fontconfig \ + $(NULL) endif ifeq ($(CFG_OSTYPE),linux-androideabi) diff --git a/src/platform/linux/fontconfig b/src/platform/linux/fontconfig new file mode 160000 index 00000000000..b2cfb1f4b35 --- /dev/null +++ b/src/platform/linux/fontconfig @@ -0,0 +1 @@ +Subproject commit b2cfb1f4b3561e01a58359cd18929457a0486db7 diff --git a/src/platform/linux/rust-fontconfig b/src/platform/linux/rust-fontconfig index f3d71aa708e..34f83d9c614 160000 --- a/src/platform/linux/rust-fontconfig +++ b/src/platform/linux/rust-fontconfig @@ -1 +1 @@ -Subproject commit f3d71aa708eb44736c4fe526fbf1bb55010c623b +Subproject commit 34f83d9c614d5e1cc10bff4628450db3a4807902 diff --git a/src/support/azure/rust-azure b/src/support/azure/rust-azure index e632b98a30e..3dd39e85d32 160000 --- a/src/support/azure/rust-azure +++ b/src/support/azure/rust-azure @@ -1 +1 @@ -Subproject commit e632b98a30eb84c333852e0bc0a68b1b6a7faf02 +Subproject commit 3dd39e85d326a4704367166c106643e8780a8a34 From f01461475e44b0e2f072678f5436cba956858907 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Thu, 27 Feb 2014 18:23:40 -0800 Subject: [PATCH 2/5] Install expat-devel on Linux builders --- bld/linux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/linux.py b/bld/linux.py index 767f088a6dc..167156e1999 100644 --- a/bld/linux.py +++ b/bld/linux.py @@ -1,7 +1,7 @@ config = { 'mock_target': 'mozilla-centos6-x86_64', 'mock_packages': ['freetype-devel', 'fontconfig-devel', 'glib2-devel', 'autoconf213', 'git', 'make', 'libX11-devel', 'mesa-libGL-devel', 'freeglut-devel', - 'xorg-x11-server-devel', 'libXrandr-devel', 'libXi-devel', 'libpng-devel'], + 'xorg-x11-server-devel', 'libXrandr-devel', 'libXi-devel', 'libpng-devel', 'expat-devel'], 'mock_files': [('/home/servobld/.ssh', '/home/mock_mozilla/.ssh')], 'concurrency': 6, 'add_actions': ['setup-mock'], From 37bcc2ffcdf17108d381842ff4b2427a52bbae52 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Fri, 28 Feb 2014 10:51:00 -0800 Subject: [PATCH 3/5] Install gperf on Linux builders --- bld/linux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/linux.py b/bld/linux.py index 167156e1999..8bf6e2afb4a 100644 --- a/bld/linux.py +++ b/bld/linux.py @@ -1,7 +1,7 @@ config = { 'mock_target': 'mozilla-centos6-x86_64', 'mock_packages': ['freetype-devel', 'fontconfig-devel', 'glib2-devel', 'autoconf213', 'git', 'make', 'libX11-devel', 'mesa-libGL-devel', 'freeglut-devel', - 'xorg-x11-server-devel', 'libXrandr-devel', 'libXi-devel', 'libpng-devel', 'expat-devel'], + 'xorg-x11-server-devel', 'libXrandr-devel', 'libXi-devel', 'libpng-devel', 'expat-devel', 'gperf'], 'mock_files': [('/home/servobld/.ssh', '/home/mock_mozilla/.ssh')], 'concurrency': 6, 'add_actions': ['setup-mock'], From 5a6675a2963f36c758529c3560fe5b168ca5115c Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Fri, 28 Feb 2014 13:09:43 -0800 Subject: [PATCH 4/5] Work around missing expat.pc on some RedHat-based systems --- configure | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure b/configure index 0011fbab8b8..5a72c10a13d 100755 --- a/configure +++ b/configure @@ -687,6 +687,11 @@ do CONFIGURE_ARGS="${CONFIGURE_ARGS} --sysconfdir=/etc" CONFIGURE_ARGS="${CONFIGURE_ARGS} --localstatedir=/var" CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-shared" # work around Rust #12557 + if [ -f /etc/redhat-release ]; then + # Some RedHat-based distros (including our CentOS 6 build machines) are missing + # pkg-config files for expat: https://bugzilla.redhat.com/show_bug.cgi?id=833338 + CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-expat=/usr" + fi CONFIGURE_ARGS="${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS}" ;; platform/android/fontconfig) From 44a3f6c58071fe3cd9e483301b44c370c7079164 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Fri, 28 Feb 2014 16:12:02 -0800 Subject: [PATCH 5/5] Fix link order for azure-test --- src/support/azure/rust-azure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/support/azure/rust-azure b/src/support/azure/rust-azure index 3dd39e85d32..cfe2d2a6894 160000 --- a/src/support/azure/rust-azure +++ b/src/support/azure/rust-azure @@ -1 +1 @@ -Subproject commit 3dd39e85d326a4704367166c106643e8780a8a34 +Subproject commit cfe2d2a6894e0ff2f7c8b10b11de275955cfdfc1