From 0ad73da5cbe93d7750bc2c64255fc3310ac7b1e4 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 20 Sep 2026 06:15:30 +0700 Subject: [PATCH] Fix clang compilation for bzip2, flycast, termcap, x11proto --- recipes/archives/bzip2/recipe.toml | 2 ++ recipes/emulators/flycast/redox.patch | 12 ++++++++++++ recipes/libs/termcap/recipe.toml | 4 ++++ recipes/libs/termcap/redox.patch | 14 ++++++++++++++ recipes/wip/x11/x11proto/recipe.toml | 2 +- 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 recipes/libs/termcap/redox.patch diff --git a/recipes/archives/bzip2/recipe.toml b/recipes/archives/bzip2/recipe.toml index f5e17f32f..f4476d38b 100644 --- a/recipes/archives/bzip2/recipe.toml +++ b/recipes/archives/bzip2/recipe.toml @@ -17,6 +17,7 @@ rsync -av --delete "${COOKBOOK_SOURCE}/" ./ PREFIX="${COOKBOOK_STAGE}/usr" \ install +if [ "${COOKBOOK_DYNAMIC}" = "1" ]; then # However, distros distribute libbz2 as well so we'll support it too # Linking the lib fails if we don't rebuild the objects from earlier "${COOKBOOK_MAKE}" clean @@ -32,6 +33,7 @@ rsync -av --delete "${COOKBOOK_SOURCE}/" ./ cp -av libbz2.so* "${COOKBOOK_STAGE}/usr/lib" ln -s "libbz2.so.1.0" "${COOKBOOK_STAGE}/usr/lib/libbz2.so.1" ln -s "libbz2.so.1.0" "${COOKBOOK_STAGE}/usr/lib/libbz2.so" +fi mkdir -p "${COOKBOOK_STAGE}/usr/lib/pkgconfig" cp "${COOKBOOK_RECIPE}/pkgconfig" "${COOKBOOK_STAGE}/usr/lib/pkgconfig/bzip2.pc" diff --git a/recipes/emulators/flycast/redox.patch b/recipes/emulators/flycast/redox.patch index 6dda50347..5259daead 100644 --- a/recipes/emulators/flycast/redox.patch +++ b/recipes/emulators/flycast/redox.patch @@ -77,6 +77,18 @@ index 61ee752..4b140b9 100644 // POSIX threads. #if !defined(ASIO_HAS_PTHREADS) # if defined(ASIO_HAS_THREADS) +diff --git a/core/deps/picotcp/modules/pico_dev_ppp.c b/core/deps/picotcp/modules/pico_dev_ppp.c +index dcffacee..121ac27f 100644 +--- a/core/deps/picotcp/modules/pico_dev_ppp.c ++++ b/core/deps/picotcp/modules/pico_dev_ppp.c +@@ -7,6 +7,7 @@ + *********************************************************************/ + + ++#include + #include + #include + #include diff --git a/core/hw/sh4/modules/mmu.cpp b/core/hw/sh4/modules/mmu.cpp index af9de30e..6f839fc7 100644 --- a/core/hw/sh4/modules/mmu.cpp diff --git a/recipes/libs/termcap/recipe.toml b/recipes/libs/termcap/recipe.toml index 8a87cafb2..acfe054cd 100644 --- a/recipes/libs/termcap/recipe.toml +++ b/recipes/libs/termcap/recipe.toml @@ -1,10 +1,14 @@ [source] tar = "https://ftp.gnu.org/gnu/termcap/termcap-1.3.1.tar.gz" blake3 = "57c095e0bb6e60e7b4a0597f51f7ac15b501ca0f95d37424d8d13978d28b8da3" +patches = [ + "redox.patch" +] [build] template = "custom" script = """ DYNAMIC_STATIC_INIT +export ac_cv_header_stdc=yes COOKBOOK_CONFIGURE_FLAGS+=( --prefix="${COOKBOOK_STAGE}/usr" ) diff --git a/recipes/libs/termcap/redox.patch b/recipes/libs/termcap/redox.patch new file mode 100644 index 000000000..cc3ce40b4 --- /dev/null +++ b/recipes/libs/termcap/redox.patch @@ -0,0 +1,14 @@ +diff -ruwN source/tparam.c source-new/tparam.c +--- source/tparam.c 2002-02-25 17:37:24.000000000 +0000 ++++ source-new/tparam.c 2026-09-22 15:11:03.072524045 +0000 +@@ -38,6 +38,10 @@ + #define bcopy(s, d, n) memcpy ((d), (s), (n)) + #endif + ++#ifdef HAVE_UNISTD_H ++#include ++#endif ++ + #endif /* not emacs */ + + #ifndef NULL diff --git a/recipes/wip/x11/x11proto/recipe.toml b/recipes/wip/x11/x11proto/recipe.toml index fc5be2a28..9e9441f90 100644 --- a/recipes/wip/x11/x11proto/recipe.toml +++ b/recipes/wip/x11/x11proto/recipe.toml @@ -4,4 +4,4 @@ blake3 = "fad667bb04e16dca5e816969f2641bb075929cd73564114cc1aabd87d1975dd3" patches = ["redox.patch"] [build] -template = "configure" +template = "meson"