diff --git a/ports/libfyaml/build.sh b/ports/libfyaml/build.sh new file mode 100755 index 00000000..f28fe2a7 --- /dev/null +++ b/ports/libfyaml/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash ../install.sh + +NAME='libfyaml' +VERSION='0.9.6' +DOWNLOAD_URL="https://github.com/pantoniou/libfyaml/releases/download/v$VERSION/libfyaml-$VERSION.tar.gz#a59cc3331e2eb903ec36933ad52a45888041cac31e44f553a00511131242c483" + +configure() { + cmake --fresh -B build -S . -G Ninja \ + --toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + || exit 1 +} + +build() { + cmake --build build || exit 1 +} + +install() { + DESTDIR="$DESTDIR" cmake --install build || exit 1 +} diff --git a/ports/libfyaml/patches/0001-fix-config-h-inclusion.patch b/ports/libfyaml/patches/0001-fix-config-h-inclusion.patch new file mode 100644 index 00000000..8f3d74b3 --- /dev/null +++ b/ports/libfyaml/patches/0001-fix-config-h-inclusion.patch @@ -0,0 +1,39 @@ +diff -ruN libfyaml-0.9.6/CMakeLists.txt libfyaml-0.9.6-banan_os/CMakeLists.txt +--- libfyaml-0.9.6/CMakeLists.txt 2026-03-15 15:48:50.000000000 +0200 ++++ libfyaml-0.9.6-banan_os/CMakeLists.txt 2026-03-25 03:53:58.967967134 +0200 +@@ -1271,8 +1271,8 @@ + endif() + + add_executable(fy-tool ${FY_TOOL_SOURCES}) +-target_include_directories(fy-tool PRIVATE ${FY_TOOL_INCLUDE_DIRS}) +-target_compile_definitions(fy-tool PRIVATE ${COMMON_C_DEFINITIONS}) ++target_include_directories(fy-tool PRIVATE ${FY_TOOL_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) ++target_compile_definitions(fy-tool PRIVATE ${COMMON_C_DEFINITIONS} HAVE_CONFIG_H) + + target_link_libraries(fy-tool PRIVATE fyaml) + +@@ -1340,9 +1340,10 @@ + src/internal/fy-thread.c + ${GETOPT_SOURCES} + ) +-target_include_directories(fy-thread PRIVATE ${INTERNAL_TOOL_INCLUDES}) ++target_include_directories(fy-thread PRIVATE ${INTERNAL_TOOL_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) + target_compile_definitions(fy-thread PRIVATE + ${COMMON_C_DEFINITIONS} ++ HAVE_CONFIG_H + FY_STATIC) + if(NOT MSVC) + if(APPLE) +@@ -1373,10 +1374,12 @@ + ) + target_include_directories(fy-b3sum PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/src/blake3 ++ ${CMAKE_CURRENT_BINARY_DIR} + ${INTERNAL_TOOL_INCLUDES} + ) + target_compile_definitions(fy-b3sum PRIVATE + ${COMMON_C_DEFINITIONS} ++ HAVE_CONFIG_H + FY_STATIC) + if(NOT MSVC) + if(APPLE) diff --git a/ports/libfyaml/patches/0002-include-endian-h.patch b/ports/libfyaml/patches/0002-include-endian-h.patch new file mode 100644 index 00000000..a7edcc8b --- /dev/null +++ b/ports/libfyaml/patches/0002-include-endian-h.patch @@ -0,0 +1,12 @@ +diff -ruN libfyaml-0.9.6/include/libfyaml/libfyaml-endian.h libfyaml-0.9.6-banan_os/include/libfyaml/libfyaml-endian.h +--- libfyaml-0.9.6/include/libfyaml/libfyaml-endian.h 2026-03-15 15:48:50.000000000 +0200 ++++ libfyaml-0.9.6-banan_os/include/libfyaml/libfyaml-endian.h 2026-03-25 03:35:29.164450940 +0200 +@@ -42,7 +42,7 @@ + extern "C" { + #endif + +-#if defined(__linux__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__GNU__) || defined(__EMSCRIPTEN__) ++#if defined(__linux__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__GNU__) || defined(__EMSCRIPTEN__) || defined(__banan_os__) + # include + #elif defined(__APPLE__) + # include diff --git a/ports/libfyaml/patches/0003-dont-require-cfmakeraw.patch b/ports/libfyaml/patches/0003-dont-require-cfmakeraw.patch new file mode 100644 index 00000000..bb60f6d9 --- /dev/null +++ b/ports/libfyaml/patches/0003-dont-require-cfmakeraw.patch @@ -0,0 +1,17 @@ +diff -ruN libfyaml-0.9.6/src/util/fy-utils.c libfyaml-0.9.6-banan_os/src/util/fy-utils.c +--- libfyaml-0.9.6/src/util/fy-utils.c 2026-03-15 15:48:50.000000000 +0200 ++++ libfyaml-0.9.6-banan_os/src/util/fy-utils.c 2026-03-25 03:41:24.070062486 +0200 +@@ -434,7 +434,13 @@ + + newt = t; + ++#ifdef __banan_os__ ++ newt.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); ++ newt.c_oflag &= ~(OPOST); ++ newt.c_lflag &= ~(ECHO | ECHONL | ISIG | ICANON | IEXTEN); ++#else + cfmakeraw(&newt); ++#endif + + ret = tcsetattr(fd, TCSANOW, &newt); + if (ret != 0)