From 1a227504e2c97fb655a4d303b72c46808e29a001 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 24 Aug 2026 21:06:57 +0300 Subject: [PATCH] ports: Add AppStream port --- ports/AppStream/build.sh | 31 +++++++++++++++++++ .../0001-dont-check-for-host-appstream.patch | 12 +++++++ .../0002-implement-physical-memory-info.patch | 12 +++++++ 3 files changed, 55 insertions(+) create mode 100755 ports/AppStream/build.sh create mode 100644 ports/AppStream/patches/0001-dont-check-for-host-appstream.patch create mode 100644 ports/AppStream/patches/0002-implement-physical-memory-info.patch diff --git a/ports/AppStream/build.sh b/ports/AppStream/build.sh new file mode 100755 index 00000000..4f11b718 --- /dev/null +++ b/ports/AppStream/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash ../install.sh + +NAME='AppStream' +VERSION='1.1.2' +DOWNLOAD_URL="https://www.freedesktop.org/software/appstream/releases/AppStream-$VERSION.tar.xz#46b4257100e25a6468ceed7b3ab82441f47b119da3398d30aea6d7b91174b586" +DEPENDENCIES=('glib' 'curl' 'libxml2' 'libfyaml') +CONFIGURE_OPTIONS=( + '-Dprefix=/usr' + '-Dbuildtype=release' + '-Dbash-completion=false' + '-Dgir=false' + '-Dman=false' + '-Dstemming=false' + '-Dsystemd=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 +} diff --git a/ports/AppStream/patches/0001-dont-check-for-host-appstream.patch b/ports/AppStream/patches/0001-dont-check-for-host-appstream.patch new file mode 100644 index 00000000..5bb73a6f --- /dev/null +++ b/ports/AppStream/patches/0001-dont-check-for-host-appstream.patch @@ -0,0 +1,12 @@ +diff -ruN AppStream-1.1.2/data/meson.build AppStream-1.1.2-banan_os/data/meson.build +--- AppStream-1.1.2/data/meson.build 2026-01-28 22:15:58.000000000 +0200 ++++ AppStream-1.1.2-banan_os/data/meson.build 2026-03-25 04:09:17.550968139 +0200 +@@ -9,8 +9,6 @@ + + # Do not rely on an exe wrapper for rel-info, use the system one in that case + if meson.is_cross_build() +- dependency('appstream', version: '>=' + as_version, native: true, +- not_found_message: 'Native appstream required for cross-building') + ascli_exe = find_program('appstreamcli', native: true) + endif + diff --git a/ports/AppStream/patches/0002-implement-physical-memory-info.patch b/ports/AppStream/patches/0002-implement-physical-memory-info.patch new file mode 100644 index 00000000..2478d626 --- /dev/null +++ b/ports/AppStream/patches/0002-implement-physical-memory-info.patch @@ -0,0 +1,12 @@ +diff -ruN AppStream-1.1.2/src/as-system-info.c AppStream-1.1.2-banan_os/src/as-system-info.c +--- AppStream-1.1.2/src/as-system-info.c 2026-01-28 22:15:58.000000000 +0200 ++++ AppStream-1.1.2-banan_os/src/as-system-info.c 2026-03-25 04:08:32.249321186 +0200 +@@ -513,7 +513,7 @@ + return 0; + } + return hbi.memory_size / MB_IN_BYTES; +-#elif defined(__sun) ++#elif defined(__sun) || defined(__banan_os__) + long physpages = sysconf (_SC_PHYS_PAGES); + long pagesize = sysconf (_SC_PAGESIZE); + if (physpages > 0 && pagesize > 0)