update of rx-* packages

This commit is contained in:
Raven 2025-03-15 12:56:01 +06:00
parent 170a085a4e
commit ee35c57ab0
58 changed files with 22211 additions and 273 deletions

View File

@ -14,7 +14,7 @@
Name: rx-cairo
Version: 1.17.4
Release: 3%{?dist}
Release: 5%{?dist}
Summary: A 2D graphics library
License: LGPLv2 or MPLv1.1
@ -187,6 +187,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%{_libdir}/cairo/
%changelog
* Tue Oct 29 2024 Raven <raven@sysadmins.ws> - 1.17.4-4
- rebuilt with new rx-freetype
* Mon Jan 30 2023 Stewart Smith <trawets@amazon.com> - 1.17.4-3.amzn2023.0.2
- Mass rebuild for AL2023

View File

@ -4,7 +4,7 @@
# "--with=ffmpeg", or "--with=openh264" to mock/rpmbuild; or by globally
# setting these variables:
# https://bugzilla.redhat.com/show_bug.cgi?id=2242028
%global _with_ffmpeg 1
#global _with_ffmpeg 1
%global _with_openh264 1
# Can be rebuilt with OpenCL support enabled by passing # "--with=opencl"
@ -28,8 +28,8 @@
%endif
Name: rx-freerdp
Version: 2.11.2
Release: 3%{?dist}
Version: 2.11.7
Release: 1%{?dist}
Epoch: 2
Summary: Free implementation of the Remote Desktop Protocol (RDP)
License: ASL 2.0
@ -100,7 +100,6 @@ Obsoletes: %{name}-plugins < 1:1.1.0
Provides: %{name}-plugins = %{?epoch}:%{version}-%{release}
Requires: (libwayland-client >= 1.22 or rx-libwayland-client)
Requires: (libwayland-cursor >= 1.22 or rx-libwayland-cursor)
#Requires: (libxkbcommon_ng or libxkbcommon >= 1.0)
%description libs
libfreerdp-core can be embedded in applications.
@ -302,6 +301,9 @@ find %{buildroot} -name "*.a" -delete
%{_libdir}/pkgconfig/winpr-tools2.pc
%changelog
* Tue Oct 29 2024 Raven <raven@sysadmins.ws> - 2:2.11.7-1
- Update to 2.11.7
* Fri Sep 13 2024 Raven <raven@sysadmins.ws> - 2:2.11.2-3
- rebuilt with new OpenSSL

View File

@ -1,13 +0,0 @@
diff --git a/include/freetype/ftmodapi.h b/include/freetype/ftmodapi.h
index 8d039c4f3..88488bfe8 100644
--- a/include/freetype/ftmodapi.h
+++ b/include/freetype/ftmodapi.h
@@ -623,7 +623,7 @@ FT_BEGIN_HEADER
* it is bytecode interpreter's execution context, `TT_ExecContext`,
* which is declared in FreeType's internal header file `tttypes.h`.
*/
- typedef FT_Error
+ typedef void
(*FT_DebugHook_Func)( void* arg );

View File

@ -1,43 +0,0 @@
From 53dfdcd8198d2b3201a23c4bad9190519ba918db Mon Sep 17 00:00:00 2001
From: Werner Lemberg <wl@gnu.org>
Date: Thu, 17 Mar 2022 19:24:16 +0100
Subject: [PATCH] [sfnt] Avoid invalid face index.
Fixes #1138.
* src/sfnt/sfobjs.c (sfnt_init_face), src/sfnt/sfwoff2.c (woff2_open_font):
Check `face_index` before decrementing.
---
src/sfnt/sfobjs.c | 2 +-
src/sfnt/sfwoff2.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index f9d4d3858..9771c35df 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -566,7 +566,7 @@
face_index = FT_ABS( face_instance_index ) & 0xFFFF;
/* value -(N+1) requests information on index N */
- if ( face_instance_index < 0 )
+ if ( face_instance_index < 0 && face_index > 0 )
face_index--;
if ( face_index >= face->ttc_header.count )
diff --git a/src/sfnt/sfwoff2.c b/src/sfnt/sfwoff2.c
index cb1e0664a..165b875e5 100644
--- a/src/sfnt/sfwoff2.c
+++ b/src/sfnt/sfwoff2.c
@@ -2085,7 +2085,7 @@
/* Validate requested face index. */
*num_faces = woff2.num_fonts;
/* value -(N+1) requests information on index N */
- if ( *face_instance_index < 0 )
+ if ( *face_instance_index < 0 && face_index > 0 )
face_index--;
if ( face_index >= woff2.num_fonts )
--
2.35.1

View File

@ -1,45 +0,0 @@
--- freetype-2.10.4/builds/unix/freetype-config.in
+++ freetype-2.10.4/builds/unix/freetype-config.in
@@ -32,9 +32,6 @@ cflags=`%PKG_CONFIG% --cflags freetype2`
dynamic_libs=`pkgconf --libs freetype2`
static_libs=`pkgconf --static --libs freetype2`
-orig_prefix=$prefix
-orig_exec_prefix=$exec_prefix
-
orig_includedir=$includedir
orig_libdir=$libdir
--- freetype-2.10.4/ft2demos-2.10.4/src/ftbench.c
+++ freetype-2.10.4/ft2demos-2.10.4/src/ftbench.c
@@ -749,6 +749,7 @@
{
fprintf( stderr,
"couldn't allocate memory to pre-load font file\n" );
+ fclose( file );
return 1;
}
@@ -758,9 +759,12 @@
fprintf( stderr, "read error\n" );
free( memory_file );
memory_file = NULL;
+ fclose( file );
return 1;
}
+
+ fclose( file );
}
error = FT_New_Memory_Face( lib,
--- freetype-2.10.4/ft2demos-2.10.4/src/ftgrid.c
+++ freetype-2.10.4/ft2demos-2.10.4/src/ftgrid.c
@@ -662,6 +662,7 @@
break;
default:
+ free( t );
return;
}

View File

@ -1,27 +0,0 @@
From 0c2bdb01a2e1d24a3e592377a6d0822856e10df2 Mon Sep 17 00:00:00 2001
From: Werner Lemberg <wl@gnu.org>
Date: Sat, 19 Mar 2022 09:37:28 +0100
Subject: [PATCH] * src/base/ftobjs.c (FT_Request_Size): Guard `face->size`.
Fixes #1140.
---
src/base/ftobjs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 6492a1517..282c9121a 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -3409,6 +3409,9 @@
if ( !face )
return FT_THROW( Invalid_Face_Handle );
+ if ( !face->size )
+ return FT_THROW( Invalid_Size_Handle );
+
if ( !req || req->width < 0 || req->height < 0 ||
req->type >= FT_SIZE_REQUEST_TYPE_MAX )
return FT_THROW( Invalid_Argument );
--
2.35.1

View File

