File mingw64-glib2.spec of Package mingw64-glib2

#
# spec file for package mingw64-glib2
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define with_gtk_doc 0
%define ver_maj 2.75

Name:           mingw64-glib2
Version:        2.75.2
Release:        0
Summary:        MinGW Windows GLib2 library
License:        LGPL-2.0-or-later
Group:          Development/Libraries/GNOME
Url:            http://www.gtk.org/
Source:         https://download.gnome.org/sources/glib/%{ver_maj}/glib-%{version}.tar.xz
Source1:        %{name}-rpmlintrc
Patch0:         glib-2.75.2-fix-finding-tools.patch
Patch1:         glib-2.75.2-fix-linking.patch
Patch2:         glib-2.75.2-default_library-both.patch
Patch3:         glib-2.75.2-fix-filename-case.patch
# Native version for msgfmt
BuildRequires:  gcc-c++
BuildRequires:  gettext-runtime
#!BuildIgnore: post-build-checks
BuildRequires:  gtk-doc
BuildRequires:  mingw64-cross-meson
BuildRequires:  mingw64-cross-gcc-c++
BuildRequires:  mingw64-cross-pkg-config
BuildRequires:  mingw64-cross-wine
BuildRequires:  mingw64-dbus-1-devel
BuildRequires:  mingw64-libffi-devel
BuildRequires:  mingw64-libintl-devel
BuildRequires:  mingw64-pcre2-devel
BuildRequires:  mingw64-win_iconv-devel
BuildRequires:  mingw64-zlib-devel
BuildRequires:  xz
Requires:       %{name}-lang = %{version}
%_mingw64_package_header_debug
BuildArch:      noarch

%description
GLib provides the core application building blocks for libraries and applications written in C. It provides the core
object system used in GNOME, the main loop implementation, and a large set of utility functions for strings and common
data structures.

%define libver 2_0-0
%define libgio libgio-%{libver}
%define libglib libglib-%{libver}
%define libgmodule libgmodule-%{libver}
%define libgobject libgobject-%{libver}
%define libgthread libgthread-%{libver}

%package tools
Summary:        MinGW Windows GLib2 library (tools)
Group:          Development/Libraries/C and C++

%description tools
GLib provides the core application building blocks for libraries and applications written in C. It provides the core
object system used in GNOME, the main loop implementation, and a large set of utility functions for strings and common
data structures.

%package devel
Summary:        MinGW Windows GLib2 library (development tools)
Group:          Development/Libraries/C and C++
Requires:       mingw64-%libgio = %{version}
Requires:       mingw64-%libglib = %{version}
Requires:       mingw64-%libgmodule = %{version}
Requires:       mingw64-%libgobject = %{version}
Requires:       mingw64-%libgthread = %{version}
Requires:       %{name}-tools = %{version}
# Required by gdbus-codegen
Requires:       python3-xml

%description devel
Development files needed for building applications against the GLib library.

%package devel-static
Summary:        Static libraries for glib, a general-purpose utility library
Group:          Development/Libraries/C and C++
Requires:       %{name}-devel = %{version}

%description devel-static
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.

This package contains static versions of the GLib libraries.

%package -n mingw64-%libglib
Summary:        General-Purpose Utility Library
Group:          System/Libraries
# need the spawn helper programs
Requires:       %{name} = %{version}

%description -n mingw64-%libglib
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.

%package -n mingw64-%libgmodule
Summary:        General-Purpose Utility Library -- Library for Modules
Group:          System/Libraries

%description -n mingw64-%libgmodule
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.

The libgmodule library provides a portable way to dynamically load
object files (commonly known as 'plug-ins').

%package -n mingw64-%libgio
Summary:        General-Purpose Utility Library -- Library for VFS
Group:          System/Libraries
Requires:       %{name}-tools = %{version}

%description -n mingw64-%libgio
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.

GIO provides a modern, easy-to-use VFS API.

