Skip to content

Commit

Permalink
appstream-glib: switch to muon, remove gnu patch dep
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Nov 16, 2023
1 parent 7bebf6d commit 7bda534
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 27 deletions.
21 changes: 9 additions & 12 deletions community/appstream-glib/build
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@

export DESTDIR="$1"

if ! patch --help 2>&1 | grep gnu; then
echo "Switch to gnu patch:"
echo "# kiss a patch /usr/bin/patch"
exit 1
fi
for p in *.patch; do
patch -p1 < "$p"
done

patch -p1 < no-uuid.patch
# Don't build tests and po.
sed -e "/subdir('tests')/d" \
-e "/subdir('po')/d" meson.build > _
mv -f _ meson.build

# Don't build tests.
sed "/subdir('tests')/d" data/meson.build > _
mv -f _ data/meson.build

meson setup \
muon setup \
-Dprefix=/usr \
-Dsysconfdir=/etc \
-Dmandir=/usr/share/man \
Expand All @@ -26,4 +23,4 @@ meson setup \
output

ninja -C output
ninja -C output install
muon -C output install
3 changes: 2 additions & 1 deletion community/appstream-glib/checksums
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
d9e33fdd4e6f4f382e64e291e9a228fde6655349409b2ef74b44a97f862e3e0d1a
8a289874ad91be7104298f85edb138a8d10735f6ce58f975f0077a29cda760fe57
e721ba2ca369dca9ee91fadd5d7e4a06e10ba84fa1d23d9447e372c77df8cc877e
3964510c3dc0fc03861d7c49d5ed9755f63f9e34ba089d11acecdf315bf3d4063d
6 changes: 2 additions & 4 deletions community/appstream-glib/depends
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
curl
gdk-pixbuf
glib
gperf
gtk+3
json-glib
libarchive
libsoup
meson make
patch make
samurai make
muon make
1 change: 1 addition & 0 deletions community/appstream-glib/esources
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
https://people.freedesktop.org/~hughsient/appstream-glib/releases/appstream-glib-VERSION.tar.xz
patches/no-uuid.patch
patches/muon.patch
41 changes: 41 additions & 0 deletions community/appstream-glib/patches/muon.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/libappstream-glib/meson.build b/libappstream-glib/meson.build
index c124532..8acc2fa 100644
--- a/libappstream-glib/meson.build
+++ b/libappstream-glib/meson.build
@@ -31,9 +31,33 @@ if get_option('stemmer')
deps += stemmer
endif

-asresources = gnome.compile_resources(
- 'as-resources', 'appstream-glib.gresource.xml',
- c_name : 'as'
+asresources = []
+asresources += custom_target('asresources_c',
+ output: 'as-resources.c',
+ input: files('appstream-glib.gresource.xml'),
+ command: [
+ find_program('glib-compile-resources'),
+ '@INPUT@',
+ '--sourcedir=' + meson.current_source_dir(),
+ '--c-name=as',
+ '--internal',
+ '--generate',
+ '--target=@OUTPUT@',
+ ],
+)
+
+asresources += custom_target('asresources_h',
+ output: 'as-resources.h',
+ input: files('appstream-glib.gresource.xml'),
+ command: [
+ find_program('glib-compile-resources'),
+ '@INPUT@',
+ '--sourcedir=' + meson.current_source_dir(),
+ '--c-name=as',
+ '--internal',
+ '--generate',
+ '--target=@OUTPUT@',
+ ],
)

configure_file(
20 changes: 10 additions & 10 deletions community/appstream-glib/patches/no-uuid.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ index 872d30d..60abcf6 100644
Libs: -L${libdir} -lappstream-glib
Cflags: -I${includedir}/libappstream-glib
diff --git a/libappstream-glib/as-utils.c b/libappstream-glib/as-utils.c
index 007a86b..35fd9d0 100644
index d9b0f56..301a632 100644
--- a/libappstream-glib/as-utils.c
+++ b/libappstream-glib/as-utils.c
@@ -23,13 +23,6 @@
@@ -22,13 +22,6 @@
#include <archive_entry.h>
#include <archive.h>
#include <libsoup/soup.h>
#include <stdlib.h>
-#ifndef _WIN32
-#ifdef __APPLE__
Expand All @@ -29,7 +29,7 @@ index 007a86b..35fd9d0 100644

#ifdef HAVE_RPM
#include <rpm/rpmlib.h>
@@ -1531,53 +1524,7 @@ as_utils_guid_from_data (const gchar *namespace_id,
@@ -1530,53 +1523,7 @@ as_utils_guid_from_data (const gchar *namespace_id,
gsize data_len,
GError **error)
{
Expand Down Expand Up @@ -83,7 +83,7 @@ index 007a86b..35fd9d0 100644
}

/**
@@ -1593,20 +1540,7 @@ as_utils_guid_from_data (const gchar *namespace_id,
@@ -1592,20 +1539,7 @@ as_utils_guid_from_data (const gchar *namespace_id,
gboolean
as_utils_guid_is_valid (const gchar *guid)
{
Expand All @@ -105,7 +105,7 @@ index 007a86b..35fd9d0 100644

/**
diff --git a/libappstream-glib/meson.build b/libappstream-glib/meson.build
index 715123d..f5beaae 100644
index 886f6c6..c124532 100644
--- a/libappstream-glib/meson.build
+++ b/libappstream-glib/meson.build
@@ -16,7 +16,7 @@ if platform_win32
Expand All @@ -117,7 +117,7 @@ index 715123d..f5beaae 100644
endif

if get_option('dep11')
@@ -158,9 +158,6 @@ pkg_req_private = [
@@ -160,9 +160,6 @@ pkg_req_private = [
'libarchive'
]

Expand All @@ -128,14 +128,14 @@ index 715123d..f5beaae 100644
pkgg.generate(
version : as_version,
diff --git a/meson.build b/meson.build
index 331dd7a..5ca8750 100644
index 45a1115..50de37b 100644
--- a/meson.build
+++ b/meson.build
@@ -69,7 +69,6 @@ elif platform_osx
@@ -71,7 +71,6 @@ elif platform_osx
giounix = dependency('gio-unix-2.0', version : glib_ver)
else
giounix = dependency('gio-unix-2.0', version : glib_ver)
- uuid = dependency('uuid')
endif
libarchive = dependency('libarchive')
soup = dependency('libsoup-2.4', version : '>= 2.51.92')
libcurl = dependency('libcurl', version : '>= 7.56.0')
1 change: 1 addition & 0 deletions community/appstream-glib/sources
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
https://people.freedesktop.org/~hughsient/appstream-glib/releases/appstream-glib-0.8.2.tar.xz
patches/no-uuid.patch
patches/muon.patch

0 comments on commit 7bda534

Please sign in to comment.