ports: Add libfyaml port
This commit is contained in:
Executable
+21
@@ -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
|
||||||
|
}
|
||||||
@@ -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)
|
||||||
@@ -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 <endian.h>
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
# include <libkern/OSByteOrder.h>
|
||||||
@@ -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)
|
||||||
Reference in New Issue
Block a user