%package -n mingw64-%libgthread
Summary:        General-Purpose Utility Library -- Library for Threads
Group:          System/Libraries

%description -n mingw64-%libgthread
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.

The libgthread library provides a portable way to write multi-threaded
software.

%package -n mingw64-%libgobject
Summary:        General-Purpose Utility Library -- Object-Oriented Framework for C
Group:          System/Libraries

%description -n mingw64-%libgobject
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.

The GObject library provides an object-oriented framework for C.

%package tests-devel
Summary:        Tests for the glib2 package
Group:          Development/Libraries/C and C++
Requires:       %{name}-devel = %{version}
Requires:       %{name}-tests = %{version}-%{release}
Provides:       %{name}-tests = %{version}-%{release}
Obsoletes:      %{name}-tests < %{version}-%{release}

%description tests-devel
The glib2-tests-devel package contains tests that can be used to verify
the functionality of the installed glib2 package.

%_mingw64_debug_package

%lang_package

%prep
%autosetup -p1 -n glib-%{version}
#sed -i "s/1.32.1/1.32/" docs/reference/meson.build

%build
%_mingw64_cross_wine_init

%_mingw64_meson \
	--default-library=both \
	-Dman=true \
%if %{with_gtk_doc}
	-Dgtk_doc=true \
%endif
%if %{with systemtap}
	-Dsystemtap=true \
	-Ddtrace=true \
%else
	-Dsystemtap=false \
	-Ddtrace=false \
%endif
	-Dinstalled_tests=true \
	-Dlibelf=disabled \
	%{nil}
%_mingw64_meson_build

%install
%_mingw64_meson_install

# replace /usr/bin/env shebangs
# /usr/bin/env @PYTHON@ -> /usr/bin/python3
grep -rl  "%{_bindir}/env python" %buildroot%{_mingw64_prefix} | xargs sed -i "s|%{_bindir}/env |%{_bindir}/|g"

chmod a+x %buildroot%{_mingw64_prefix}/libexec/installed-tests/glib/taptestrunner.py
chmod a+x %buildroot%{_mingw64_prefix}/libexec/installed-tests/glib/x-content/unix-software/autorun.sh

%find_lang glib20

%files
%defattr(-,root,root)
%{_mingw64_bindir}/gspawn-*-helper-console.exe
%{_mingw64_bindir}/gspawn-*-helper.exe

%files -n mingw64-%libgio
%defattr(-,root,root)
%{_mingw64_bindir}/libgio-2.0-0.dll

%files -n mingw64-%libglib
%defattr(-,root,root)
%{_mingw64_bindir}/libglib-2.0-0.dll

%files -n mingw64-%libgmodule
%defattr(-,root,root)
%{_mingw64_bindir}/libgmodule-2.0-0.dll

%files -n mingw64-%libgobject
%defattr(-,root,root)
%{_mingw64_bindir}/libgobject-2.0-0.dll

%files -n mingw64-%libgthread
%defattr(-,root,root)
%{_mingw64_bindir}/libgthread-2.0-0.dll

%files tools
%defattr(-,root,root)
%{_mingw64_datadir}/bash-completion/completions/gapplication
%{_mingw64_datadir}/bash-completion/completions/gdbus
%{_mingw64_datadir}/bash-completion/completions/gio
%{_mingw64_datadir}/bash-completion/completions/gresource
%{_mingw64_datadir}/bash-completion/completions/gsettings
%{_mingw64_bindir}/gdbus.exe
%{_mingw64_bindir}/gio.exe
%{_mingw64_bindir}/gio-querymodules.exe
%{_mingw64_bindir}/glib-compile-schemas.exe
%{_mingw64_bindir}/glib-compile-resources.exe
%{_mingw64_bindir}/gresource.exe
%{_mingw64_bindir}/gsettings.exe
%{_mingw64_mandir}/man1/gapplication.1*
%{_mingw64_mandir}/man1/gdbus.1*
%{_mingw64_mandir}/man1/gio.1*
%{_mingw64_mandir}/man1/gio-querymodules.1*
%{_mingw64_mandir}/man1/glib-compile-schemas.1*
%{_mingw64_mandir}/man1/glib-compile-resources.1*
%{_mingw64_mandir}/man1/gresource.1*
%{_mingw64_mandir}/man1/gsettings.1*

