%global _python_bytecompile_extra 0 # enable_gtkdoc: Toggle if gtkdoc stuff should be rebuilt # 0 = no # 1 = yes %define enable_gtkdoc 1 # This package has static probes which do not work with LTO # Disable LTO %define _lto_cflags %{nil} # Note that this is NOT a relocatable package %define api_version 2.0 %define lib_major 0 %define lib_name %mklibname %{name}_ %{lib_major} %define libgio_name %mklibname gio%{api_version}_ %{lib_major} %define develname %mklibname -d %name %define staticname %mklibname -d -s %name %define url_ver %{lua: ver = rpm.expand("%{version}"); majmin, count1 = string.gsub(ver, "^([0123456789]+%.[0123456789]+).*", "%1", 1); if count1 == 0 then print(ver); return; end; maj, count2 = string.gsub(majmin, "^([0123456789]+).*", "%1", 1); if count2 == 0 then print(majmin) elseif tonumber(majmin) < 40 then print(majmin) else print(maj) end} Summary: A library of handy utility functions Name: glib%{api_version} Version: 2.74.7 Release: %mkrel 1 License: LGPLv2+ Group: System/Libraries URL: https://www.gtk.org/ Source0: https://download.gnome.org/sources/glib/%{url_ver}/glib-%{version}.tar.xz Source1: glib20.sh Source2: glib20.csh # (tmb) disable deprecated schema warnings on mga3 like we did for mga2 Patch0: glib-silence-deprecated-paths.patch # Disable statx as it makes Firefox and Chromium crash (mga#27234), # and upstream doesn't care: # https://gitlab.gnome.org/GNOME/glib/-/issues/2198 Patch2: glib-2.65.2-disable-statx.patch Source3: glib-2.57.2-guard-against-reading-past-the-end-of-a-timezone-file.patch Requires: common-licenses Requires: shared-mime-info >= 0.70 BuildRequires: systemtap BuildRequires: pkgconfig(libpcre2-8) BuildRequires: pkgconfig(mount) BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(dbus-1) >= 1.2.14 BuildRequires: gettext BuildRequires: libtool BuildRequires: locales-en BuildRequires: pkgconfig(libffi) >= 3.0.0 BuildRequires: xsltproc BuildRequires: docbook-dtds BuildRequires: docbook-xsl BuildRequires: docbook-style-xsl BuildRequires: libxml2-utils BuildRequires: meson BuildRequires: pkgconfig(bash-completion) # for sys/sdt.h BuildRequires: systemtap-sdt-devel # ovitters adds elf support to gresource binary, needed to determine # gnome-shell requires BuildRequires: elfutils-devel %if %enable_gtkdoc BuildRequires: gtk-doc >= 0.10 %endif BuildRequires: pkgconfig(python3) %description Glib is a handy library of utility functions. This C library is designed to solve some portability problems and provide other useful functionality which most programs require. Glib is used by GDK, GTK+ and many applications. %package common Summary: data files used by glib Group: System/Libraries %description common Glib is a handy library of utility functions. This C library is designed to solve some portability problems and provide other useful functionality which most programs require. This package contains data used by glib library. %package -n %{lib_name} Summary: %{summary} Group: %{group} Provides: glib2 = %{version}-%{release} Provides: libglib2 = %{version}-%{release} Provides: lib%{name} = %{version}-%{release} %description -n %{lib_name} Glib is a handy library of utility functions. This C library is designed to solve some portability problems and provide other useful functionality which most programs require. Glib is used by GDK, GTK+ and many applications. You should install Glib because many of your applications will depend on this library. This package contains the library needed to run programs dynamically linked with the glib. %package -n %{libgio_name} Summary: GIO is the input, output and streaming API of glib Group: %{group} Requires: %{lib_name} = %{version} Requires: shared-mime-info Recommends: %{mklibname glib-networking-gnutls} %description -n %{libgio_name} GIO is the input, output and streaming API of glib. It on the one hand provides a set of various streaming classes to access data from different sources in a convenient way and on the other hand it provides a high level file system abstraction to access file and directories not only local but also on the network. For the latter you need to install gvfs. %package -n %develname Summary: Static libraries and header files of %{name} Group: Development/C Provides: glib2-devel = %{version}-%{release} Provides: libglib2-devel = %{version}-%{release} Provides: lib%{name}-devel = %{version}-%{release} Requires: %{lib_name} = %{version} Requires: %{libgio_name} = %{version} Requires: %{name}-common = %{version} Requires: glib-gettextize >= %{version} %description -n %develname Header files for the support library for the GIMP's X libraries, which are available as public libraries. GLIB includes generally useful data structures. %package -n %staticname Summary: Static libraries and header files of %{name} Group: Development/C Requires: %develname = %{version}-%{release} Provides: glib2-static-devel = %{version}-%{release} Provides: libglib2-static-devel = %{version}-%{release} Provides: lib%{name}-static-devel = %{version}-%{release} %description -n %staticname Static libraries and files for the support library for the GIMP's X libraries, which are available as public libraries. GLIB includes generally useful data structures. %package -n glib-gettextize Summary: Gettextize replacement Group: Development/Other %description -n glib-gettextize %{name} package is designed to replace gettextize completely. Various gettext related files are modified in glib and gtk+ to allow better and more flexible i18n; however gettextize overwrites them with its own copy of files, thus nullifying the changes. If this replacement of gettextize is run instead, then all gnome packages can potentially benefit from the changes. %package tests Summary: Tests for the glib2 package Requires: %{lib_name}%{?_isa} = %{version}-%{release} %description tests The glib2-tests package contains tests that can be used to verify the functionality of the installed glib2 package. %prep %autosetup -n glib-%{version} -p1 %build %ifarch %arm # workaround from https://bugzilla.redhat.com/show_bug.cgi?id=2026858 export CPPFLAGS="-DSTAP_SDT_ARG_CONSTRAINT=g" %endif %meson \ -Dselinux=disabled \ --default-library=both \ -Dman=true \ -Ddtrace=true \ -Dsystemtap=true \ -Dinstalled_tests=true \ %if !%enable_gtkdoc -Dgtk_doc=false %else -Dgtk_doc=true %endif %meson_build %check #gw https://bugzilla.gnome.org/show_bug.cgi?id=440544 #make check %install %meson_install mkdir -p %{buildroot}%{_sysconfdir}/profile.d install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/profile.d/50glib20.sh install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d/50glib20.csh %find_lang glib20 mv %{buildroot}%{_bindir}/gio-querymodules %{buildroot}%{_bindir}/gio-querymodules-%{__isa_bits} #ghost files mkdir -p %buildroot%_libdir/gio/modules mkdir -p %buildroot%_datadir/glib-2.0/schemas touch %buildroot%_libdir/gio/modules/giomodule.cache \ %buildroot%_datadir/glib-2.0/schemas/gschemas.compiled # don't ship .a files for gio modules rm -f %buildroot%_libdir/gio/modules/lib*a # we don't want these find %{buildroot} -name "*.la" -delete rm -f %{buildroot}%{_datadir}/glib-2.0/gdb/*.{pyc,pyo} rm -f %{buildroot}%{_datadir}/glib-2.0/codegen/*.{pyc,pyo} # automatic gschema compilation on rpm installs/removals %transfiletriggerpostun -n %{name}-common -- %_datadir/glib-2.0/schemas/ if [ -x /usr/bin/glib-compile-schemas ]; then /usr/bin/glib-compile-schemas --allow-any-name %_datadir/glib-2.0/schemas/ fi %transfiletriggerin -n %{name}-common -- %_datadir/glib-2.0/schemas/ if [ -x /usr/bin/glib-compile-schemas ]; then /usr/bin/glib-compile-schemas --allow-any-name %_datadir/glib-2.0/schemas/ fi # automatic update of gio module cache %transfiletriggerpostun -n %{libgio_name} -- %{_libdir}/gio/modules/ if [ -x %{_bindir}/gio-querymodules-%{__isa_bits} ]; then %{_bindir}/gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules fi %transfiletriggerin -n %{libgio_name} -- %{_libdir}/gio/modules/ if [ -x %{_bindir}/gio-querymodules-%{__isa_bits} ]; then %{_bindir}/gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules fi %files common -f glib20.lang %doc NEWS README.md %config(noreplace) %{_sysconfdir}/profile.d/* %_datadir/bash-completion/completions/gapplication %_datadir/bash-completion/completions/gdbus %_datadir/bash-completion/completions/gio %_datadir/bash-completion/completions/gsettings %_datadir/bash-completion/completions/gresource %{_bindir}/gapplication %{_bindir}/gdbus %{_bindir}/gio %{_bindir}/glib-compile-schemas %{_bindir}/glib-compile-resources %{_bindir}/gresource %{_bindir}/gsettings %{_libexecdir}/gio-launch-desktop %{_mandir}/man1/gio-querymodules.1* %_mandir/man1/glib-compile-schemas.1* %_mandir/man1/glib-compile-resources.1* %_mandir/man1/gsettings.1* %{_mandir}/man1/gapplication.1* %{_mandir}/man1/gdbus.1* %{_mandir}/man1/gio.1* %{_mandir}/man1/gresource.1* %dir %_datadir/glib-2.0/ %dir %_datadir/glib-2.0/schemas/ %_datadir/glib-2.0/schemas/gschema.dtd %ghost %_datadir/glib-2.0/schemas/gschemas.compiled %_datadir/gettext/its/ %{_datadir}/glib-2.0/valgrind/*.* %files -n %{lib_name} %doc README.md %{_libdir}/libglib-%{api_version}.so.%{lib_major}{,.*} %{_libdir}/libgmodule-%{api_version}.so.%{lib_major}{,.*} %{_libdir}/libgthread-%{api_version}.so.%{lib_major}{,.*} %{_libdir}/libgobject-%{api_version}.so.%{lib_major}{,.*} %files -n %{libgio_name} %_bindir/gio-querymodules-%{__isa_bits} %{_libdir}/libgio-%{api_version}.so.%{lib_major}{,.*} %dir %_libdir/gio/ %dir %_libdir/gio/modules/ %ghost %_libdir/gio/modules/giomodule.cache %files -n %develname %doc NEWS %doc %{_datadir}/gtk-doc/html/* %{_libdir}/lib*.so %{_libdir}/glib-%{api_version} %{_datadir}/glib-%{api_version}/codegen %{_libdir}/pkgconfig/* %{_includedir}/* %{_mandir}/man1/glib-genmarshal.1* %{_mandir}/man1/glib-mkenums.1* %{_mandir}/man1/gobject-query.1* %{_mandir}/man1/gtester-report.1* %{_mandir}/man1/gtester.1* %{_mandir}/man1/gdbus-codegen.1* %{_datadir}/aclocal/glib-%{api_version}.m4 %{_datadir}/aclocal/gsettings.m4 %{_bindir}/glib-genmarshal %{_bindir}/glib-mkenums %{_bindir}/gobject-query %{_bindir}/gtester* %{_bindir}/gdbus-codegen %{_datadir}/gdb/auto-load%{_libdir}/lib*-gdb.py* %{_datadir}/glib-%{api_version}/gdb %{_datadir}/systemtap/ %files -n glib-gettextize %{_bindir}/glib-gettextize %_mandir/man1/glib-gettextize.1* %{_datadir}/aclocal/glib-gettext.m4 %{_datadir}/glib-%{api_version}/gettext %files -n %staticname %{_libdir}/lib*.a %files tests %{_libexecdir}/installed-tests %{_datadir}/installed-tests