Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Freetype and Harfbuzz
@ 2022-08-11 13:33 sgn
  0 siblings, 0 replies; only message in thread
From: sgn @ 2022-08-11 13:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

There is a new pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages freetype-harfbuzz
https://github.com/void-linux/void-packages/pull/38608

Freetype and Harfbuzz
xbps can't resolve circular dependency, yet. So, I can't add cairo into the loop.

A patch file from https://github.com/void-linux/void-packages/pull/38608.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-freetype-harfbuzz-38608.patch --]
[-- Type: text/x-diff, Size: 10357 bytes --]

From 551fce04bee74ef59d8b8c0548b46d3194fb49bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 11 Aug 2022 15:40:29 +0700
Subject: [PATCH 1/4] New package: freetype-bootstrap-2.12.1

---
 .../patches/enable-subpixel-rendering.patch   | 11 ++++++++
 srcpkgs/freetype-bootstrap/template           | 28 +++++++++++++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 srcpkgs/freetype-bootstrap/patches/enable-subpixel-rendering.patch
 create mode 100644 srcpkgs/freetype-bootstrap/template

diff --git a/srcpkgs/freetype-bootstrap/patches/enable-subpixel-rendering.patch b/srcpkgs/freetype-bootstrap/patches/enable-subpixel-rendering.patch
new file mode 100644
index 000000000000..4d516983ff1c
--- /dev/null
+++ b/srcpkgs/freetype-bootstrap/patches/enable-subpixel-rendering.patch
@@ -0,0 +1,11 @@
+--- a/include/freetype/config/ftoption.h
++++ b/include/freetype/config/ftoption.h
+@@ -126,7 +126,7 @@
+    * macro is not defined, FreeType offers alternative LCD rendering
+    * technology that produces excellent output without LCD filtering.
+    */
+-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
++#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+
+
+   /**************************************************************************
diff --git a/srcpkgs/freetype-bootstrap/template b/srcpkgs/freetype-bootstrap/template
new file mode 100644
index 000000000000..b9fe8de1772b
--- /dev/null
+++ b/srcpkgs/freetype-bootstrap/template
@@ -0,0 +1,28 @@
+# Template file for 'freetype-bootstrap'
+pkgname=freetype-bootstrap
+version=2.12.1
+revision=1
+wrksrc="freetype-${version}"
+build_style=gnu-configure
+configure_args="--enable-freetype-config --without-harfbuzz"
+hostmakedepends="pkg-config"
+makedepends="bzip2-devel libpng-devel brotli-devel"
+depends="$makedepends"
+short_desc="Font rendering engine and library API - for bootstrapping"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="GPL-2.0-or-later, FTL"
+homepage="https://www.freetype.org/"
+distfiles="${NONGNU_SITE}/freetype/freetype-${version}.tar.xz"
+checksum=4766f20157cc4cf0cd292f80bf917f92d1c439b243ac3018debf6b9140c41a7f
+provides="freetype-${version}_999
+ libfreetype-devel-${version}_999"
+conflicts="freetype>=0 libfreetype-devel>=0"
+
+post_patch() {
+	vsed -i -e "s/%PKG_CONFIG%/pkg-config/" builds/unix/freetype-config.in
+}
+
+post_install() {
+	vlicense LICENSE.TXT
+	vlicense docs/FTL.TXT
+}

From 3aa970ee5476fd64cb80cbaf8729b2f82d33da01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 11 Aug 2022 15:40:36 +0700
Subject: [PATCH 2/4] New package: harfbuzz-bootstrap-5.1.0

---
 .../patches/fix-char-signed.patch             | 29 +++++++++++++++++++
 srcpkgs/harfbuzz-bootstrap/template           | 25 ++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 srcpkgs/harfbuzz-bootstrap/patches/fix-char-signed.patch
 create mode 100644 srcpkgs/harfbuzz-bootstrap/template

diff --git a/srcpkgs/harfbuzz-bootstrap/patches/fix-char-signed.patch b/srcpkgs/harfbuzz-bootstrap/patches/fix-char-signed.patch
new file mode 100644
index 000000000000..affcbc57dc55
--- /dev/null
+++ b/srcpkgs/harfbuzz-bootstrap/patches/fix-char-signed.patch
@@ -0,0 +1,29 @@
+Patch-Source: https://github.com/harfbuzz/harfbuzz/pull/3771
+From 81fe35159e4fdc5ca2c9436cc9ad2750bda64203 Mon Sep 17 00:00:00 2001
+From: psykose <alice@ayaya.dev>
+Date: Mon, 1 Aug 2022 07:45:25 +0000
+Subject: [PATCH] [repacker] fix signedness of char in tests
+
+---
+ src/test-repacker.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/test-repacker.cc b/src/test-repacker.cc
+index 053c0c603..1b7e1f08b 100644
+--- a/src/test-repacker.cc
++++ b/src/test-repacker.cc
+@@ -112,9 +112,9 @@ static void start_lookup (int8_t type,
+                           hb_serialize_context_t* c)
+ {
+   char lookup[] = {
+-    0, type, // type
++    0, (char)type, // type
+     0, 0, // flag
+-    0, num_subtables, // num subtables
++    0, (char)num_subtables, // num subtables
+   };
+ 
+   start_object (lookup, 6, c);
+-- 
+2.37.1
+
diff --git a/srcpkgs/harfbuzz-bootstrap/template b/srcpkgs/harfbuzz-bootstrap/template
new file mode 100644
index 000000000000..61e1881ab615
--- /dev/null
+++ b/srcpkgs/harfbuzz-bootstrap/template
@@ -0,0 +1,25 @@
+# Template file for 'harfbuzz-bootstrap'
+pkgname=harfbuzz-bootstrap
+version=5.1.0
+revision=1
+wrksrc="harfbuzz-${version}"
+build_style=meson
+configure_args="-Dfreetype=enabled"
+hostmakedepends="pkg-config"
+makedepends="freetype-bootstrap"
+# Don't set depends="freetype-bootstrap"
+short_desc="OpenType text shaping engine - Bootstrapping"
+maintainer="Duncaen <duncaen@voidlinux.org>"
+license="MIT"
+homepage="http://www.freedesktop.org/wiki/Software/HarfBuzz/"
+changelog="https://github.com/harfbuzz/harfbuzz/raw/main/NEWS"
+distfiles="https://github.com/harfbuzz/harfbuzz/releases/download/${version}/harfbuzz-${version}.tar.xz"
+checksum=2edb95db668781aaa8d60959d21be2ff80085f31b12053cdd660d9a50ce84f05
+provides="harfbuzz-${version}_999
+ libharfbuzz-${version}_999
+ harfbuzz-devel-${version}_999"
+conflicts="harfbuzz>=0 libharfbuzz>=0 harfbuzz-devel>=0"
+
+post_install() {
+	vlicense COPYING LICENSE
+}

From 88ccdc99ead6c765e44fedc3f2185e8f866e6921 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 11 Aug 2022 15:40:56 +0700
Subject: [PATCH 3/4] freetype: build with harfbuzz

---
 srcpkgs/freetype-devel/template               | 13 +++++++++++
 srcpkgs/freetype/template                     | 23 ++++++++++++++-----
 srcpkgs/{freetype-devel => libfreetype-devel} |  0
 3 files changed, 30 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/freetype-devel/template
 rename srcpkgs/{freetype-devel => libfreetype-devel} (100%)

diff --git a/srcpkgs/freetype-devel/template b/srcpkgs/freetype-devel/template
new file mode 100644
index 000000000000..9966f522abc9
--- /dev/null
+++ b/srcpkgs/freetype-devel/template
@@ -0,0 +1,13 @@
+# Template file for 'freetype-devel'
+# Sync with freetype
+# Split because freetype-devel depends on harfbuzz.pc,
+# which in turn depends on freetype2.pc
+pkgname=freetype-devel
+version=2.12.1
+revision=3
+build_style=meta
+depends="libfreetype-devel>=${sourcepkg}_${version} harfbuzz-devel"
+short_desc="Font rendering engine and library API - development files"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="GPL-2.0-or-later"
+homepage="https://www.freetype.org/"
diff --git a/srcpkgs/freetype/template b/srcpkgs/freetype/template
index 72549c71bd7e..035e06aa6246 100644
--- a/srcpkgs/freetype/template
+++ b/srcpkgs/freetype/template
@@ -1,17 +1,27 @@
 # Template file for 'freetype'
+# Sync with freetype-devel
+# Split because:
+# - harfbuzz.pc needs freetype2.pc,
+# - freetype2.pc needs harfbuzz.pc
+# Let's make:
+# - harfbuzz-devel depends on libfreetype-devel
+# - freetype-devel depends on harfbuzz-devel and libfreetype-devel
 pkgname=freetype
 version=2.12.1
-revision=2
+revision=3
 build_style=gnu-configure
-configure_args="--enable-freetype-config"
+configure_args="--enable-freetype-config --with-harfbuzz"
 hostmakedepends="pkg-config"
-makedepends="bzip2-devel libpng-devel brotli-devel"
+# Keep those 2 bootstrap packages as first makedepends
+makedepends="freetype-bootstrap harfbuzz-bootstrap
+ bzip2-devel libpng-devel brotli-devel"
 short_desc="Font rendering engine and library API"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, FTL"
 homepage="https://www.freetype.org/"
 distfiles="${NONGNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
 checksum=4766f20157cc4cf0cd292f80bf917f92d1c439b243ac3018debf6b9140c41a7f
+conflicts="freetype-bootstrap>=0"
 
 post_patch() {
 	vsed -i -e "s/%PKG_CONFIG%/pkg-config/" builds/unix/freetype-config.in
@@ -22,9 +32,10 @@ post_install() {
 	vlicense docs/FTL.TXT
 }
 
-freetype-devel_package() {
-	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
-	short_desc+=" - development files"
+libfreetype-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}
+	 bzip2-devel libpng-devel brotli-devel"
+	short_desc=" - development files - see freetype-devel"
 	pkg_install() {
 		vmove usr/bin/freetype-config
 		vmove usr/share/man/man1/freetype-config.1
diff --git a/srcpkgs/freetype-devel b/srcpkgs/libfreetype-devel
similarity index 100%
rename from srcpkgs/freetype-devel
rename to srcpkgs/libfreetype-devel

From d66982761f1a8c75acf63f0ff8d32738bcf04eb5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 11 Aug 2022 15:42:26 +0700
Subject: [PATCH 4/4] harfbuzz: solve the cycle between freetype and harfbuzz

---
 srcpkgs/harfbuzz/template | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/harfbuzz/template b/srcpkgs/harfbuzz/template
index 2fc515698f92..301621567403 100644
--- a/srcpkgs/harfbuzz/template
+++ b/srcpkgs/harfbuzz/template
@@ -1,13 +1,15 @@
 # Template file for 'harfbuzz'
 pkgname=harfbuzz
 version=5.1.0
-revision=2
+revision=3
 build_style=meson
 build_helper="gir qemu"
 configure_args="-Dglib=enabled -Dfreetype=enabled -Dcairo=enabled -Dicu=enabled
  -Dgraphite=enabled -Dintrospection=enabled"
 hostmakedepends="glib-devel pkg-config gtk-doc"
-makedepends="cairo-devel graphite-devel icu-devel libxml2"
+# Always keep harfbuzz-bootstrap as first makedepends
+makedepends="harfbuzz-bootstrap libfreetype-devel cairo-devel graphite-devel
+ icu-devel libxml2"
 short_desc="OpenType text shaping engine"
 maintainer="Duncaen <duncaen@voidlinux.org>"
 license="MIT"
@@ -18,6 +20,7 @@ checksum=2edb95db668781aaa8d60959d21be2ff80085f31b12053cdd660d9a50ce84f05
 
 libharfbuzz_package() {
 	short_desc+=" - runtime library"
+	conflicts="harfbuzz-bootstrap>=0"
 	pkg_install() {
 		vmove "usr/lib/*.so.*"
 		vmove usr/lib/girepository-1.0
@@ -26,7 +29,8 @@ libharfbuzz_package() {
 }
 
 harfbuzz-devel_package() {
-	depends="${makedepends} libharfbuzz>=${version}_${revision}"
+	depends="libharfbuzz>=${version}_${revision} libfreetype-devel
+	 cairo-devel graphite-devel icu-devel libxml2"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/include

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-11 13:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 13:33 [PR PATCH] Freetype and Harfbuzz sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).