From b9ddf201aa6484d6ff6b0a1f88a2b104dca29cf5 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Wed, 30 Nov 2022 08:12:23 -0700
Subject: [PATCH] Convert fontconfig to recipe.toml

---
 recipes/fontconfig/recipe.sh   | 37 ----------------------------------
 recipes/fontconfig/recipe.toml | 24 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 37 deletions(-)
 delete mode 100755 recipes/fontconfig/recipe.sh
 create mode 100755 recipes/fontconfig/recipe.toml

diff --git a/recipes/fontconfig/recipe.sh b/recipes/fontconfig/recipe.sh
deleted file mode 100755
index d3382aef8..000000000
--- a/recipes/fontconfig/recipe.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-VERSION="2.13.91"
-TAR="https://www.freedesktop.org/software/fontconfig/release/fontconfig-${VERSION}.tar.xz"
-BUILD_DEPENDS=(expat freetype libpng zlib)
-
-function recipe_version {
-	echo "$VERSION"
-	skip=1
-}
-
-function recipe_build {
-	wget -O config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false"
-	sysroot="$(realpath ../sysroot)"
-	export CFLAGS="-I$sysroot/include"
-	export LDFLAGS="-L$sysroot/lib --static"
-	./configure \
-	    --build=${BUILD} \
-	    --host=${HOST} \
-	    --prefix=/ \
-	    --disable-shared \
-	    --enable-static \
-	    --disable-docs \
-	    ac_cv_func_XML_SetDoctypeDeclHandler=yes
-	"$REDOX_MAKE" -j"$($NPROC)"
-    	skip=1
-}
-
-function recipe_clean {
-	"$REDOX_MAKE" clean
-	skip=1
-}
-
-function recipe_stage {
-	dest="$(realpath $1)"
-	"$REDOX_MAKE" DESTDIR="$dest" install
-	rm -f "$dest/lib/"*.la
-	skip=1
-}
diff --git a/recipes/fontconfig/recipe.toml b/recipes/fontconfig/recipe.toml
new file mode 100755
index 000000000..055e18f8c
--- /dev/null
+++ b/recipes/fontconfig/recipe.toml
@@ -0,0 +1,24 @@
+[source]
+tar = "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.91.tar.xz"
+patches = [
+	"redox.patch"
+]
+script = """
+wget -O config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false"
+"""
+
+[build]
+template = "custom"
+dependencies = [
+	"expat",
+	"freetype",
+	"libpng",
+	"zlib",
+]
+script = """
+COOKBOOK_CONFIGURE_FLAGS+=(
+    --disable-docs \
+    ac_cv_func_XML_SetDoctypeDeclHandler=yes
+)
+cookbook_configure
+"""
-- 
GitLab