From f2d08a85a5076c2d26b3f8fd3c0b9c576062f66d Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 24 Aug 2026 21:00:14 +0300 Subject: [PATCH] porst: Add json-glib port --- ports/json-c/build.sh | 23 +++++++++++++++ .../0001-fix-install-destination.patch | 12 ++++++++ ports/json-glib/build.sh | 29 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100755 ports/json-c/build.sh create mode 100644 ports/json-c/patches/0001-fix-install-destination.patch create mode 100755 ports/json-glib/build.sh diff --git a/ports/json-c/build.sh b/ports/json-c/build.sh new file mode 100755 index 00000000..e2973681 --- /dev/null +++ b/ports/json-c/build.sh @@ -0,0 +1,23 @@ +#!/bin/bash ../install.sh + +NAME='json-c' +VERSION='0.18-20240915' +DOWNLOAD_URL="https://github.com/json-c/json-c/archive/refs/tags/json-c-$VERSION.tar.gz#3112c1f25d39eca661fe3fc663431e130cc6e2f900c081738317fba49d29e298" +TAR_CONTENT="json-c-json-c-$VERSION" + +configure() { + cmake --fresh -B build -S . -G Ninja \ + --toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_STATIC_LIBS=OFF \ + || exit 1 +} + +build() { + cmake --build build || exit 1 +} + +install() { + DESTDIR="$DESTDIR" cmake --install build || exit 1 +} diff --git a/ports/json-c/patches/0001-fix-install-destination.patch b/ports/json-c/patches/0001-fix-install-destination.patch new file mode 100644 index 00000000..89fc1987 --- /dev/null +++ b/ports/json-c/patches/0001-fix-install-destination.patch @@ -0,0 +1,12 @@ +diff -ruN json-c-0.18-20240915/CMakeLists.txt json-c-0.18-20240915-banan_os/CMakeLists.txt +--- json-c-0.18-20240915/CMakeLists.txt 2024-09-15 19:22:45.000000000 +0300 ++++ json-c-0.18-20240915-banan_os/CMakeLists.txt 2026-03-25 02:59:13.104155305 +0200 +@@ -571,7 +571,7 @@ + set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files") + install(FILES ${PROJECT_BINARY_DIR}/json-c.pc DESTINATION "${INSTALL_PKGCONFIG_DIR}") + +-install(FILES ${JSON_C_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/json-c) ++install(FILES ${JSON_C_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/json-c) + + if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING AND + (NOT MSVC OR NOT (MSVC_VERSION LESS 1800)) # Tests need at least VS2013 diff --git a/ports/json-glib/build.sh b/ports/json-glib/build.sh new file mode 100755 index 00000000..36e5f9b9 --- /dev/null +++ b/ports/json-glib/build.sh @@ -0,0 +1,29 @@ +#!/bin/bash ../install.sh + +NAME='json-glib' +VERSION='1.10.8' +DOWNLOAD_URL="https://github.com/GNOME/json-glib/archive/refs/tags/$VERSION.tar.gz#7a114bdac0b2611a7207e981c37fa9b1e70d9cb642470cd9e967b135428cec52" +DEPENDENCIES=('glib' 'json-c') +CONFIGURE_OPTIONS=( + '-Dprefix=/usr' + '-Dbuildtype=release' + '-Dintrospection=disabled' + '-Dnls=disabled' + '-Dtests=false' +) + +configure() { + meson setup \ + --reconfigure \ + --cross-file "$MESON_CROSS_FILE" \ + "${CONFIGURE_OPTIONS[@]}" \ + build || exit 1 +} + +build() { + meson compile -C build || exit 1 +} + +install() { + meson install --destdir="$DESTDIR" -C build || exit 1 +}