File lua-lgi.spec of Package lua-lgi
#
# spec file for package lua-lgi
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2012 Adam Mizerski <adam@mizerski.pl>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define flavor @BUILD_FLAVOR@
%define mod_name lgi
Version: 0.9.2
Release: 0
Summary: Lua bindings to GObject libraries
License: MIT
Group: Development/Languages/Other
URL: https://github.com/pavouk/lgi
Source0: https://github.com/pavouk/%{mod_name}/archive/%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz
Patch0: lua54.patch
# PATCH-FIX-UPSTREAM 001-Fix-GLib-2.86-regression.patch boo#1250526
Patch1: 001-Fix-GLib-2.86-regression.patch
# PATCH-FIX-UPSTREAM warnings-away.patch bsc#[0-9]+ mcepl@suse.com
# remove warnings from deprecated calls
Patch2: warnings-away.patch
# PATCH-FIX-UPSTREAM pango-1_56_2.patch gh#lgi-devs/lgi!342 mcepl@suse.com
# update to use pango 1.56.2
Patch3: pango-1_56_2.patch
# PATCH-FIX-UPSTREAM network_metered-property.patch gh#lgi-devs/lgi!215 mcepl@suse.com
# support for network_metered property
Patch4: network_metered-property.patch
BuildRequires: lua-macros
BuildRequires: %{flavor}-devel
BuildRequires: pkgconfig
BuildRequires: pkgconfig(gmodule-2.0)
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 0.10.8
BuildRequires: pkgconfig(libffi)
BuildRequires: pkgconfig(pango)
BuildRequires: pkgconfig(gtk4)
BuildRequires: pkgconfig(cairo)
Requires: %{flavor}
%lua_provides
%if "%{flavor}" == ""
Name: lua-%{mod_name}
ExclusiveArch: do_not_build
%else
Name: %{flavor}-%{mod_name}
%endif
%description
Dynamic Lua binding to any library which is introspectable
using gobject-introspection. Allows using GObject-based libraries
directly from Lua.
%package doc
Summary: Lua bindings to GObject libraries - documentation and samples
Group: Documentation/Other
BuildArch: noarch
%description doc
Dynamic Lua binding to any library which is introspectable
using gobject-introspection. Allows using GObject-based libraries
directly from Lua.
%prep
%autosetup -n %{mod_name}-%{version} -p1
find . -name \*.lua -exec sed -i -e 's,# *\! *%{_bindir}/.*lua,#!%{_bindir}/lua,' '{}' +;
%build
make %{?_smp_mflags} V=1 \
LUA_CFLAGS=" -I%{lua_incdir}" \
COPTFLAGS="%{optflags}" \
%install
%make_install \
PREFIX=%{_prefix} \
LUA_LIBDIR=%{lua_archdir} \
LUA_SHAREDIR=%{lua_noarchdir}
%check
make check || true
%files
%if 0%{?suse_version} >= 1500
%license LICENSE
%else
%doc LICENSE
%endif
%doc README.md
%{lua_archdir}/%{mod_name}/
%{lua_noarchdir}/%{mod_name}.lua
%{lua_noarchdir}/%{mod_name}/
%files doc
%doc docs samples tools
%changelog