Notification time stamped 2021-08-29 00:33:01 UTC
From 2e088686f9cad70ef83a43088dfae7f0f48ff320 Mon Sep 17 00:00:00 2001 From: Neal Gompa ngompa@fedoraproject.org Date: Aug 29 2021 00:08:12 +0000 Subject: Add missing patch
---
diff --git a/0001-Fix-build-with-GLib-2.69.patch b/0001-Fix-build-with-GLib-2.69.patch new file mode 100644 index 0000000..a5af3b1 --- /dev/null +++ b/0001-Fix-build-with-GLib-2.69.patch @@ -0,0 +1,134 @@ +From 0644bc10d13fc68ab39b4328a386033f700b8410 Mon Sep 17 00:00:00 2001 +From: Matthias Klumpp matthias@tenstral.net +Date: Sun, 29 Aug 2021 01:45:29 +0200 +Subject: [PATCH] Fix build with GLib >= 2.69 + +GLibD for GLib 2.69 changed some API, so we need to account for that +while still having the code build for older versions of GLib. +--- + meson.build | 1 + + src/app.d | 1 - + src/asgen/defines.d.in | 3 ++ + src/asgen/handlers/screenshothandler.d | 46 ++++++++++++++++++-------- + src/asgen/meson.build | 5 +++ + 5 files changed, 41 insertions(+), 15 deletions(-) + +diff --git a/meson.build b/meson.build +index f4b0aa9..dc32699 100644 +--- a/meson.build ++++ b/meson.build +@@ -15,6 +15,7 @@ build_root = meson.build_root() + # + src_dir = include_directories('src/') + ++glib_dep = dependency('glib-2.0') + glibd_dep = dependency('glibd-2.0') + appstream_dep = dependency('appstream', version : '>= 0.14.5') + ascompose_dep = dependency('appstream-compose', version : '>= 0.14.5') +diff --git a/src/app.d b/src/app.d +index 070c980..d9b61ea 100644 +--- a/src/app.d ++++ b/src/app.d +@@ -224,7 +224,6 @@ void main(string[] args) + default: + writeln (format ("The command '%s' is unknown.", command)); + exit (1); +- break; + } + } + +diff --git a/src/asgen/defines.d.in b/src/asgen/defines.d.in +index af49792..16cccba 100644 +--- a/src/asgen/defines.d.in ++++ b/src/asgen/defines.d.in +@@ -25,3 +25,6 @@ public enum DATADIR = "@datadir@"; + + // current version of the tool + public enum ASGEN_VERSION = "@asgen_version@"; ++ ++// Used for GLib/GLibD API change tests ++public enum GLIB_GE_2_69 = @glib_ge_2_29@; +diff --git a/src/asgen/handlers/screenshothandler.d b/src/asgen/handlers/screenshothandler.d +index 26dcd12..14a346c 100644 +--- a/src/asgen/handlers/screenshothandler.d ++++ b/src/asgen/handlers/screenshothandler.d +@@ -35,6 +35,7 @@ import ascompose.c.types : ImageFormat, ImageLoadFlags, ImageSaveFlags; + static import ascompose.Image; + static import std.file; + ++import asgen.defines : GLIB_GE_2_69; + import asgen.config : Config; + import asgen.result : GeneratorResult; + import asgen.downloader : Downloader; +@@ -124,20 +125,37 @@ private VideoInfo checkVideoInfo (GeneratorResult gres, Component cpt, const Con + try { + // NOTE: We are currently extracting information from ffprobe's simple output, but it also has a JSON + // mode. Parsing JSON is a bit slower, but if it is more reliable we should switch to that. +- Spawn.sync (null, // working directory +- [conf.ffprobeBinary, +- "-v", "quiet", +- "-show_entries", "stream=width,height,codec_name,codec_type", +- "-show_entries", "format=format_name", +- "-of", "default=noprint_wrappers=1", +- vidFname], +- [], // envp +- SpawnFlags.LEAVE_DESCRIPTORS_OPEN, +- null, // child setup +- null, // user data +- ffStdout, // out stdout +- ffStderr, // out stderr +- exitStatus); ++ static if (GLIB_GE_2_69) { ++ Spawn.sync (null, // working directory ++ [conf.ffprobeBinary, ++ "-v", "quiet", ++ "-show_entries", "stream=width,height,codec_name,codec_type", ++ "-show_entries", "format=format_name", ++ "-of", "default=noprint_wrappers=1", ++ vidFname], ++ [], // envp ++ SpawnFlags.LEAVE_DESCRIPTORS_OPEN, ++ null, // child setup ++ null, // user data ++ ffStdout, // out stdout ++ ffStderr, // out stderr ++ &exitStatus); ++ } else { ++ Spawn.sync (null, // working directory ++ [conf.ffprobeBinary, ++ "-v", "quiet", ++ "-show_entries", "stream=width,height,codec_name,codec_type", ++ "-show_entries", "format=format_name", ++ "-of", "default=noprint_wrappers=1", ++ vidFname], ++ [], // envp ++ SpawnFlags.LEAVE_DESCRIPTORS_OPEN, ++ null, // child setup ++ null, // user data ++ ffStdout, // out stdout ++ ffStderr, // out stderr ++ exitStatus); ++ } + } catch (Exception e) { + logError ("Failed to spawn ffprobe: %s", e.to!string); + gres.addHint (cpt, "metainfo-screenshot-but-no-media", ["fname": vidFname.baseName, "msg": e.to!string]); +diff --git a/src/asgen/meson.build b/src/asgen/meson.build +index 48f64a5..26f47d7 100644 +--- a/src/asgen/meson.build ++++ b/src/asgen/meson.build +@@ -1,7 +1,12 @@ + ++glib_ge_2_29 = 'false' ++if glib_dep.version().version_compare('>=2.69') ++ glib_ge_2_29 = 'true' ++endif + conf_data = configuration_data() + conf_data.set('datadir', join_paths(get_option('prefix'), get_option('datadir'), 'appstream')) + conf_data.set('asgen_version', asgen_version) ++conf_data.set('glib_ge_2_29', glib_ge_2_29) + configure_file(input : 'defines.d.in', + output: 'defines.d', + configuration: conf_data +-- +2.31.1 +
https://src.fedoraproject.org/rpms/appstream-generator/c/2e088686f9cad70ef83...