@ -1,43 +0,0 @@
From 007c109b4594c5e63948bd08b4d5011ad76ffb10 Mon Sep 17 00:00:00 2001
From: Ben Wagner <bungeman@google.com>
Date: Fri, 23 Oct 2020 08:29:14 +0200
Subject: [PATCH] * src/sfnt/pngshim.c (Load_SBit_Png): Fix memory leak
(#59322).
The issue is that `rows` is allocated but will not be freed in the
event that the call to `png_read_image` fails and calls `longjmp`.
---
ChangeLog | 7 +++++++
src/sfnt/pngshim.c | 1 +
2 files changed, 8 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 42f7c34ba..ff048b8ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-10-23 Ben Wagner <bungeman@google.com>
+
+ * src/sfnt/pngshim.c (Load_SBit_Png): Fix memory leak (#59322).
+
+ The issue is that `rows` is allocated but will not be freed in the
+ event that the call to `png_read_image` fails and calls `longjmp`.
+
2020-10-20 Werner Lemberg <wl@gnu.org>
* Version 2.10.4 released.
diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c
index f55016122..d4e43a9f4 100644
--- a/src/sfnt/pngshim.c
+++ b/src/sfnt/pngshim.c
@@ -443,6 +443,7 @@
png_read_end( png, info );
DestroyExit:
+ FT_FREE( rows );
png_destroy_read_struct( &png, &info, NULL );
FT_Stream_Close( &stream );
--
2.26.2

View File

@ -1,46 +0,0 @@
From 22a0cccb4d9d002f33c1ba7a4b36812c7d4f46b5 Mon Sep 17 00:00:00 2001
From: Werner Lemberg <wl@gnu.org>
Date: Sat, 19 Mar 2022 06:40:17 +0100
Subject: [PATCH] * src/base/ftobjs.c (ft_open_face_internal): Properly guard
`face_index`.
We must ensure that the cast to `FT_Int` doesn't change the sign.
Fixes #1139.
---
src/base/ftobjs.c | 9 +++++++++
1 file changed, 9 insertions(+)
From d014387ad4a5dd04d8e7f99587c7dacb70261924 Mon Sep 17 00:00:00 2001
From: Werner Lemberg <wl@gnu.org>
Date: Sat, 19 Mar 2022 09:30:45 +0100
Subject: [PATCH 2/2] * src/base/ftobjs.c (ft_open_face_internal): Thinko.
---
src/base/ftobjs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 2c0f0e6c9..10952a6c6 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -2527,6 +2527,16 @@
#endif
+ /* only use lower 31 bits together with sign bit */
+ if ( face_index > 0 )
+ face_index &= 0x7FFFFFFFL;
+ else
+ {
+ face_index = -face_index;
+ face_index &= 0x7FFFFFFFL;
+ face_index = -face_index;
+ }
+
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE3(( "FT_Open_Face: " ));
if ( face_index < 0 )
--
2.35.1

View File

@ -0,0 +1,75 @@
diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c
index b7403fa65..1fd5a0be3 100644
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -245,6 +245,12 @@
af_shaper_get_coverage( globals, style_class, gstyles, 0 );
}
+ if ( dflt >= sizeof (af_style_classes) / sizeof (AF_StyleClass) )
+ {
+ error = FT_THROW( Invalid_Offset );
+ goto Exit;
+ }
+
/* ... and finally the default OpenType features of the default script */
af_shaper_get_coverage( globals, af_style_classes[dflt], gstyles, 1 );
diff --git a/src/tools/apinames.c b/src/tools/apinames.c
index 5a49b0649..feefb4ee7 100644
--- a/src/tools/apinames.c
+++ b/src/tools/apinames.c
@@ -182,6 +182,7 @@ names_dump( FILE* out,
case OUTPUT_WATCOM_LBC:
{
const char* dot;
+ char temp[512];
if ( !dll_name )
@@ -195,7 +196,6 @@ names_dump( FILE* out,
dot = strchr( dll_name, '.' );
if ( dot )
{
- char temp[512];
int len = dot - dll_name;
diff --git a/src/ftbench.c b/src/ftbench.c
index ec5c46c..7d96f60 100644
--- a/ft2demos-2.13.2/src/ftbench.c
+++ b/ft2demos-2.13.2/src/ftbench.c
@@ -907,6 +907,7 @@
{
fprintf( stderr,
"couldn't allocate memory to pre-load font file\n" );
+ fclose( file );
return 1;
}
@@ -916,9 +917,11 @@
fprintf( stderr, "read error\n" );
free( memory_file );
memory_file = NULL;
+ fclose( file );
return 1;
}
+ fclose( file );
}
error = FT_New_Memory_Face( lib,
diff --git a/src/ftgrid.c b/src/ftgrid.c
index bae4826..1a8f421 100644
--- a/ft2demos-2.13.2/src/ftgrid.c
+++ b/ft2demos-2.13.2/src/ftgrid.c
@@ -420,6 +420,9 @@
if ( !line )
return;
+ if (bit->mode == gr_pixel_mode_mono)
+ memset( line, 0, (size_t)( pitch * bit->rows * scale * scale ));
+
switch( bit->mode )
{
case gr_pixel_mode_mono:

View File

@ -14,4 +14,4 @@
+ EXES += fttimer
# EXES += testname
exes: $(EXES:%=$(BIN_DIR_2)/%$E)
# Not all demo programs have a man page; we thus check for existence in a

View File

@ -5,9 +5,9 @@
Summary: A free and portable font rendering engine
Name: rx-freetype
Version: 2.10.4
Release: 9%{?dist}
License: (FTL or GPLv2+) and BSD and MIT and Public Domain and zlib with acknowledgement
Version: 2.13.2
Release: 7%{?dist}
License: (FTL OR GPL-2.0-or-later) AND BSD-3-Clause AND MIT AND MIT-Modern-Variant AND LicenseRef-Fedora-Public-Domain AND Zlib
URL: http://www.freetype.org
Source: http://download.savannah.gnu.org/releases/freetype/freetype-%{version}.tar.xz
Source1: http://download.savannah.gnu.org/releases/freetype/freetype-doc-%{version}.tar.xz
@ -26,22 +26,8 @@ Patch3: freetype-2.6.5-libtool.patch
Patch4: freetype-2.8-multilib.patch
Patch5: freetype-2.10.0-internal-outline.patch
# Revert ABI/API change
Patch6: freetype-2.10.1-debughook.patch
Patch7: freetype-2.10.4-png-memory-leak.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1964066
Patch8: freetype-2.10.4-covscan.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2077989
Patch9: freetype-2.10.4-avoid-invalid-face-index.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2077991
Patch10: freetype-2.10.4-properly-guard-face_index.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2077985
Patch11: freetype-2.10.4-guard-face-size.patch
Patch6: freetype-2.13.2-SAST-findings.patch
BuildRequires: gcc
BuildRequires: libX11-devel
@ -52,14 +38,13 @@ BuildRequires: brotli-devel
BuildRequires: make
%if %{without bootstrap}
BuildRequires: rx-harfbuzz-devel
Requires: rx-harfbuzz
%endif
Provides: pkgconfig(freetype2) = %{version}-%{release}
Provides: %{name}-bytecode
Provides: %{name}-subpixel
Obsoletes: freetype-freeworld < 2.9.1-2
Requires: rx-harfbuzz
%description
The FreeType engine is a free and portable font rendering
@ -85,8 +70,6 @@ small utilities showing various capabilities of the FreeType library.
Summary: FreeType development libraries and header files
Requires: %{name} = %{version}-%{release}
Requires: pkgconf%{?_isa}
#Conflicts: freetype-devel
%description devel
The freetype-devel package includes the static libraries and header files
@ -109,14 +92,11 @@ popd
%patch3 -p1 -b .libtool
%patch4 -p1 -b .multilib
%patch5 -p1 -b .internal-outline
%patch6 -p1 -b .debughook
%patch7 -p1 -b .png-memory-leak
%patch8 -p1 -b .covscan
%patch9 -p1 -b .avoid-invalid-face-index
%patch10 -p1 -b .properly-guard-face_index
%patch11 -p1 -b .guard-face-size
%patch6 -p1 -b .SAST-findings
%build
export PATH=%{_bindir}:$PATH
export LDFLAGS="-L%{_libdir} -Wl,-rpath=%{_libdir} ${LDFLAGS}"
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
@ -210,7 +190,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la}
%files
%{!?_licensedir:%global license %%doc}
%license docs/LICENSE.TXT docs/FTL.TXT docs/GPLv2.TXT
%license LICENSE.TXT docs/FTL.TXT docs/GPLv2.TXT
%{_libdir}/libfreetype.so.*
%doc README
@ -258,28 +238,70 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la}
%{_mandir}/man1/*
%changelog
* Tue May 31 2022 Marek Kasik <mkasik@redhat.com> - 2.10.4-9
- Guard face->size
- Resolves: #2079280
* Mon Sep 30 2024 Marek Kasik <mkasik@redhat.com> - 2.13.2-7
- Fix SAST Automation findings
- Resolves: RHEL-44737
* Mon May 30 2022 Marek Kasik <mkasik@redhat.com> - 2.10.4-8
- Properly guard "face_index"
- Resolves: #2079262
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 2.13.2-6
- Bump release for June 2024 mass rebuild
* Thu May 26 2022 Marek Kasik <mkasik@redhat.com> - 2.10.4-7
- Avoid invalid face index
- Resolves: #2079271
* Tue Feb 6 2024 Marek Kasik <mkasik@redhat.com> - 2.13.2-5
- Migrated to SPDX license
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.10.4-6
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Jan 30 2024 Marek Kasik <mkasik@redhat.com> - 2.13.2-4
- Remove a patch which causes FTBFS
- Resolves: #2261113
* Wed May 26 2021 Marek Kasik <mkasik@redhat.com> - 2.10.4-5
- Backport fixes for issues found by Coverity scan
- Resolves: #1964066
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.13.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 2.10.4-4
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.13.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Jan 16 2024 Marek Kasik <mkasik@redhat.com> - 2.13.2-1
- Update to 2.13.2
- Resolves: #2217137
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.13.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jun 27 2023 Marek Kasik <mkasik@redhat.com> - 2.13.1-1
- Update to 2.13.1
- Resolves: #2217137
* Sat Feb 25 2023 Marek Kasik <mkasik@redhat.com> - 2.13.0-1
- Update to 2.13.0
- Resolves: #2168496
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.12.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.12.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Jul 8 2022 Marek Kasik <mkasik@redhat.com> - 2.12.1-2
- Clear correct flags for doc ownership
- Resolves: #2104570
* Mon May 2 2022 Marek Kasik <mkasik@redhat.com> - 2.12.1-1
- Update to 2.12.1
- Resolves: #2080714
* Mon Apr 25 2022 Marek Kasik <mkasik@redhat.com> - 2.12.0-1
- Update to 2.12.0
- Resolves: #2070686
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.11.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sat Dec 4 2021 Diego Herrera <dherrera@redhat.com> - 2.11.1-1
- Update to 2.11.1
* Thu Jul 22 2021 Marek Kasik <mkasik@redhat.com> - 2.11.0-1
- Update to 2.11.0
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.10.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Feb 5 2021 Akira TAGOH <tagoh@redhat.com> - 2.10.4-3
- Enable HarfBuzz support

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,60 @@
%global realname fribidi
%global _prefix /opt/rx
Summary: Library implementing the Unicode Bidirectional Algorithm
Name: rx-fribidi
Version: 1.0.14
Release: 1%{?dist}
URL: https://github.com/fribidi/fribidi/
Source: https://github.com/%{realname}/%{realname}/releases/download/v%{version}/%{realname}-%{version}.tar.xz
License: LGPL-2.1-or-later AND Unicode-DFS-2016
BuildRequires: gcc
BuildRequires: meson
BuildRequires: make
Patch0: fribidi-drop-bundled-gnulib.patch
%description
A library to handle bidirectional scripts (for example Hebrew, Arabic),
so that the display is done in the proper way; while the text data itself
is always written in logical order.
%package devel
Summary: Libraries and include files for FriBidi
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Include files and libraries needed for developing applications which use
FriBidi.
%prep
%autosetup -p1 -n %{realname}-%{version}
%build
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
export LDFLAGS="-L%{_libdir} -Wl,-rpath=%{_libdir} $LDFLAGS"
%meson -Ddocs=false
%meson_build
%check
%meson_test
%install
%meson_install
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%ldconfig_scriptlets
%files
%doc README AUTHORS ChangeLog THANKS NEWS TODO
%license COPYING
%{_bindir}/fribidi
%{_libdir}/libfribidi.so.0*
%files devel
%{_includedir}/fribidi
%{_libdir}/libfribidi.so
%{_libdir}/pkgconfig/*.pc
#%%{_mandir}/man3/*.gz

222
base/rx/rx-glib2/1965.patch Normal file
View File

@ -0,0 +1,222 @@
From 1248b642ad32b0bdf296211c1a0a8817bebf1c66 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Thu, 25 Feb 2021 10:35:36 +0000
Subject: [PATCH 1/2] gversionmacros: Add version macros for GLib 2.70
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
docs/reference/gio/gio-docs.xml | 4 +++
docs/reference/glib/glib-docs.xml | 4 +++
docs/reference/glib/glib-sections.txt | 14 ++++++++
docs/reference/gobject/gobject-docs.xml | 4 +++
docs/reference/meson.build | 2 +-
glib/gversionmacros.h | 44 +++++++++++++++++++++++++
6 files changed, 71 insertions(+), 1 deletion(-)
diff --git a/docs/reference/gio/gio-docs.xml b/docs/reference/gio/gio-docs.xml
index 9cd3d0e39..a09d6d31d 100644
--- a/docs/reference/gio/gio-docs.xml
+++ b/docs/reference/gio/gio-docs.xml
@@ -389,6 +389,10 @@
<title>Index of new symbols in 2.68</title>
<xi:include href="xml/api-index-2.68.xml"><xi:fallback /></xi:include>
</index>
+ <index id="api-index-2-70" role="2.70">
+ <title>Index of new symbols in 2.70</title>
+ <xi:include href="xml/api-index-2.70.xml"><xi:fallback /></xi:include>
+ </index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
diff --git a/docs/reference/glib/glib-docs.xml b/docs/reference/glib/glib-docs.xml
index e464fb792..2f5de9e31 100644
--- a/docs/reference/glib/glib-docs.xml
+++ b/docs/reference/glib/glib-docs.xml
@@ -288,6 +288,10 @@
<title>Index of new symbols in 2.68</title>
<xi:include href="xml/api-index-2.68.xml"><xi:fallback /></xi:include>
</index>
+ <index id="api-index-2-70" role="2.70">
+ <title>Index of new symbols in 2.70</title>
+ <xi:include href="xml/api-index-2.70.xml"><xi:fallback /></xi:include>
+ </index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt
index 460a299bf..75994e889 100644
--- a/docs/reference/glib/glib-sections.txt
+++ b/docs/reference/glib/glib-sections.txt
@@ -138,6 +138,7 @@ GLIB_VERSION_2_62
GLIB_VERSION_2_64
GLIB_VERSION_2_66
GLIB_VERSION_2_68
+GLIB_VERSION_2_70
GLIB_VERSION_CUR_STABLE
GLIB_VERSION_PREV_STABLE
GLIB_VERSION_MIN_REQUIRED
@@ -168,6 +169,7 @@ GLIB_AVAILABLE_ENUMERATOR_IN_2_62
GLIB_AVAILABLE_ENUMERATOR_IN_2_64
GLIB_AVAILABLE_ENUMERATOR_IN_2_66
GLIB_AVAILABLE_ENUMERATOR_IN_2_68
+GLIB_AVAILABLE_ENUMERATOR_IN_2_70
GLIB_AVAILABLE_IN_ALL
GLIB_AVAILABLE_IN_2_26
GLIB_AVAILABLE_IN_2_28
@@ -191,6 +193,7 @@ GLIB_AVAILABLE_IN_2_62
GLIB_AVAILABLE_IN_2_64
GLIB_AVAILABLE_IN_2_66
GLIB_AVAILABLE_IN_2_68
+GLIB_AVAILABLE_IN_2_70
GLIB_AVAILABLE_MACRO_IN_2_26
GLIB_AVAILABLE_MACRO_IN_2_28
GLIB_AVAILABLE_MACRO_IN_2_30
@@ -213,12 +216,14 @@ GLIB_AVAILABLE_MACRO_IN_2_62
GLIB_AVAILABLE_MACRO_IN_2_64
GLIB_AVAILABLE_MACRO_IN_2_66
GLIB_AVAILABLE_MACRO_IN_2_68
+GLIB_AVAILABLE_MACRO_IN_2_70
GLIB_AVAILABLE_STATIC_INLINE_IN_2_44
GLIB_AVAILABLE_STATIC_INLINE_IN_2_60
GLIB_AVAILABLE_STATIC_INLINE_IN_2_62
GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
GLIB_AVAILABLE_STATIC_INLINE_IN_2_66
GLIB_AVAILABLE_STATIC_INLINE_IN_2_68
+GLIB_AVAILABLE_STATIC_INLINE_IN_2_70
GLIB_AVAILABLE_TYPE_IN_2_26
GLIB_AVAILABLE_TYPE_IN_2_28
GLIB_AVAILABLE_TYPE_IN_2_30
@@ -241,6 +246,7 @@ GLIB_AVAILABLE_TYPE_IN_2_62
GLIB_AVAILABLE_TYPE_IN_2_64
GLIB_AVAILABLE_TYPE_IN_2_66
GLIB_AVAILABLE_TYPE_IN_2_68
+GLIB_AVAILABLE_TYPE_IN_2_70
GLIB_DEPRECATED_ENUMERATOR
GLIB_DEPRECATED_ENUMERATOR_FOR
GLIB_DEPRECATED_ENUMERATOR_IN_2_26
@@ -287,6 +293,8 @@ GLIB_DEPRECATED_ENUMERATOR_IN_2_66
GLIB_DEPRECATED_ENUMERATOR_IN_2_66_FOR
GLIB_DEPRECATED_ENUMERATOR_IN_2_68
GLIB_DEPRECATED_ENUMERATOR_IN_2_68_FOR
+GLIB_DEPRECATED_ENUMERATOR_IN_2_70
+GLIB_DEPRECATED_ENUMERATOR_IN_2_70_FOR
GLIB_DEPRECATED_IN_2_26
GLIB_DEPRECATED_IN_2_26_FOR
GLIB_DEPRECATED_IN_2_28
@@ -331,6 +339,8 @@ GLIB_DEPRECATED_IN_2_66
GLIB_DEPRECATED_IN_2_66_FOR
GLIB_DEPRECATED_IN_2_68
GLIB_DEPRECATED_IN_2_68_FOR
+GLIB_DEPRECATED_IN_2_70
+GLIB_DEPRECATED_IN_2_70_FOR
GLIB_DEPRECATED_MACRO
GLIB_DEPRECATED_MACRO_FOR
GLIB_DEPRECATED_MACRO_IN_2_26
@@ -377,6 +387,8 @@ GLIB_DEPRECATED_MACRO_IN_2_66
GLIB_DEPRECATED_MACRO_IN_2_66_FOR
GLIB_DEPRECATED_MACRO_IN_2_68
GLIB_DEPRECATED_MACRO_IN_2_68_FOR
+GLIB_DEPRECATED_MACRO_IN_2_70
+GLIB_DEPRECATED_MACRO_IN_2_70_FOR
GLIB_DEPRECATED_TYPE
GLIB_DEPRECATED_TYPE_FOR
GLIB_DEPRECATED_TYPE_IN_2_26
@@ -423,6 +435,8 @@ GLIB_DEPRECATED_TYPE_IN_2_66
GLIB_DEPRECATED_TYPE_IN_2_66_FOR
GLIB_DEPRECATED_TYPE_IN_2_68
GLIB_DEPRECATED_TYPE_IN_2_68_FOR
+GLIB_DEPRECATED_TYPE_IN_2_70
+GLIB_DEPRECATED_TYPE_IN_2_70_FOR
GLIB_VERSION_CUR_STABLE
GLIB_VERSION_PREV_STABLE
</SECTION>
diff --git a/docs/reference/gobject/gobject-docs.xml b/docs/reference/gobject/gobject-docs.xml
index ddbc9f274..e8e7c76d9 100644
--- a/docs/reference/gobject/gobject-docs.xml
+++ b/docs/reference/gobject/gobject-docs.xml
@@ -208,6 +208,10 @@
<title>Index of new symbols in 2.68</title>
<xi:include href="xml/api-index-2.68.xml"><xi:fallback /></xi:include>
</index>
+ <index id="api-index-2-70" role="2.70">
+ <title>Index of new symbols in 2.70</title>
+ <xi:include href="xml/api-index-2.70.xml"><xi:fallback /></xi:include>
+ </index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 3f09be555..53ca12ff8 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -7,7 +7,7 @@
stable_2_series_versions = [
'26', '28', '30', '32', '34', '36', '38',
'40', '42', '44', '46', '48', '50', '52', '54', '56', '58',
- '60', '62', '64', '66', '68',
+ '60', '62', '64', '66', '68', '70',
]
ignore_decorators = [
diff --git a/glib/gversionmacros.h b/glib/gversionmacros.h
index 77486eafb..d052709cf 100644
--- a/glib/gversionmacros.h
+++ b/glib/gversionmacros.h
@@ -255,6 +255,16 @@
*/
#define GLIB_VERSION_2_68 (G_ENCODE_VERSION (2, 68))
+/**
+ * GLIB_VERSION_2_70:
+ *
+ * A macro that evaluates to the 2.70 version of GLib, in a format
+ * that can be used by the C pre-processor.
+ *
+ * Since: 2.70
+ */
+#define GLIB_VERSION_2_70 (G_ENCODE_VERSION (2, 70))
+
/**
* GLIB_VERSION_CUR_STABLE:
*
@@ -1076,4 +1086,38 @@
# define GLIB_AVAILABLE_TYPE_IN_2_68
#endif
+#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_70
+# define GLIB_DEPRECATED_IN_2_70 GLIB_DEPRECATED
+# define GLIB_DEPRECATED_IN_2_70_FOR(f) GLIB_DEPRECATED_FOR(f)
+# define GLIB_DEPRECATED_MACRO_IN_2_70 GLIB_DEPRECATED_MACRO
+# define GLIB_DEPRECATED_MACRO_IN_2_70_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_70 GLIB_DEPRECATED_ENUMERATOR
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_70_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_70 GLIB_DEPRECATED_TYPE
+# define GLIB_DEPRECATED_TYPE_IN_2_70_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
+#else
+# define GLIB_DEPRECATED_IN_2_70 _GLIB_EXTERN
+# define GLIB_DEPRECATED_IN_2_70_FOR(f) _GLIB_EXTERN
+# define GLIB_DEPRECATED_MACRO_IN_2_70
+# define GLIB_DEPRECATED_MACRO_IN_2_70_FOR(f)
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_70
+# define GLIB_DEPRECATED_ENUMERATOR_IN_2_70_FOR(f)
+# define GLIB_DEPRECATED_TYPE_IN_2_70
+# define GLIB_DEPRECATED_TYPE_IN_2_70_FOR(f)
+#endif
+
+#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_70
+# define GLIB_AVAILABLE_IN_2_70 GLIB_UNAVAILABLE(2, 70)
+# define GLIB_AVAILABLE_STATIC_INLINE_IN_2_70 GLIB_UNAVAILABLE_STATIC_INLINE(2, 70)
+# define GLIB_AVAILABLE_MACRO_IN_2_70 GLIB_UNAVAILABLE_MACRO(2, 70)
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_70 GLIB_UNAVAILABLE_ENUMERATOR(2, 70)
+# define GLIB_AVAILABLE_TYPE_IN_2_70 GLIB_UNAVAILABLE_TYPE(2, 70)
+#else
+# define GLIB_AVAILABLE_IN_2_70 _GLIB_EXTERN
+# define GLIB_AVAILABLE_STATIC_INLINE_IN_2_70
+# define GLIB_AVAILABLE_MACRO_IN_2_70
+# define GLIB_AVAILABLE_ENUMERATOR_IN_2_70
+# define GLIB_AVAILABLE_TYPE_IN_2_70
+#endif
+
#endif /* __G_VERSION_MACROS_H__ */
--
GitLab

1052
base/rx/rx-glib2/1968.patch Normal file

File diff suppressed because it is too large Load Diff

920
base/rx/rx-glib2/2194.patch Normal file
View File

@ -0,0 +1,920 @@
From 2e500304e304e45042a59855319ff0379b1978b3 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 27 Jul 2021 17:24:17 +0200
Subject: [PATCH 1/4] tests: Remove unused constant in GMemoryMonitor test
---
gio/tests/memory-monitor-dbus.py.in | 3 ---
1 file changed, 3 deletions(-)
diff --git a/gio/tests/memory-monitor-dbus.py.in b/gio/tests/memory-monitor-dbus.py.in
index cd16cf4e3..7823e7309 100755
--- a/gio/tests/memory-monitor-dbus.py.in
+++ b/gio/tests/memory-monitor-dbus.py.in
@@ -31,9 +31,6 @@ try:
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
- # XDG_DESKTOP_PORTAL_PATH = os.path.expanduser("~/.cache/jhbuild/build/xdg-desktop-portal/xdg-desktop-portal")
- XDG_DESKTOP_PORTAL_PATH = "@libexecdir@/xdg-desktop-portal"
-
class TestLowMemoryMonitor(dbusmock.DBusTestCase):
'''Test GMemoryMonitorDBus'''
--
GitLab
From a7000cd989438b01e599b2cfa8b6d5a360bfd102 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 28 Jul 2021 15:10:16 +0200
Subject: [PATCH 2/4] gio: g_clear_signal_handler() can handle NULL args
---
gio/gmemorymonitordbus.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/gio/gmemorymonitordbus.c b/gio/gmemorymonitordbus.c
index a34a58d3b..08dc53df1 100644
--- a/gio/gmemorymonitordbus.c
+++ b/gio/gmemorymonitordbus.c
@@ -115,8 +115,7 @@ lmm_vanished_cb (GDBusConnection *connection,
{
GMemoryMonitorDBus *dbus = user_data;
- if (dbus->proxy != NULL)
- g_clear_signal_handler (&dbus->signal_id, dbus->proxy);
+ g_clear_signal_handler (&dbus->signal_id, dbus->proxy);
g_clear_object (&dbus->proxy);
}
@@ -143,8 +142,7 @@ g_memory_monitor_dbus_finalize (GObject *object)
{
GMemoryMonitorDBus *dbus = G_MEMORY_MONITOR_DBUS (object);
- if (dbus->proxy != NULL)
- g_clear_signal_handler (&dbus->signal_id, dbus->proxy);
+ g_clear_signal_handler (&dbus->signal_id, dbus->proxy);
g_clear_object (&dbus->proxy);
g_clear_handle_id (&dbus->watch_id, g_bus_unwatch_name);
--
GitLab
From 92399e7114e590f0371b1a5d71f478f840cb4074 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 28 Jul 2021 15:30:15 +0200
Subject: [PATCH 3/4] gio: Do not block when low-memory-monitor daemon appears
---
gio/gmemorymonitordbus.c | 42 +++++++++++++++++++++++++++-------------
1 file changed, 29 insertions(+), 13 deletions(-)
diff --git a/gio/gmemorymonitordbus.c b/gio/gmemorymonitordbus.c
index 08dc53df1..739b83214 100644
--- a/gio/gmemorymonitordbus.c
+++ b/gio/gmemorymonitordbus.c
@@ -25,6 +25,7 @@
#include "giomodule-priv.h"
#include "glibintl.h"
#include "glib/gstdio.h"
+#include "gcancellable.h"
#include "gdbusproxy.h"
#include "gdbusnamewatching.h"
@@ -38,6 +39,7 @@ struct _GMemoryMonitorDBus
GObject parent_instance;
guint watch_id;
+ GCancellable *cancellable;
GDBusProxy *proxy;
gulong signal_id;
};
@@ -77,24 +79,15 @@ proxy_signal_cb (GDBusProxy *proxy,
}
static void
-lmm_appeared_cb (GDBusConnection *connection,
- const gchar *name,
- const gchar *name_owner,
- gpointer user_data)
+lmm_proxy_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
GMemoryMonitorDBus *dbus = user_data;
GDBusProxy *proxy;
GError *error = NULL;
- proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
- G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
- NULL,
- "org.freedesktop.LowMemoryMonitor",
- "/org/freedesktop/LowMemoryMonitor",
- "org.freedesktop.LowMemoryMonitor",
- NULL,
- &error);
-
+ proxy = g_dbus_proxy_new_finish (res, &error);
if (!proxy)
{
g_debug ("Failed to create LowMemoryMonitor D-Bus proxy: %s",
@@ -106,6 +99,26 @@ lmm_appeared_cb (GDBusConnection *connection,
dbus->signal_id = g_signal_connect (G_OBJECT (proxy), "g-signal",
G_CALLBACK (proxy_signal_cb), dbus);
dbus->proxy = proxy;
+
+}
+
+static void
+lmm_appeared_cb (GDBusConnection *connection,
+ const gchar *name,
+ const gchar *name_owner,
+ gpointer user_data)
+{
+ GMemoryMonitorDBus *dbus = user_data;
+
+ g_dbus_proxy_new (connection,
+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
+ NULL,
+ "org.freedesktop.LowMemoryMonitor",
+ "/org/freedesktop/LowMemoryMonitor",
+ "org.freedesktop.LowMemoryMonitor",
+ dbus->cancellable,
+ lmm_proxy_cb,
+ dbus);
}
static void
@@ -126,6 +139,7 @@ g_memory_monitor_dbus_initable_init (GInitable *initable,
{
GMemoryMonitorDBus *dbus = G_MEMORY_MONITOR_DBUS (initable);
+ dbus->cancellable = g_cancellable_new ();
dbus->watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
"org.freedesktop.LowMemoryMonitor",
G_BUS_NAME_WATCHER_FLAGS_AUTO_START,
@@ -142,6 +156,8 @@ g_memory_monitor_dbus_finalize (GObject *object)
{
GMemoryMonitorDBus *dbus = G_MEMORY_MONITOR_DBUS (object);
+ g_cancellable_cancel (dbus->cancellable);
+ g_clear_object (&dbus->cancellable);
g_clear_signal_handler (&dbus->signal_id, dbus->proxy);
g_clear_object (&dbus->proxy);
g_clear_handle_id (&dbus->watch_id, g_bus_unwatch_name);
--
GitLab
From 889bdb994fed44344a84ad01aa5633a1b1b62b19 Mon Sep 17 00:00:00 2001
From: Patrick Griffis <pgriffis@igalia.com>
Date: Tue, 20 Jul 2021 16:04:31 -0500
Subject: [PATCH 4/4] Add GPowerProfileMonitor
---
docs/reference/gio/gio-docs.xml | 1 +
docs/reference/gio/gio-sections-common.txt | 18 ++
docs/reference/gio/meson.build | 1 +
gio/gio.h | 1 +
gio/giomodule.c | 7 +
gio/gpowerprofilemonitor.c | 141 ++++++++++++
gio/gpowerprofilemonitor.h | 63 ++++++
gio/gpowerprofilemonitordbus.c | 240 +++++++++++++++++++++
gio/gpowerprofilemonitordbus.h | 32 +++
gio/meson.build | 3 +
gio/tests/meson.build | 1 +
gio/tests/power-profile-monitor.c | 79 +++++++
12 files changed, 587 insertions(+)
create mode 100644 gio/gpowerprofilemonitor.c
create mode 100644 gio/gpowerprofilemonitor.h
create mode 100644 gio/gpowerprofilemonitordbus.c
create mode 100644 gio/gpowerprofilemonitordbus.h
create mode 100644 gio/tests/power-profile-monitor.c
diff --git a/docs/reference/gio/gio-docs.xml b/docs/reference/gio/gio-docs.xml
index a09d6d31d..b01133900 100644
--- a/docs/reference/gio/gio-docs.xml
+++ b/docs/reference/gio/gio-docs.xml
@@ -238,6 +238,7 @@
<xi:include href="xml/gmenuexporter.xml"/>
<xi:include href="xml/gdbusmenumodel.xml"/>
<xi:include href="xml/gnotification.xml"/>
+ <xi:include href="xml/gpowerprofilemonitor.xml"/>
</chapter>
<chapter id="extending">
<title>Extending GIO</title>
diff --git a/docs/reference/gio/gio-sections-common.txt b/docs/reference/gio/gio-sections-common.txt
index 250491a42..a7addedc2 100644
--- a/docs/reference/gio/gio-sections-common.txt
+++ b/docs/reference/gio/gio-sections-common.txt
@@ -4247,6 +4247,24 @@ G_NETWORK_MONITOR_GET_INTERFACE
g_network_connectivity_get_type
</SECTION>
+<SECTION>
+<FILE>gpowerprofilemonitor</FILE>
+<TITLE>GPowerProfileMonitor</TITLE>
+GPowerProfileMonitor
+GPowerProfileMonitorInterface
+G_POWER_PROFILE_MONITOR_EXTENSION_POINT_NAME
+g_power_profile_monitor_dup_default
+g_power_profile_monitor_get_power_saver_enabled
+<SUBSECTION Standard>
+g_power_profile_monitor_get_type
+G_TYPE_POWER_PROFILE_MONITOR
+G_POWER_PROFILE_MONITOR
+G_IS_POWER_PROFILE_MONITOR
+G_POWER_PROFILE_MONITOR_GET_INTERFACE
+G_TYPE_POWER_PROFILE_LEVEL
+g_power_profile_level_get_type
+</SECTION>
+
<SECTION>
<FILE>gmenuexporter</FILE>
g_dbus_connection_export_menu_model
diff --git a/docs/reference/gio/meson.build b/docs/reference/gio/meson.build
index 4d0364819..fbabd25ca 100644
--- a/docs/reference/gio/meson.build
+++ b/docs/reference/gio/meson.build
@@ -65,6 +65,7 @@ if get_option('gtk_doc')
'gopenuriportal.h',
'gpollfilemonitor.h',
'gportalsupport.h',
+ 'gpowerprofilemonitordbus.h',
'gproxyresolverportal.h',
'gregistrysettingsbackend.h',
'gresourcefile.h',
diff --git a/gio/gio.h b/gio/gio.h
index f5d2dd5a3..e9afab666 100644
--- a/gio/gio.h
+++ b/gio/gio.h
@@ -120,6 +120,7 @@
#include <gio/gpollableinputstream.h>
#include <gio/gpollableoutputstream.h>
#include <gio/gpollableutils.h>
+#include <gio/gpowerprofilemonitor.h>
#include <gio/gpropertyaction.h>
#include <gio/gproxy.h>
#include <gio/gproxyaddress.h>
diff --git a/gio/giomodule.c b/gio/giomodule.c
index c1d451b5c..dfd895717 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -48,6 +48,8 @@
#include "gmemorymonitor.h"
#include "gmemorymonitorportal.h"
#include "gmemorymonitordbus.h"
+#include "gpowerprofilemonitor.h"
+#include "gpowerprofilemonitordbus.h"
#ifdef G_OS_WIN32
#include "gregistrysettingsbackend.h"
#include "giowin32-priv.h"
@@ -1077,6 +1079,7 @@ extern GType _g_network_monitor_nm_get_type (void);
extern GType g_memory_monitor_dbus_get_type (void);
extern GType g_memory_monitor_portal_get_type (void);
+extern GType g_power_profile_monitor_dbus_get_type (void);
#ifdef G_OS_UNIX
extern GType g_fdo_notification_backend_get_type (void);
@@ -1187,6 +1190,9 @@ _g_io_modules_ensure_extension_points_registered (void)
ep = g_io_extension_point_register (G_MEMORY_MONITOR_EXTENSION_POINT_NAME);
g_io_extension_point_set_required_type (ep, G_TYPE_MEMORY_MONITOR);
+
+ ep = g_io_extension_point_register (G_POWER_PROFILE_MONITOR_EXTENSION_POINT_NAME);
+ g_io_extension_point_set_required_type (ep, G_TYPE_POWER_PROFILE_MONITOR);
}
G_UNLOCK (registered_extensions);
@@ -1272,6 +1278,7 @@ _g_io_modules_ensure_loaded (void)
g_type_ensure (g_null_settings_backend_get_type ());
g_type_ensure (g_memory_settings_backend_get_type ());
g_type_ensure (g_keyfile_settings_backend_get_type ());
+ g_type_ensure (g_power_profile_monitor_dbus_get_type ());
#if defined(HAVE_INOTIFY_INIT1)
g_type_ensure (g_inotify_file_monitor_get_type ());
#endif
diff --git a/gio/gpowerprofilemonitor.c b/gio/gpowerprofilemonitor.c
new file mode 100644
index 000000000..f5028b3e8
--- /dev/null
+++ b/gio/gpowerprofilemonitor.c
@@ -0,0 +1,141 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2019 Red Hat, Inc
+ * Copyright 2021 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+#include "glib.h"
+#include "glibintl.h"
+
+#include "gpowerprofilemonitor.h"
+#include "ginetaddress.h"
+#include "ginetsocketaddress.h"
+#include "ginitable.h"
+#include "gioenumtypes.h"
+#include "giomodule-priv.h"
+#include "gtask.h"
+
+/**
+ * SECTION:gpowerprofilemonitor
+ * @title: GPowerProfileMonitor
+ * @short_description: Power profile monitor
+ * @include: gio/gio.h
+ *
+ * #GPowerProfileMonitor makes it possible for applications as well as OS components
+ * to monitor system power profiles and act upon them. It currently only exports
+ * whether the system is in “Power Saver” mode (known as “Low Power” mode on
+ * some systems).
+ *
+ * When in “Low Power” mode, it is recommended that applications:
+ * - disabling automatic downloads
+ * - reduce the rate of refresh from online sources such as calendar or
+ * email synchronisation
+ * - if the application has expensive visual effects, reduce them
+ *
+ * It is also likely that OS components providing services to applications will
+ * lower their own background activity, for the sake of the system.
+ *
+ * There are a variety of tools that exist for power consumption analysis, but those
+ * usually depend on the OS and hardware used. On Linux, one could use `upower` to
+ * monitor the battery discharge rate, `powertop` to check on the background activity
+ * or activity at all), `sysprof` to inspect CPU usage, and `intel_gpu_time` to
+ * profile GPU usage.
+ *
+ * Don't forget to disconnect the #GPowerProfileMonitor::notify::power-saver-enabled
+ * signal, and unref the #GPowerProfileMonitor itself when exiting.
+ *
+ * Since: 2.70
+ */
+
+/**
+ * GPowerProfileMonitor:
+ *
+ * #GPowerProfileMonitor monitors system power profile and notifies on
+ * changes.
+ *
+ * Since: 2.70
+ */
+
+/**
+ * GPowerProfileMonitorInterface:
+ * @g_iface: The parent interface.
+ *
+ * The virtual function table for #GPowerProfileMonitor.
+ *
+ * Since: 2.70
+ */
+
+G_DEFINE_INTERFACE_WITH_CODE (GPowerProfileMonitor, g_power_profile_monitor, G_TYPE_OBJECT,
+ g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_INITABLE))
+
+
+/**
+ * g_power_profile_monitor_dup_default:
+ *
+ * Gets a reference to the default #GPowerProfileMonitor for the system.
+ *
+ * Returns: (not nullable) (transfer full): a new reference to the default #GPowerProfileMonitor
+ *
+ * Since: 2.70
+ */
+GPowerProfileMonitor *
+g_power_profile_monitor_dup_default (void)
+{
+ return g_object_ref (_g_io_module_get_default (G_POWER_PROFILE_MONITOR_EXTENSION_POINT_NAME,
+ "GIO_USE_POWER_PROFILE_MONITOR",
+ NULL));
+}
+
+/**
+ * g_power_profile_monitor_get_power_saver_enabled:
+ * @monitor: a #GPowerProfileMonitor
+ *
+ * Gets whether the system is in “Power Saver” mode.
+ *
+ * You are expected to listen to the
+ * #GPowerProfileMonitor::notify::power-saver-enabled signal to know when the profile has
+ * changed.
+ *
+ * Returns: Whether the system is in “Power Saver” mode.
+ *
+ * Since: 2.70
+ */
+gboolean
+g_power_profile_monitor_get_power_saver_enabled (GPowerProfileMonitor *monitor)
+{
+ gboolean enabled;
+ g_object_get (monitor, "power-saver-enabled", &enabled, NULL);
+ return enabled;
+}
+
+static void
+g_power_profile_monitor_default_init (GPowerProfileMonitorInterface *iface)
+{
+ /**
+ * GPowerProfileMonitor:power-saver-enabled:
+ *
+ * Whether “Power Saver” mode is enabled on the system.
+ *
+ * Since: 2.70
+ */
+ g_object_interface_install_property (iface,
+ g_param_spec_boolean ("power-saver-enabled",
+ "power-saver-enabled",
+ "Power Saver Enabled",
+ FALSE,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
+}
diff --git a/gio/gpowerprofilemonitor.h b/gio/gpowerprofilemonitor.h
new file mode 100644
index 000000000..0891fc3dc
--- /dev/null
+++ b/gio/gpowerprofilemonitor.h
@@ -0,0 +1,63 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2019 Red Hat, Inc.
+ * Copyright 2021 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_POWER_PROFILE_MONITOR_H__
+#define __G_POWER_PROFILE_MONITOR_H__
+
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
+#include <gio/giotypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * G_POWER_PROFILE_MONITOR_EXTENSION_POINT_NAME:
+ *
+ * Extension point for power profile usage monitoring functionality.
+ * See [Extending GIO][extending-gio].
+ *
+ * Since: 2.70
+ */
+#define G_POWER_PROFILE_MONITOR_EXTENSION_POINT_NAME "gio-power-profile-monitor"
+
+#define G_TYPE_POWER_PROFILE_MONITOR (g_power_profile_monitor_get_type ())
+GLIB_AVAILABLE_IN_2_70
+G_DECLARE_INTERFACE (GPowerProfileMonitor, g_power_profile_monitor, g, power_profile_monitor, GObject)
+
+#define G_POWER_PROFILE_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_POWER_PROFILE_MONITOR, GPowerProfileMonitor))
+#define G_IS_POWER_PROFILE_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_POWER_PROFILE_MONITOR))
+#define G_POWER_PROFILE_MONITOR_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), G_TYPE_POWER_PROFILE_MONITOR, GPowerProfileMonitorInterface))
+
+struct _GPowerProfileMonitorInterface
+{
+ /*< private >*/
+ GTypeInterface g_iface;
+};
+
+GLIB_AVAILABLE_IN_2_70
+GPowerProfileMonitor *g_power_profile_monitor_dup_default (void);
+
+GLIB_AVAILABLE_IN_2_70
+gboolean g_power_profile_monitor_get_power_saver_enabled (GPowerProfileMonitor *monitor);
+
+G_END_DECLS
+
+#endif /* __G_POWER_PROFILE_MONITOR_H__ */
diff --git a/gio/gpowerprofilemonitordbus.c b/gio/gpowerprofilemonitordbus.c
new file mode 100644
index 000000000..8bbfe3acc
--- /dev/null
+++ b/gio/gpowerprofilemonitordbus.c
@@ -0,0 +1,240 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2019 Red Hat, Inc.
+ * Copyrgith 2021 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "gpowerprofilemonitor.h"
+#include "gpowerprofilemonitordbus.h"
+#include "gioerror.h"
+#include "ginitable.h"
+#include "giomodule-priv.h"
+#include "glibintl.h"
+#include "glib/gstdio.h"
+#include "gcancellable.h"
+#include "gdbusproxy.h"
+#include "gdbusnamewatching.h"
+
+#define G_POWER_PROFILE_MONITOR_DBUS_GET_INITABLE_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), G_TYPE_INITABLE, GInitable))
+
+static void g_power_profile_monitor_dbus_iface_init (GPowerProfileMonitorInterface *iface);
+static void g_power_profile_monitor_dbus_initable_iface_init (GInitableIface *iface);
+
+struct _GPowerProfileMonitorDBus
+{
+ GObject parent_instance;
+
+ guint watch_id;
+ GCancellable *cancellable;
+ GDBusProxy *proxy;
+ gulong signal_id;
+
+ gboolean power_saver_enabled;
+};
+
+typedef enum
+{
+ PROP_POWER_SAVER_ENABLED = 1,
+} GPowerProfileMonitorDBusProperty;
+
+#define POWERPROFILES_DBUS_NAME "net.hadess.PowerProfiles"
+#define POWERPROFILES_DBUS_IFACE "net.hadess.PowerProfiles"
+#define POWERPROFILES_DBUS_PATH "/net/hadess/PowerProfiles"
+
+G_DEFINE_TYPE_WITH_CODE (GPowerProfileMonitorDBus, g_power_profile_monitor_dbus, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
+ g_power_profile_monitor_dbus_initable_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_POWER_PROFILE_MONITOR,
+ g_power_profile_monitor_dbus_iface_init)
+ _g_io_modules_ensure_extension_points_registered ();
+ g_io_extension_point_implement (G_POWER_PROFILE_MONITOR_EXTENSION_POINT_NAME,
+ g_define_type_id,
+ "dbus",
+ 30))
+
+static void
+g_power_profile_monitor_dbus_init (GPowerProfileMonitorDBus *dbus)
+{
+ dbus->power_saver_enabled = FALSE;
+}
+
+static void
+ppd_properties_changed_cb (GDBusProxy *proxy,
+ GVariant *changed_properties,
+ GStrv *invalidated_properties,
+ gpointer user_data)
+{
+ GPowerProfileMonitorDBus *dbus = user_data;
+ const char *active_profile;
+ gboolean enabled;
+
+ if (!g_variant_lookup (changed_properties, "ActiveProfile", "&s", &active_profile))
+ return;
+
+ enabled = g_strcmp0 (active_profile, "power-saver") == 0;
+ if (enabled == dbus->power_saver_enabled)
+ return;
+
+ dbus->power_saver_enabled = enabled;
+ g_object_notify (G_OBJECT (dbus), "power-saver-enabled");
+}
+
+static void
+ppd_proxy_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ GPowerProfileMonitorDBus *dbus = user_data;
+ GVariant *active_profile_variant;
+ GDBusProxy *proxy;
+ GError *error = NULL;
+ const char *active_profile;
+ gboolean power_saver_enabled;
+
+ proxy = g_dbus_proxy_new_finish (res, &error);
+ if (!proxy)
+ {
+ g_debug ("GPowerProfileMonitorDBus: Failed to create PowerProfiles D-Bus proxy: %s",
+ error->message);
+ g_error_free (error);
+ return;
+ }
+
+ active_profile_variant = g_dbus_proxy_get_cached_property (proxy, "ActiveProfile");
+ if (g_variant_is_of_type (active_profile_variant, G_VARIANT_TYPE_STRING))
+ {
+ active_profile = g_variant_get_string (active_profile_variant, NULL);
+ power_saver_enabled = g_strcmp0 (active_profile, "power-saver") == 0;
+ if (power_saver_enabled != dbus->power_saver_enabled)
+ {
+ dbus->power_saver_enabled = power_saver_enabled;
+ g_object_notify (G_OBJECT (dbus), "power-saver-enabled");
+ }
+ }
+
+ dbus->signal_id = g_signal_connect (G_OBJECT (proxy), "g-properties-changed",
+ G_CALLBACK (ppd_properties_changed_cb), dbus);
+ dbus->proxy = g_steal_pointer (&proxy);
+}
+
+static void
+ppd_appeared_cb (GDBusConnection *connection,
+ const gchar *name,
+ const gchar *name_owner,
+ gpointer user_data)
+{
+ GPowerProfileMonitorDBus *dbus = user_data;
+
+ g_dbus_proxy_new (connection,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ POWERPROFILES_DBUS_NAME,
+ POWERPROFILES_DBUS_PATH,
+ POWERPROFILES_DBUS_IFACE,
+ dbus->cancellable,
+ ppd_proxy_cb,
+ dbus);
+}
+
+static void
+ppd_vanished_cb (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ GPowerProfileMonitorDBus *dbus = user_data;
+
+ g_clear_signal_handler (&dbus->signal_id, dbus->proxy);
+ g_clear_object (&dbus->proxy);
+
+ dbus->power_saver_enabled = FALSE;
+ g_object_notify (G_OBJECT (dbus), "power-saver-enabled");
+}
+
+static void
+g_power_profile_monitor_dbus_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GPowerProfileMonitorDBus *dbus = G_POWER_PROFILE_MONITOR_DBUS (object);
+
+ switch ((GPowerProfileMonitorDBusProperty) prop_id)
+ {
+ case PROP_POWER_SAVER_ENABLED:
+ g_value_set_boolean (value, dbus->power_saver_enabled);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static gboolean
+g_power_profile_monitor_dbus_initable_init (GInitable *initable,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GPowerProfileMonitorDBus *dbus = G_POWER_PROFILE_MONITOR_DBUS (initable);
+
+ dbus->cancellable = g_cancellable_new ();
+ dbus->watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
+ POWERPROFILES_DBUS_NAME,
+ G_BUS_NAME_WATCHER_FLAGS_AUTO_START,
+ ppd_appeared_cb,
+ ppd_vanished_cb,
+ dbus,
+ NULL);
+
+ return TRUE;
+}
+
+static void
+g_power_profile_monitor_dbus_finalize (GObject *object)
+{
+ GPowerProfileMonitorDBus *dbus = G_POWER_PROFILE_MONITOR_DBUS (object);
+
+ g_cancellable_cancel (dbus->cancellable);
+ g_clear_object (&dbus->cancellable);
+ g_clear_signal_handler (&dbus->signal_id, dbus->proxy);
+ g_clear_object (&dbus->proxy);
+ g_clear_handle_id (&dbus->watch_id, g_bus_unwatch_name);
+
+ G_OBJECT_CLASS (g_power_profile_monitor_dbus_parent_class)->finalize (object);
+}
+
+static void
+g_power_profile_monitor_dbus_class_init (GPowerProfileMonitorDBusClass *nl_class)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (nl_class);
+
+ gobject_class->get_property = g_power_profile_monitor_dbus_get_property;
+ gobject_class->finalize = g_power_profile_monitor_dbus_finalize;
+
+ g_object_class_override_property (gobject_class, PROP_POWER_SAVER_ENABLED, "power-saver-enabled");
+}
+
+static void
+g_power_profile_monitor_dbus_iface_init (GPowerProfileMonitorInterface *monitor_iface)
+{
+}
+
+static void
+g_power_profile_monitor_dbus_initable_iface_init (GInitableIface *iface)
+{
+ iface->init = g_power_profile_monitor_dbus_initable_init;
+}
diff --git a/gio/gpowerprofilemonitordbus.h b/gio/gpowerprofilemonitordbus.h
new file mode 100644
index 000000000..ecf7246d1
--- /dev/null
+++ b/gio/gpowerprofilemonitordbus.h
@@ -0,0 +1,32 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2019 Red Hat, Inc.
+ * Copyright 2021 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_POWER_PROFILE_MONITOR_DBUS_H__
+#define __G_POWER_PROFILE_MONITOR_DBUS_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_POWER_PROFILE_MONITOR_DBUS (g_power_profile_monitor_dbus_get_type ())
+G_DECLARE_FINAL_TYPE (GPowerProfileMonitorDBus, g_power_profile_monitor_dbus, G, POWER_PROFILE_MONITOR_DBUS, GObject)
+
+G_END_DECLS
+
+#endif /* __G_POWER_PROFILE_MONITOR_DBUS_H__ */
diff --git a/gio/meson.build b/gio/meson.build
index 49a37a7bd..d5838ed8a 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -533,6 +533,8 @@ gio_sources = files(
'gpollableoutputstream.c',
'gpollableutils.c',
'gpollfilemonitor.c',
+ 'gpowerprofilemonitor.c',
+ 'gpowerprofilemonitordbus.c',
'gproxy.c',
'gproxyaddress.c',
'gproxyaddressenumerator.c',
@@ -673,6 +675,7 @@ gio_headers = files(
'gpollableinputstream.h',
'gpollableoutputstream.h',
'gpollableutils.h',
+ 'gpowerprofilemonitor.h',
'gproxy.h',
'gproxyaddress.h',
'gproxyaddressenumerator.h',
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index 98d1401d0..fc2055101 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -75,6 +75,7 @@ gio_tests = {
'network-monitor-race' : {},
'permission' : {},
'pollable' : {'dependencies' : [libdl_dep]},
+ 'power-profile-monitor' : {},
'proxy-test' : {},
'readwrite' : {},
'simple-async-result' : {},
diff --git a/gio/tests/power-profile-monitor.c b/gio/tests/power-profile-monitor.c
new file mode 100644
index 000000000..bb32f181f
--- /dev/null
+++ b/gio/tests/power-profile-monitor.c
@@ -0,0 +1,79 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2021 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gio/gio.h>
+
+static void
+test_dup_default (void)
+{
+ GPowerProfileMonitor *monitor;
+
+ monitor = g_power_profile_monitor_dup_default ();
+ g_assert_nonnull (monitor);
+ g_object_unref (monitor);
+}
+
+static void
+power_saver_enabled_cb (GPowerProfileMonitor *monitor,
+ GParamSpec *pspec,
+ gpointer user_data)
+{
+ gboolean enabled;
+
+ enabled = g_power_profile_monitor_get_power_saver_enabled (monitor);
+ g_debug ("Power Saver %s (%d)", enabled ? "enabled" : "disabled", enabled);
+}
+
+static void
+do_watch_power_profile (void)
+{
+ GPowerProfileMonitor *monitor;
+ GMainLoop *loop;
+ gulong signal_id;
+
+ monitor = g_power_profile_monitor_dup_default ();
+ signal_id = g_signal_connect (G_OBJECT (monitor), "notify::power-saver-enabled",
+ G_CALLBACK (power_saver_enabled_cb), NULL);
+
+ loop = g_main_loop_new (NULL, TRUE);
+ g_main_loop_run (loop);
+
+ g_signal_handler_disconnect (monitor, signal_id);
+ g_object_unref (monitor);
+ g_main_loop_unref (loop);
+}
+
+int
+main (int argc, char **argv)
+{
+ int ret;
+
+ if (argc == 2 && !strcmp (argv[1], "--watch"))
+ {
+ do_watch_power_profile ();
+ return 0;
+ }
+
+ g_test_init (&argc, &argv, NULL);
+
+ g_test_add_func ("/power-profile-monitor/default", test_dup_default);
+
+ ret = g_test_run ();
+
+ return ret;
+}
--
GitLab

739
base/rx/rx-glib2/2222.patch Normal file
View File

@ -0,0 +1,739 @@
From 9645cbffa8ba1a08b73fdae50b31125d11aa5684 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Mon, 9 Aug 2021 23:19:17 +0200
Subject: [PATCH 1/4] gio: Add portal version of GPowerProfileMonitor
---
docs/reference/gio/meson.build | 1 +
gio/giomodule.c | 2 +
gio/gpowerprofilemonitorportal.c | 182 +++++++++++++++++++++++++++++++
gio/gpowerprofilemonitorportal.h | 31 ++++++
gio/meson.build | 1 +
5 files changed, 217 insertions(+)
create mode 100644 gio/gpowerprofilemonitorportal.c
create mode 100644 gio/gpowerprofilemonitorportal.h
diff --git a/docs/reference/gio/meson.build b/docs/reference/gio/meson.build
index fbabd25ca..9aaafeed5 100644
--- a/docs/reference/gio/meson.build
+++ b/docs/reference/gio/meson.build
@@ -66,6 +66,7 @@ if get_option('gtk_doc')
'gpollfilemonitor.h',
'gportalsupport.h',
'gpowerprofilemonitordbus.h',
+ 'gpowerprofilemonitorportal.h',
'gproxyresolverportal.h',
'gregistrysettingsbackend.h',
'gresourcefile.h',
diff --git a/gio/giomodule.c b/gio/giomodule.c
index dfd895717..d34037a45 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -50,6 +50,7 @@
#include "gmemorymonitordbus.h"
#include "gpowerprofilemonitor.h"
#include "gpowerprofilemonitordbus.h"
+#include "gpowerprofilemonitorportal.h"
#ifdef G_OS_WIN32
#include "gregistrysettingsbackend.h"
#include "giowin32-priv.h"
@@ -1305,6 +1306,7 @@ _g_io_modules_ensure_loaded (void)
g_type_ensure (g_memory_monitor_dbus_get_type ());
g_type_ensure (g_memory_monitor_portal_get_type ());
g_type_ensure (g_network_monitor_portal_get_type ());
+ g_type_ensure (g_power_profile_monitor_portal_get_type ());
g_type_ensure (g_proxy_resolver_portal_get_type ());
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
diff --git a/gio/gpowerprofilemonitorportal.c b/gio/gpowerprofilemonitorportal.c
new file mode 100644
index 000000000..bb1b4fd15
--- /dev/null
+++ b/gio/gpowerprofilemonitorportal.c
@@ -0,0 +1,182 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2021 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "gpowerprofilemonitor.h"
+#include "gpowerprofilemonitorportal.h"
+#include "gdbuserror.h"
+#include "gdbusproxy.h"
+#include "ginitable.h"
+#include "gioerror.h"
+#include "giomodule-priv.h"
+#include "gportalsupport.h"
+
+#define G_POWER_PROFILE_MONITOR_PORTAL_GET_INITABLE_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), G_TYPE_INITABLE, GInitable))
+
+static void g_power_profile_monitor_portal_iface_init (GPowerProfileMonitorInterface *iface);
+static void g_power_profile_monitor_portal_initable_iface_init (GInitableIface *iface);
+
+typedef enum
+{
+ PROP_POWER_SAVER_ENABLED = 1,
+} GPowerProfileMonitorPortalProperty;
+
+struct _GPowerProfileMonitorPortal
+{
+ GObject parent_instance;
+
+ GDBusProxy *proxy;
+ gulong signal_id;
+ gboolean power_saver_enabled;
+};
+
+G_DEFINE_TYPE_WITH_CODE (GPowerProfileMonitorPortal, g_power_profile_monitor_portal, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
+ g_power_profile_monitor_portal_initable_iface_init)
+ G_IMPLEMENT_INTERFACE (G_TYPE_POWER_PROFILE_MONITOR,
+ g_power_profile_monitor_portal_iface_init)
+ _g_io_modules_ensure_extension_points_registered ();
+ g_io_extension_point_implement (G_POWER_PROFILE_MONITOR_EXTENSION_POINT_NAME,
+ g_define_type_id,
+ "portal",
+ 40))
+
+static void
+g_power_profile_monitor_portal_init (GPowerProfileMonitorPortal *portal)
+{
+}
+
+static void
+proxy_properties_changed (GDBusProxy *proxy,
+ GVariant *changed_properties,
+ GStrv invalidated_properties,
+ gpointer user_data)
+{
+ GPowerProfileMonitorPortal *ppm = user_data;
+ gboolean power_saver_enabled;
+
+ if (!g_variant_lookup (changed_properties, "power-saver-enabled", "b", &power_saver_enabled))
+ return;
+
+ if (power_saver_enabled == ppm->power_saver_enabled)
+ return;
+
+ ppm->power_saver_enabled = power_saver_enabled;
+ g_object_notify (G_OBJECT (ppm), "power-saver-enabled");
+}
+
+static void
+g_power_profile_monitor_portal_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GPowerProfileMonitorPortal *ppm = G_POWER_PROFILE_MONITOR_PORTAL (object);
+
+ switch ((GPowerProfileMonitorPortalProperty) prop_id)
+ {
+ case PROP_POWER_SAVER_ENABLED:
+ g_value_set_boolean (value, ppm->power_saver_enabled);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static gboolean
+g_power_profile_monitor_portal_initable_init (GInitable *initable,
+ GCancellable *cancellable,
+ GError **error)
+{
+ GPowerProfileMonitorPortal *ppm = G_POWER_PROFILE_MONITOR_PORTAL (initable);
+ GDBusProxy *proxy;
+ gchar *name_owner;
+
+ if (!glib_should_use_portal ())
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Not using portals");
+ return FALSE;
+ }
+
+ proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "org.freedesktop.portal.Desktop",
+ "/org/freedesktop/portal/desktop",
+ "org.freedesktop.portal.PowerProfileMonitor",
+ cancellable,
+ error);
+ if (!proxy)
+ return FALSE;
+
+ name_owner = g_dbus_proxy_get_name_owner (proxy);
+
+ if (name_owner == NULL)
+ {
+ g_object_unref (proxy);
+ g_set_error (error,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NAME_HAS_NO_OWNER,
+ "Desktop portal not found");
+ return FALSE;
+ }
+
+ g_free (name_owner);
+
+ ppm->signal_id = g_signal_connect (proxy, "g-properties-changed",
+ G_CALLBACK (proxy_properties_changed), ppm);
+
+ ppm->proxy = g_steal_pointer (&proxy);
+
+ return TRUE;
+}
+
+static void
+g_power_profile_monitor_portal_finalize (GObject *object)
+{
+ GPowerProfileMonitorPortal *ppm = G_POWER_PROFILE_MONITOR_PORTAL (object);
+
+ g_clear_signal_handler (&ppm->signal_id, ppm->proxy);
+ g_clear_object (&ppm->proxy);
+
+ G_OBJECT_CLASS (g_power_profile_monitor_portal_parent_class)->finalize (object);
+}
+
+static void
+g_power_profile_monitor_portal_class_init (GPowerProfileMonitorPortalClass *nl_class)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (nl_class);
+
+ gobject_class->get_property = g_power_profile_monitor_portal_get_property;
+ gobject_class->finalize = g_power_profile_monitor_portal_finalize;
+
+ g_object_class_override_property (gobject_class, PROP_POWER_SAVER_ENABLED, "power-saver-enabled");
+}
+
+static void
+g_power_profile_monitor_portal_iface_init (GPowerProfileMonitorInterface *monitor_iface)
+{
+}
+
+static void
+g_power_profile_monitor_portal_initable_iface_init (GInitableIface *iface)
+{
+ iface->init = g_power_profile_monitor_portal_initable_init;
+}
diff --git a/gio/gpowerprofilemonitorportal.h b/gio/gpowerprofilemonitorportal.h
new file mode 100644
index 000000000..b91a14610
--- /dev/null
+++ b/gio/gpowerprofilemonitorportal.h
@@ -0,0 +1,31 @@
+/* GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2021 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __G_POWER_PROFILE_MONITOR_PORTAL_H__
+#define __G_POWER_PROFILE_MONITOR_PORTAL_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define G_TYPE_POWER_PROFILE_MONITOR_PORTAL (g_power_profile_monitor_portal_get_type ())
+G_DECLARE_FINAL_TYPE (GPowerProfileMonitorPortal, g_power_profile_monitor_portal, G, POWER_PROFILE_MONITOR_PORTAL, GObject)
+
+G_END_DECLS
+
+#endif /* __G_POWER_PROFILE_MONITOR_PORTAL_H__ */
diff --git a/gio/meson.build b/gio/meson.build
index d5838ed8a..ac3373f2b 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -383,6 +383,7 @@ if host_system != 'windows'
'gopenuriportal.c',
'gmemorymonitorportal.c',
'gnetworkmonitorportal.c',
+ 'gpowerprofilemonitorportal.c',
'gproxyresolverportal.c',
'gtrashportal.c',
'gportalsupport.c',
--
GitLab
From 18eb29897d80bf662d58bd11a89617ddd7ebfeed Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 10 Aug 2021 10:58:53 +0200
Subject: [PATCH 2/4] gio: Add GPowerProfileMonitor tests
Tests both the portal and direct D-Bus variants.
---
gio/tests/meson.build | 14 ++-
gio/tests/power-profile-monitor-dbus.py.in | 107 ++++++++++++++++
gio/tests/power-profile-monitor-portal.py.in | 126 +++++++++++++++++++
3 files changed, 241 insertions(+), 6 deletions(-)
create mode 100755 gio/tests/power-profile-monitor-dbus.py.in
create mode 100755 gio/tests/power-profile-monitor-portal.py.in
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index fc2055101..5dbfb8e60 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -541,27 +541,29 @@ if installed_tests_enabled
install_subdir('static-link', install_dir : installed_tests_execdir)
install_data('static-link.py', install_dir : installed_tests_execdir)
- memory_monitor_tests = [
+ monitor_tests = [
'memory-monitor-dbus',
'memory-monitor-portal',
+ 'power-profile-monitor-dbus',
+ 'power-profile-monitor-portal'
]
- foreach memory_monitor_test : memory_monitor_tests
+ foreach monitor_test : monitor_tests
cdata = configuration_data()
cdata.set('installed_tests_dir', installed_tests_execdir)
- cdata.set('program', memory_monitor_test + '.py')
+ cdata.set('program', monitor_test + '.py')
cdata.set('env', '')
configure_file(
input: installed_tests_template_tap,
- output: memory_monitor_test + '.test',
+ output: monitor_test + '.test',
install_dir: installed_tests_metadir,
configuration: cdata
)
cdata = configuration_data()
cdata.set('libexecdir', join_paths(glib_prefix, get_option('libexecdir')))
configure_file(
- input: memory_monitor_test + '.py.in',
- output: memory_monitor_test + '.py',
+ input: monitor_test + '.py.in',
+ output: monitor_test + '.py',
install_dir : installed_tests_execdir,
configuration: cdata,
)
diff --git a/gio/tests/power-profile-monitor-dbus.py.in b/gio/tests/power-profile-monitor-dbus.py.in
new file mode 100755
index 000000000..06e594f4a
--- /dev/null
+++ b/gio/tests/power-profile-monitor-dbus.py.in
@@ -0,0 +1,107 @@
+#!/usr/bin/python3
+
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; either version 3 of the License, or (at your option) any
+# later version. See http://www.gnu.org/copyleft/lgpl.html for the full text
+# of the license.
+
+__author__ = 'Bastien Nocera'
+__email__ = 'hadess@hadess.net'
+__copyright__ = '(c) 2019, 2021 Red Hat Inc.'
+__license__ = 'LGPL 3+'
+
+import unittest
+import sys
+import subprocess
+import fcntl
+import os
+import time
+
+import taptestrunner
+
+try:
+ # Do all non-standard imports here so we can skip the tests if any
+ # needed packages are not available.
+ import dbus
+ import dbus.mainloop.glib
+ import dbusmock
+ from gi.repository import GLib
+ from gi.repository import Gio
+
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+ class TestPowerProfileMonitor(dbusmock.DBusTestCase):
+ '''Test GPowerProfileMonitorDBus'''
+
+ @classmethod
+ def setUpClass(klass):
+ klass.start_system_bus()
+ klass.dbus_con = klass.get_dbus(True)
+
+ def setUp(self):
+ try:
+ Gio.PowerProfileMonitor
+ except AttributeError:
+ raise unittest.SkipTest('Power Profile Monitor not in '
+ 'introspection data. Requires '
+ 'GObject-Introspection ≥ 1.63.2') # FIXME version
+ try:
+ (self.p_mock, self.obj_ppd) = self.spawn_server_template(
+ 'power_profiles_daemon', {}, stdout=subprocess.PIPE)
+ except ModuleNotFoundError:
+ raise unittest.SkipTest("power-profiles-daemon dbusmock template not "
+ "found. Requires dbusmock > 0.23.1.") # FIXME version
+ # set log to nonblocking
+ flags = fcntl.fcntl(self.p_mock.stdout, fcntl.F_GETFL)
+ fcntl.fcntl(self.p_mock.stdout, fcntl.F_SETFL, flags | os.O_NONBLOCK)
+ self.power_saver_enabled = False
+ self.dbus_props = dbus.Interface(self.obj_ppd, dbus.PROPERTIES_IFACE)
+ self.power_profile_monitor = Gio.PowerProfileMonitor.dup_default()
+ self.power_profile_monitor.connect("notify::power-saver-enabled", self.power_saver_enabled_cb)
+ self.mainloop = GLib.MainLoop()
+ self.main_context = self.mainloop.get_context()
+
+ def tearDown(self):
+ self.p_mock.terminate()
+ self.p_mock.wait()
+
+ def assertEventually(self, condition, message=None, timeout=50):
+ '''Assert that condition function eventually returns True.
+
+ Timeout is in deciseconds, defaulting to 50 (5 seconds). message is
+ printed on failure.
+ '''
+ while timeout >= 0:
+ context = GLib.MainContext.default()
+ while context.iteration(False):
+ pass
+ if condition():
+ break
+ timeout -= 1
+ time.sleep(0.1)
+ else:
+ self.fail(message or 'timed out waiting for ' + str(condition))
+
+ def power_saver_enabled_cb(self, spec, data):
+ self.power_saver_enabled = self.power_profile_monitor.get_power_saver_enabled()
+ self.main_context.wakeup()
+
+ def test_power_profile_power_saver_enabled(self):
+ '''power-saver-enabled property'''
+
+ self.assertEqual(self.power_profile_monitor.get_power_saver_enabled(), False)
+ self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('power-saver', variant_level=1))
+ self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 10)
+
+ self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('balanced', variant_level=1))
+ self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 10)
+
+except ImportError as e:
+ @unittest.skip("Cannot import %s" % e.name)
+ class TestPowerProfileMonitor(unittest.TestCase):
+ def test_power_profile_power_saver_enabled(self):
+ pass
+
+if __name__ == '__main__':
+ unittest.main(testRunner=taptestrunner.TAPTestRunner())
diff --git a/gio/tests/power-profile-monitor-portal.py.in b/gio/tests/power-profile-monitor-portal.py.in
new file mode 100755
index 000000000..960a62232
--- /dev/null
+++ b/gio/tests/power-profile-monitor-portal.py.in
@@ -0,0 +1,126 @@
+#!/usr/bin/python3
+
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; either version 3 of the License, or (at your option) any
+# later version. See http://www.gnu.org/copyleft/lgpl.html for the full text
+# of the license.
+
+__author__ = 'Bastien Nocera'
+__email__ = 'hadess@hadess.net'
+__copyright__ = '(c) 2021 Red Hat Inc.'
+__license__ = 'LGPL 3+'
+
+import unittest
+import sys
+import subprocess
+import fcntl
+import os
+import time
+
+import taptestrunner
+
+try:
+ # Do all non-standard imports here so we can skip the tests if any
+ # needed packages are not available.
+ import dbus
+ import dbus.mainloop.glib
+ import dbusmock
+ from gi.repository import GLib
+ from gi.repository import Gio
+
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+ # XDG_DESKTOP_PORTAL_PATH = os.path.expanduser("~/.cache/jhbuild/build/xdg-desktop-portal/xdg-desktop-portal")
+ XDG_DESKTOP_PORTAL_PATH = "@libexecdir@/xdg-desktop-portal"
+
+ class TestPowerProfileMonitorPortal(dbusmock.DBusTestCase):
+ '''Test GPowerProfileMonitorPortal'''
+
+ @classmethod
+ def setUpClass(klass):
+ klass.start_system_bus()
+ klass.dbus_con = klass.get_dbus(True)
+ # Start session bus so that xdg-desktop-portal can run on it
+ klass.start_session_bus()
+
+ def setUp(self):
+ try:
+ Gio.PowerProfileMonitor
+ except AttributeError:
+ raise unittest.SkipTest('Power Profile Monitor not in '
+ 'introspection data. Requires '
+ 'GObject-Introspection > 1.69.0')
+ try:
+ (self.p_mock, self.obj_ppd) = self.spawn_server_template(
+ 'power_profiles_daemon', {}, stdout=subprocess.PIPE)
+ except ModuleNotFoundError:
+ raise unittest.SkipTest("power-profiles-daemon dbusmock template not "
+ "found. Requires dbusmock > 0.23.1.")
+ # set log to nonblocking
+ flags = fcntl.fcntl(self.p_mock.stdout, fcntl.F_GETFL)
+ fcntl.fcntl(self.p_mock.stdout, fcntl.F_SETFL, flags | os.O_NONBLOCK)
+ self.power_saver_enabled = False
+ self.dbus_props = dbus.Interface(self.obj_ppd, dbus.PROPERTIES_IFACE)
+ try:
+ self.xdp = subprocess.Popen([XDG_DESKTOP_PORTAL_PATH])
+ except FileNotFoundError:
+ raise unittest.SkipTest("xdg-desktop-portal not available")
+
+ try:
+ self.wait_for_bus_object('org.freedesktop.portal.Desktop',
+ '/org/freedesktop/portal/desktop')
+ except:
+ raise
+ # subprocess.Popen(['gdbus', 'monitor', '--session', '--dest', 'org.freedesktop.portal.Desktop'])
+
+ os.environ['GTK_USE_PORTAL'] = "1"
+ self.power_profile_monitor = Gio.PowerProfileMonitor.dup_default()
+ assert("GPowerProfileMonitorPortal" in str(self.power_profile_monitor))
+ self.power_profile_monitor.connect("notify::power-saver-enabled", self.power_saver_enabled_cb)
+ self.mainloop = GLib.MainLoop()
+ self.main_context = self.mainloop.get_context()
+
+ def tearDown(self):
+ self.p_mock.terminate()
+ self.p_mock.wait()
+
+ def assertEventually(self, condition, message=None, timeout=50):
+ '''Assert that condition function eventually returns True.
+
+ Timeout is in deciseconds, defaulting to 50 (5 seconds). message is
+ printed on failure.
+ '''
+ while timeout >= 0:
+ context = GLib.MainContext.default()
+ while context.iteration(False):
+ pass
+ if condition():
+ break
+ timeout -= 1
+ time.sleep(0.1)
+ else:
+ self.fail(message or 'timed out waiting for ' + str(condition))
+
+ def power_saver_enabled_cb(self, spec, data):
+ self.power_saver_enabled = self.power_profile_monitor.get_power_saver_enabled()
+ self.main_context.wakeup()
+
+ def test_power_profile_power_saver_enabled_portal(self):
+ '''power-saver-enabled property'''
+
+ self.assertEqual(self.power_profile_monitor.get_power_saver_enabled(), False)
+ self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('power-saver', variant_level=1))
+ self.assertEventually(lambda: self.power_saver_enabled == True, "power-saver didn't become enabled", 10)
+
+ self.dbus_props.Set('net.hadess.PowerProfiles', 'ActiveProfile', dbus.String('balanced', variant_level=1))
+ self.assertEventually(lambda: self.power_saver_enabled == False, "power-saver didn't become disabled", 10)
+
+except ImportError as e:
+ @unittest.skip("Cannot import %s" % e.name)
+ class TestPowerProfileMonitorPortal(unittest.TestCase):
+ def test_power_profile_power_saver_enabled_portal(self):
+ pass
+
+if __name__ == '__main__':
+ unittest.main(testRunner=taptestrunner.TAPTestRunner())
--
GitLab
From 66acea8418eb3d8e46bb6f93dc0c3f13a1f7822b Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 11 Aug 2021 15:37:40 +0200
Subject: [PATCH 3/4] gio: Remove left-over debug statement from memory monitor
portal test
---
gio/tests/memory-monitor-portal.py.in | 1 -
1 file changed, 1 deletion(-)
diff --git a/gio/tests/memory-monitor-portal.py.in b/gio/tests/memory-monitor-portal.py.in
index cb4a960eb..f5fd2283f 100755
--- a/gio/tests/memory-monitor-portal.py.in
+++ b/gio/tests/memory-monitor-portal.py.in
@@ -31,7 +31,6 @@ try:
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
- # XDG_DESKTOP_PORTAL_PATH = os.path.expanduser("~/.cache/jhbuild/build/xdg-desktop-portal/xdg-desktop-portal")
XDG_DESKTOP_PORTAL_PATH = "@libexecdir@/xdg-desktop-portal"
class TestLowMemoryMonitorPortal(dbusmock.DBusTestCase):
--
GitLab
From 2e9842cafc73a7fb94cfde7937e125e1a91f35f8 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 11 Aug 2021 15:38:12 +0200
Subject: [PATCH 4/4] gio: Simplify memory monitor tests by using
assertEventually() helper
assertEventually is a helper used in a number of projects that use
dbusmock.
See https://github.com/martinpitt/python-dbusmock/issues/82
---
gio/tests/memory-monitor-dbus.py.in | 31 ++++++++++++++++-----------
gio/tests/memory-monitor-portal.py.in | 31 ++++++++++++++++-----------
2 files changed, 38 insertions(+), 24 deletions(-)
diff --git a/gio/tests/memory-monitor-dbus.py.in b/gio/tests/memory-monitor-dbus.py.in
index 7823e7309..e8ac28faf 100755
--- a/gio/tests/memory-monitor-dbus.py.in
+++ b/gio/tests/memory-monitor-dbus.py.in
@@ -66,6 +66,23 @@ try:
self.p_mock.terminate()
self.p_mock.wait()
+ def assertEventually(self, condition, message=None, timeout=50):
+ '''Assert that condition function eventually returns True.
+
+ Timeout is in deciseconds, defaulting to 50 (5 seconds). message is
+ printed on failure.
+ '''
+ while timeout >= 0:
+ context = GLib.MainContext.default()
+ while context.iteration(False):
+ pass
+ if condition():
+ break
+ timeout -= 1
+ time.sleep(0.1)
+ else:
+ self.fail(message or 'timed out waiting for ' + str(condition))
+
def memory_warning_cb(self, monitor, level):
self.last_warning = level
self.main_context.wakeup()
@@ -82,21 +99,11 @@ try:
self.dbusmock.EmitWarning(100)
# Wait 2 seconds or until warning
- timeout = 2
- while timeout > 0 and self.last_warning != 100:
- time.sleep(0.5)
- timeout -= 0.5
- self.main_context.iteration(False)
- self.assertEqual(self.last_warning, 100)
+ self.assertEventually(self.last_warning == 100, "'100' low-memory warning not received", 20)
self.dbusmock.EmitWarning(255)
# Wait 2 seconds or until warning
- timeout = 2
- while timeout > 0 and self.last_warning != 255:
- time.sleep(0.5)
- timeout -= 0.5
- self.main_context.iteration(False)
- self.assertEqual(self.last_warning, 255)
+ self.assertEventually(self.last_warning == 255, "'255' low-memory warning not received", 20)
except ImportError as e:
@unittest.skip("Cannot import %s" % e.name)
diff --git a/gio/tests/memory-monitor-portal.py.in b/gio/tests/memory-monitor-portal.py.in
index f5fd2283f..36d5094d3 100755
--- a/gio/tests/memory-monitor-portal.py.in
+++ b/gio/tests/memory-monitor-portal.py.in
@@ -84,6 +84,23 @@ try:
self.p_mock.terminate()
self.p_mock.wait()
+ def assertEventually(self, condition, message=None, timeout=50):
+ '''Assert that condition function eventually returns True.
+
+ Timeout is in deciseconds, defaulting to 50 (5 seconds). message is
+ printed on failure.
+ '''
+ while timeout >= 0:
+ context = GLib.MainContext.default()
+ while context.iteration(False):
+ pass
+ if condition():
+ break
+ timeout -= 1
+ time.sleep(0.1)
+ else:
+ self.fail(message or 'timed out waiting for ' + str(condition))
+
def portal_memory_warning_cb(self, monitor, level):
self.last_warning = level
self.main_context.wakeup()
@@ -100,21 +117,11 @@ try:
self.dbusmock.EmitWarning(100)
# Wait 2 seconds or until warning
- timeout = 2
- while timeout > 0 and self.last_warning != 100:
- time.sleep(0.5)
- timeout -= 0.5
- self.main_context.iteration(False)
- self.assertEqual(self.last_warning, 100)
+ self.assertEventually(self.last_warning == 100, "'100' low-memory warning not received", 20)
self.dbusmock.EmitWarning(255)
# Wait 2 seconds or until warning
- timeout = 2
- while timeout > 0 and self.last_warning != 255:
- time.sleep(0.5)
- timeout -= 0.5
- self.main_context.iteration(False)
- self.assertEqual(self.last_warning, 255)
+ self.assertEventually(self.last_warning == 255, "'255' low-memory warning not received", 20)
except ImportError as e:
@unittest.skip("Cannot import %s" % e.name)
--
GitLab

View File

@ -0,0 +1,49 @@
From b6036e23b0477be147211b4e21a6b49cd4d6c9a0 Mon Sep 17 00:00:00 2001
From: Jamie Bainbridge <jamie.bainbridge@gmail.com>
Date: Wed, 8 Sep 2021 12:08:17 +1000
Subject: [PATCH] gutils: Avoid segfault in g_get_user_database_entry
g_get_user_database_entry() uses variable pwd to store the contents of
the call to getpwnam_r(), then capitalises the first letter of pw_name
with g_ascii_toupper (pw->pw_name[0]).
However, as per the getpwnam manpage, the result of that call "may point
to a static area". When this happens, GLib is trying to edit static
memory which belongs to a shared library, so segfaults.
Instead, copy pw_name off to a temporary variable, set uppercase on
that variable, and use the variable to join into the desired string.
Free the new variable after it is no longer needed.
Signed-off-by: Jamie Bainbridge <jamie.bainbridge@gmail.com>
---
glib/gutils.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/glib/gutils.c b/glib/gutils.c
index b7a2113d4..4bccd7229 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -692,14 +692,17 @@ g_get_user_database_entry (void)
{
gchar **gecos_fields;
gchar **name_parts;
+ gchar *uppercase_pw_name;
/* split the gecos field and substitute '&' */
gecos_fields = g_strsplit (pw->pw_gecos, ",", 0);
name_parts = g_strsplit (gecos_fields[0], "&", 0);
- pw->pw_name[0] = g_ascii_toupper (pw->pw_name[0]);
- e.real_name = g_strjoinv (pw->pw_name, name_parts);
+ uppercase_pw_name = g_strdup (pw->pw_name);
+ uppercase_pw_name[0] = g_ascii_toupper (uppercase_pw_name[0]);
+ e.real_name = g_strjoinv (uppercase_pw_name, name_parts);
g_strfreev (gecos_fields);
g_strfreev (name_parts);
+ g_free (uppercase_pw_name);
}
#endif
--
GitLab

129
base/rx/rx-glib2/2291.patch Normal file
View File

@ -0,0 +1,129 @@
From f419966808475cb6c0f0ba2f63967876218ffdaf Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <julian.klode@canonical.com>
Date: Tue, 12 Oct 2021 12:01:50 +0200
Subject: [PATCH 1/2] gnetworkmonitornm: Stop using removed PropertiesChanged
signal
Use the org.freedesktop.DBus.Properties interface to listen
to PropertiesChanged signals on /org/freedesktop/NetworkManager.
NetworkManager used to provide its own legacy PropertiesChanged
signal, but that was dropped in
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/853
This requires NetworkManager >= 1.2 (2016)
Fixes: #2505
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1946196
---
gio/gnetworkmonitornm.c | 29 +++++++----------------------
1 file changed, 7 insertions(+), 22 deletions(-)
diff --git a/gio/gnetworkmonitornm.c b/gio/gnetworkmonitornm.c
index 5a36a0ba1..6a6d1d666 100644
--- a/gio/gnetworkmonitornm.c
+++ b/gio/gnetworkmonitornm.c
@@ -267,29 +267,14 @@ update_cached_property (GDBusProxy *proxy,
}
static void
-proxy_signal_cb (GDBusProxy *proxy,
- const gchar *sender_name,
- const gchar *signal_name,
- GVariant *parameters,
- GNetworkMonitorNM *nm)
+proxy_properties_changed_cb (GDBusProxy *proxy,
+ GVariant *changed_properties,
+ GStrv invalidated_properties,
+ GNetworkMonitorNM *nm)
{
- GVariant *asv;
GVariantDict *dict;
- if (g_strcmp0 (signal_name, "PropertiesChanged") != 0)
- return;
-
- g_variant_get (parameters, "(@a{sv})", &asv);
- if (!asv)
- return;
-
- dict = g_variant_dict_new (asv);
- g_variant_unref (asv);
- if (!dict)
- {
- g_warning ("Failed to handle PropertiesChanged signal from NetworkManager");
- return;
- }
+ dict = g_variant_dict_new (changed_properties);
update_cached_property (nm->priv->proxy, "Connectivity", dict);
@@ -361,8 +346,8 @@ g_network_monitor_nm_initable_init (GInitable *initable,
return FALSE;
}
- nm->priv->signal_id = g_signal_connect (G_OBJECT (proxy), "g-signal",
- G_CALLBACK (proxy_signal_cb), nm);
+ nm->priv->signal_id = g_signal_connect (G_OBJECT (proxy), "g-properties-changed",
+ G_CALLBACK (proxy_properties_changed_cb), nm);
nm->priv->proxy = proxy;
sync_properties (nm, FALSE);
--
GitLab
From 643fc7ea49e818310f6b3f6e4ebe621c7a4d6bd7 Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <julian.klode@canonical.com>
Date: Tue, 12 Oct 2021 17:31:42 +0200
Subject: [PATCH 2/2] gnetworkmonitornm: Do not re-update cached property
GDBusProxy already takes care of updating the cached property
before emitting the signal, so there is no need to do this
a second time ourselves.
---
gio/gnetworkmonitornm.c | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/gio/gnetworkmonitornm.c b/gio/gnetworkmonitornm.c
index 6a6d1d666..a8040fb36 100644
--- a/gio/gnetworkmonitornm.c
+++ b/gio/gnetworkmonitornm.c
@@ -252,34 +252,12 @@ sync_properties (GNetworkMonitorNM *nm,
}
}
-static void
-update_cached_property (GDBusProxy *proxy,
- const char *property_name,
- GVariantDict *dict)
-{
- GVariant *v;
-
- v = g_variant_dict_lookup_value (dict, property_name, NULL);
- if (!v)
- return;
- g_dbus_proxy_set_cached_property (proxy, property_name, v);
- g_variant_unref (v);
-}
-
static void
proxy_properties_changed_cb (GDBusProxy *proxy,
GVariant *changed_properties,
GStrv invalidated_properties,
GNetworkMonitorNM *nm)
{
- GVariantDict *dict;
-
- dict = g_variant_dict_new (changed_properties);
-
- update_cached_property (nm->priv->proxy, "Connectivity", dict);
-
- g_variant_dict_unref (dict);
-
sync_properties (nm, TRUE);
}
--
GitLab

391
base/rx/rx-glib2/2408.patch Normal file
View File

@ -0,0 +1,391 @@
From 0bbd63bf1945c6f3e1c88232521e1618c21d44f2 Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@endlessos.org>
Date: Thu, 23 Dec 2021 17:45:51 +0000
Subject: [PATCH 1/4] gmain: Use waitid() on pidfds rather than a global
SIGCHLD handler
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When the system supports it (as all Linux kernels ≥ 5.3 should), its
preferable to use `pidfd_open()` and `waitid()` to be notified of
child processes exiting or being signalled, rather than installing a
default `SIGCHLD` handler.
A default `SIGCHLD` handler is global, and can never interact well with
other code (from the application or other libraries) which also wants to
install a `SIGCHLD` handler.
This use of `pidfd_open()` is racy (the PID may be reused between
`g_child_watch_source_new()` being called and `pidfd_open()` being
called), so it doesnt improve behaviour there. For that, wed need
continuous use of pidfds throughout GLib, from fork/spawn time until
here. See #1866 for that.
The use of `waitid()` to get the process exit status could be expanded
in future to also work for stopped or continued processes (as per #175)
by adding `WSTOPPED | WCONTINUED` into the flags. Thats a behaviour
change which is outside the strict scope of adding pidfd support,
though.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #1866
Fixes: #2216
---
glib/gmain.c | 117 ++++++++++++++++++++++++++++++++++++++++++++++++---
meson.build | 14 ++++++
2 files changed, 125 insertions(+), 6 deletions(-)
diff --git a/glib/gmain.c b/glib/gmain.c
index 15581ee7a..e9965f7f6 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -67,6 +67,12 @@
#include <errno.h>
#include <string.h>
+#ifdef HAVE_PIDFD
+#include <sys/syscall.h>
+#include <sys/wait.h>
+#include <linux/wait.h> /* P_PIDFD */
+#endif /* HAVE_PIDFD */
+
#ifdef G_OS_WIN32
#define STRICT
#include <windows.h>
@@ -329,10 +335,11 @@ struct _GChildWatchSource
GSource source;
GPid pid;
gint child_status;
-#ifdef G_OS_WIN32
+ /* @poll is always used on Windows, and used on Unix iff @using_pidfd is set: */
GPollFD poll;
-#else /* G_OS_WIN32 */
- gboolean child_exited; /* (atomic) */
+#ifndef G_OS_WIN32
+ gboolean child_exited; /* (atomic); not used iff @using_pidfd is set */
+ gboolean using_pidfd;
#endif /* G_OS_WIN32 */
};
@@ -5325,7 +5332,8 @@ dispatch_unix_signals_unlocked (void)
{
GChildWatchSource *source = node->data;
- if (!g_atomic_int_get (&source->child_exited))
+ if (!source->using_pidfd &&
+ !g_atomic_int_get (&source->child_exited))
{
pid_t pid;
do
@@ -5384,6 +5392,38 @@ g_child_watch_prepare (GSource *source,
return g_atomic_int_get (&child_watch_source->child_exited);
}
+#ifdef HAVE_PIDFD
+static int
+siginfo_t_to_wait_status (const siginfo_t *info)
+{
+ /* Each of these returns is essentially the inverse of WIFEXITED(),
+ * WIFSIGNALED(), etc. */
+ switch (info->si_code)
+ {
+ case CLD_EXITED:
+ return W_EXITCODE (info->si_status, 0);
+ case CLD_KILLED:
+ return W_EXITCODE (0, info->si_status);
+ case CLD_DUMPED:
+#ifdef WCOREFLAG
+ return W_EXITCODE (0, info->si_status | WCOREFLAG);
+#else
+ g_assert_not_reached ();
+#endif
+ case CLD_CONTINUED:
+#ifdef __W_CONTINUED
+ return __W_CONTINUED;
+#else
+ g_assert_not_reached ();
+#endif
+ case CLD_STOPPED:
+ case CLD_TRAPPED:
+ default:
+ return W_STOPCODE (info->si_status);
+ }
+}
+#endif /* HAVE_PIDFD */
+
static gboolean
g_child_watch_check (GSource *source)
{
@@ -5391,6 +5431,34 @@ g_child_watch_check (GSource *source)
child_watch_source = (GChildWatchSource *) source;
+#ifdef HAVE_PIDFD
+ if (child_watch_source->using_pidfd)
+ {
+ gboolean child_exited = child_watch_source->poll.revents & G_IO_IN;
+
+ if (child_exited)
+ {
+ siginfo_t child_info = { 0, };
+
+ /* Get the exit status */
+ if (waitid (P_PIDFD, child_watch_source->poll.fd, &child_info, WEXITED | WNOHANG) >= 0 &&
+ child_info.si_pid != 0)
+ {
+ /* waitid() helpfully provides the wait status in a decomposed
+ * form which is quite useful. Unfortunately we have to report it
+ * to the #GChildWatchFunc as a waitpid()-style platform-specific
+ * wait status, so that the user code in #GChildWatchFunc can then
+ * call WIFEXITED() (etc.) on it. That means re-composing the
+ * status information. */
+ child_watch_source->child_status = siginfo_t_to_wait_status (&child_info);
+ child_watch_source->child_exited = TRUE;
+ }
+ }
+
+ return child_exited;
+ }
+#endif /* HAVE_PIDFD */
+
return g_atomic_int_get (&child_watch_source->child_exited);
}
@@ -5575,6 +5643,11 @@ g_unix_signal_watch_finalize (GSource *source)
static void
g_child_watch_finalize (GSource *source)
{
+ GChildWatchSource *child_watch_source = (GChildWatchSource *) source;
+
+ if (child_watch_source->using_pidfd)
+ return;
+
G_LOCK (unix_signal_lock);
unix_child_watches = g_slist_remove (unix_child_watches, source);
unref_unix_signal_handler_unlocked (SIGCHLD);
@@ -5676,6 +5749,9 @@ g_child_watch_source_new (GPid pid)
{
GSource *source;
GChildWatchSource *child_watch_source;
+#ifdef HAVE_PIDFD
+ int errsv;
+#endif
#ifndef G_OS_WIN32
g_return_val_if_fail (pid > 0, NULL);
@@ -5694,14 +5770,43 @@ g_child_watch_source_new (GPid pid)
child_watch_source->poll.events = G_IO_IN;
g_source_add_poll (source, &child_watch_source->poll);
-#else /* G_OS_WIN32 */
+#else /* !G_OS_WIN32 */
+
+#ifdef HAVE_PIDFD
+ /* Use a pidfd, if possible, to avoid having to install a global SIGCHLD
+ * handler and potentially competing with any other library/code which wants
+ * to install one.
+ *
+ * Unfortunately this use of pidfd isnt race-free (the PID could be recycled
+ * between the caller calling g_child_watch_source_new() and here), but its
+ * better than SIGCHLD.
+ */
+ child_watch_source->poll.fd = (int) syscall (SYS_pidfd_open, pid, 0);
+ errsv = errno;
+
+ if (child_watch_source->poll.fd >= 0)
+ {
+ child_watch_source->using_pidfd = TRUE;
+ child_watch_source->poll.events = G_IO_IN;
+ g_source_add_poll (source, &child_watch_source->poll);
+
+ return source;
+ }
+ else
+ {
+ g_debug ("pidfd_open(%" G_PID_FORMAT ") failed with error: %s",
+ pid, g_strerror (errsv));
+ /* Fall through; likely the kernel isnt new enough to support pidfd_open() */
+ }
+#endif /* HAVE_PIDFD */
+
G_LOCK (unix_signal_lock);
ref_unix_signal_handler_unlocked (SIGCHLD);
unix_child_watches = g_slist_prepend (unix_child_watches, child_watch_source);
if (waitpid (pid, &child_watch_source->child_status, WNOHANG) > 0)
child_watch_source->child_exited = TRUE;
G_UNLOCK (unix_signal_lock);
-#endif /* G_OS_WIN32 */
+#endif /* !G_OS_WIN32 */
return source;
}
diff --git a/meson.build b/meson.build
index a0223ce5b..1e1bd602c 100644
--- a/meson.build
+++ b/meson.build
@@ -810,6 +810,20 @@ if cc.links('''#include <sys/eventfd.h>
glib_conf.set('HAVE_EVENTFD', 1)
endif
+# Check for pidfd_open(2)
+if cc.links('''#include <sys/syscall.h>
+ #include <sys/wait.h>
+ #include <linux/wait.h>
+ #include <unistd.h>
+ int main (int argc, char ** argv) {
+ siginfo_t child_info = { 0, };
+ syscall (SYS_pidfd_open, 0, 0);
+ waitid (P_PIDFD, 0, &child_info, WEXITED | WNOHANG);
+ return 0;
+ }''', name : 'pidfd_open(2) system call')
+ glib_conf.set('HAVE_PIDFD', 1)
+endif
+
# Check for __uint128_t (gcc) by checking for 128-bit division
uint128_t_src = '''int main() {
static __uint128_t v1 = 100;
--
2.41.0
From 13c62bc181c6da9f287b737f7a3238e0269b40b3 Mon Sep 17 00:00:00 2001
From: Christian Hergert <chergert@redhat.com>
Date: Tue, 2 Aug 2022 12:35:40 -0700
Subject: [PATCH 2/4] gmain: close pidfd when finalizing GChildWatchSource
A file-descriptor was created with the introduction of pidfd_getfd() but
nothing is closing it when the source finalizes. The GChildWatchSource is
the creator and consumer of this FD and therefore responsible for closing
it on finalization.
The pidfd leak was introduced in !2408.
This fixes issues with Builder where anon_inode:[pidfd] exhaust the
available FD limit for the process.
Fixes #2708
---
glib/gmain.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/glib/gmain.c b/glib/gmain.c
index e9965f7f6..3ceec61ee 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -5646,7 +5646,11 @@ g_child_watch_finalize (GSource *source)
GChildWatchSource *child_watch_source = (GChildWatchSource *) source;
if (child_watch_source->using_pidfd)
- return;
+ {
+ if (child_watch_source->poll.fd >= 0)
+ close (child_watch_source->poll.fd);
+ return;
+ }
G_LOCK (unix_signal_lock);
unix_child_watches = g_slist_remove (unix_child_watches, source);
--
2.41.0
From 378c72cbe12767b8f6aedc19c7ca46c07aa1ca73 Mon Sep 17 00:00:00 2001
From: Owen Rafferty <owen@owenrafferty.com>
Date: Tue, 12 Jul 2022 20:03:56 -0500
Subject: [PATCH 3/4] gmain: define non-posix symbols
---
glib/gmain.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/glib/gmain.c b/glib/gmain.c
index 3ceec61ee..a2d7bb3ba 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -71,6 +71,12 @@
#include <sys/syscall.h>
#include <sys/wait.h>
#include <linux/wait.h> /* P_PIDFD */
+#ifndef W_EXITCODE
+#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
+#endif
+#ifndef W_STOPCODE
+#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
+#endif
#endif /* HAVE_PIDFD */
#ifdef G_OS_WIN32
--
2.41.0
From aac37188ce26366bd86626700d49cee0cb121472 Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@endlessos.org>
Date: Wed, 21 Dec 2022 12:11:46 +0000
Subject: [PATCH 4/4] gmain: Define fallback values for siginfo_t constants for
musl
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
musl doesnt define them itself, presumably because theyre not defined
in POSIX. glibc does define them. Thankfully, the values used in glibc
match the values used internally in other musl macros.
Define the values as a fallback. As a result of this, we can get rid of
the `g_assert_if_reached()` checks in `siginfo_t_to_wait_status()`.
This should fix catching signals from a subprocess when built against
musl.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #2852
---
glib/gmain.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/glib/gmain.c b/glib/gmain.c
index a2d7bb3ba..f0cf700c0 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -77,6 +77,16 @@
#ifndef W_STOPCODE
#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
#endif
+#ifndef WCOREFLAG
+/* musl doesnt define WCOREFLAG while glibc does. Unfortunately, theres no way
+ * to detect were building against musl, so just define it and hope.
+ * See https://git.musl-libc.org/cgit/musl/tree/include/sys/wait.h#n51 */
+#define WCOREFLAG 0x80
+#endif
+#ifndef __W_CONTINUED
+/* Same as above, for musl */
+#define __W_CONTINUED 0xffff
+#endif
#endif /* HAVE_PIDFD */
#ifdef G_OS_WIN32
@@ -5411,17 +5421,9 @@ siginfo_t_to_wait_status (const siginfo_t *info)
case CLD_KILLED:
return W_EXITCODE (0, info->si_status);
case CLD_DUMPED:
-#ifdef WCOREFLAG
return W_EXITCODE (0, info->si_status | WCOREFLAG);
-#else
- g_assert_not_reached ();
-#endif
case CLD_CONTINUED:
-#ifdef __W_CONTINUED
return __W_CONTINUED;
-#else
- g_assert_not_reached ();
-#endif
case CLD_STOPPED:
case CLD_TRAPPED:
default:
--
2.41.0

132
base/rx/rx-glib2/2435.patch Normal file
View File

@ -0,0 +1,132 @@
From a879d08e912a4421786b44af479f94f7b4503f5a Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@endlessos.org>
Date: Mon, 17 Jan 2022 15:27:24 +0000
Subject: [PATCH] gspawn: Report errors with closing file descriptors between
fork/exec
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If a seccomp policy is set up incorrectly so that it returns `EPERM` for
`close_range()` rather than `ENOSYS` due to it not being recognised, no
error would previously be reported from GLib, but some file descriptors
wouldnt be closed, and that would cause a hung zombie process. The
zombie process would be waiting for one half of a socket to be closed.
Fix that by correctly propagating errors from `close_range()` back to the
parent process so they can be reported correctly.
Distributions which arent yet carrying the Docker fix to correctly
return `ENOSYS` from unrecognised syscalls may want to temporarily carry
an additional patch to fall back to `safe_fdwalk()` if `close_range()`
fails with `EPERM`. This change will not be accepted upstream as `EPERM`
is not the right error for `close_range()` to be returning.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #2580
---
glib/gspawn.c | 35 ++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/glib/gspawn.c b/glib/gspawn.c
index c2fe306dc..9c2f7ba7b 100644
--- a/glib/gspawn.c
+++ b/glib/gspawn.c
@@ -1457,8 +1457,10 @@ safe_fdwalk (int (*cb)(void *data, int fd), void *data)
}
/* This function is called between fork() and exec() and hence must be
- * async-signal-safe (see signal-safety(7)). */
-static void
+ * async-signal-safe (see signal-safety(7)).
+ *
+ * On failure, `-1` will be returned and errno will be set. */
+static int
safe_closefrom (int lowfd)
{
#if defined(__FreeBSD__) || defined(__OpenBSD__)
@@ -1472,6 +1474,7 @@ safe_closefrom (int lowfd)
* should be safe to use.
*/
(void) closefrom (lowfd);
+ return 0;
#elif defined(__DragonFly__)
/* It is unclear whether closefrom function included in DragonFlyBSD libc_r
* is safe to use because it calls a lot of library functions. It is also
@@ -1479,12 +1482,13 @@ safe_closefrom (int lowfd)
* direct system call here ourselves to avoid possible issues.
*/
(void) syscall (SYS_closefrom, lowfd);
+ return 0;
#elif defined(F_CLOSEM)
/* NetBSD and AIX have a special fcntl command which does the same thing as
* closefrom. NetBSD also includes closefrom function, which seems to be a
* simple wrapper of the fcntl command.
*/
- (void) fcntl (lowfd, F_CLOSEM);
+ return fcntl (lowfd, F_CLOSEM);
#else
#if defined(HAVE_CLOSE_RANGE)
@@ -1494,9 +1498,11 @@ safe_closefrom (int lowfd)
*
* Handle ENOSYS in case its supported in libc but not the kernel; if so,
* fall back to safe_fdwalk(). */
- if (close_range (lowfd, G_MAXUINT, 0) != 0 && errno == ENOSYS)
+ int ret = close_range (lowfd, G_MAXUINT, 0);
+ if (ret == 0 || errno != ENOSYS)
+ return ret;
#endif /* HAVE_CLOSE_RANGE */
- (void) safe_fdwalk (close_func, GINT_TO_POINTER (lowfd));
+ return safe_fdwalk (close_func, GINT_TO_POINTER (lowfd));
#endif
}
@@ -1534,7 +1540,8 @@ enum
CHILD_EXEC_FAILED,
CHILD_OPEN_FAILED,
CHILD_DUP2_FAILED,
- CHILD_FORK_FAILED
+ CHILD_FORK_FAILED,
+ CHILD_CLOSE_FAILED,
};
/* This function is called between fork() and exec() and hence must be
@@ -1650,12 +1657,14 @@ do_exec (gint child_err_report_fd,
if (safe_dup2 (child_err_report_fd, 3) < 0)
write_err_and_exit (child_err_report_fd, CHILD_DUP2_FAILED);
set_cloexec (GINT_TO_POINTER (0), 3);
- safe_closefrom (4);
+ if (safe_closefrom (4) < 0)
+ write_err_and_exit (child_err_report_fd, CHILD_CLOSE_FAILED);
child_err_report_fd = 3;
}
else
{
- safe_fdwalk (set_cloexec, GINT_TO_POINTER (3));
+ if (safe_fdwalk (set_cloexec, GINT_TO_POINTER (3)) < 0)
+ write_err_and_exit (child_err_report_fd, CHILD_CLOSE_FAILED);
}
}
else
@@ -2446,7 +2455,15 @@ fork_exec (gboolean intermediate_child,
_("Failed to fork child process (%s)"),
g_strerror (buf[1]));
break;
-
+
+ case CHILD_CLOSE_FAILED:
+ g_set_error (error,
+ G_SPAWN_ERROR,
+ G_SPAWN_ERROR_FAILED,
+ _("Failed to close file descriptor for child process (%s)"),
+ g_strerror (buf[1]));
+ break;
+
default:
g_set_error (error,
G_SPAWN_ERROR,
--
2.34.1

278
base/rx/rx-glib2/2826.patch Normal file
View File

@ -0,0 +1,278 @@
From 764f071909df70622e79ee71323973c18c055c8c Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <giuseppe@scrivano.org>
Date: Mon, 14 Sep 2020 16:28:10 +0200
Subject: [PATCH 1/5] gdbusauth: empty DATA does not need a trailing space
This is an interoperability fix. If the line is exactly "DATA\r\n",
the reference implementation of D-Bus treats this as equivalent to
"DATA \r\n", meaning the data block consists of zero hex-encoded bytes.
In practice, D-Bus clients send empty data blocks as "DATA\r\n", and
in fact sd-bus only accepts that, rejecting "DATA \r\n".
[Originally part of a larger commit; commit message added by smcv]
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
Co-authored-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
gio/gdbusauth.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
index ede21c8514..d2ca41a201 100644
--- a/gio/gdbusauth.c
+++ b/gio/gdbusauth.c
@@ -783,13 +783,13 @@ _g_dbus_auth_run_client (GDBusAuth *auth,
if (line == NULL)
goto out;
debug_print ("CLIENT: WaitingForData, read='%s'", line);
- if (g_str_has_prefix (line, "DATA "))
+ if (g_str_equal (line, "DATA") || g_str_has_prefix (line, "DATA "))
{
gchar *encoded;
gchar *decoded_data;
gsize decoded_data_len = 0;
- encoded = g_strdup (line + 5);
+ encoded = g_strdup (line + 4);
g_free (line);
g_strstrip (encoded);
decoded_data = hexdecode (encoded, &decoded_data_len, error);
@@ -1255,13 +1255,13 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
debug_print ("SERVER: WaitingForData, read '%s'", line);
if (line == NULL)
goto out;
- if (g_str_has_prefix (line, "DATA "))
+ if (g_str_equal (line, "DATA") || g_str_has_prefix (line, "DATA "))
{
gchar *encoded;
gchar *decoded_data;
gsize decoded_data_len = 0;
- encoded = g_strdup (line + 5);
+ encoded = g_strdup (line + 4);
g_free (line);
g_strstrip (encoded);
decoded_data = hexdecode (encoded, &decoded_data_len, error);
--
GitLab
From a7d2e727eefcf883bb463ad559f5632e8e448757 Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <giuseppe@scrivano.org>
Date: Mon, 14 Sep 2020 16:28:10 +0200
Subject: [PATCH 2/5] GDBusServer: If no initial response for EXTERNAL, send a
challenge
Sending an "initial response" along with the AUTH command is meant
to be an optional optimization, and clients are allowed to omit it.
We must reply with our initial challenge, which in the case of EXTERNAL
is an empty string: the client responds to that with the authorization
identity.
If we do not reply to the AUTH command, then the client will wait
forever for our reply, while we wait forever for the reply that we
expect the client to send, resulting in deadlock.
D-Bus does not have a way to distinguish between an empty initial
response and the absence of an initial response, so clients that want
to use an empty authorization identity, such as systed's sd-bus,
cannot use the initial-response optimization and will fail to connect
to a GDBusServer that does not have this change.
[Originally part of a larger commit; commit message added by smcv.]
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
gio/gdbusauthmechanismexternal.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/gio/gdbusauthmechanismexternal.c b/gio/gdbusauthmechanismexternal.c
index 617fe1d0e5..ddd06cbd5e 100644
--- a/gio/gdbusauthmechanismexternal.c
+++ b/gio/gdbusauthmechanismexternal.c
@@ -40,6 +40,7 @@ struct _GDBusAuthMechanismExternalPrivate
gboolean is_client;
gboolean is_server;
GDBusAuthMechanismState state;
+ gboolean empty_data_sent;
};
static gint mechanism_get_priority (void);
@@ -253,7 +254,9 @@ mechanism_server_initiate (GDBusAuthMechanism *mechanism,
}
else
{
- m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA;
+ /* The initial-response optimization was not used, so we need to
+ * send an empty challenge to prompt the client to respond. */
+ m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND;
}
}
@@ -288,12 +291,22 @@ mechanism_server_data_send (GDBusAuthMechanism *mechanism,
g_return_val_if_fail (G_IS_DBUS_AUTH_MECHANISM_EXTERNAL (mechanism), NULL);
g_return_val_if_fail (m->priv->is_server && !m->priv->is_client, NULL);
- g_return_val_if_fail (m->priv->state == G_DBUS_AUTH_MECHANISM_STATE_HAVE_DATA_TO_SEND, NULL);
- /* can never end up here because we are never in the HAVE_DATA_TO_SEND state */
- g_assert_not_reached ();
+ if (out_data_len)
+ *out_data_len = 0;
- return NULL;
+ if (m->priv->empty_data_sent)
+ {
+ /* We have already sent an empty data response.
+ Reject the connection. */
+ m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_REJECTED;
+ return NULL;
+ }
+
+ m->priv->state = G_DBUS_AUTH_MECHANISM_STATE_WAITING_FOR_DATA;
+ m->priv->empty_data_sent = TRUE;
+
+ return g_strdup ("");
}
static gchar *
--
GitLab
From b51e3ab09e39c590c65a7be6228ecfa48a6189f6 Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <giuseppe@scrivano.org>
Date: Mon, 14 Sep 2020 16:28:10 +0200
Subject: [PATCH 3/5] GDBusServer: Accept empty authorization identity for
EXTERNAL mechanism
RFC 4422 appendix A defines the empty authorization identity to mean
the identity that the server associated with its authentication
credentials. In this case, this means whatever uid is in the
GCredentials object.
In particular, this means that clients in a different Linux user
namespace can authenticate against our server and will be authorized
as the version of their uid that is visible in the server's namespace,
even if the corresponding numeric uid returned by geteuid() in the
client's namespace was different. systemd's sd-bus has relied on this
since commit
https://github.com/systemd/systemd/commit/1ed4723d38cd0d1423c8fe650f90fa86007ddf55.
[Originally part of a larger commit; commit message added by smcv]
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
gio/gdbusauthmechanismexternal.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/gio/gdbusauthmechanismexternal.c b/gio/gdbusauthmechanismexternal.c
index ddd06cbd5e..a465862d12 100644
--- a/gio/gdbusauthmechanismexternal.c
+++ b/gio/gdbusauthmechanismexternal.c
@@ -201,14 +201,24 @@ data_matches_credentials (const gchar *data,
if (credentials == NULL)
goto out;
- if (data == NULL || data_len == 0)
- goto out;
-
#if defined(G_OS_UNIX)
{
gint64 alleged_uid;
gchar *endp;
+ /* If we were unable to find out the uid, then nothing
+ * can possibly match it. */
+ if (g_credentials_get_unix_user (credentials, NULL) == (uid_t) -1)
+ goto out;
+
+ /* An empty authorization identity means we want to be
+ * whatever identity the out-of-band credentials say we have
+ * (RFC 4422 appendix A.1). This effectively matches any uid. */
+ if (data == NULL || data_len == 0)
+ {
+ match = TRUE;
+ goto out;
+ }
/* on UNIX, this is the uid as a string in base 10 */
alleged_uid = g_ascii_strtoll (data, &endp, 10);
if (*endp == '\0')
--
GitLab
From 3f532af65c98e4ba8426c53f26c9ee15d3692f9c Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Mon, 18 Jul 2022 17:14:44 +0100
Subject: [PATCH 4/5] gdbusauth: Represent empty data block as DATA\r\n, with
no space
This is an interoperability fix. The reference implementation of D-Bus
treats "DATA\r\n" as equivalent to "DATA \r\n", but sd-bus does not,
and only accepts the former.
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
gio/gdbusauth.c | 34 ++++++++++++++++++++++++++--------
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
index d2ca41a201..89cbbf67c6 100644
--- a/gio/gdbusauth.c
+++ b/gio/gdbusauth.c
@@ -807,11 +807,21 @@ _g_dbus_auth_run_client (GDBusAuth *auth,
{
gchar *data;
gsize data_len;
- gchar *encoded_data;
+
data = _g_dbus_auth_mechanism_client_data_send (mech, &data_len);
- encoded_data = _g_dbus_hexencode (data, data_len);
- s = g_strdup_printf ("DATA %s\r\n", encoded_data);
- g_free (encoded_data);
+
+ if (data_len == 0)
+ {
+ s = g_strdup ("DATA\r\n");
+ }
+ else
+ {
+ gchar *encoded_data = _g_dbus_hexencode (data, data_len);
+
+ s = g_strdup_printf ("DATA %s\r\n", encoded_data);
+ g_free (encoded_data);
+ }
+
g_free (data);
debug_print ("CLIENT: writing '%s'", s);
if (!g_data_output_stream_put_string (dos, s, cancellable, error))
@@ -1209,13 +1219,21 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
gsize data_len;
data = _g_dbus_auth_mechanism_server_data_send (mech, &data_len);
+
if (data != NULL)
{
- gchar *encoded_data;
+ if (data_len == 0)
+ {
+ s = g_strdup ("DATA\r\n");
+ }
+ else
+ {
+ gchar *encoded_data = _g_dbus_hexencode (data, data_len);
+
+ s = g_strdup_printf ("DATA %s\r\n", encoded_data);
+ g_free (encoded_data);
+ }
- encoded_data = _g_dbus_hexencode (data, data_len);
- s = g_strdup_printf ("DATA %s\r\n", encoded_data);
- g_free (encoded_data);
g_free (data);
debug_print ("SERVER: writing '%s'", s);
--
GitLab

3021
base/rx/rx-glib2/3126.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,65 @@
From ba2137b0d9ea3744155be81a5ba770c6535b46f3 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Thu, 15 Dec 2022 12:51:37 +0000
Subject: [PATCH] gvariant-serialiser: Convert endianness of offsets
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The array of offsets is little-endian, even on big-endian architectures
like s390x.
Fixes: ade71fb5 "gvariant: Don’t allow child elements to overlap with each other"
Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/2839
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
glib/gvariant-serialiser.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c
index fadefab659..f443c2eb85 100644
--- a/glib/gvariant-serialiser.c
+++ b/glib/gvariant-serialiser.c
@@ -714,17 +714,19 @@ gvs_variable_sized_array_n_children (GVariantSerialised value)
/* Find the index of the first out-of-order element in @data, assuming that
* @data is an array of elements of given @type, starting at index @start and
* containing a further @len-@start elements. */
-#define DEFINE_FIND_UNORDERED(type) \
+#define DEFINE_FIND_UNORDERED(type, le_to_native) \
static gsize \
find_unordered_##type (const guint8 *data, gsize start, gsize len) \
{ \
gsize off; \
- type current, previous; \
+ type current_le, previous_le, current, previous; \
\
- memcpy (&previous, data + start * sizeof (current), sizeof (current)); \
+ memcpy (&previous_le, data + start * sizeof (current), sizeof (current)); \
+ previous = le_to_native (previous_le); \
for (off = (start + 1) * sizeof (current); off < len * sizeof (current); off += sizeof (current)) \
{ \
- memcpy (&current, data + off, sizeof (current)); \
+ memcpy (&current_le, data + off, sizeof (current)); \
+ current = le_to_native (current_le); \
if (current < previous) \
break; \
previous = current; \
@@ -732,10 +734,11 @@ gvs_variable_sized_array_n_children (GVariantSerialised value)
return off / sizeof (current) - 1; \
}
-DEFINE_FIND_UNORDERED (guint8);
-DEFINE_FIND_UNORDERED (guint16);
-DEFINE_FIND_UNORDERED (guint32);
-DEFINE_FIND_UNORDERED (guint64);
+#define NO_CONVERSION(x) (x)
+DEFINE_FIND_UNORDERED (guint8, NO_CONVERSION);
+DEFINE_FIND_UNORDERED (guint16, GUINT16_FROM_LE);
+DEFINE_FIND_UNORDERED (guint32, GUINT32_FROM_LE);
+DEFINE_FIND_UNORDERED (guint64, GUINT64_FROM_LE);
static GVariantSerialised
gvs_variable_sized_array_get_child (GVariantSerialised value,
--
GitLab

199
base/rx/rx-glib2/3163.patch Normal file
View File

@ -0,0 +1,199 @@
From 78da5faccb3e065116b75b3ff87ff55381da6c76 Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@endlessos.org>
Date: Thu, 15 Dec 2022 13:00:39 +0000
Subject: [PATCH 1/2] =?UTF-8?q?gvariant:=20Check=20offset=20table=20doesn?=
=?UTF-8?q?=E2=80=99t=20fall=20outside=20variant=20bounds?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When dereferencing the first entry in the offset table for a tuple,
check that it doesn’t fall outside the bounds of the variant first.
This prevents an out-of-bounds read from some non-normal tuples.
This bug was introduced in commit 73d0aa81c2575a5c9ae77d.
Includes a unit test, although the test will likely only catch the
original bug if run with asan enabled.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #2840
oss-fuzz#54302
---
glib/gvariant-serialiser.c | 12 ++++++--
glib/tests/gvariant.c | 63 ++++++++++++++++++++++++++++++++++++++
2 files changed, 72 insertions(+), 3 deletions(-)
diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c
index f443c2eb85..4e4a73ad17 100644
--- a/glib/gvariant-serialiser.c
+++ b/glib/gvariant-serialiser.c
@@ -984,7 +984,8 @@ gvs_tuple_get_member_bounds (GVariantSerialised value,
member_info = g_variant_type_info_member_info (value.type_info, index_);
- if (member_info->i + 1)
+ if (member_info->i + 1 &&
+ offset_size * (member_info->i + 1) <= value.size)
member_start = gvs_read_unaligned_le (value.data + value.size -
offset_size * (member_info->i + 1),
offset_size);
@@ -995,7 +996,8 @@ gvs_tuple_get_member_bounds (GVariantSerialised value,
member_start &= member_info->b;
member_start |= member_info->c;
- if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_LAST)
+ if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_LAST &&
+ offset_size * (member_info->i + 1) <= value.size)
member_end = value.size - offset_size * (member_info->i + 1);
else if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_FIXED)
@@ -1006,11 +1008,15 @@ gvs_tuple_get_member_bounds (GVariantSerialised value,
member_end = member_start + fixed_size;
}
- else /* G_VARIANT_MEMBER_ENDING_OFFSET */
+ else if (member_info->ending_type == G_VARIANT_MEMBER_ENDING_OFFSET &&
+ offset_size * (member_info->i + 2) <= value.size)
member_end = gvs_read_unaligned_le (value.data + value.size -
offset_size * (member_info->i + 2),
offset_size);
+ else /* invalid */
+ member_end = G_MAXSIZE;
+
if (out_member_start != NULL)
*out_member_start = member_start;
if (out_member_end != NULL)
diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c
index b360888e4d..98c51a1d75 100644
--- a/glib/tests/gvariant.c
+++ b/glib/tests/gvariant.c
@@ -5576,6 +5576,67 @@ test_normal_checking_tuple_offsets4 (void)
g_variant_unref (variant);
}
+/* This is a regression test that dereferencing the first element in the offset
+ * table doesn’t dereference memory before the start of the GVariant. The first
+ * element in the offset table gives the offset of the final member in the
+ * tuple (the offset table is stored in reverse), and the position of this final
+ * member is needed to check that none of the tuple members overlap with the
+ * offset table
+ *
+ * See https://gitlab.gnome.org/GNOME/glib/-/issues/2840 */
+static void
+test_normal_checking_tuple_offsets5 (void)
+{
+ /* A tuple of type (sss) in normal form would have an offset table with two
+ * entries:
+ * - The first entry (lowest index in the table) gives the offset of the
+ * third `s` in the tuple, as the offset table is reversed compared to the
+ * tuple members.
+ * - The second entry (highest index in the table) gives the offset of the
+ * second `s` in the tuple.
+ * - The offset of the first `s` in the tuple is always 0.
+ *
+ * See §2.5.4 (Structures) of the GVariant specification for details, noting
+ * that the table is only layed out this way because all three members of the
+ * tuple have non-fixed sizes.
+ *
+ * It’s not clear whether the 0xaa data of this variant is part of the strings
+ * in the tuple, or part of the offset table. It doesn’t really matter. This
+ * is a regression test to check that the code to validate the offset table
+ * doesn’t unconditionally try to access the first entry in the offset table
+ * by subtracting the table size from the end of the GVariant data.
+ *
+ * In this non-normal case, that would result in an address off the start of
+ * the GVariant data, and an out-of-bounds read, because the GVariant is one
+ * byte long, but the offset table is calculated as two bytes long (with 1B
+ * sized entries) from the tuple’s type.
+ */
+ const GVariantType *data_type = G_VARIANT_TYPE ("(sss)");
+ const guint8 data[] = { 0xaa };
+ gsize size = sizeof (data);
+ GVariant *variant = NULL;
+ GVariant *normal_variant = NULL;
+ GVariant *expected = NULL;
+
+ g_test_bug ("https://gitlab.gnome.org/GNOME/glib/-/issues/2840");
+
+ variant = g_variant_new_from_data (data_type, data, size, FALSE, NULL, NULL);
+ g_assert_nonnull (variant);
+
+ g_assert_false (g_variant_is_normal_form (variant));
+
+ normal_variant = g_variant_get_normal_form (variant);
+ g_assert_nonnull (normal_variant);
+
+ expected = g_variant_new_parsed ("('', '', '')");
+ g_assert_cmpvariant (expected, variant);
+ g_assert_cmpvariant (expected, normal_variant);
+
+ g_variant_unref (expected);
+ g_variant_unref (normal_variant);
+ g_variant_unref (variant);
+}
+
/* Test that an otherwise-valid serialised GVariant is considered non-normal if
* its offset table entries are too wide.
*
@@ -5827,6 +5888,8 @@ main (int argc, char **argv)
test_normal_checking_tuple_offsets3);
g_test_add_func ("/gvariant/normal-checking/tuple-offsets4",
test_normal_checking_tuple_offsets4);
+ g_test_add_func ("/gvariant/normal-checking/tuple-offsets5",
+ test_normal_checking_tuple_offsets5);
g_test_add_func ("/gvariant/normal-checking/tuple-offsets/minimal-sized",
test_normal_checking_tuple_offsets_minimal_sized);
g_test_add_func ("/gvariant/normal-checking/empty-object-path",
--
GitLab
From 21a204147b16539b3eda3143b32844c49e29f4d4 Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@endlessos.org>
Date: Thu, 15 Dec 2022 16:49:28 +0000
Subject: [PATCH 2/2] gvariant: Propagate trust when getting a child of a
serialised variant
If a variant is trusted, that means all its children are trusted, so
ensure that their checked offsets are set as such.
This allows a lot of the offset table checks to be avoided when getting
children from trusted serialised tuples, which speeds things up.
No unit test is included because this is just a performance fix. If
there are other slownesses, or regressions, in serialised `GVariant`
performance, the fuzzing setup will catch them like it did this one.
This change does reduce the time to run the oss-fuzz reproducer from 80s
to about 0.7s on my machine.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #2841
oss-fuzz#54314
---
glib/gvariant-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/glib/gvariant-core.c b/glib/gvariant-core.c
index f441c4757e..4778022829 100644
--- a/glib/gvariant-core.c
+++ b/glib/gvariant-core.c
@@ -1198,8 +1198,8 @@ g_variant_get_child_value (GVariant *value,
child->contents.serialised.bytes =
g_bytes_ref (value->contents.serialised.bytes);
child->contents.serialised.data = s_child.data;
- child->contents.serialised.ordered_offsets_up_to = s_child.ordered_offsets_up_to;
- child->contents.serialised.checked_offsets_up_to = s_child.checked_offsets_up_to;
+ child->contents.serialised.ordered_offsets_up_to = (value->state & STATE_TRUSTED) ? G_MAXSIZE : s_child.ordered_offsets_up_to;
+ child->contents.serialised.checked_offsets_up_to = (value->state & STATE_TRUSTED) ? G_MAXSIZE : s_child.checked_offsets_up_to;
return child;
}
--
GitLab

141
base/rx/rx-glib2/3272.patch Normal file
View File

@ -0,0 +1,141 @@
From 059f4f3999f1de506417611318c6f27db57fb689 Mon Sep 17 00:00:00 2001
From: Marius Vollmer <mvollmer@redhat.com>
Date: Mon, 13 Feb 2023 14:12:52 +0200
Subject: [PATCH] gdbus: Never buffer reads during server authentication
Otherwise, the content of the buffer is thrown away when switching
from reading via a GDataInputStream to unbuffered reads when waiting
for the "BEGIN" line.
(The code already tried to protect against over-reading like this by
using unbuffered reads for the last few lines of the auth protocol,
but it might already be too late at that point. The buffer of the
GDataInputStream might already contain the "BEGIN" line for example.)
This matters when connecting a sd-bus client directly to a GDBus
client. A sd-bus client optimistically sends the whole auth
conversation in one go without waiting for intermediate replies. This
is done to improve performance for the many short-lived connections
that are typically made.
---
gio/gdbusauth.c | 50 ++++++++++++++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 19 deletions(-)
diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
index c430f0cf0..17c7d47b7 100644
--- a/gio/gdbusauth.c
+++ b/gio/gdbusauth.c
@@ -933,7 +933,6 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
{
gboolean ret;
ServerState state;
- GDataInputStream *dis;
GDataOutputStream *dos;
GError *local_error;
gchar *line;
@@ -949,7 +948,6 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
_g_dbus_auth_add_mechs (auth, observer);
ret = FALSE;
- dis = NULL;
dos = NULL;
mech = NULL;
negotiated_capabilities = 0;
@@ -965,13 +963,18 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
goto out;
}
- dis = G_DATA_INPUT_STREAM (g_data_input_stream_new (g_io_stream_get_input_stream (auth->priv->stream)));
+ /* We use an extremely slow (but reliable) line reader for input
+ * instead of something buffered - this basically does a recvfrom()
+ * system call per character
+ *
+ * (the problem with using GDataInputStream's read_line is that
+ * because of buffering it might start reading into the first D-Bus
+ * message that appears after "BEGIN\r\n"....)
+ */
+
dos = G_DATA_OUTPUT_STREAM (g_data_output_stream_new (g_io_stream_get_output_stream (auth->priv->stream)));
- g_filter_input_stream_set_close_base_stream (G_FILTER_INPUT_STREAM (dis), FALSE);
g_filter_output_stream_set_close_base_stream (G_FILTER_OUTPUT_STREAM (dos), FALSE);
- g_data_input_stream_set_newline_type (dis, G_DATA_STREAM_NEWLINE_TYPE_CR_LF);
-
/* read the NUL-byte, possibly with credentials attached */
#ifdef G_OS_UNIX
#ifndef G_CREDENTIALS_PREFER_MESSAGE_PASSING
@@ -1010,11 +1013,22 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
}
else
{
+ gchar c;
+ gssize num_read;
+
local_error = NULL;
- (void)g_data_input_stream_read_byte (dis, cancellable, &local_error);
- if (local_error != NULL)
+ num_read = g_input_stream_read (g_io_stream_get_input_stream (auth->priv->stream),
+ &c, 1,
+ cancellable, &local_error);
+ if (num_read != 1 || local_error != NULL)
{
- g_propagate_error (error, local_error);
+ if (local_error == NULL)
+ g_set_error_literal (error,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ _ ("Unexpected lack of content trying to read a byte"));
+ else
+ g_propagate_error (error, local_error);
goto out;
}
}
@@ -1050,7 +1064,10 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
{
case SERVER_STATE_WAITING_FOR_AUTH:
debug_print ("SERVER: WaitingForAuth");
- line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error);
+ line = _my_g_input_stream_read_line_safe (g_io_stream_get_input_stream (auth->priv->stream),
+ &line_length,
+ cancellable,
+ error);
debug_print ("SERVER: WaitingForAuth, read '%s'", line);
if (line == NULL)
goto out;
@@ -1260,7 +1277,10 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
case SERVER_STATE_WAITING_FOR_DATA:
debug_print ("SERVER: WaitingForData");
- line = _my_g_data_input_stream_read_line (dis, &line_length, cancellable, error);
+ line = _my_g_input_stream_read_line_safe (g_io_stream_get_input_stream (auth->priv->stream),
+ &line_length,
+ cancellable,
+ error);
debug_print ("SERVER: WaitingForData, read '%s'", line);
if (line == NULL)
goto out;
@@ -1299,13 +1319,6 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
case SERVER_STATE_WAITING_FOR_BEGIN:
debug_print ("SERVER: WaitingForBegin");
- /* Use extremely slow (but reliable) line reader - this basically
- * does a recvfrom() system call per character
- *
- * (the problem with using GDataInputStream's read_line is that because of
- * buffering it might start reading into the first D-Bus message that
- * appears after "BEGIN\r\n"....)
- */
line = _my_g_input_stream_read_line_safe (g_io_stream_get_input_stream (auth->priv->stream),
&line_length,
cancellable,
@@ -1364,7 +1377,6 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
out:
g_clear_object (&mech);
- g_clear_object (&dis);
g_clear_object (&dos);
g_clear_object (&own_credentials);
--
2.41.0

1078
base/rx/rx-glib2/3353.patch Normal file

File diff suppressed because it is too large Load Diff

195
base/rx/rx-glib2/3845.patch Normal file
View File

@ -0,0 +1,195 @@
From 37e323f1d16720d662611866cde567b1d2a01d48 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Mon, 22 Jan 2024 15:29:37 +0100
Subject: [PATCH 1/2] gunixmounts: Use libmnt_monitor API for monitoring
The `GUnixMountMonitor` object implements monitoring on its own currently.
Only the `/proc/mounts` file changes are monitored. It is not aware of the
`/run/mount/utab` file changes. This file contains the userspace mount
options (e.g. `x-gvfs-notrash`, `x-gvfs-hide`) among others. There is a
problem when `/sbin/mount.<type>` (e.g. `mount.nfs`) helper programs are
used. In that case, the `/run/mount/utab` file is updated later than the
`/proc/mounts` file and thus the `GUnixMountMonitor` clients (e.g.
`gvfs-udisks2-volume-monitor`, `gvfsd-trash`) don't see the userspace
options until the next `mount-changed` signal. Let's use the `libmnt_monitor`
API for monitoring instead and emit the `mount-changed` signal also when the
`/run/mount/utab` file is changed.
Related: https://issues.redhat.com/browse/RHEL-14607
Related: https://github.com/util-linux/util-linux/pull/2607
---
gio/gunixmounts.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 71 insertions(+), 1 deletion(-)
diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
index 32b936259..e11b34a7d 100644
--- a/gio/gunixmounts.c
+++ b/gio/gunixmounts.c
@@ -202,6 +202,11 @@ static GSource *proc_mounts_watch_source;
#define endmntent(f) fclose(f)
#endif
+#ifdef HAVE_LIBMOUNT
+/* Protected by proc_mounts_source lock */
+static struct libmnt_monitor *proc_mounts_monitor = NULL;
+#endif
+
static gboolean
is_in (const char *value, const char *set[])
{
@@ -1859,7 +1864,36 @@ proc_mounts_changed (GIOChannel *channel,
GIOCondition cond,
gpointer user_data)
{
+ gboolean has_changed = FALSE;
+
+#ifdef HAVE_LIBMOUNT
+ if (cond & G_IO_IN)
+ {
+ G_LOCK (proc_mounts_source);
+ if (proc_mounts_monitor != NULL)
+ {
+ int ret;
+
+ /* The mnt_monitor_next_change function needs to be used to avoid false-positives. */
+ ret = mnt_monitor_next_change (proc_mounts_monitor, NULL, NULL);
+ if (ret == 0)
+ {
+ has_changed = TRUE;
+ ret = mnt_monitor_event_cleanup (proc_mounts_monitor);
+ }
+
+ if (ret < 0)
+ g_debug ("mnt_monitor_next_change failed: %s", g_strerror (-ret));
+ }
+ G_UNLOCK (proc_mounts_source);
+ }
+
+#else
if (cond & G_IO_ERR)
+ has_changed = TRUE;
+#endif
+
+ if (has_changed)
{
G_LOCK (proc_mounts_source);
mount_poller_time = (guint64) g_get_monotonic_time ();
@@ -1924,6 +1958,10 @@ mount_monitor_stop (void)
g_source_destroy (proc_mounts_watch_source);
proc_mounts_watch_source = NULL;
}
+
+#ifdef HAVE_LIBMOUNT
+ g_clear_pointer (&proc_mounts_monitor, mnt_unref_monitor);
+#endif
G_UNLOCK (proc_mounts_source);
if (mtab_monitor)
@@ -1965,9 +2003,37 @@ mount_monitor_start (void)
*/
if (g_str_has_prefix (mtab_path, "/proc/"))
{
- GIOChannel *proc_mounts_channel;
+ GIOChannel *proc_mounts_channel = NULL;
GError *error = NULL;
+#ifdef HAVE_LIBMOUNT
+ int ret;
+
+ G_LOCK (proc_mounts_source);
+
+ proc_mounts_monitor = mnt_new_monitor ();
+ ret = mnt_monitor_enable_kernel (proc_mounts_monitor, TRUE);
+ if (ret < 0)
+ g_warning ("mnt_monitor_enable_kernel failed: %s", g_strerror (-ret));
+
+ ret = mnt_monitor_enable_userspace (proc_mounts_monitor, TRUE, NULL);
+ if (ret < 0)
+ g_warning ("mnt_monitor_enable_userspace failed: %s", g_strerror (-ret));
+
+ ret = mnt_monitor_get_fd (proc_mounts_monitor);
+ if (ret >= 0)
+ {
+ proc_mounts_channel = g_io_channel_unix_new (ret);
+ }
+ else
+ {
+ g_set_error_literal (&error, G_IO_ERROR, g_io_error_from_errno (-ret),
+ g_strerror (-ret));
+ }
+
+ G_UNLOCK (proc_mounts_source);
+#else
proc_mounts_channel = g_io_channel_new_file (mtab_path, "r", &error);
+#endif
if (proc_mounts_channel == NULL)
{
g_warning ("Error creating IO channel for %s: %s (%s, %d)", mtab_path,
@@ -1978,7 +2044,11 @@ mount_monitor_start (void)
{
G_LOCK (proc_mounts_source);
+#ifdef HAVE_LIBMOUNT
+ proc_mounts_watch_source = g_io_create_watch (proc_mounts_channel, G_IO_IN);
+#else
proc_mounts_watch_source = g_io_create_watch (proc_mounts_channel, G_IO_ERR);
+#endif
mount_poller_time = (guint64) g_get_monotonic_time ();
g_source_set_callback (proc_mounts_watch_source,
(GSourceFunc) proc_mounts_changed,
--
2.43.0
From bb7d6b8fcef36af5452071c8758f89955888469a Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Wed, 31 Jan 2024 13:35:39 +0100
Subject: [PATCH 2/2] gunixmounts: Use mnt_monitor_veil_kernel option
The previous commit enabled the `/run/mount/utab` monitoring. The problem
is that the `mount-changed` signal can be emitted twice for one mount. One
for the `/proc/mounts` file change and another one for the `/run/media/utab`
file change. This is still not ideal because e.g. the `GMount` objects for
mounts with the `x-gvfs-hide` option are added and immediately removed.
Let's enable the `mnt_monitor_veil_kernel` option to avoid this.
Related: https://github.com/util-linux/util-linux/pull/2725
---
gio/gunixmounts.c | 6 ++++++
meson.build | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
index e11b34a7d..6abe87414 100644
--- a/gio/gunixmounts.c
+++ b/gio/gunixmounts.c
@@ -2019,6 +2019,12 @@ mount_monitor_start (void)
if (ret < 0)
g_warning ("mnt_monitor_enable_userspace failed: %s", g_strerror (-ret));
+#ifdef HAVE_MNT_MONITOR_VEIL_KERNEL
+ ret = mnt_monitor_veil_kernel (proc_mounts_monitor, TRUE);
+ if (ret < 0)
+ g_warning ("mnt_monitor_veil_kernel failed: %s", g_strerror (-ret));
+#endif
+
ret = mnt_monitor_get_fd (proc_mounts_monitor);
if (ret >= 0)
{
diff --git a/meson.build b/meson.build
index a0502fe69..159703557 100644
--- a/meson.build
+++ b/meson.build
@@ -2102,6 +2102,10 @@ libmount_dep = []
if host_system == 'linux'
libmount_dep = dependency('mount', version : '>=2.23', required : get_option('libmount'))
glib_conf.set('HAVE_LIBMOUNT', libmount_dep.found())
+
+ if libmount_dep.found() and cc.has_function('mnt_monitor_veil_kernel', dependencies: libmount_dep)
+ glib_conf.set('HAVE_MNT_MONITOR_VEIL_KERNEL', 1)
+ endif
endif
# gnutls is used optionally by GHmac
--
2.43.0

3359
base/rx/rx-glib2/4038.patch Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1012
base/rx/rx-glib2/glib2.spec Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,47 @@
From 07a8ac908cbadb22c344895ebf9cc00c6a8fd3f7 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Wed, 29 Mar 2017 07:05:41 +0200
Subject: [PATCH] don't add extra libraries for linking
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
---
lang/cpp/src/GpgmeppConfig.cmake.in.in | 2 +-
src/gpgme-config.in | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lang/cpp/src/GpgmeppConfig.cmake.in.in b/lang/cpp/src/GpgmeppConfig.cmake.in.in
index 73f5eaad..3104d715 100644
--- a/lang/cpp/src/GpgmeppConfig.cmake.in.in
+++ b/lang/cpp/src/GpgmeppConfig.cmake.in.in
@@ -63,7 +63,7 @@ add_library(Gpgmepp SHARED IMPORTED)
set_target_properties(Gpgmepp PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/gpgme++;@resolved_includedir@"
- INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme@libsuffix@;@LIBASSUAN_LIBS@"
+ INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme@libsuffix@"
IMPORTED_LOCATION "@resolved_libdir@/libgpgmepp@libsuffix@"
)
diff --git a/src/gpgme-config.in b/src/gpgme-config.in
index a4d152e1..6a854e4a 100644
--- a/src/gpgme-config.in
+++ b/src/gpgme-config.in
@@ -22,12 +22,12 @@ cflags="-I@includedir@"
libs="-L@libdir@"
# Network libraries.
-assuan_cflags="@LIBASSUAN_CFLAGS@"
-assuan_libs="@LIBASSUAN_LIBS@"
+#assuan_cflags="@LIBASSUAN_CFLAGS@"
+#assuan_libs="@LIBASSUAN_LIBS@"
# Configure libgpg-error.
gpg_error_cflags="@GPG_ERROR_CFLAGS@"
-gpg_error_libs="@GPG_ERROR_LIBS@"
+#gpg_error_libs="@GPG_ERROR_LIBS@"
# Configure thread packages.
thread_modules=""
--
2.15.1

View File

@ -0,0 +1,112 @@
From b0eabea4b1232ee7f45d13b8add928d463f37444 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Wed, 29 Mar 2017 07:13:35 +0200
Subject: [PATCH] fix stupid ax_python_devel
References: https://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commit;h=883a2abd5af5c96be894d5ef7ee6e9a2b8e64307
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
---
m4/ax_python_devel.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -up gpgme-1.22.0/configure.stupid gpgme-1.22.0/configure
--- gpgme-1.22.0/configure.stupid 2023-08-21 09:46:33.000000000 +0200
+++ gpgme-1.22.0/configure 2023-10-10 12:31:08.317796779 +0200
@@ -23374,7 +23374,7 @@ variable to configure. See \`\`configure
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
printf %s "checking for the distutils Python package... " >&6; }
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
- if test -z "$ac_distutils_result"; then
+ if test $? -eq 0; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
@@ -24146,7 +24146,7 @@ variable to configure. See \`\`configure
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
printf %s "checking for the distutils Python package... " >&6; }
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
- if test -z "$ac_distutils_result"; then
+ if test $? -eq 0; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
@@ -24918,7 +24918,7 @@ variable to configure. See \`\`configure
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
printf %s "checking for the distutils Python package... " >&6; }
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
- if test -z "$ac_distutils_result"; then
+ if test $? -eq 0; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
@@ -25690,7 +25690,7 @@ variable to configure. See \`\`configure
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
printf %s "checking for the distutils Python package... " >&6; }
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
- if test -z "$ac_distutils_result"; then
+ if test $? -eq 0; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
@@ -26462,7 +26462,7 @@ variable to configure. See \`\`configure
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
printf %s "checking for the distutils Python package... " >&6; }
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
- if test -z "$ac_distutils_result"; then
+ if test $? -eq 0; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
@@ -27234,7 +27234,7 @@ variable to configure. See \`\`configure
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
printf %s "checking for the distutils Python package... " >&6; }
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
- if test -z "$ac_distutils_result"; then
+ if test $? -eq 0; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
@@ -28006,7 +28006,7 @@ variable to configure. See \`\`configure
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
printf %s "checking for the distutils Python package... " >&6; }
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
- if test -z "$ac_distutils_result"; then
+ if test $? -eq 0; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
@@ -28778,7 +28778,7 @@ variable to configure. See \`\`configure
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
printf %s "checking for the distutils Python package... " >&6; }
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
- if test -z "$ac_distutils_result"; then
+ if test $? -eq 0; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
@@ -29550,7 +29550,7 @@ variable to configure. See \`\`configure
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
printf %s "checking for the distutils Python package... " >&6; }
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
- if test -z "$ac_distutils_result"; then
+ if test $? -eq 0; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
@@ -30322,7 +30322,7 @@ variable to configure. See \`\`configure
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
printf %s "checking for the distutils Python package... " >&6; }
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
- if test -z "$ac_distutils_result"; then
+ if test $? -eq 0; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
@@ -31094,7 +31094,7 @@ variable to configure. See \`\`configure
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5
printf %s "checking for the distutils Python package... " >&6; }
ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
- if test -z "$ac_distutils_result"; then
+ if test $? -eq 0; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else

View File

@ -0,0 +1,12 @@
diff --git a/lang/python/Makefile.in b/lang/python/Makefile.in
index c0fc091..d567ecb 100644
--- a/lang/python/Makefile.in
+++ b/lang/python/Makefile.in
@@ -802,6 +802,7 @@ install-exec-local:
--build-base="$$(basename "$${PYTHON}")-gpg" \
install \
--prefix "$(DESTDIR)$(prefix)" \
+ $${SETUP_PY_EXTRA_OPTS:-} \
--verbose ; \
done

View File

@ -0,0 +1,58 @@
diff --git a/lang/qt/tests/t-remarks.cpp b/lang/qt/tests/t-remarks.cpp
index f9a901a..4b2f2ab 100644
--- a/lang/qt/tests/t-remarks.cpp
+++ b/lang/qt/tests/t-remarks.cpp
@@ -47,6 +47,12 @@
#include "t-support.h"
+#define SKIP_ON_2_4() do { \
+ if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() >= "2.4.0") { \
+ QSKIP("The test does not work well with gnupg 2.4+."); \
+ } \
+} while (false)
+
using namespace QGpgME;
using namespace GpgME;
@@ -105,6 +111,7 @@ private Q_SLOTS:
void testRemarkReplaceSingleUIDExportable()
{
+ SKIP_ON_2_4();
if (!loopbackSupported()) {
return;
}
@@ -187,6 +194,7 @@ private Q_SLOTS:
void testMultipleRemarks()
{
+ SKIP_ON_2_4();
if (!loopbackSupported()) {
return;
}
@@ -269,6 +277,7 @@ private Q_SLOTS:
void testRemarkReplaceSingleUID()
{
+ SKIP_ON_2_4();
if (!loopbackSupported()) {
return;
}
@@ -350,6 +359,7 @@ private Q_SLOTS:
void testRemarkReplaceMultiUID()
{
+ SKIP_ON_2_4();
if (!loopbackSupported()) {
return;
}
@@ -466,6 +476,8 @@ private:
QTemporaryDir mDir;
};
+#undef SKIP_ON_2_4
+
QTEST_MAIN(TestRemarks)
#include "t-remarks.moc"

380
base/rx/rx-gpgme/changelog Normal file
View File

@ -0,0 +1,380 @@
* Fri Jun 16 2023 Marie Loise Nolden <loise@kde.org> - 1.20.0-1
- Update to 1.20.0 and enable/add qt6 build for qgpgme. The qt5 and qt6
rpms have been split out into separate libs and -devel rpms for compatibility.
* Tue Nov 02 2021 Frantisek Sumsal <frantisek@sumsal.cz> - 1.15.1-6
- Fix build with glibc >=2.34 (RHBZ#1984691, RHBZ#1987561)
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jun 03 2021 Python Maint <python-maint@redhat.com> - 1.15.1-4
- Rebuilt for Python 3.10
* Wed Jun 02 2021 Miro Hrončok <mhroncok@redhat.com> - 1.15.1-3
- Also remove RPATH from /usr/bin/gpgme-json
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sun Jan 24 2021 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.15.1-1
- Update to 1.15.1
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.14.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sat Jul 18 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.14.0-1
- Update to 1.14.0
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 1.13.1-8
- Rebuilt for Python 3.9
* Thu Apr 30 2020 Tomáš Mráz <tmraz@redhat.com> - 1.13.1-7
- Fix FTBFS with gnupg-2.2.19 and above
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.13.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.13.1-5
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 1.13.1-4
- Rebuilt for Python 3.8
* Sat Aug 10 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.13.1-3
- Set real VERSION
* Sat Aug 3 2019 Peter Robinson <pbrobinson@fedoraproject.org> 1.13.1-2
- Move .pc files to devel so the base library doesn't pull in devel packages
* Mon Jul 29 18:46:42 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.13.1-1
- Update to 1.13.1
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Jun 05 2019 Miro Hrončok <mhroncok@redhat.com> - 1.12.0-2
- Subpackage python2-gpg has been removed
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
* Sat Feb 16 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.12.0-1
- Update to 1.12.0
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 1.11.1-2
- Rebuilt for Python 3.7
* Fri Apr 20 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.11.1-1
- Update to 1.11.1
* Thu Apr 19 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.11.0-1
- Update to 1.11.0
* Tue Apr 17 2018 Jonathan Lebon <jonathan@jlebon.com> - 1.10.0-4
- Backport patch to tweak STATUS_FAILURE handling
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Tue Jan 30 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.10.0-2
- Switch to %%ldconfig_scriptlets
* Wed Dec 13 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.10.0-1
- Update to 1.10.0
* Tue Nov 07 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.9.0-8
- Use better Obsoletes for platform-python
* Fri Nov 03 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.9.0-7
- Remove platform-python subpackages
* Thu Aug 10 2017 Petr Viktorin <pviktori@redhat.com> - 1.9.0-6
- Add subpackage for platform-python (https://fedoraproject.org/wiki/Changes/Platform_Python_Stack)
* Mon Aug 07 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.9.0-5
- Remove BuildRequires: pth-devel, it is not needed for long time
* Mon Aug 07 2017 Björn Esser <besser82@fedoraproject.org> - 1.9.0-4
- Rebuilt for AutoReq cmake-filesystem
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Wed Mar 29 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.9.0-1
- Update to 1.9.0
* Sat Feb 11 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.8.0-12
- Fix FTBFS
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Wed Jan 18 2017 Rex Dieter <rdieter@fedoraproject.org> - 1.8.0-10
- patch out LIBASSUAN_LIBRARIES in cmake too
* Wed Jan 18 2017 Rex Dieter <rdieter@fedoraproject.org> - 1.8.0-9
- gpgmepp-devel: Requires: libassuan-devel
* Mon Jan 16 2017 Rex Dieter <rdieter@fedoraproject.org> - 1.8.0-8
- qgpgme-devel: Conflicts: kdepimlibs-devel < 4.14.10-17
* Sun Jan 01 2017 Rex Dieter <rdieter@math.unl.edu> - 1.8.0-7
- rename gpgme-pp to gpgmepp, simplify -devel deps
* Sun Jan 01 2017 Rex Dieter <rdieter@math.unl.edu> - 1.8.0-6
- backport upstream cmake-related fix
* Thu Dec 22 2016 Miro Hrončok <mhroncok@redhat.com> - 1.8.0-5
- Rebuild for Python 3.6
* Sun Dec 11 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.8.0-4
- Rename pythonX-gpgme into pythonX-gpg
* Sun Dec 11 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.8.0-3
- Add Qt and C++ subpackages
* Sat Dec 10 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.8.0-2
- Enable tests
* Sat Dec 10 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.8.0-1
- Update to 1.8.0
* Wed Sep 21 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.7.0-1
- Update to 1.7.0
* Mon Jul 25 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.6.0-3
- Set min ver for libgpg-error
* Mon Jul 25 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.6.0-2
- Backport patch for STATUS_KEY_CONSIDERED (RHBZ #1359521)
* Wed Jul 13 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.6.0-1
- Update to 1.6.0 (RHBZ #1167656)
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Dec 06 2014 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.4.3-5
- CVE-2014-3564, rhbz#1125170, gpgme-1.3.2-bufferoverflow.patch
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jul 12 2014 Tom Callaway <spot@fedoraproject.org> - 1.4.3-3
- fix license handling
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed Oct 09 2013 Rex Dieter <rdieter@fedoraproject.org> - 1.4.3-1
- gpgme-1.4.3
- cleanup .spec, trim changelog
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Tue Jul 09 2013 Karsten Hopp <karsten@redhat.com> 1.3.2-3
- rebuild to fix some f20 dependency issues on PPC
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Tue Nov 20 2012 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.3.2-2
- minor spec cleanup
* Wed Sep 26 2012 Tomas Mraz <tmraz@redhat.com> - 1.3.2-1
- new upstream version
- re-enable gpg tests (original patch by John Morris <john@zultron.com>)
- quiet configure warning 'could not find g13'
- there is no libgpgme-pth anymore
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Sun Apr 22 2012 Rex Dieter <rdieter@fedoraproject.org> 1.3.0-8
- -devel: make Requires: libgpg-error-devel arch'd
- ensure gpgme-config wrapper is executable
* Sun Apr 22 2012 Rex Dieter <rdieter@fedoraproject.org> 1.3.0-7
- gpgme.h: fatal error: gpgme-i386.h: No such file or directory compilation terminated (#815116)
* Wed Feb 15 2012 Simon Lukasik <slukasik@redhat.com> - 1.3.0-6
- Resolve multilib conflict of gpgme-config (#341351)
- Resolve multilib conflict of gpgme.h (#341351)
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Thu Mar 17 2011 Rex Dieter <rdieter@fedoraproject.org> - 1.3.0-4
- gpgme-config: remove libassuan-related flags as threatened (#676954)
\
* Sun Feb 13 2011 Rex Dieter <rdieter@fedoraproject.org> - 1.3.0-3
- -devel: fix typo (broken dep)
* Sat Feb 12 2011 Rex Dieter <rdieter@fedoraproject.org> - 1.3.0-2
- BR: libassuan2-devel
- gpgme-config outputs -lassuan (#676954)
* Fri Feb 11 2011 Tomas Mraz <tmraz@redhat.com> - 1.3.0-1
- new upstream version
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Wed Aug 18 2010 Tomas Mraz <tmraz@redhat.com> - 1.2.0-3
- fix the condition for adding the -D_FILE_OFFSET_BITS...
* Wed Aug 11 2010 Tomas Mraz <tmraz@redhat.com> - 1.2.0-2
- add -D_FILE_OFFSET_BITS... to gpgme-config as appropriate (#621698)
* Fri Jul 02 2010 Rex Dieter <rdieter@fedoraproject.org> - 1.2.0-1
- gpgme-1.2.0 (#610984)
* Sun Feb 14 2010 Rex Dieter <rdieter@fedoraproject.org> - 1.1.8-4
- FTBFS gpgme-1.1.8-3.fc13: ImplicitDSOLinking (#564605)
* Thu Nov 19 2009 Tomas Mraz <tmraz@redhat.com> - 1.1.8-3
- Add buildrequires gnupg2-smime for the gpgsm
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Sat Jun 20 2009 Rex Dieter <rdieter@fedoraproject.org> - 1.1.8-1
- gpgme-1.1.8
- -devel: s/postun/preun/ info scriptlet
* Wed Mar 11 2009 Rex Dieter <rdieter@fedoraproject.org> - 1.1.7-3
- track shlib sonames closer, to highlight future abi/soname changes
- _with_gpg macro, to potentially conditionalize gnupg vs gnupg2 defaults
for various os/releases (ie, fedora vs rhel)
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Sat Oct 18 2008 Rex Dieter <rdieter@fedoraproject.org> 1.1.7-1
- gpgme-1.1.7
* Sun Feb 17 2008 Rex Dieter <rdieter@fedoraproject.org> 1.1.6-3
- --with-gpg=%%_bindir/gpg2 (#432445)
- drop Requires: gnupg (#432445)
* Fri Feb 08 2008 Rex Dieter <rdieter@fedoraproject.org> 1.1.6-2
- respin (gcc43)
* Fri Jan 04 2008 Rex Dieter <rdieter[AT]fedoraproject.org> 1.1.6-1
- gpgme-1.1.6
- multiarch conflicts in gpgme (#341351)
* Sat Aug 25 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1.1.5-4
- BR: gawk
* Sat Aug 25 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1.1.5-3
- respin (BuildID)
* Thu Aug 09 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1.1.5-2
- License: LGPLv2+
* Mon Jul 09 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1.1.5-1
- gpgme-1.1.5
* Mon Mar 05 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1.1.4-1
- gpgme-1.1.4
* Sat Feb 03 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 1.1.3-1
- gpgme-1.1.3
* Tue Oct 03 2006 Rex Dieter <rexdieter[AT]users.sf.net>
- respin
* Mon Sep 18 2006 Rex Dieter <rexdieter[AT]users.sf.net> 1.1.2-6
- fix gpgme-config --thread=pthread --cflags
* Tue Aug 29 2006 Rex Dieter <rexdieter[AT]users.sf.net> 1.1.2-5
- fc6 respin
* Mon Mar 6 2006 Rex Dieter <rexdieter[AT]users.sf.net> 1.1.2-4
- add back support for gpgme-config --thread=pthread
* Mon Mar 6 2006 Rex Dieter <rexdieter[AT]users.sf.net> 1.1.2-2
- drop extraneous libs from gpgme-config
* Fri Mar 3 2006 Rex Dieter <rexdieter[AT]users.sf.net> 1.1.2-1
- 1.1.2
- drop upstreamed gpgme-1.1.0-tests.patch
* Wed Mar 1 2006 Rex Dieter <rexdieter[AT]users.sf.net>
- fc5: gcc/glibc respin
* Wed Nov 30 2005 Rex Dieter <rexdieter[AT]users.sf.net> - 1.1.0-3
- (re)build against (newer) libksba/gnupg2
* Thu Oct 06 2005 Rex Dieter <rexdieter[AT]users.sf.net> - 1.1.0-2
- 1.1.0
* Mon Aug 8 2005 Rex Dieter <rexdieter[AT]users.sf.net> - 1.0.3-1
- 1.0.3
- --disable-static
* Thu May 12 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 1.0.2-3
- rebuilt
* Fri Mar 18 2005 Ville Skyttä <ville.skytta at iki.fi> - 1.0.2-2
- Fix FC4 build.
* Tue Feb 1 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 0:1.0.2-1
- LGPL used here, and made summary more explicit.
- Remove dirmngr dependency (gpgsm interfaces with it).
- Obsolete cryptplug as gpgme >= 0.4.5 provides what we used cryptplug for.
* Thu Jan 06 2005 Rex Dieter <rexdieter[AT]users.sf.net> 0:1.0.2-0.fdr.1
- 1.0.2
* Thu Oct 21 2004 Rex Dieter <rexdieter at sf.net> 0:1.0.0-0.fdr.1
- 1.0.0
- Requires: dirmngr
* Tue Oct 19 2004 Rex Dieter <rexdieter at sf.net> 0:0.4.7-0.fdr.1
- 0.4.7
* Sun May 2 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:0.4.3-0.fdr.3
- Require %%{_bindir}/gpgsm instead of newpg.
- Cosmetic spec file improvements.
* Thu Oct 23 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:0.4.3-0.fdr.2
- Update description.
* Tue Oct 7 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:0.4.3-0.fdr.1
- Update to 0.4.3.
* Fri Aug 15 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:0.4.2-0.fdr.1
- Update to 0.4.2.
- make check in the %%check section.
* Thu Jul 10 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:0.4.1-0.fdr.1
- Update to 0.4.1.
- Make -devel cooperate with --excludedocs.
* Sat Apr 19 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:0.4.0-0.fdr.2
- BuildRequire pth-devel, fix missing epoch in -devel Requires (#169).
- Save .spec in UTF-8.
* Sat Mar 22 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:0.4.0-0.fdr.1
- Update to current Fedora guidelines.
- Exclude %%{_libdir}/*.la.
* Tue Feb 12 2003 Warren Togami <warren@togami.com> 0.4.0-1.fedora.3
- info/dir temporary workaround
* Sat Feb 8 2003 Ville Skyttä <ville.skytta at iki.fi> - 0.4.0-1.fedora.1
- First Fedora release.

View File

@ -0,0 +1,24 @@
diff -up gpgme-1.3.2/src/gpgme-config.in.largefile gpgme-1.3.2/src/gpgme-config.in
--- gpgme-1.3.2/src/gpgme-config.in.largefile 2012-09-26 10:10:37.882744198 +0200
+++ gpgme-1.3.2/src/gpgme-config.in 2012-09-26 10:16:02.558762827 +0200
@@ -41,6 +41,10 @@ cflags_pthread=""
cflags_glib="@GLIB_CFLAGS@"
with_glib=
+if test "0@NEED__FILE_OFFSET_BITS@" -gt "0" ; then
+ cflags_lfs="-D_FILE_OFFSET_BITS=@NEED__FILE_OFFSET_BITS@"
+fi
+
output=""
usage()
@@ -105,6 +109,9 @@ while test $# -gt 0; do
exit 0
;;
--cflags)
+ if test "x$cflags_lfs" != "x"; then
+ output="$output $cflags_lfs"
+ fi
result=
tmp_c=
tmp_g=

View File

@ -0,0 +1,24 @@
diff -Naur a/configure b/configure
--- a/configure 2025-02-10 16:01:00.000000000 +0600
+++ b/configure 2025-02-18 10:34:48.662943905 +0600
@@ -3570,7 +3570,7 @@
GPGME_CONFIG_API_VERSION=1
##############################################
-NEED_GPG_ERROR_VERSION=1.47
+NEED_GPG_ERROR_VERSION=1.31
NEED_LIBASSUAN_API=2
NEED_LIBASSUAN_VERSION=2.4.2
diff -Naur a/configure.ac b/configure.ac
--- a/configure.ac 2025-02-10 15:57:10.000000000 +0600
+++ b/configure.ac 2025-02-18 10:34:59.988883253 +0600
@@ -87,7 +87,7 @@
GPGME_CONFIG_API_VERSION=1
##############################################
-NEED_GPG_ERROR_VERSION=1.47
+NEED_GPG_ERROR_VERSION=1.31
NEED_LIBASSUAN_API=2
NEED_LIBASSUAN_VERSION=2.4.2

View File

@ -0,0 +1,31 @@
diff -Naur a/lang/cpp/src/GpgmeppConfig.cmake.in.in b/lang/cpp/src/GpgmeppConfig.cmake.in.in
--- a/lang/cpp/src/GpgmeppConfig.cmake.in.in 2025-02-10 15:52:23.000000000 +0600
+++ b/lang/cpp/src/GpgmeppConfig.cmake.in.in 2025-02-18 10:36:13.788488048 +0600
@@ -63,7 +63,7 @@
set_target_properties(Gpgmepp PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/gpgme++;@resolved_includedir@"
- INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme@libsuffix@;@LIBASSUAN_LIBS@"
+ INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme@libsuffix@"
IMPORTED_LOCATION "@resolved_libdir@/libgpgmepp@libsuffix@"
)
diff -Naur a/src/gpgme-config.in b/src/gpgme-config.in
--- a/src/gpgme-config.in 2018-12-03 15:37:25.000000000 +0600
+++ b/src/gpgme-config.in 2025-02-18 10:36:59.981240681 +0600
@@ -25,12 +25,12 @@
libs="-L@libdir@"
# Network libraries.
-assuan_cflags="@LIBASSUAN_CFLAGS@"
-assuan_libs="@LIBASSUAN_LIBS@"
+#assuan_cflags="@LIBASSUAN_CFLAGS@"
+#assuan_libs="@LIBASSUAN_LIBS@"
# Configure libgpg-error.
gpg_error_cflags="@GPG_ERROR_CFLAGS@"
-gpg_error_libs="@GPG_ERROR_LIBS@"
+#gpg_error_libs="@GPG_ERROR_LIBS@"
# Configure thread packages.
thread_modules=""

View File

@ -0,0 +1,20 @@
/* gpgme-multilib.h */
/* This file is here to prevent a file conflict on multiarch systems. A
* conflict will occur because gpgme.h has arch-specific definitions.
*
* DO NOT INCLUDE THE NEW FILE DIRECTLY -- ALWAYS INCLUDE THIS ONE INSTEAD. */
#ifndef GPGME_MULTILIB_H
#define GPGME_MULTILIB_H
#include <bits/wordsize.h>
#if __WORDSIZE == 32
#include "gpgme-32.h"
#elif __WORDSIZE == 64
#include "gpgme-64.h"
#else
#error "unexpected value for __WORDSIZE macro"
#endif
#endif

412
base/rx/rx-gpgme/gpgme.spec Normal file
View File

@ -0,0 +1,412 @@
%bcond_with check
# No Qt5 on RHEL 10 and higher
%bcond_without qt5
%bcond_without qt6
%bcond_with python
%global base_name gpgme
%global gnupg2_min_ver 2.2.24
%global libgpg_error_min_ver 1.47
# we are doing out of source build
%global _configure ../configure
# brpldconfig creates links that conflict with original gpgme
%undefine __brp_ldconfig
# We are using python3.11, make sure sitearch is correct
%global python3_pkgversion 3.11
%global _syslibdir %{_libdir}
%global _sysincludedir %{_includedir}
%global _prefix /opt/rx
%global _sysconfdir %{_prefix}/etc
%global _includedir %{_prefix}/include
%global _libdir %{_prefix}/%{_lib}
%global _sbindir %{_prefix}/sbin
%global _datadir %{_prefix}/share
%global _mandir %{_datadir}/man
%global _docdir %{_datadir}/doc
%global _infodir %{_datadir}/info
Name: rx-gpgme
Summary: GnuPG Made Easy - high level crypto API - version 1.23
Version: 1.24.2
Release: 1%{?dist}
# MIT: src/cJSON.{c,h} (used by gpgme-json)
License: LGPL-2.1-or-later AND MIT
URL: https://gnupg.org/related_software/gpgme/
Source0: https://gnupg.org/ftp/gcrypt/gpgme/gpgme-%{version}.tar.bz2
Source2: gpgme-multilib.h
## downstream patches
# Don't add extra libs/cflags in gpgme-config/cmake equivalent
Patch1001: 0001-don-t-add-extra-libraries-for-linking.patch
# add -D_FILE_OFFSET_BITS... to gpgme-config, upstreamable
Patch1002: gpgme-1.3.2-largefile.patch
# Let's fix stupid AX_PYTHON_DEVEL
#Patch1003: 0001-fix-stupid-ax_python_devel.patch
# Allow extra options to be passed to setup.py during installation
Patch1004: 0002-setup_py_extra_opts.patch
%if 0%{?rhel} < 9
# Adjust libgpg-error version
Patch1100: gpgme-downgrade-libgpg-error-version.patch
%endif
## temporary downstream fixes
# Skip lang/qt/tests/t-remarks on gnupg 2.4+
Patch3001: 1001-qt-skip-test-remarks-for-gnupg2-2.4.patch
BuildRequires: make
BuildRequires: cmake
#BuildRequires: gcc
BuildRequires: clang
BuildRequires: gawk
BuildRequires: texinfo
BuildRequires: rx-gnupg2 >= %{gnupg2_min_ver}
BuildRequires: rx-gnupg2-smime
BuildRequires: pkgconfig(gpg-error) >= %{libgpg_error_min_ver}
BuildRequires: libassuan-devel >= 2.4.2
# For python bindings
BuildRequires: swig
# to remove RPATH
BuildRequires: chrpath
# For AutoReq cmake-filesystem
BuildRequires: cmake
Requires: rx-gnupg2 >= %{gnupg2_min_ver}
Provides: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
# On the following architectures workaround multiarch conflict of -devel packages:
%define multilib_arches %{ix86} x86_64 ia64 ppc ppc64 s390 s390x %{sparc}
%description
GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
easier for applications. It provides a high-level crypto API for
encryption, decryption, signing, signature verification and key
management.
%package devel
Summary: Development headers and libraries for %{name}
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: pkgconfig(gpg-error) >= %{libgpg_error_min_ver}
# Conflicts with files in gpgme devel packages
Conflicts: gpgme-devel
Obsoletes: gpgme1.22-devel < %{?epoch:%{epoch}:}%{version}-%{release}
%description devel
%{summary}.
%package -n %{name}pp
Summary: C++ bindings/wrapper for GPGME
Provides: %{name}-pp = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}-pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description -n %{name}pp
%{summary}.
%package -n %{name}pp-devel
Summary: Development libraries and header files for %{name}-pp
Provides: %{name}-pp-devel = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}-pp-devel%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name}-devel%{?_isa}
# Conflicts with files in gpgme devel packages
Conflicts: gpgmepp-devel <= 1.16
Obsoletes: gpgme1.22pp-devel < %{?epoch:%{epoch}:}%{version}-%{release}
%description -n %{name}pp-devel
%{summary}
%if %{with qt5}
%package -n rx-q%{base_name}-qt5
Summary: Qt5 API bindings/wrapper for GPGME
Requires: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Test)
Obsoletes: rx-q%{base_name} < %{?epoch:%{epoch}:}%{version}-%{release}
Provides: rx-q%{base_name} = %{?epoch:%{epoch}:}%{version}-%{release}
%description -n rx-q%{base_name}-qt5
%{summary}.
%endif
%if %{with qt6}
%package -n rx-q%{base_name}-qt6
Summary: Qt6 API bindings/wrapper for GPGME
Requires: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
BuildRequires: pkgconfig(Qt6Core)
BuildRequires: pkgconfig(Qt6Test)
%description -n rx-q%{base_name}-qt6
%{summary}.
%endif
%if %{with qt5}
%package -n rx-q%{base_name}-qt5-devel
Summary: Development libraries and header files for %{name}-qt5
# before libqgpgme.so symlink was moved to avoid conflict
Conflicts: kdepimlibs-devel < 4.14.10-17
Requires: rx-q%{base_name}-qt5%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: rx-q%{base_name}-devel = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: rx-q%{base_name}-devel%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
# Conflicts with files in gpgme devel packages
Conflicts: qgpgme-devel
Obsoletes: qgpgme1.22-qt5-devel < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: rx-q%{base_name}-common-devel < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: q%{base_name}1.22-common-devel < %{?epoch:%{epoch}:}%{version}-%{release}
%description -n rx-q%{base_name}-qt5-devel
%{summary}.
%endif
%if %{with qt6}
%package -n rx-q%{base_name}-qt6-devel
Summary: Development libraries and header files for %{name}-qt6
Requires: rx-q%{base_name}-qt6%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: qgpgme1.22-qt6-devel < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: rx-q%{base_name}-common-devel < %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: q%{base_name}1.22-common-devel < %{?epoch:%{epoch}:}%{version}-%{release}
%description -n rx-q%{base_name}-qt6-devel
%{summary}.
%endif
%if %{with python}
%package -n python%{python3_pkgversion}-gpg
Summary: %{name} bindings for Python 3
BuildRequires: python%{python3_pkgversion}-devel
# Needed since Python 3.12+ drops distutils
BuildRequires: python%{python3_pkgversion}-setuptools
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description -n python%{python3_pkgversion}-gpg
%{summary}.
%endif
%prep
%autosetup -p1 -n gpgme-%{version}
## HACK ALERT
# The config script already suppresses the -L if it's /usr/lib, so cheat and
# set it to a value which we know will be suppressed.
sed -i -e 's|^libdir=@libdir@$|libdir=@exec_prefix@/lib|g' src/gpgme-config.in
# The build machinery does not support Python 3.9+ yet
# https://github.com/gpg/gpgme/pull/4
sed -i 's/3.8/%{python3_pkgversion}/g' configure
%build
export CC=clang
export CXX=clang++
# People neeed to learn that you can't run autogen.sh anymore
#./autogen.sh
# Since 1.16.0, we need to explicitly pass -D_LARGEFILE_SOURCE and
# -D_FILE_OFFSET_BITS=64 for the QT binding to build successfully on 32-bit
# platforms.
export CFLAGS='-I%{_sysincludedir} -I%{_sysincludedir}/Qt6 %{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Qunused-arguments'
export CXXFLAGS='-I%{_sysincludedir} -I%{_sysincludedir}/Qt6 %{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Qunused-arguments'
# Explicit new lines in C(XX)FLAGS can break naive build scripts
export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')"
export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')"
export SETUPTOOLS_USE_DISTUTILS=local
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
# Link statically
export LDFLAGS="-L%{_libdir} -L%{_syslibdir} -Wl,-rpath=%{_libdir} -lgpg-error $LDFLAGS"
export PATH="%{_bindir}:$PATH"
# Force to use rx-gnupg2
sed 's@GPG_DEFAULT=no@GPG_DEFAULT="/opt/rx/bin/gpg"@g' -i configure
sed 's@GPGSM_DEFAULT=no@GPGSM_DEFAULT="/opt/rx/bin/gpgsm"@g' -i configure
sed 's@GPGCONF_DEFAULT=no@GPGCONF_DEFAULT="/opt/rx/bin/gpgconf"@g' -i configure
sed 's@G13_DEFAULT=no@G13_DEFAULT="/opt/rx/bin/g13"@g' -i configure
# Also build either qt5 or qt6
mkdir build
pushd build
%configure --disable-static --disable-silent-rules --enable-languages=cpp,%{?with_python:python,}%{?with_qt5:qt,}%{!?with_qt5:%{?with_qt6:qt6,}}
%make_build
popd
# Build qt6 in extra step if qt5 has been build
%if %{with qt5} && %{with qt6}
mkdir build-qt6
pushd build-qt6
%configure --disable-static --disable-silent-rules --enable-languages=cpp,qt6%{?with_python:,python}
%make_build
popd
%endif
%install
# When using distutils from setuptools 60+, ./setup.py install use
# the .egg format. This forces setuptools to use .egg-info format.
# SETUP_PY_EXTRA_OPTS is introduced by the Patch1004 above.
export SETUPTOOLS_USE_DISTUTILS=local
export SETUP_PY_EXTRA_OPTS="--single-version-externally-managed --root=/"
# Aliso install either qt5 or qt6
pushd build
%make_install
popd
# Install qt6 in extra step if qt5 has been installed
%if %{with qt5} && %{with qt6}
pushd build-qt6
%make_install
popd
%endif
# unpackaged files
rm -fv %{buildroot}%{_infodir}/dir
rm -fv %{buildroot}%{_libdir}/lib*.la
# Hack to resolve multiarch conflict (#341351)
%ifarch %{multilib_arches}
mv %{buildroot}%{_bindir}/gpgme-config{,.%{_target_cpu}}
cat > gpgme-config-multilib.sh <<__END__
#!/bin/sh
exec %{_bindir}/gpgme-config.\$(arch) \$@
__END__
install -D -p gpgme-config-multilib.sh %{buildroot}%{_bindir}/gpgme-config
mv %{buildroot}%{_includedir}/gpgme.h \
%{buildroot}%{_includedir}/gpgme-%{__isa_bits}.h
install -m644 -p -D %{SOURCE2} %{buildroot}%{_includedir}/gpgme.h
%endif
chrpath -d %{buildroot}%{_bindir}/%{base_name}-tool
chrpath -d %{buildroot}%{_bindir}/%{base_name}-json
chrpath -d %{buildroot}%{_libdir}/lib%{base_name}pp.so*
# qt5
%if %{with qt5}
chrpath -d %{buildroot}%{_libdir}/libq%{base_name}.so*
%endif
# qt6
%if %{with qt6}
chrpath -d %{buildroot}%{_libdir}/libq%{base_name}qt6.so*
%endif
# autofoo installs useless stuff for uninstall
rm -vf %{buildroot}%{python2_sitelib}/gpg/install_files.txt
rm -vf %{buildroot}%{python3_sitelib}/gpg/install_files.txt
# Remove duplicate stuff
rm -rf %{buildroot}%{_bindir}/%{base_name}-json
rm -rf %{buildroot}%{_datadir}/man/man1/gpgme-json*
#rm -fv %{buildroot}%{_libdir}/lib%{base_name}.so.11
#rm -fv %{buildroot}%{_libdir}/lib%{base_name}pp.so.6
mkdir -p %{buildroot}%{_syslibdir}/cmake
ln -sf %{_libdir}/cmake/Gpgmepp %{buildroot}%{_syslibdir}/cmake/Gpgmepp
%if %{with qt5}
ln -sf %{_libdir}/cmake/QGpgme %{buildroot}%{_syslibdir}/cmake/QGpgme
%endif
%if %{with qt6}
ln -sf %{_libdir}/cmake/QGpgmeQt6 %{buildroot}%{_syslibdir}/cmake/QGpgmeQt6
%endif
%if %{with check}
%check
pushd build
make check
popd
%endif
%files
%license COPYING* LICENSES
%doc AUTHORS NEWS README*
%{_libdir}/lib%{base_name}.so.11*
%files devel
%{_bindir}/%{base_name}-config
%{_bindir}/%{base_name}-tool
%ifarch %{multilib_arches}
%{_bindir}/%{base_name}-config.%{_target_cpu}
%{_includedir}/%{base_name}-%{__isa_bits}.h
%endif
%{_includedir}/%{base_name}.h
%{_libdir}/lib%{base_name}.so
%{_datadir}/aclocal/%{base_name}.m4
%{_infodir}/%{base_name}.info*
%{_libdir}/pkgconfig/%{base_name}*.pc
%files -n %{name}pp
%doc lang/cpp/README
%{_libdir}/lib%{base_name}pp.so.6*
%files -n %{name}pp-devel
%{_includedir}/%{base_name}++/
%{_libdir}/lib%{base_name}pp.so
%{_libdir}/cmake/Gpgmepp/
%{_syslibdir}/cmake/Gpgmepp
%if %{with qt5}
%files -n rx-q%{base_name}-qt5
%doc lang/qt/README
%{_libdir}/libq%{base_name}.so.15*
%endif
%if %{with qt6}
%files -n rx-q%{base_name}-qt6
%{_libdir}/libq%{base_name}qt6.so.15*
%endif
%if %{with qt5}
%files -n rx-q%{base_name}-qt5-devel
%{_libdir}/libq%{base_name}.so
%{_libdir}/cmake/QGpgme/
%{_syslibdir}/cmake/QGpgme
%{_includedir}/q%{base_name}-qt5/
%endif
%if %{with qt6}
%files -n rx-q%{base_name}-qt6-devel
%{_libdir}/libq%{base_name}qt6.so
%{_libdir}/cmake/QGpgmeQt6/
%{_syslibdir}/cmake/QGpgmeQt6
%{_includedir}/q%{base_name}-qt6/
%endif
%if %{with python}
%files -n python%{python3_pkgversion}-gpg
%doc lang/python/README
%{python3_sitearch}/gpg-*.egg-info/
%{python3_sitearch}/gpg/
%endif
%changelog
* Tue Feb 18 2025 Raven <raven@sysadmins.ws> - 1.24.2-1
- update to 1.24.2
* Tue Feb 18 2025 Raven <raven@sysadmins.ws> - 1.23.2-4
- rebuild (qt6)
* Tue Oct 1 2024 Raven <raven@sysadmins.ws> - 1.23.2-3
- downgrade gpg-error version
- obsolete *1.22-devel packages from epel
* Mon Jun 3 2024 Raven <raven@sysadmins.ws> - 1.23.2-2
- rebuild (qt6)
* Fri Mar 15 2024 Raven <raven@sysadmins.ws> - 1.23.2-1
- update to 1.23.2
* Fri Mar 15 2024 Raven <raven@sysadmins.ws> - 1.22.0-1
- converted from el9 epel package

View File

@ -2,7 +2,7 @@
Name: rx-harfbuzz
Version: 7.0.0
Release: 2%{?dist}%{?_trivial}%{?_buildid}
Release: 4%{?dist}%{?_trivial}%{?_buildid}
Summary: Text shaping library
License: MIT
@ -101,6 +101,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%{_libdir}/libharfbuzz-icu.so.*
%changelog
* Tue Oct 29 2024 Raven <raven@sysadmins.ws> - 7.0.0-4
- rebuilt with new rx-freetype
* Fri Feb 17 2023 Lucas Meneghel Rodrigues <lmr@amazon.com> 7.0.0-2.amzn2023.0.1
- Update to upstream 7.0.0

View File

@ -0,0 +1,122 @@
diff -up libgpg-error-1.29/configure.ac.multilib libgpg-error-1.29/configure.ac
--- libgpg-error-1.29/configure.ac.multilib 2018-04-11 14:41:10.479019981 +0200
+++ libgpg-error-1.29/configure.ac 2018-04-11 14:43:31.288394113 +0200
@@ -215,13 +215,13 @@ GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
# Find a 64 bit integer type to be used instead of off_t. We prefer
-# the standard integer types over int64_t and finally try long long.
-if test "$ac_cv_sizeof_int" = "8"; then
+# int64_t and finally try long long.
+if test "$ac_cv_header_stdint_h" = yes; then
+ replacement_for_off_t="int64_t"
+elif test "$ac_cv_sizeof_int" = "8"; then
replacement_for_off_t="int"
elif test "$ac_cv_sizeof_long" = "8"; then
replacement_for_off_t="long"
-elif test "$ac_cv_header_stdint_h" = yes; then
- replacement_for_off_t="int64_t"
elif test "$ac_cv_sizeof_long_long" = "8"; then
replacement_for_off_t="long long"
else
diff -up libgpg-error-1.29/configure.multilib libgpg-error-1.29/configure
--- libgpg-error-1.29/configure.multilib 2018-04-11 09:34:30.000000000 +0200
+++ libgpg-error-1.29/configure 2018-04-11 14:41:10.481020028 +0200
@@ -11301,7 +11301,7 @@ shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib64 /usr/lib64"
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -11775,7 +11775,7 @@ fi
# appending ld.so.conf contents (and includes) to the search path.
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib64 /usr/lib64 $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -15879,12 +15879,12 @@ fi
# Find a 64 bit integer type to be used instead of off_t. We prefer
# the standard integer types over int64_t and finally try long long.
-if test "$ac_cv_sizeof_int" = "8"; then
+if test "$ac_cv_header_stdint_h" = yes; then
+ replacement_for_off_t="int64_t"
+elif test "$ac_cv_sizeof_int" = "8"; then
replacement_for_off_t="int"
elif test "$ac_cv_sizeof_long" = "8"; then
replacement_for_off_t="long"
-elif test "$ac_cv_header_stdint_h" = yes; then
- replacement_for_off_t="int64_t"
elif test "$ac_cv_sizeof_long_long" = "8"; then
replacement_for_off_t="long long"
else
diff -up libgpg-error-1.29/src/gen-posix-lock-obj.c.multilib libgpg-error-1.29/src/gen-posix-lock-obj.c
--- libgpg-error-1.29/src/gen-posix-lock-obj.c.multilib 2016-11-16 13:22:03.000000000 +0100
+++ libgpg-error-1.29/src/gen-posix-lock-obj.c 2018-04-11 14:41:10.481020028 +0200
@@ -72,6 +72,7 @@ main (void)
#ifdef USE_POSIX_THREADS
unsigned char *p;
int i;
+ int initidx = 0;
#endif
struct {
long vers;
@@ -111,11 +112,12 @@ main (void)
/* To force a probably suitable alignment of the structure we use a
union and include a long and a pointer to a long. */
- printf ("typedef struct\n"
+ printf ("#include <pthread.h>\n"
+ "typedef struct\n"
"{\n"
" long _vers;\n"
" union {\n"
- " volatile char _priv[%d];\n"
+ " volatile char _priv[sizeof(pthread_mutex_t)];\n"
"%s"
" long _x_align;\n"
" long *_xp_align;\n"
@@ -123,7 +125,6 @@ main (void)
"} gpgrt_lock_t;\n"
"\n"
"#define GPGRT_LOCK_INITIALIZER {%d,{{",
- SIZEOF_PTHREAD_MUTEX_T,
# if USE_16BYTE_ALIGNMENT
" int _x16_align __attribute__ ((aligned (16)));\n",
# elif USE_DOUBLE_FOR_ALIGNMENT
@@ -137,10 +138,16 @@ main (void)
p = (unsigned char *)&mtx;
for (i=0; i < sizeof mtx; i++)
{
+ if (p[i] != 0)
+ initidx = i;
+ }
+
+ for (i=0; i <= initidx; i++)
+ {
if (i && !(i % 8))
printf (" \\\n%*s", 36, "");
printf ("%u", p[i]);
- if (i < sizeof mtx - 1)
+ if (i < initidx)
putchar (',');
}
fputs ("}}}\n", stdout);
diff -up libgpg-error-1.29/src/gpg-error.h.in.multilib libgpg-error-1.29/src/gpg-error.h.in
--- libgpg-error-1.29/src/gpg-error.h.in.multilib 2018-04-11 14:41:10.481020028 +0200
+++ libgpg-error-1.29/src/gpg-error.h.in 2018-04-11 14:45:28.184203566 +0200
@@ -17,7 +17,7 @@
* License along with this program; if not, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: LGPL-2.1-or-later
*
- * @configure_input@
+ * Do not edit. Generated from gpg-error.h.in.
*/
/* The GnuPG project consists of many components. Error codes are

View File

@ -0,0 +1,361 @@
%global realname libgpg-error
%global _syslibdir %{_libdir}
%global _prefix /opt/rx
%global _bindir %{_prefix}/bin
%global _libdir %{_prefix}/%{_lib}
%global _includedir %{_prefix}/include
%global _datadir %{_prefix}/share
%global _docdir %{_datadir}/doc
%global _mandir %{_datadir}/man
%global _infodir %{_datadir}/info
Name: rx-libgpg-error
Version: 1.51
Release: 1%{?dist}
Summary: Library for error values used by GnuPG components
URL: https://www.gnupg.org/related_software/libgpg-error/
License: LGPLv2+
Source0: https://www.gnupg.org/ftp/gcrypt/libgpg-error/%{realname}-%{version}.tar.bz2
Source1: https://www.gnupg.org/ftp/gcrypt/libgpg-error/%{realname}-%{version}.tar.bz2.sig
Patch1: libgpg-error-1.29-multilib.patch
Patch2: set-proper-version-suffix.patch
BuildRequires: gcc
BuildRequires: gawk, gettext, autoconf, automake, gettext-devel, libtool
BuildRequires: texinfo
BuildRequires: gettext-autopoint
BuildRequires: make
%description
This is a library that defines common error values for all GnuPG
components. Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt,
pinentry, SmartCard Daemon and possibly more in the future.
%package devel
Summary: Development files for the %{name} package
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%description devel
This is a library that defines common error values for all GnuPG
components. Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt,
pinentry, SmartCard Daemon and possibly more in the future. This package
contains files necessary to develop applications using libgpg-error.
%prep
%autosetup -p1 -n %{realname}-%{version}
autoreconf -f
# The config script already suppresses the -L if it's /usr/lib, so cheat and
# set it to a value which we know will be suppressed.
sed -i -e 's|^libdir=@libdir@$|libdir=@exec_prefix@/lib64|g;s|@GPG_ERROR_CONFIG_HOST@|none|g' src/gpg-error-config.in
sed -i -e '/--variable=host/d' src/gpg-error-config-test.sh.in
# Modify configure to drop rpath for /usr/lib64
sed -i -e 's|sys_lib_dlsearch_path_spec="/lib /usr/lib|sys_lib_dlsearch_path_spec="/lib /usr/lib %{_libdir} %{_syslibdir}|g' configure
%build
export LDFLAGS="-L%{_libdir} -L%{_syslibdir} -Wl,-rpath=%{_libdir} $LDFLAGS"
%configure \
--disable-static\
--disable-rpath \
--disable-languages \
--enable-install-gpg-error-config
%make_build
%install
%make_install
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
%find_lang %{realname}
%check
make check
%ldconfig_scriptlets
%files -f %{realname}.lang
%license COPYING COPYING.LIB
%doc AUTHORS README NEWS
%{_bindir}/gpg-error
%{_libdir}/libgpg-error.so.0*
%{_datadir}/libgpg-error
%files devel
%{_bindir}/gpg-error-config
%{_bindir}/gpgrt-config
%{_bindir}/yat2m
%{_libdir}/libgpg-error.so
%{_libdir}/pkgconfig/gpg-error.pc
%{_includedir}/gpg-error.h
%{_includedir}/gpgrt.h
%{_datadir}/aclocal/gpg-error.m4
%{_datadir}/aclocal/gpgrt.m4
%{_infodir}/gpgrt.info*
%{_mandir}/man1/gpgrt-config.*
%{_mandir}/man1/gpg-error-config.*
%changelog
* Tue Feb 18 2025 Raven <raven@sysadmins.ws> - 1.51-1
- New upstream release
* Wed Aug 24 2022 Raven <raven@sysadmins.ws> - 1.42-5
- change installation root to /opt/rx
* Mon Dec 06 2021 Jakub Jelen <jjelen@redhat.com> - 1.42-5
- Avoid using bad function inet_addr
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.42-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.42-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Mon Apr 12 2021 Jakub Jelen <jjelen@redhat.com> - 1.42-2
- Address coverity reported issues
* Mon Mar 22 2021 Jakub Jelen <jjelen@redhat.com> - 1.42-1
- New upstream release (#1941582)
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.41-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Jan 04 2021 Jakub Jelen <jjelen@redhat.com> - 1.41-1
- New upstream release (#1909749)
* Tue Dec 01 2020 Jakub Jelen <jjelen@redhat.com> - 1.39-1
- New upstream release (#1800640)
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.37-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Feb 28 2020 Tomáš Mráz <tmraz@redhat.com> 1.37-1
- new upstream release 1.37
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.36-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Aug 14 2019 Tomáš Mráz <tmraz@redhat.com> 1.36-2
- fix FTBFS in rawhide due to new gawk
* Sat Aug 3 2019 Peter Robinson <pbrobinson@fedoraproject.org> 1.36-1
- new upstream release 1.36
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.33-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.33-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Jan 08 2019 Tomáš Mráz <tmraz@redhat.com> 1.33-1
- new upstream release 1.33
- dropped obsolete install-info scriptlets
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.31-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jun 11 2018 Tomáš Mráz <tmraz@redhat.com> 1.31-1
- new upstream release 1.31
* Wed Apr 11 2018 Tomáš Mráz <tmraz@redhat.com> 1.29-1
- new upstream release 1.29
* Wed Feb 28 2018 Richard W.M. Jones <rjones@redhat.com> - 1.27-6
- Backport patch which adds riscv64 support.
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.27-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.27-4
- Switch to %%ldconfig_scriptlets
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.27-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.27-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Wed Mar 15 2017 Tomáš Mráz <tmraz@redhat.com> 1.27-1
- new upstream release 1.27
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.25-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Nov 15 2016 Tomáš Mráz <tmraz@redhat.com> 1.25-1
- new upstream release 1.25
* Thu Jul 14 2016 Tomáš Mráz <tmraz@redhat.com> 1.24-1
- new upstream release
* Fri Mar 18 2016 Rex Dieter <rdieter@fedoraproject.org> - 1.21-3
- drop explicit /sbin/ldconfig scriptlet deps (#1319144)
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.21-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Dec 22 2015 Tomáš Mráz <tmraz@redhat.com> 1.21-1
- new upstream release
* Tue Sep 1 2015 Tomáš Mráz <tmraz@redhat.com> 1.20-1
- new upstream release
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.19-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Apr 13 2015 Tomáš Mráz <tmraz@redhat.com> 1.19-1
- new upstream release
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 1.17-3
- Rebuilt for Fedora 23 Change
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
* Fri Jan 30 2015 Tomáš Mráz <tmraz@redhat.com> 1.17-2
- do not conflict on header file between architectures (#1180857)
* Thu Jan 29 2015 Tomáš Mráz <tmraz@redhat.com> 1.17-1
- new upstream release
* Fri Sep 19 2014 Tomáš Mráz <tmraz@redhat.com> 1.16-1
- new upstream release
- move from /lib to /usr/lib
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.13-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Fri Jul 18 2014 Tom Callaway <spot@fedoraproject.org> 1.13-2
- fix license handling
* Wed Jun 25 2014 Tomáš Mráz <tmraz@redhat.com> 1.13-1
- new upstream release
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri Aug 23 2013 Tomáš Mráz <tmraz@redhat.com> 1.12-1
- new upstream release
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Fri Apr 5 2013 Tomáš Mráz <tmraz@redhat.com> 1.11-1
- new upstream release
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Fri Jul 15 2011 Tomáš Mráz <tmraz@redhat.com> 1.10-1
- new upstream release
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Fri Jul 23 2010 Rex Dieter <rdieter@fedoraproject.org> 1.9-1
- libgpg-error-1.9
* Thu Feb 25 2010 Nalin Dahyabhai <nalin@redhat.com> - 1.7-3
- turn off common lisp bindings the right way
- drop finger output
- recode the changelog into UTF-8 if it isn't UTF-8 (rpmlint)
* Mon Jan 11 2010 Nalin Dahyabhai <nalin@redhat.com> - 1.7-2
- fix use of macro in changelog (rpmlint)
- build with --disable-rpath (rpmlint)
- build with %%{?_smp_mflags}
* Thu Oct 15 2009 Nalin Dahyabhai <nalin@redhat.com> - 1.7-1
- long-overdue update to 1.7
- add a disttag
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.6-2
- Autorebuild for GCC 4.3
* Fri Dec 7 2007 Nalin Dahyabhai <nalin@redhat.com>
- remove the generic install docs (#226021)
* Fri Dec 7 2007 Nalin Dahyabhai <nalin@redhat.com> - 1.6-1
- update to 1.6
- add suggested summary, buildrequires, and modify install call as suggested
by package review (#226021)
* Mon Oct 15 2007 Nalin Dahyabhai <nalin@redhat.com> - 1.5-6
- use ldconfig to make the soname symlink so that it gets packaged (#331241)
* Wed Aug 22 2007 Nalin Dahyabhai <nalin@redhat.com> - 1.5-5
- add missing gawk buildrequirement
* Thu Aug 16 2007 Nalin Dahyabhai <nalin@redhat.com> - 1.5-4
- clarify license
* Mon Jul 30 2007 Nalin Dahyabhai <nalin@redhat.com> - 1.5-3
- disable static libraries (part of #249815)
* Fri Jul 27 2007 Nalin Dahyabhai <nalin@redhat.com> - 1.5-2
- move libgpg-error shared library to /%%{_lib} (#249816)
* Thu Jul 19 2007 Nalin Dahyabhai <nalin@redhat.com> - 1.5-1
- update to 1.5
* Sun Oct 01 2006 Jesse Keating <jkeating@redhat.com> - 1.4-2
- rebuilt for unwind info generation, broken in gcc-4.1.1-21
* Mon Sep 18 2006 Bill Nottngham <notting@redhat.com> - 1.4-1
- update to 1.4
- don't ship lisp bindings
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.3-3.1
- rebuild
* Mon Jun 5 2006 Nalin Dahyabhai <nalin@redhat.com> 1.3-3
- give gpg-error-config libdir=@exec_prefix@/lib instead of @libdir@, so that
it agrees on 32- and 64-bit arches (it suppresses the -L argument if @libdir@
is /usr/lib, so this should be cleaner than adding a non-standard .pc file
which upstream developers might inadvertently think they can depend to be on
every system which provides this library)
* Mon May 15 2006 Karsten Hopp <karsten@redhat.de> 1.3-2
- switch to pkgconfig so that gpg-error-config can be the same on
32bit and 64bit archs
* Tue May 2 2006 Nalin Dahyabhai <nalin@redhat.com> - 1.3-1
- update to version 1.3
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 1.1-1.2.1
- bump again for double-long bug on ppc(64)
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1.1-1.2
- rebuilt for new gcc4.1 snapshot and glibc changes
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt
* Wed Nov 30 2005 Karsten Hopp <karsten@redhat.de> 1.1-1
- update
* Wed Mar 2 2005 Bill Nottingham <notting@redhat.com> - 1.0-2
- we can rebuild it. we have the technology.
* Tue Aug 31 2004 Bill Nottingham <notting@redhat.com> - 1.0-1
- update to 1.0
* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Fri Apr 16 2004 Bill Nottingham <notting@redhat.com> - 0.7-1
- adapt upstream specfile

View File

@ -0,0 +1,11 @@
--- a/autogen.sh 2024-07-04 21:14:53.000000000 +0600
+++ b/autogen.sh 2025-02-18 11:23:30.572654260 +0600
@@ -271,7 +271,7 @@
else
ingit=no
beta=yes
- tmp="-unknown"
+ tmp="-rx"
cid="0000000"
rev="0000000"
rvd="0"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,33 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index adb0ca4..902c271 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1768,18 +1768,6 @@ endif()
install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg
- ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.c
- ${CMAKE_CURRENT_SOURCE_DIR}/tjexample.c
- ${CMAKE_CURRENT_SOURCE_DIR}/libjpeg.txt
- ${CMAKE_CURRENT_SOURCE_DIR}/structure.txt
- ${CMAKE_CURRENT_SOURCE_DIR}/usage.txt ${CMAKE_CURRENT_SOURCE_DIR}/wizard.txt
- ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION ${CMAKE_INSTALL_DOCDIR})
-if(WITH_JAVA)
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/java/TJExample.java
- DESTINATION ${CMAKE_INSTALL_DOCDIR})
-endif()
-
if(UNIX OR MINGW)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cjpeg.1
${CMAKE_CURRENT_SOURCE_DIR}/djpeg.1 ${CMAKE_CURRENT_SOURCE_DIR}/jpegtran.1
@@ -1803,7 +1791,7 @@ install(EXPORT ${CMAKE_PROJECT_NAME}Targets
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h
${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h
- ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h ${CMAKE_CURRENT_SOURCE_DIR}/jpegint.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
include(cmakescripts/BuildPackages.cmake)
--

View File

@ -0,0 +1,508 @@
%global realname libjpeg-turbo
%global _sys_bindir %_bindir
%global _prefix /opt/rx
%global _bindir %{_prefix}/bin
%global _libdir %{_prefix}/%{_lib}
%global _datadir %{_prefix}/share
%global _includedir %{_prefix}/include
%global _mandir %{_datadir}/man
Name: rx-libjpeg-turbo
Version: 3.0.2
Release: 1%{?dist}
Summary: A MMX/SSE2/SIMD accelerated library for manipulating JPEG image files
License: IJG
URL: http://sourceforge.net/projects/libjpeg-turbo
Source0: http://downloads.sourceforge.net/%{realname}/%{realname}-%{version}.tar.gz
Patch0: libjpeg-turbo-cmake.patch
Patch1: libjpeg-turbo-CET.patch
BuildRequires: gcc
BuildRequires: cmake
BuildRequires: libtool
BuildRequires: nasm
%description
The libjpeg-turbo package contains a library of functions for manipulating JPEG
images.
%package devel
Summary: Headers for the libjpeg-turbo library
Requires: rx-libjpeg-turbo%{?_isa} = %{version}-%{release}
%description devel
This package contains header files necessary for developing programs which will
manipulate JPEG files using the libjpeg-turbo library.
%package utils
Summary: Utilities for manipulating JPEG images
Requires: rx-libjpeg-turbo%{?_isa} = %{version}-%{release}
%description utils
The libjpeg-turbo-utils package contains simple client programs for accessing
the libjpeg functions. It contains cjpeg, djpeg, jpegtran, rdjpgcom and
wrjpgcom. Cjpeg compresses an image file into JPEG format. Djpeg decompresses a
JPEG file into a regular image file. Jpegtran can perform various useful
transformations on JPEG files. Rdjpgcom displays any text comments included in a
JPEG file. Wrjpgcom inserts text comments into a JPEG file.
%package -n rx-turbojpeg
Summary: TurboJPEG library
%description -n rx-turbojpeg
The turbojpeg package contains the TurboJPEG shared library.
%package -n rx-turbojpeg-devel
Summary: Headers for the TurboJPEG library
Requires: rx-turbojpeg%{?_isa} = %{version}-%{release}
%description -n rx-turbojpeg-devel
This package contains header files necessary for developing programs which will
manipulate JPEG files using the TurboJPEG library.
%prep
%autosetup -p1 -n %{realname}-%{version}
%build
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
export LDFLAGS="-L%{_libdir} -Wl,-rpath=%{_libdir} $LDFLAGS"
# NASM object files are missing GNU Property note for Intel CET,
# force it on the resulting library
%ifarch %{ix86} x86_64
export LDFLAGS="$RPM_LD_FLAGS -Wl,-z,ibt -Wl,-z,shstk"
%endif
%{cmake} -DCMAKE_SKIP_RPATH:BOOL=YES \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \
%ifarch s390x
-DFLOATTEST:STRING="fp-contract" \
%endif
-DENABLE_STATIC:BOOL=NO
%cmake_build
%install
%cmake_install
find %{buildroot} -name "*.la" -delete
# Fix perms
chmod -x README.md
# Remove tjbench
rm -f %{buildroot}/%{_bindir}/tjbench
# multilib header hack
# we only apply this to known Red Hat multilib arches, per bug #1264675
case `uname -i` in
i386 | ppc | s390 | sparc )
wordsize="32"
;;
x86_64 | ppc64 | s390x | sparc64 )
wordsize="64"
;;
*)
wordsize=""
;;
esac
if test -n "$wordsize"
then
mv $RPM_BUILD_ROOT%{_includedir}/jconfig.h \
$RPM_BUILD_ROOT%{_includedir}/jconfig-$wordsize.h
cat >$RPM_BUILD_ROOT%{_includedir}/jconfig.h <<EOF
#ifndef JCONFIG_H_MULTILIB
#define JCONFIG_H_MULTILIB
#include <bits/wordsize.h>
#if __WORDSIZE == 32
# include "jconfig-32.h"
#elif __WORDSIZE == 64
# include "jconfig-64.h"
#else
# error "unexpected value for __WORDSIZE macro"
#endif
#endif
EOF
fi
mkdir -p %{buildroot}%{_sys_bindir}
for bin in cjpeg djpeg jpegtran rdjpgcom wrjpgcom
do
ln -sf %{_bindir}/${bin} %{buildroot}/%{_sys_bindir}/${bin}-3
done
%check
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
%ctest
%ldconfig_scriptlets
%ldconfig_scriptlets -n rx-turbojpeg
%files
%license LICENSE.md
%doc README.md README.ijg ChangeLog.md
%{_libdir}/libjpeg.so.62*
%files devel
%doc coderules.txt jconfig.txt libjpeg.txt structure.txt
%{_includedir}/jconfig*.h
%{_includedir}/jerror.h
%{_includedir}/jmorecfg.h
%{_includedir}/jpegint.h
%{_includedir}/jpeglib.h
%{_libdir}/libjpeg.so
%{_libdir}/pkgconfig/libjpeg.pc
%{_libdir}/cmake/%{realname}/%{realname}*.cmake
%files utils
%doc usage.txt wizard.txt
%{_sys_bindir}/*-3
%{_bindir}/cjpeg
%{_bindir}/djpeg
%{_bindir}/jpegtran
%{_bindir}/rdjpgcom
%{_bindir}/wrjpgcom
%{_mandir}/man1/cjpeg.1*
%{_mandir}/man1/djpeg.1*
%{_mandir}/man1/jpegtran.1*
%{_mandir}/man1/rdjpgcom.1*
%{_mandir}/man1/wrjpgcom.1*
%files -n rx-turbojpeg
%license LICENSE.md
%doc README.md README.ijg ChangeLog.md
%{_libdir}/libturbojpeg.so.0*
%files -n rx-turbojpeg-devel
%doc tjexample.c
%{_includedir}/turbojpeg.h
%{_libdir}/libturbojpeg.so
%{_libdir}/pkgconfig/libturbojpeg.pc
%changelog
* Tue May 7 2024 Raven <raven@sysadmins.ws> - 3.0.2-1
- New upstream release 3.0.2
* Mon Aug 15 2022 Nikola Forró <nforro@redhat.com> - 2.1.4-1
- New upstream release 2.1.4 (#2118023)
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sun Feb 27 2022 Nikola Forró <nforro@redhat.com> - 2.1.3-1
- New upstream release 2.1.3 (#2058898)
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Mon Nov 22 2021 Matej Mužila <mmuzila@redhat.com> - 2.1.2-1
- New upstream release 2.1.2 (#2025141)
* Wed Aug 11 2021 Nikola Forró <nforro@redhat.com> - 2.1.1-1
- New upstream release 2.1.1 (#1991844)
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon Apr 26 2021 Nikola Forró <nforro@redhat.com> - 2.1.0-1
- New upstream release 2.1.0 (#1953074)
* Thu Mar 25 2021 Nikola Forró <nforro@redhat.com> - 2.0.90-2
- Fix CVE-2021-20205 (#1937387)
* Thu Jan 28 2021 Nikola Forró <nforro@redhat.com> - 2.0.90-1
- New upstream release 2.0.90 (#1898427)
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Aug 04 2020 Nikola Forró <nforro@redhat.com> - 2.0.5-5
- Fix FTBFS (#1864007)
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.5-4
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 2.0.5-2
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Fri Jul 03 2020 Nikola Forró <nforro@redhat.com> - 2.0.5-1
- New upstream release 2.0.5 (#1850293)
* Tue Jun 16 2020 Nikola Forró <nforro@redhat.com> - 2.0.4-3
- Fix CVE-2020-13790 (#1847159)
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Jan 08 2020 Nikola Forró <nforro@redhat.com> - 2.0.4-1
- New upstream release 2.0.4 (#1787793)
* Thu Sep 05 2019 Nikola Forró <nforro@redhat.com> - 2.0.3-1
- New upstream release 2.0.3 (#1749130)
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue Jun 04 2019 Nikola Forró <nforro@redhat.com> - 2.0.2-3
- Fix LDFLAGS
* Mon Apr 29 2019 Nikola Forró <nforro@redhat.com> - 2.0.2-2
- Support running with Intel CET
* Wed Feb 27 2019 Nikola Forró <nforro@redhat.com> - 2.0.2-1
- New upstream release 2.0.2
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jan 11 2019 Nikola Forró <nforro@redhat.com> - 2.0.0-3
- Fix CVE-2018-19664 (#1656219)
* Fri Jan 11 2019 Nikola Forró <nforro@redhat.com> - 2.0.0-2
- Fix CVE-2018-20330 (#1665224)
* Mon Jul 30 2018 Nikola Forró <nforro@redhat.com> - 2.0.0-1
- New upstream release 2.0.0 (#1609439)
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.90-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jun 29 2018 Nikola Forró <nforro@redhat.com> - 1.5.90-3
- Fix CVE-2018-1152 (#1593555)
* Fri Jun 15 2018 Nikola Forró <nforro@redhat.com> - 1.5.90-2
- Fix CVE-2018-11813 (#1588804)
* Wed Mar 28 2018 Nikola Forró <nforro@redhat.com> - 1.5.90-1
- New upstream release 1.5.90 (#1560219)
* Tue Feb 20 2018 Nikola Forró <nforro@redhat.com> - 1.5.3-4
- Add missing gcc build dependency
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.5.3-2
- Switch to %%ldconfig_scriptlets
* Tue Dec 19 2017 Nikola Forró <nforro@redhat.com> - 1.5.3-1
- New upstream release 1.5.3 (#1468783)
* Tue Dec 19 2017 Nikola Forró <nforro@redhat.com> - 1.5.1-5
- re-enable check on ppc64(le)
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu May 18 2017 Karsten Hopp <karsten@redhat.com> - 1.5.1-2
- disable check on ppc64(le)
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Oct 06 2016 Petr Hracek <phracek@redhat.com> - 1.5.1-1
- New upstream relelase 1.5.1 (#1377903)
* Wed Sep 21 2016 Peter Robinson <pbrobinson@fedoraproject.org> 1.5.0-4
- Add upstream aarch64 NEON fix, re-enable SIMD on aarch64
* Mon Sep 19 2016 Peter Robinson <pbrobinson@fedoraproject.org> 1.5.0-3
- Temporarily disable SIMD on aarch64 until upstream #97 is fixed
- Add NEON fix for ARMv7
* Tue Sep 13 2016 Peter Robinson <pbrobinson@fedoraproject.org> 1.5.0-2
- Add upstream fix to fix SIMD crash on aarch64 (rhbz #1368569)
* Tue Jun 21 2016 Petr Hracek <phracek@redhat.com> - 1.5.0-1
- New upstream release 1.5.0 (#1343786)
* Thu Mar 10 2016 Petr Hracek <phracek@redhat.com> - 1.4.90-1
- New upstream release 1.4.90 (#1313111)
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Oct 07 2015 Petr Hracek <phracek@redhat.com> - 1.4.2-2
- Fix problem with multilibs like jconfig.h (#1264675)
* Wed Oct 07 2015 Petr Hracek <phracek@redhat.com> - 1.4.2-1
- New upstream release 1.4.2 (#1265034)
* Tue Jun 16 2015 Peter Robinson <pbrobinson@fedoraproject.org> 1.4.1-1
- new upstream version 1.4.1
- nasm available on all arches
- run tests with SMP
* Tue Jan 20 2015 Petr Hracek <phracek@redhat.com> - 1.4.0-1
- new upstream version 1.4.0 (#1180442)
* Wed Nov 26 2014 Petr Hracek <phracek@redhat.com> - 1.3.90-3
- libjpeg-turbo no longer defined macros like JPP (#1164815)
* Wed Nov 19 2014 Petr Hracek <phracek@redhat.com> - 1.3.90-2
- Resolves #1161585 Add suport for secondary arches
* Mon Oct 27 2014 Petr Hracek <phracek@redhat.com> - 1.3.90-1
- new upstream version 1.3.90
Resolves #1135375
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu Apr 17 2014 Simone Caronni <negativo17@gmail.com> - 1.3.1-2
- Re-add libjpeg-devel requirements for broken packages since Fedora 13.
* Wed Apr 16 2014 Petr Hracek <phracek@redhat.com> - 1.3.1-1
- New upstream version
- Remove upstreamed patches, add missing jpegint.h
- Clean up SPEC file
- Disable --static subpackage
- Remove libjpeg obsolency, removed in Fedora 13
* Thu Dec 19 2013 Petr Hracek <phracek@redhat.com> - 1.3.0-2
- Apply fixes CVE-2013-6629, CVE-2013-6630 (#20131737)
* Thu Jul 25 2013 Petr Hracek <phracek@redhat.com> - 1.3.0-1
- new upstream version
- no soname bump change
* Tue Mar 26 2013 Adam Tkac <atkac redhat com> - 1.2.90-2
- rebuild for ARM64 support
* Fri Feb 08 2013 Adam Tkac <atkac redhat com> 1.2.90-1
- update to 1.2.90
* Mon Feb 04 2013 Adam Tkac <atkac redhat com> 1.2.90-0.1.20130204svn922
- update to 1.2.80 snapshot (#854695)
- run `make test` during build
* Fri Jan 18 2013 Adam Tkac <atkac redhat com> 1.2.1-6
- build with jpeg6 API/ABI (jpeg8-ABI feature was dropped)
* Tue Dec 04 2012 Adam Tkac <atkac redhat com> 1.2.1-5
- change license to IJG (#877517)
* Wed Oct 24 2012 Adam Tkac <atkac redhat com> 1.2.1-4
- build with jpeg8 API/ABI (#854695)
* Thu Oct 18 2012 Adam Tkac <atkac redhat com> 1.2.1-3
- minor provides tuning (#863231)
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Mon Jul 16 2012 Adam Tkac <atkac redhat com> 1.2.1-1
- update to 1.2.1
* Thu Mar 08 2012 Adam Tkac <atkac redhat com> 1.2.0-1
- update to 1.2.0
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Mon Nov 21 2011 Orion Poplawski <orion cora nwra com> 1.1.1-3
- Make turobojpeg-devel depend on turbojpeg
* Fri Oct 7 2011 Orion Poplawski <orion cora nwra com> 1.1.1-2
- Ship the turbojpeg library (#744258)
* Mon Jul 11 2011 Adam Tkac <atkac redhat com> 1.1.1-1
- update to 1.1.1
- ljt11-rh688712.patch merged
* Tue Mar 22 2011 Adam Tkac <atkac redhat com> 1.1.0-2
- handle broken JPEGs better (#688712)
* Tue Mar 01 2011 Adam Tkac <atkac redhat com> 1.1.0-1
- update to 1.1.0
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.90-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Jan 17 2011 Adam Tkac <atkac redhat com> 1.0.90-1
- update to 1.0.90
- libjpeg-turbo10-rh639672.patch merged
* Fri Oct 29 2010 Adam Tkac <atkac redhat com> 1.0.1-3
- add support for arithmetic coded files into decoder (#639672)
* Wed Sep 29 2010 jkeating - 1.0.1-2
- Rebuilt for gcc bug 634757
* Mon Sep 13 2010 Adam Tkac <atkac redhat com> 1.0.1-1
- update to 1.0.1
- libjpeg-turbo10-rh617469.patch merged
- add -static subpkg (#632859)
* Wed Aug 04 2010 Adam Tkac <atkac redhat com> 1.0.0-3
- fix huffman decoder to handle broken JPEGs well (#617469)
* Fri Jul 02 2010 Adam Tkac <atkac redhat com> 1.0.0-2
- add libjpeg-devel%%{_isa} provides to -devel subpkg to satisfy imlib-devel
deps
* Fri Jul 02 2010 Adam Tkac <atkac redhat com> 1.0.0-1
- update to 1.0.0
- patches merged
- libjpeg-turbo-programs.patch
- libjpeg-turbo-nosimd.patch
- add libjpeg provides to the main package to workaround problems with broken
java-1.6.0-openjdk package
* Fri Jul 02 2010 Adam Tkac <atkac redhat com> 0.0.93-13
- remove libjpeg provides from -utils subpkg
* Wed Jun 30 2010 Rex Dieter <rdieter@fedoraproject.org> 0.0.93-12
- move Obsoletes: libjpeg to main pkg
* Wed Jun 30 2010 Rex Dieter <rdieter@fedoraproject.org> 0.0.93-11
- -utils: Requires: %%name ...
* Wed Jun 30 2010 Adam Tkac <atkac redhat com> 0.0.93-10
- add Provides = libjpeg to -utils subpackage
* Mon Jun 28 2010 Adam Tkac <atkac redhat com> 0.0.93-9
- merge review related fixes (#600243)
* Wed Jun 16 2010 Adam Tkac <atkac redhat com> 0.0.93-8
- merge review related fixes (#600243)
* Mon Jun 14 2010 Adam Tkac <atkac redhat com> 0.0.93-7
- obsolete -static libjpeg subpackage (#600243)
* Mon Jun 14 2010 Adam Tkac <atkac redhat com> 0.0.93-6
- improve package description a little (#600243)
- include example.c as %%doc in the -devel subpackage
* Fri Jun 11 2010 Adam Tkac <atkac redhat com> 0.0.93-5
- don't use "fc12" disttag in obsoletes/provides (#600243)
* Thu Jun 10 2010 Adam Tkac <atkac redhat com> 0.0.93-4
- fix compilation on platforms without MMX/SSE (#600243)
* Thu Jun 10 2010 Adam Tkac <atkac redhat com> 0.0.93-3
- package review related fixes (#600243)
* Wed Jun 09 2010 Adam Tkac <atkac redhat com> 0.0.93-2
- package review related fixes (#600243)
* Fri Jun 04 2010 Adam Tkac <atkac redhat com> 0.0.93-1
- initial package

View File

@ -0,0 +1,26 @@
diff -rupN --no-dereference libwebp-1.3.2/src/dec/vp8l_dec.c libwebp-1.3.2-new/src/dec/vp8l_dec.c
--- libwebp-1.3.2/src/dec/vp8l_dec.c 2023-09-14 00:11:07.000000000 +0200
+++ libwebp-1.3.2-new/src/dec/vp8l_dec.c 2023-09-28 20:47:39.648154201 +0200
@@ -1241,9 +1241,20 @@ static int DecodeImageData(VP8LDecoder*
}
br->eos_ = VP8LIsEndOfStream(br);
- if (dec->incremental_ && br->eos_ && src < src_end) {
+ // In incremental decoding:
+ // br->eos_ && src < src_last: if 'br' reached the end of the buffer and
+ // 'src_last' has not been reached yet, there is not enough data. 'dec' has to
+ // be reset until there is more data.
+ // !br->eos_ && src < src_last: this cannot happen as either the buffer is
+ // fully read, either enough has been read to reach 'src_last'.
+ // src >= src_last: 'src_last' is reached, all is fine. 'src' can actually go
+ // beyond 'src_last' in case the image is cropped and an LZ77 goes further.
+ // The buffer might have been enough or there is some left. 'br->eos_' does
+ // not matter.
+ assert(!dec->incremental_ || (br->eos_ && src < src_last) || src >= src_last);
+ if (dec->incremental_ && br->eos_ && src < src_last) {
RestoreState(dec);
- } else if (!br->eos_) {
+ } else if ((dec->incremental_ && src >= src_last) || !br->eos_) {
// Process the remaining rows corresponding to last row-block.
if (process_func != NULL) {
process_func(dec, row > last_row ? last_row : row);

View File

@ -0,0 +1,11 @@
--- a/CMakeLists.txt 2024-04-13 02:48:48.000000000 +0600
+++ b/CMakeLists.txt 2024-05-13 10:06:57.159443901 +0600
@@ -781,7 +781,7 @@
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
-set(ConfigPackageLocation ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake/)
+set(ConfigPackageLocation ${CMAKE_CONFIG_PREFIX}/cmake/${PROJECT_NAME}/)
install(EXPORT ${PROJECT_NAME}Targets NAMESPACE ${PROJECT_NAME}::
DESTINATION ${ConfigPackageLocation})

View File

@ -0,0 +1,12 @@
diff -rupN --no-dereference libwebp-1.4.0/CMakeLists.txt libwebp-1.4.0-new/CMakeLists.txt
--- libwebp-1.4.0/CMakeLists.txt 2024-04-14 15:30:20.053730120 +0200
+++ libwebp-1.4.0-new/CMakeLists.txt 2024-04-14 15:30:20.056730140 +0200
@@ -784,7 +784,7 @@ install(
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
-set(ConfigPackageLocation ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake/)
+set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/)
install(EXPORT ${PROJECT_NAME}Targets NAMESPACE ${PROJECT_NAME}::
DESTINATION ${ConfigPackageLocation})

View File

@ -0,0 +1,35 @@
diff -rupN --no-dereference libwebp-1.4.0/CMakeLists.txt libwebp-1.4.0-new/CMakeLists.txt
--- libwebp-1.4.0/CMakeLists.txt 2024-04-12 22:48:48.000000000 +0200
+++ libwebp-1.4.0-new/CMakeLists.txt 2024-04-14 15:30:19.981729641 +0200
@@ -582,8 +582,8 @@ endif()
if(WEBP_BUILD_VWEBP)
# vwebp
- find_package(GLUT)
- if(GLUT_FOUND)
+ find_package(FreeGLUT)
+ if(FreeGLUT_FOUND)
include_directories(${WEBP_DEP_IMG_INCLUDE_DIRS})
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "VWEBP_SRCS" "vwebp")
add_executable(vwebp ${VWEBP_SRCS})
@@ -591,7 +591,7 @@ if(WEBP_BUILD_VWEBP)
vwebp
${OPENGL_LIBRARIES}
exampleutil
- GLUT::GLUT
+ glut
imageioutil
webp
webpdemux)
diff -rupN --no-dereference libwebp-1.4.0/examples/vwebp.c libwebp-1.4.0-new/examples/vwebp.c
--- libwebp-1.4.0/examples/vwebp.c 2024-04-12 22:48:48.000000000 +0200
+++ libwebp-1.4.0-new/examples/vwebp.c 2024-04-14 15:30:19.981729641 +0200
@@ -28,7 +28,7 @@
#if defined(HAVE_GLUT_GLUT_H)
#include <GLUT/glut.h>
#else
-#include <GL/glut.h>
+#include <GL/freeglut.h>
#ifdef FREEGLUT
#include <GL/freeglut.h>
#endif

View File

@ -0,0 +1,13 @@
diff -rupN --no-dereference libwebp-1.4.0/CMakeLists.txt libwebp-1.4.0-new/CMakeLists.txt
--- libwebp-1.4.0/CMakeLists.txt 2024-04-14 15:30:20.015729868 +0200
+++ libwebp-1.4.0-new/CMakeLists.txt 2024-04-14 15:30:20.020729901 +0200
@@ -301,6 +301,9 @@ macro(set_version FILE TARGET_NAME NAME_
MACHO_CURRENT_VERSION
${LIBWEBP_MACHO_COMPATIBILITY_VERSION}.${LT_REVISION})
endif()
+ if(WIN32)
+ set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX "-${LT_CURRENT_MINUS_AGE}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ endif(WIN32)
endmacro()
# ##############################################################################

View File

@ -0,0 +1,20 @@
diff -rupN --no-dereference libwebp-1.4.0/CMakeLists.txt libwebp-1.4.0-new/CMakeLists.txt
--- libwebp-1.4.0/CMakeLists.txt 2024-04-14 15:30:20.089730360 +0200
+++ libwebp-1.4.0-new/CMakeLists.txt 2024-04-14 15:30:20.093730386 +0200
@@ -114,11 +114,11 @@ endif()
include(cmake/deps.cmake)
include(GNUInstallDirs)
-if(BUILD_SHARED_LIBS AND NOT DEFINED CMAKE_INSTALL_RPATH)
- # Set the rpath to match autoconf/libtool behavior. Note this must be set
- # before target creation.
- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
-endif()
+# if(BUILD_SHARED_LIBS AND NOT DEFINED CMAKE_INSTALL_RPATH)
+# # Set the rpath to match autoconf/libtool behavior. Note this must be set
+# # before target creation.
+# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+# endif()
# ##############################################################################
# Options.

View File

@ -0,0 +1,365 @@
%global _hardened_build 1
%global realname libwebp
%global _root_prefix %{_prefix}
%global _root_libdir %{_root_prefix}/%{_lib}
%global _root_bindir %{_root_prefix}/bin
%global _prefix /opt/rx
%global _libdir %{_prefix}/%{_lib}
%global _bindir %{_prefix}/bin
%global _datadir %{_prefix}/share
%global _mandir %{_prefix}/share/man
%global _includedir %{_prefix}/include
Name: rx-libwebp
Version: 1.4.0
Release: 1%{?dist}
URL: http://webmproject.org/
Summary: Library and tools for the WebP graphics format
# Additional IPR is licensed as well. See PATENTS file for details
License: BSD
Source0: http://downloads.webmproject.org/releases/webp/%{realname}-%{version}.tar.gz
Source1: libwebp_jni_example.java
# Fix build with freeglut
Patch0: libwebp-freeglut.patch
# Fix cmake module install location
Patch2: fix-cmake-files-location.patch
# Kill rpath
#Patch3: libwebp-rpath.patch
#BuildRequires: rx-libjpeg-turbo-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: giflib-devel
BuildRequires: libtiff-devel
BuildRequires: java-devel
BuildRequires: jpackage-utils
BuildRequires: swig
BuildRequires: ninja-build
BuildRequires: freeglut-devel
BuildRequires: cmake
BuildRequires: clang
#Requires: rx-libjpeg-turbo
%description
WebP is an image format that does lossy compression of digital
photographic images. WebP consists of a codec based on VP8, and a
container based on RIFF. Webmasters, web developers and browser
developers can use WebP to compress, archive and distribute digital
images more efficiently.
%package tools
Summary: The WebP command line tools
%description tools
WebP is an image format that does lossy compression of digital
photographic images. WebP consists of a codec based on VP8, and a
container based on RIFF. Webmasters, web developers and browser
developers can use WebP to compress, archive and distribute digital
images more efficiently.
%package devel
Summary: Development files for libwebp, a library for the WebP format
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: pkgconfig(libsharpyuv) = %{version}-%{release}
Provides: pkgconfig(libwebp) = %{version}-%{release}
Provides: pkgconfig(libwebpdecoder) = %{version}-%{release}
Provides: pkgconfig(libwebpdemux) = %{version}-%{release}
Provides: pkgconfig(libwebpmux) = %{version}-%{release}
%description devel
WebP is an image format that does lossy compression of digital
photographic images. WebP consists of a codec based on VP8, and a
container based on RIFF. Webmasters, web developers and browser
developers can use WebP to compress, archive and distribute digital
images more efficiently.
%package java
Summary: Java bindings for libwebp, a library for the WebP format
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: java-headless
Requires: jpackage-utils
%description java
Java bindings for libwebp.
%prep
%autosetup -p1 -n %{realname}-%{version}
%build
%ifarch aarch64
export CFLAGS="%{optflags} -frename-registers"
%endif
export LDFLAGS="%{build_ldflags} -L%{_libdir} -Wl,-rpath=%{_libdir}"
export CC=clang
export CXX=clang++
# Native build
%cmake -DCMAKE_CONFIG_PREFIX=%{_libdir}
%cmake_build
# swig generated Java bindings
cp %{SOURCE1} .
cd swig
rm -rf libwebp.jar libwebp_java_wrap.c
mkdir -p java/com/google/webp
swig -ignoremissing -I../src -java \
-package com.google.webp \
-outdir java/com/google/webp \
-o libwebp_java_wrap.c libwebp.swig
clang %{__global_ldflags} %(echo %{optflags} | sed 's/-fcf-protection//')-shared -fPIC \
-I/usr/lib/jvm/java/include \
-I/usr/lib/jvm/java/include/linux \
-I../src \
-L.. \
-L../src/.libs -lwebp libwebp_java_wrap.c \
-o libwebp_jni.so
cd java
javac com/google/webp/libwebp.java
jar cvf ../libwebp.jar com/google/webp/*.class
%install
%cmake_install
find "%{buildroot}/%{_libdir}" -type f -name "*.la" -delete
# swig generated Java bindings
mkdir -p %{buildroot}/%{_libdir}/%{realname}-java
cp swig/*.jar swig/*.so %{buildroot}/%{_libdir}/%{realname}-java/
#mkdir -p %{buildroot}%{_root_libdir}/
#mv %{buildroot}%{_libdir}/pkgconfig %{buildroot}%{_root_libdir}/
mkdir -p %{buildroot}%{_root_bindir}
for b in cwebp dwebp gif2webp img2webp webpinfo webpmux
do
ln -sf %{_bindir}/$b %{buildroot}%{_root_bindir}/${b}-1.3
done
%ldconfig_scriptlets
%files tools
%{_bindir}/cwebp
%{_bindir}/dwebp
%{_bindir}/gif2webp
%{_bindir}/img2webp
%{_bindir}/webpinfo
%{_bindir}/webpmux
%{_root_bindir}/*-1.3
%{_mandir}/man*/*
%files -n %{name}
%doc README.md PATENTS NEWS AUTHORS
%license COPYING
%{_libdir}/%{realname}.so.7*
%{_libdir}/%{realname}decoder.so.3*
%{_libdir}/%{realname}demux.so.2*
%{_libdir}/%{realname}mux.so.3*
%{_libdir}/libsharpyuv.so.0*
%files devel
%{_libdir}/%{realname}*.so
%{_libdir}/libsharpyuv.so
%{_includedir}/*
%{_libdir}/pkgconfig/*.pc
%{_libdir}/cmake/WebP/
%files java
%doc libwebp_jni_example.java
%{_libdir}/%{realname}-java/
%changelog
* Tue May 7 2024 Raven <raven@sysadmins.ws> - 1.4.0-1
- Update to 1.4.0
* Wed Dec 20 2023 Raven <raven@sysadmins.ws> - 1.3.2-1
- Update to 1.3.2
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.2.0-2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Mon Feb 01 2021 Sandro Mani <manisandro@gmail.com> - 1.2.0-1
- Update to 1.2.0
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sat Jul 11 2020 Jiri Vanek <jvanek@redhat.com> - 1.1.0-4
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
* Mon May 18 2020 Sandro Mani <manisandro@gmail.com> - 1.1.0-3
- Don't manually and incorrectly install vwebp, Makefile already does it correctly (#1836640)
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Jan 07 2020 Sandro Mani <manisandro@gmail.com> - 1.1.0-1
- Update to 1.1.0
* Tue Sep 17 2019 Gwyn Ciesla <gwync@protonmail.com> - 1.0.3-3
- Rebuilt for new freeglut
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Jul 15 2019 Sandro Mani <manisandro@gmail.com> - 1.0.3-1
- Update to 1.0.3
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Jan 22 2019 Sandro Mani <manisandro@gmail.com> - 1.0.2-1
- Update to 1.0.2
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Apr 26 2018 Sandro Mani <manisandro@gmail.com> - 1.0.0-1
- Update to 1.0.0
* Tue Feb 27 2018 Sandro Mani <manisandro@gmail.com> - 0.6.1-8
- Fix LDFLAGS not passed when building libwebp_jni.so (#1548718)
* Mon Feb 26 2018 Sandro Mani <manisandro@gmail.com> - 0.6.1-7
- More big-endian fixes
* Fri Feb 16 2018 Sandro Mani <manisandro@gmail.com> - 0.6.1-6
- Backport another big-endian fix
* Fri Feb 16 2018 Sandro Mani <manisandro@gmail.com> - 0.6.1-5
- Backport upstream big-endian fix
* Tue Feb 13 2018 Sandro Mani <manisandro@gmail.com> - 0.6.1-4
- Rebuild (giflib)
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.6.1-2
- Switch to %%ldconfig_scriptlets
* Thu Nov 30 2017 Sandro Mani <manisandro@gmail.com> - 0.6.1-1
- Update to 0.6.1
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Wed Feb 01 2017 Sandro Mani <manisandro@gmail.com> - 0.6.0-1
- Update to 0.6.0
* Thu Dec 22 2016 Sandro Mani <manisandro@gmail.com> - 0.5.2-1
- Update to 0.5.2
* Sat Oct 29 2016 Sandro Mani <manisandro@gmail.com> - 0.5.1-2
- Backport e2affacc35f1df6cc3b1a9fa0ceff5ce2d0cce83 (CVE-2016-9085, rhbz#1389338)
* Fri Aug 12 2016 Sandro Mani <manisandro@gmail.com> - 0.5.1-1
- upstream release 0.5.1
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Mon Dec 28 2015 Sandro Mani <manisandro@gmail.com> - 0.5.0-1
- upstream release 0.5.0
* Fri Oct 30 2015 Sandro Mani <manisandro@gmail.com> - 0.4.4-1
- upstream release 0.4.4
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri Mar 27 2015 Sandro Mani <manisandro@gmail.com> - 0.4.3-2
- Add BuildRequires: freeglut-devel to build vwebp
* Thu Mar 12 2015 Sandro Mani <manisandro@gmail.com> - 0.4.3-1
- upstream release 0.4.3
* Fri Oct 17 2014 Sandro Mani <manisandro@gmail.com> - 0.4.2-1
- upstream release 0.4.2
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Wed Aug 13 2014 Peter Robinson <pbrobinson@fedoraproject.org> 0.4.1-2
- Use frename-registers cflag to fix FTBFS on aarch64
* Tue Aug 05 2014 Sandro Mani <manisandro@gmail.com> - 0.4.1-1
- upstream release 0.4.1
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Tue Apr 08 2014 Jaromir Capik <jcapik@redhat.com> - 0.4.0-3
- Fixing endian checks (#962091)
- Fixing FTPBS caused by rpath presence
* Fri Mar 28 2014 Michael Simacek <msimacek@redhat.com> - 0.4.0-2
- Use Requires: java-headless rebuild (#1067528)
* Thu Jan 02 2014 Sandro Mani <manisandro@gmail.com> - 0.4.0-1
- upstream release 0.4.0
* Wed Oct 02 2013 Sandro Mani <manisandro@gmail.com> - 0.3.1-2
- enable webpdemux
* Sun Aug 04 2013 Sandro Mani <manisandro@gmail.com> - 0.3.1-1
- upstream release 0.3.1
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Mon May 13 2013 Rahul Sundaram <sundaram@fedoraproject.org> - 0.3.0-1
- upstream release 0.3.0
- enable gif2webp
- add build requires on giflib-devel and libtiff-devel
- use make_install and hardened macros
- list binaries explicitly
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Fri Jan 18 2013 Adam Tkac <atkac redhat com> - 0.2.1-2
- rebuild due to "jpeg8-ABI" feature drop
* Thu Dec 27 2012 Rahul Sundaram <sundaram@fedoraproject.org> - 0.2.1-1
- new upstream release 0.2.1
* Fri Dec 21 2012 Adam Tkac <atkac redhat com> - 0.1.3-3
- rebuild against new libjpeg
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Thu Feb 02 2012 Rahul Sundaram <sundaram@fedoraproject.org> - 0.1.3-1
- Several spec improvements by Scott Tsai <scottt.tw@gmail.com>
* Wed May 25 2011 Rahul Sundaram <sundaram@fedoraproject.org> - 0.1.2-1
- Initial spec. Based on openSUSE one

View File

@ -0,0 +1,27 @@
import com.google.webp.libwebp;
import java.lang.reflect.Method;
public class libwebp_jni_example {
static {
try {
System.load("/usr/lib64/libwebp-java/libwebp_jni.so");
} catch (UnsatisfiedLinkError e) {
System.load("/usr/lib/libwebp-java/libwebp_jni.so");
}
}
/**
* usage: java -cp libwebp.jar:. libwebp_jni_example
*/
public static void main(String argv[]) {
final int version = libwebp.WebPGetDecoderVersion();
System.out.println("libwebp version: " + Integer.toHexString(version));
System.out.println("libwebp methods:");
final Method[] libwebpMethods = libwebp.class.getDeclaredMethods();
for (int i = 0; i < libwebpMethods.length; i++) {
System.out.println(libwebpMethods[i]);
}
}
}

View File

@ -19,7 +19,7 @@
Summary: PDF rendering library
Name: rx-poppler
Version: 23.02.0
Release: 2%{?dist}
Release: 5%{?dist}
License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT
URL: http://poppler.freedesktop.org/
Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz
@ -32,7 +32,7 @@ Patch3: poppler-21.01.0-glib-introspection.patch
BuildRequires: make
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: gcc-toolset-14-gcc-c++
BuildRequires: gettext-devel
BuildRequires: pkgconfig(cairo)
BuildRequires: pkgconfig(cairo-ft)
@ -171,6 +171,7 @@ Requires: %{name}-devel%{?_isa} = %{version}-%{release}
chmod -x poppler/CairoFontEngine.cc
%build
%enable_devtoolset14
export PATH=%{_bindir}${PATH:+:${PATH}}
export LDFLAGS="-L%{_libdir} -Wl,-rpath=%{_libdir} -L%{_prefix}/glib2/%{_lib} -Wl,-rpath=%{_prefix}/glib2/%{_lib} ${LDFLAGS}"
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
@ -288,6 +289,9 @@ test "$(pkg-config --modversion poppler-qt6)" = "%{version}"
%{_includedir}/poppler/cpp
%changelog
* Tue Oct 29 2024 Raven <raven@sysadmins.ws> - 23.02.0-4
- rebuilt with new rx-freetype
* Fri Feb 3 2023 Marek Kasik <mkasik@redhat.com> - 23.02.0-1
- Update to 23.02.0
- Resolves: #2123190