SHA256
1
0
forked from pool/gegl

Accepting request 1190583 from home:dimstar:Factory

- Add backported 66de8124.patch: Fix build against ffmpeg-7.

OBS-URL: https://build.opensuse.org/request/show/1190583
OBS-URL: https://build.opensuse.org/package/show/graphics/gegl?expand=0&rev=152
This commit is contained in:
Dominique Leuenberger 2024-07-31 07:05:37 +00:00 committed by Git OBS Bridge
commit b060df1051
8 changed files with 1629 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

113
66de8124.patch Normal file
View File

@ -0,0 +1,113 @@
From 66de8124f496617eee8e6b5c68138a00343882db Mon Sep 17 00:00:00 2001
From: Joe Locash <@jlocash2>
Date: Sat, 4 May 2024 17:08:04 +0200
Subject: [PATCH] ff-load, ff-save: fix build with FFmpeg 7
Fixing issue #371
---
operations/external/ff-load.c | 8 ++++++++
operations/external/ff-save.c | 24 ++++++++++++++++++++++--
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/operations/external/ff-load.c b/operations/external/ff-load.c
index 6b96fdfdd..dc24a6d59 100644
--- a/operations/external/ff-load.c
+++ b/operations/external/ff-load.c
@@ -250,7 +250,11 @@ decode_audio (GeglOperation *operation,
while (samples_left)
{
int sample_count = samples_left;
+#if LIBAVCODEC_VERSION_MAJOR < 61
int channels = MIN(p->audio_stream->codecpar->channels, GEGL_MAX_AUDIO_CHANNELS);
+#else
+ int channels = MIN(p->audio_stream->codecpar->ch_layout.nb_channels, GEGL_MAX_AUDIO_CHANNELS);
+#endif
GeglAudioFragment *af = gegl_audio_fragment_new (o->audio_sample_rate, channels,
AV_CH_LAYOUT_STEREO, samples_left);
//);
@@ -553,7 +557,11 @@ prepare (GeglOperation *operation)
else
{
o->audio_sample_rate = p->audio_stream->codecpar->sample_rate;
+#if LIBAVCODEC_VERSION_MAJOR < 61
o->audio_channels = MIN(p->audio_stream->codecpar->channels, GEGL_MAX_AUDIO_CHANNELS);
+#else
+ o->audio_channels = MIN(p->audio_stream->codecpar->ch_layout.nb_channels, GEGL_MAX_AUDIO_CHANNELS);
+#endif
}
}
diff --git a/operations/external/ff-save.c b/operations/external/ff-save.c
index 9196b34aa..ffa5d8bee 100644
--- a/operations/external/ff-save.c
+++ b/operations/external/ff-save.c
@@ -315,8 +315,13 @@ add_audio_stream (GeglProperties *o, AVFormatContext * oc, int codec_id)
}
cp->sample_rate = o->audio_sample_rate;
+#if LIBAVCODEC_VERSION_MAJOR < 61
cp->channel_layout = AV_CH_LAYOUT_STEREO;
cp->channels = 2;
+#else
+ cp->ch_layout.u.mask = AV_CH_LAYOUT_STEREO;
+ cp->ch_layout.nb_channels = 2;
+#endif
return st;
}
@@ -392,8 +397,13 @@ static AVFrame *alloc_audio_frame(AVCodecContext *c, int nb_samples)
frame->format = c->sample_fmt;
+#if LIBAVCODEC_VERSION_MAJOR < 61
frame->channel_layout = c->channel_layout;
frame->channels = c->channels;
+#else
+ frame->ch_layout = c->ch_layout;
+ frame->ch_layout.nb_channels = c->ch_layout.nb_channels;
+#endif
frame->sample_rate = c->sample_rate;
frame->nb_samples = nb_samples;
@@ -423,8 +433,13 @@ static void encode_audio_fragments (Priv *p, AVFormatContext *oc, AVStream *st,
{
float left = 0, right = 0;
get_sample_data (p, i + p->audio_read_pos, &left, &right);
+#if LIBAVCODEC_VERSION_MAJOR < 61
((float*)frame->data[0])[c->channels*i+0] = left;
((float*)frame->data[0])[c->channels*i+1] = right;
+#else
+ ((float*)frame->data[0])[c->ch_layout.nb_channels*i+0] = left;
+ ((float*)frame->data[0])[c->ch_layout.nb_channels*i+1] = right;
+#endif
}
break;
case AV_SAMPLE_FMT_FLTP:
@@ -441,8 +456,13 @@ static void encode_audio_fragments (Priv *p, AVFormatContext *oc, AVStream *st,
{
float left = 0, right = 0;
get_sample_data (p, i + p->audio_read_pos, &left, &right);
+#if LIBAVCODEC_VERSION_MAJOR < 61
((int16_t*)frame->data[0])[c->channels*i+0] = left * (1<<15);
((int16_t*)frame->data[0])[c->channels*i+1] = right * (1<<15);
+#else
+ ((int16_t*)frame->data[0])[c->ch_layout.nb_channels*i+0] = left * (1<<15);
+ ((int16_t*)frame->data[0])[c->ch_layout.nb_channels*i+1] = right * (1<<15);
+#endif
}
break;
case AV_SAMPLE_FMT_S32:
@@ -450,8 +470,8 @@ static void encode_audio_fragments (Priv *p, AVFormatContext *oc, AVStream *st,
{
float left = 0, right = 0;
get_sample_data (p, i + p->audio_read_pos, &left, &right);
- ((int32_t*)frame->data[0])[c->channels*i+0] = left * (1<<31);
- ((int32_t*)frame->data[0])[c->channels*i+1] = right * (1<<31);
+ ((int32_t*)frame->data[0])[c->ch_layout.nb_channels*i+0] = left * (1<<31);
+ ((int32_t*)frame->data[0])[c->ch_layout.nb_channels*i+1] = right * (1<<31);
}
break;
case AV_SAMPLE_FMT_S32P:
--
GitLab

1
baselibs.conf Normal file
View File

@ -0,0 +1 @@
libgegl-0_4-0

3
gegl-0.4.48.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:418c26d94be8805d7d98f6de0c6825ca26bd74fcacb6c188da47533d9ee28247
size 5805488

1222
gegl.changes Normal file

File diff suppressed because it is too large Load Diff

246
gegl.spec Normal file
View File

@ -0,0 +1,246 @@
#
# spec file for package gegl
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# This is based on the ExcludeArch in https://build.opensuse.org/package/show/openSUSE:Factory/luajit
%ifarch riscv64 ppc64 ppc64le
%bcond_with luajit
%else
%bcond_without luajit
%endif
%bcond_with gegl_docs
Name: gegl
Version: 0.4.48
Release: 0
Summary: Generic Graphics Library
License: GPL-3.0-or-later AND LGPL-3.0-or-later
Group: Productivity/Graphics/Other
URL: http://gegl.org/
Source0: https://download.gimp.org/pub/gegl/0.4/%{name}-%{version}.tar.xz
Source1: normalize-gir.pl
Source99: baselibs.conf
# PATCH-FIX-UPSTREAM
Patch0: https://gitlab.gnome.org/GNOME/gegl/-/commit/66de8124.patch
BuildRequires: ImageMagick
BuildRequires: asciidoc
BuildRequires: gcc-c++
BuildRequires: gobject-introspection-devel >= 1.32.0
BuildRequires: gtk-doc
BuildRequires: libjpeg-devel
BuildRequires: libspiro-devel
BuildRequires: libstdc++-devel
BuildRequires: meson >= 0.54.0
BuildRequires: pkgconfig
%if %{with gegl_docs}
BuildRequires: python3-gi-docgen
%endif
BuildRequires: ruby
BuildRequires: suitesparse-devel
BuildRequires: (pkgconfig(babl) or pkgconfig(babl-0.1))
BuildRequires: pkgconfig(OpenEXR) >= 1.6.1
BuildRequires: pkgconfig(cairo) >= 1.12.2
BuildRequires: pkgconfig(gdk-pixbuf-2.0) >= 2.32.0
BuildRequires: pkgconfig(gexiv2)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(glib-2.0) >= 2.44.0
BuildRequires: pkgconfig(gmodule-2.0)
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(gthread-2.0)
BuildRequires: pkgconfig(json-glib-1.0)
BuildRequires: pkgconfig(lcms2) >= 2.8
BuildRequires: pkgconfig(lensfun)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libavutil) >= 55.92.100
BuildRequires: pkgconfig(libpng) >= 1.6.0
BuildRequires: pkgconfig(libraw) >= 0.15.4
BuildRequires: pkgconfig(librsvg-2.0) >= 2.40.6
BuildRequires: pkgconfig(libswscale)
BuildRequires: pkgconfig(libtiff-4) >= 4.0.0
BuildRequires: pkgconfig(libv4l2) >= 1.0.1
BuildRequires: pkgconfig(libwebp) >= 0.5.0
%if %{with luajit}
BuildRequires: pkgconfig(luajit)
%endif
# TODO: BuildRequires: pkgconfig(mrg)
# TODO: BuildRequires: pkgconfig(maxflow)
BuildRequires: pkgconfig(pango) >= 1.38.0
BuildRequires: pkgconfig(pangocairo) >= 1.38.0
BuildRequires: pkgconfig(poppler-glib) >= 0.71.0
BuildRequires: pkgconfig(pygobject-3.0)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(vapigen) >= 0.20.0
# since version 0.3.5, we no longer provide an orig-addon package, as ffmpeg/libav
# exists in Tumbleweed and we use it to build
Provides: %{name}-0_3-orig-addon = %{version}
Obsoletes: %{name}-0_3-orig-addon < 0.3.5
# Since 13/02/18 (version 0.3.28) gegl-unstable is obsolete, gegl is now on "0.4" branch.
Provides: gegl-unstable = %{version}
Obsoletes: gegl-unstable < 0.3.28
%description
GEGL provides infrastructure to do demand based cached non destructive
image editing on larger than RAM buffers. Through babl, it provides
support for a wide range of color models and pixel storage formats for
input and output.
%package -n %{name}-0_4
Summary: Generic Graphics Library
Group: System/Libraries
%description -n %{name}-0_4
GEGL provides infrastructure to do demand based cached non destructive
image editing on larger than RAM buffers. Through babl, it provides
support for a wide range of color models and pixel storage formats for
input and output.
%package -n libgegl-0_4-0
Summary: Generic Graphics Library
# The plugins are required for the lib to be usable
Group: System/Libraries
Requires: %{name}-0_4 >= %{version}
%description -n libgegl-0_4-0
GEGL provides infrastructure to do demand based cached non destructive
image editing on larger than RAM buffers. Through babl, it provides
support for a wide range of color models and pixel storage formats for
input and output.
%package -n typelib-1_0-Gegl-0_4
Summary: Introspection bindings for the GEGL "Generic Graphics Library"
Group: System/Libraries
%description -n typelib-1_0-Gegl-0_4
GEGL provides infrastructure to do demand based cached non destructive
image editing on larger than RAM buffers. Through babl, it provides
support for a wide range of color models and pixel storage formats for
input and output.
This package provides the GObject Introspection bindings for the
libgegl library.
%package devel
Summary: Development files for the GEGL "Generic Graphics Library"
Group: Development/Libraries/C and C++
Requires: libgegl-0_4-0 = %{version}
Requires: typelib-1_0-Gegl-0_4 = %{version}
%description devel
GEGL provides infratructure to do demand based cached non destructive
image editing on larger than RAM buffers. Through babl, it provides
support for a wide range of color models and pixel storage formats for
input and output.
%package doc
Summary: Documentation for the GEGL "Generic Graphics Library"
Group: Documentation/HTML
%description doc
GEGL provides infrastructure to do demand based cached non destructive
image editing on larger than RAM buffers. Through babl, it provides
support for a wide range of color models and pixel storage formats for
input and output.
%lang_package -n %{name}-0_4
%prep
%autosetup -p1
%build
%ifarch aarch64
export LD_PRELOAD="/usr/lib64/libgomp.so.1"
%endif
%meson \
-Dmrg=disabled \
-Dmaxflow=disabled \
%if ! %{with luajit}
-Dlua=disabled \
%endif
-Dworkshop=true \
-Djasper=disabled \
%if %{with gegl_docs}
-Ddocs=true \
-Dgi-docgen=enabled \
%else
-Ddocs=false \
-Dgi-docgen=disabled \
%endif
%{nil}
%meson_build
%install
%meson_install
perl -i %{SOURCE1} %{buildroot}%{_datadir}/gir-1.0/Gegl-0.4.gir
find %{buildroot} -type f -name "*.la" -delete -print
%find_lang %{name}-0.4 %{?no_lang_C}
%post -n gegl-0_4 -p /sbin/ldconfig
%postun -n gegl-0_4 -p /sbin/ldconfig
%post -n libgegl-0_4-0 -p /sbin/ldconfig
%postun -n libgegl-0_4-0 -p /sbin/ldconfig
%files
%{_bindir}/gegl
%{_bindir}/gegl-imgcmp
%files -n %{name}-0_4
%dir %{_libdir}/gegl-0.4/
%{_libdir}/gegl-0.4/*.so
# libgegl-sc-0.4.so is a support library for the seamless-clone module
%{_libdir}/libgegl-sc-0.4.so
%{_libdir}/libgegl-npd-0.4.so
%{_libdir}/gegl-0.4/grey2.json
%{_libdir}/gegl-0.4/dropshadow2.json
%if %{with luajit}
# lua files
%dir %{_datadir}/gegl-0.4/
%{_datadir}/gegl-0.4/lua/
%endif
%files -n libgegl-0_4-0
%license COPYING COPYING.LESSER
%{_libdir}/libgegl-0.4.so.*
%files -n typelib-1_0-Gegl-0_4
%{_libdir}/girepository-1.0/Gegl-0.4.typelib
%files devel
%{_includedir}/gegl-0.4/
%{_libdir}/libgegl-0.4.so
%{_libdir}/pkgconfig/gegl-0.4.pc
%{_libdir}/pkgconfig/gegl-sc-0.4.pc
%{_datadir}/gir-1.0/Gegl-0.4.gir
%dir %{_datadir}/vala
%dir %{_datadir}/vala/vapi
%{_datadir}/vala/vapi/gegl-0.4.deps
%{_datadir}/vala/vapi/gegl-0.4.vapi
%files doc
%doc AUTHORS docs/ChangeLog NEWS
%if %{with gegl_docs}
%doc %{_datadir}/gegl-0.4/
%endif
%files -n %{name}-0_4-lang -f %{name}-0.4.lang
%changelog

20
normalize-gir.pl Normal file
View File

@ -0,0 +1,20 @@
#!/usr/bin/perl -w
# SPDX-License-Identifier: LGPL-3.0-or-later
# written by Bernhard M. Wiedemann in 2024
# to normalize the .gir file values
# for reproducible builds of the gegl package
use strict;
my $property = "";
while(<>) {
if(m/<property name="([^"]+)"/) {
$property = $1;
}
if($property eq "threads") {
s/(default-value=)"[^"]+"/$1"4"/;
}
if($property eq "tile-cache-size") {
s/(default-value=)"[^"]+"/$1"4000000000"/;
}
print;
}