From 557562b6e6504b778ee5e1dc68a72bf63b95746a Mon Sep 17 00:00:00 2001 From: nulano Date: Sat, 2 Jan 2021 13:29:37 +0100 Subject: [PATCH 1/9] install harfbuzz --- config.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/config.sh b/config.sh index f7185fc17..5d964c6c7 100644 --- a/config.sh +++ b/config.sh @@ -5,6 +5,7 @@ ARCHIVE_SDIR=pillow-depends-master # Package versions for fresh source builds FREETYPE_VERSION=2.10.4 +HARFBUZZ_VERSION=2.7.4 LIBPNG_VERSION=1.6.37 ZLIB_VERSION=1.2.11 JPEG_VERSION=9d @@ -17,6 +18,21 @@ LIBWEBP_VERSION=1.1.0 BZIP2_VERSION=1.0.8 LIBXCB_VERSION=1.14 +# workaround for multibuild bug with .tar.xz +function untar { + local in_fname=$1 + if [ -z "$in_fname" ];then echo "in_fname not defined"; exit 1; fi + local extension=${in_fname##*.} + case $extension in + tar) tar -xf $in_fname ;; + gz|tgz) tar -zxf $in_fname ;; + bz2) tar -jxf $in_fname ;; + zip) unzip -qq $in_fname ;; + xz) unxz -c $in_fname | tar -xf - ;; + *) echo Did not recognize extension $extension; exit 1 ;; + esac +} + function pre_build { # Any stuff that you need to do before you start building the wheels # Runs in the root directory of this repository. @@ -69,6 +85,8 @@ function pre_build { build_freetype fi + build_simple harfbuzz $HARFBUZZ_VERSION https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION tar.xz --with-freetype=yes --with-glib=no + # Append licenses for filename in dependency_licenses/*; do echo -e "\n\n----\n\n$(basename $filename | cut -f 1 -d '.')\n" | cat >> Pillow/LICENSE From 283913826a7289f534ecf6a8a9392cba963697a7 Mon Sep 17 00:00:00 2001 From: nulano Date: Sat, 2 Jan 2021 15:12:41 +0100 Subject: [PATCH 2/9] add wheel build options to vendor raqm, fribidi shim --- config.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config.sh b/config.sh index 5d964c6c7..2ae0df059 100644 --- a/config.sh +++ b/config.sh @@ -94,6 +94,14 @@ function pre_build { done } +function pip_wheel_cmd { + local abs_wheelhouse=$1 + pip wheel $(pip_opts) \ + --global-option build_ext --global-option --enable-raqm \ + --global-option --vendor-raqm --global-option --vendor-fribidi \ + -w $abs_wheelhouse --no-deps . +} + function run_tests_in_repo { # Run Pillow tests from within source repo python3 selftest.py From 5fa0403b3bb680746a0fe46d32fb52cf6f62c3f9 Mon Sep 17 00:00:00 2001 From: nulano Date: Sat, 2 Jan 2021 16:34:21 +0100 Subject: [PATCH 3/9] manually config freetype --- config.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config.sh b/config.sh index 2ae0df059..dcd3dfc75 100644 --- a/config.sh +++ b/config.sh @@ -85,7 +85,15 @@ function pre_build { build_freetype fi + if [ -z "$IS_OSX" ]; then + export FREETYPE_LIBS=-lfreetype + export FREETYPE_CFLAGS=-I/usr/local/include/freetype2/ + fi build_simple harfbuzz $HARFBUZZ_VERSION https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION tar.xz --with-freetype=yes --with-glib=no + if [ -z "$IS_OSX" ]; then + export FREETYPE_LIBS='' + export FREETYPE_CFLAGS='' + fi # Append licenses for filename in dependency_licenses/*; do From 1794fcad90caf7f449a5aca8fbf717e3aa010444 Mon Sep 17 00:00:00 2001 From: nulano Date: Sat, 2 Jan 2021 16:56:48 +0100 Subject: [PATCH 4/9] compile in c99 mode due to raqm --- config.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config.sh b/config.sh index dcd3dfc75..b0ce57bd1 100644 --- a/config.sh +++ b/config.sh @@ -104,6 +104,9 @@ function pre_build { function pip_wheel_cmd { local abs_wheelhouse=$1 + if [ -z "$IS_OSX" ]; then + CFLAGS="$CFLAGS --std=c99" # for Raqm + fi pip wheel $(pip_opts) \ --global-option build_ext --global-option --enable-raqm \ --global-option --vendor-raqm --global-option --vendor-fribidi \ From 303bf0bc5c34242b56ded0d8e940165e9891f8c1 Mon Sep 17 00:00:00 2001 From: nulano Date: Sat, 2 Jan 2021 17:11:37 +0100 Subject: [PATCH 5/9] expected features with dynamic raqm/fribidi --- config.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config.sh b/config.sh index b0ce57bd1..745fb4ea6 100644 --- a/config.sh +++ b/config.sh @@ -121,7 +121,12 @@ function run_tests_in_repo { EXP_CODECS="jpg jpg_2000 libtiff zlib" EXP_MODULES="freetype2 littlecms2 pil tkinter webp" -EXP_FEATURES="transp_webp webp_anim webp_mux xcb" +if [ -z "$IS_OSX" ] && [[ "$MB_PYTHON_VERSION" != pypy3* ]]; then + EXP_FEATURES="fribidi harfbuzz raqm transp_webp webp_anim webp_mux xcb" +else + # can't find FriBiDi + EXP_FEATURES="transp_webp webp_anim webp_mux xcb" +fi function run_tests { if [ -n "$IS_OSX" ]; then From 357c884eb4b841e57dc1bac4e30da85134980d83 Mon Sep 17 00:00:00 2001 From: nulano Date: Sat, 2 Jan 2021 19:06:08 +0100 Subject: [PATCH 6/9] add raqm license --- dependency_licenses/RAQM.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 dependency_licenses/RAQM.txt diff --git a/dependency_licenses/RAQM.txt b/dependency_licenses/RAQM.txt new file mode 100644 index 000000000..196511ef6 --- /dev/null +++ b/dependency_licenses/RAQM.txt @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright © 2015 Information Technology Authority (ITA) +Copyright © 2016 Khaled Hosny + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From a41f5578ad738022958ae93c670f2720c6c38d44 Mon Sep 17 00:00:00 2001 From: nulano Date: Thu, 25 Mar 2021 02:13:17 +0100 Subject: [PATCH 7/9] add HarfBuzz license --- dependency_licenses/HARFBUZZ.txt | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 dependency_licenses/HARFBUZZ.txt diff --git a/dependency_licenses/HARFBUZZ.txt b/dependency_licenses/HARFBUZZ.txt new file mode 100644 index 000000000..57343164f --- /dev/null +++ b/dependency_licenses/HARFBUZZ.txt @@ -0,0 +1,38 @@ +HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. +For parts of HarfBuzz that are licensed under different licenses see individual +files names COPYING in subdirectories where applicable. + +Copyright © 2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020 Google, Inc. +Copyright © 2018,2019,2020 Ebrahim Byagowi +Copyright © 2019,2020 Facebook, Inc. +Copyright © 2012 Mozilla Foundation +Copyright © 2011 Codethink Limited +Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) +Copyright © 2009 Keith Stribley +Copyright © 2009 Martin Hosken and SIL International +Copyright © 2007 Chris Wilson +Copyright © 2006 Behdad Esfahbod +Copyright © 2005 David Turner +Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc. +Copyright © 1998-2004 David Turner and Werner Lemberg + +For full copyright notices consult the individual files in the package. + + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. From 5f04e4a6df5807e65c072b7a68bec85cf4dc5c9a Mon Sep 17 00:00:00 2001 From: nulano Date: Thu, 25 Mar 2021 02:14:51 +0100 Subject: [PATCH 8/9] replace IS_OSX with IS_MACOS --- config.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.sh b/config.sh index 41539da80..020647b0d 100644 --- a/config.sh +++ b/config.sh @@ -89,12 +89,12 @@ function pre_build { build_freetype fi - if [ -z "$IS_OSX" ]; then + if [ -z "$IS_MACOS" ]; then export FREETYPE_LIBS=-lfreetype export FREETYPE_CFLAGS=-I/usr/local/include/freetype2/ fi build_simple harfbuzz $HARFBUZZ_VERSION https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION tar.xz --with-freetype=yes --with-glib=no - if [ -z "$IS_OSX" ]; then + if [ -z "$IS_MACOS" ]; then export FREETYPE_LIBS='' export FREETYPE_CFLAGS='' fi @@ -108,7 +108,7 @@ function pre_build { function pip_wheel_cmd { local abs_wheelhouse=$1 - if [ -z "$IS_OSX" ]; then + if [ -z "$IS_MACOS" ]; then CFLAGS="$CFLAGS --std=c99" # for Raqm fi pip wheel $(pip_opts) \ @@ -129,7 +129,7 @@ if [[ $MACOSX_DEPLOYMENT_TARGET != "11.0" ]]; then fi EXP_CODECS="$EXP_CODECS libtiff zlib" EXP_MODULES="freetype2 littlecms2 pil tkinter webp" -if [ -z "$IS_OSX" ] && [[ "$MB_PYTHON_VERSION" != pypy3* ]]; then +if [ -z "$IS_MACOS" ] && [[ "$MB_PYTHON_VERSION" != pypy3* ]]; then EXP_FEATURES="fribidi harfbuzz raqm transp_webp webp_anim webp_mux" else # can't find FriBiDi From f2afbdac0273a5376aca7d95b339bd4f2cf72826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondrej=20Baranovi=C4=8D?= Date: Wed, 31 Mar 2021 10:51:19 +0200 Subject: [PATCH 9/9] update HarfBuzz to 2.8.0 Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.sh b/config.sh index 020647b0d..3994c1689 100644 --- a/config.sh +++ b/config.sh @@ -5,7 +5,7 @@ ARCHIVE_SDIR=pillow-depends-master # Package versions for fresh source builds FREETYPE_VERSION=2.10.4 -HARFBUZZ_VERSION=2.7.4 +HARFBUZZ_VERSION=2.8.0 LIBPNG_VERSION=1.6.37 ZLIB_VERSION=1.2.11 JPEG_VERSION=9d