From 41318f906bb3d3621a818d3a41059096dae89605 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 30 Aug 2026 08:25:07 +0700 Subject: [PATCH] Partially port mupdf --- config/x86_64/ci.toml | 1 + recipes/wip/libs/media/jbig2dec/recipe.toml | 16 ++++++++++++++ recipes/wip/libs/media/jbig2dec/redox.patch | 12 +++++++++++ recipes/wip/libs/other/libbrotli/recipe.toml | 3 ++- recipes/wip/libs/other/libbrotli/redox.patch | 18 ++++++++++++++++ recipes/wip/libs/other/libgumbo/recipe.toml | 8 +++---- recipes/wip/libs/text/mupdf/recipe.toml | 22 +++++++++++++++----- 7 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 recipes/wip/libs/media/jbig2dec/recipe.toml create mode 100644 recipes/wip/libs/media/jbig2dec/redox.patch create mode 100644 recipes/wip/libs/other/libbrotli/redox.patch diff --git a/config/x86_64/ci.toml b/config/x86_64/ci.toml index e1503ddae..ecc9e024b 100644 --- a/config/x86_64/ci.toml +++ b/config/x86_64/ci.toml @@ -173,6 +173,7 @@ mesa-demos-x11 = {} mgba = {} miniserve = {} mpc = {} +mupdf = {} nano = {} nasm = {} ncdu = {} diff --git a/recipes/wip/libs/media/jbig2dec/recipe.toml b/recipes/wip/libs/media/jbig2dec/recipe.toml new file mode 100644 index 000000000..8b220362b --- /dev/null +++ b/recipes/wip/libs/media/jbig2dec/recipe.toml @@ -0,0 +1,16 @@ +#TODO compile and test +[source] +tar = "https://github.com/ArtifexSoftware/jbig2dec/releases/download/0.20/jbig2dec-0.20.tar.gz" +blake3 = "d03f5f958f4083e17d6d09d7da9a77b5dc9083b71f8c20167ce51a2fca14660c" +patches = [ + "redox.patch" +] +script = """ +GNU_CONFIG_GET config.sub +""" +[build] +template = "custom" +script = """ +DYNAMIC_INIT +cookbook_configure +""" diff --git a/recipes/wip/libs/media/jbig2dec/redox.patch b/recipes/wip/libs/media/jbig2dec/redox.patch new file mode 100644 index 000000000..939b83f97 --- /dev/null +++ b/recipes/wip/libs/media/jbig2dec/redox.patch @@ -0,0 +1,12 @@ +diff -ruwN source/configure source-new/configure +--- source/configure 2023-09-14 19:44:55.000000000 +0700 ++++ source-new/configure 2026-08-30 08:13:54.849157973 +0700 +@@ -11593,7 +11593,7 @@ + ;; + + # This must be glibc/ELF. +-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) ++linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu* | redox*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no diff --git a/recipes/wip/libs/other/libbrotli/recipe.toml b/recipes/wip/libs/other/libbrotli/recipe.toml index 0685a9221..9e15547ac 100644 --- a/recipes/wip/libs/other/libbrotli/recipe.toml +++ b/recipes/wip/libs/other/libbrotli/recipe.toml @@ -2,10 +2,11 @@ # build instructions: https://github.com/google/brotli#cmake [source] git = "https://github.com/google/brotli" +patches = [ "redox.patch" ] branch = "v1.2" shallow_clone = true [build] template = "cmake" cmakeflags = [ "-DBROTLI_DISABLE_TESTS=TRUE" -] \ No newline at end of file +] diff --git a/recipes/wip/libs/other/libbrotli/redox.patch b/recipes/wip/libs/other/libbrotli/redox.patch new file mode 100644 index 000000000..10209184c --- /dev/null +++ b/recipes/wip/libs/other/libbrotli/redox.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 22b21d2..b900d57 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,13 +17,6 @@ else() + message(STATUS "Build type is '${CMAKE_BUILD_TYPE}'") + endif() + +-include(CheckCSourceCompiles) +-check_c_source_compiles( +- "#if defined(__EMSCRIPTEN__) +- int main() {return 0;} +- #endif" +- BROTLI_EMSCRIPTEN +-) + if (BROTLI_EMSCRIPTEN) + message("-- Compiler is EMSCRIPTEN") + else() diff --git a/recipes/wip/libs/other/libgumbo/recipe.toml b/recipes/wip/libs/other/libgumbo/recipe.toml index 99b15c77c..fe1a3d4c8 100644 --- a/recipes/wip/libs/other/libgumbo/recipe.toml +++ b/recipes/wip/libs/other/libgumbo/recipe.toml @@ -1,8 +1,8 @@ #TODO compiled but not tested [source] tar = "https://codeberg.org/gumbo-parser/gumbo-parser/archive/0.13.2.tar.gz" -script = """ -autotools_recursive_regenerate -""" [build] -template = "configure" +template = "meson" +mesonflags = [ + "-Dtests=false" +] diff --git a/recipes/wip/libs/text/mupdf/recipe.toml b/recipes/wip/libs/text/mupdf/recipe.toml index 6dd267c5a..f8b2d83a0 100644 --- a/recipes/wip/libs/text/mupdf/recipe.toml +++ b/recipes/wip/libs/text/mupdf/recipe.toml @@ -1,11 +1,23 @@ -#TODO compile and test +#TODO compiled but not tested, need freeglut or x11 [source] -tar = "https://casper.mupdf.com/downloads/archive/mupdf-1.28.2-source.tar.gz" +tar = "https://casper.mupdf.com/downloads/archive/mupdf-1.28.3-source.tar.gz" +blake3 = "30376f12931f638c17785d69152b9e4eda44cf7bea2c883d67f90408e4f6a138" [build] template = "custom" +dependencies = [ + "harfbuzz", + "libjpeg", + "freetype2", + "libbrotli", + "openjpeg", + "jbig2dec", + "libgumbo", + # "freeglut", TODO: HAVE_GLUT=yes +] script = """ -rsync -av --delete "${COOKBOOK_SOURCE}/" ./ DYNAMIC_INIT -"${COOKBOOK_MAKE}" libs -j "${COOKBOOK_MAKE_JOBS}" -"${COOKBOOK_MAKE}" install-libs PREFIX="${COOKBOOK_STAGE}/usr" +cd $COOKBOOK_SOURCE +mkdir -p $COOKBOOK_BUILD/shared-release +"${COOKBOOK_MAKE}" install-libs install-apps shared=yes build=release USE_SYSTEM_LIBS=yes \ + -j "${COOKBOOK_MAKE_JOBS}" DESTDIR="${COOKBOOK_STAGE}" "OUT=$COOKBOOK_BUILD/shared-release" """