%files devel
%defattr(-,root,root)
%{_mingw64_bindir}/glib-genmarshal
%{_mingw64_bindir}/glib-gettextize
%{_mingw64_bindir}/glib-mkenums
%{_mingw64_bindir}/gobject-query.exe
%{_mingw64_bindir}/gdbus-codegen
%{_mingw64_bindir}/gtester-report
%{_mingw64_includedir}/glib-2.0/
%{_mingw64_includedir}/gio-win32-2.0/
%{_mingw64_libdir}/glib-2.0/
%{_mingw64_libdir}/libgio-2.0.dll.a
%{_mingw64_libdir}/libglib-2.0.dll.a
%{_mingw64_libdir}/libgmodule-2.0.dll.a
%{_mingw64_libdir}/libgobject-2.0.dll.a
%{_mingw64_libdir}/libgthread-2.0.dll.a
%{_mingw64_libdir}/pkgconfig/gio-2.0.pc
%{_mingw64_libdir}/pkgconfig/gio-windows-2.0.pc
%{_mingw64_libdir}/pkgconfig/glib-2.0.pc
%{_mingw64_libdir}/pkgconfig/gmodule-2.0.pc
%{_mingw64_libdir}/pkgconfig/gmodule-export-2.0.pc
%{_mingw64_libdir}/pkgconfig/gmodule-no-export-2.0.pc
%{_mingw64_libdir}/pkgconfig/gobject-2.0.pc
%{_mingw64_libdir}/pkgconfig/gthread-2.0.pc
%{_mingw64_datadir}/aclocal/glib-2.0.m4
%{_mingw64_datadir}/aclocal/glib-gettext.m4
%{_mingw64_datadir}/aclocal/gsettings.m4
%{_mingw64_datadir}/gettext/its/gschema.its
%{_mingw64_datadir}/gettext/its/gschema.loc
%{_mingw64_datadir}/glib-2.0/
%if %{with_gtk_doc}
%{_mingw64_datadir}/gtk-doc/html/gio/
%{_mingw64_datadir}/gtk-doc/html/glib/
%{_mingw64_datadir}/gtk-doc/html/gobject/
%endif
%{_mingw64_mandir}/man1/glib-genmarshal.1*
%{_mingw64_mandir}/man1/glib-gettextize.1*
%{_mingw64_mandir}/man1/glib-mkenums.1*
%{_mingw64_mandir}/man1/gobject-query.1*
%{_mingw64_mandir}/man1/gtester-report.1*
%{_mingw64_mandir}/man1/gtester.1*
%{_mingw64_mandir}/man1/gdbus-codegen.1.gz

%files devel-static
%license COPYING
%{_mingw64_libdir}/libgio-2.0.a
%{_mingw64_libdir}/libglib-2.0.a
%{_mingw64_libdir}/libgmodule-2.0.a
%{_mingw64_libdir}/libgobject-2.0.a
%{_mingw64_libdir}/libgthread-2.0.a

%files lang -f glib20.lang
%defattr(-,root,root)

%define testdir %{_mingw64_libexecdir}/installed-tests/glib

%files tests-devel
%license COPYING
%{_mingw64_libexecdir}/installed-tests
%exclude %{_mingw64_libexecdir}/installed-tests/glib/*.debug
%{_mingw64_datadir}/installed-tests
%exclude %{_mingw64_datadir}/installed-tests/glib/*.debug

%changelog
openSUSE Build Service is sponsored by