## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 11;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

# Generated by go2rpm 1.3
%bcond_without check

# https://git.sr.ht/~eliasnaur/gio
%global goipath         gioui.org
%global forgeurl        https://github.com/gioui/gio
%global commit          18d4dbf60c4ff644fe976b9e4f1be27229848529

%gometa

%global godevelheader %{expand:
Requires:               pkgconfig(glesv2)
Requires:               pkgconfig(xkbcommon)}

%global common_description %{expand:
Immediate mode GUI programs in Go for Android, iOS, macOS, Linux, FreeBSD,
OpenBSD, Windows, and WebAssembly (experimental). See the project page gioui.org
for documentation and more information.}

%global golicenses      LICENSE
%global godocs          README.md

Name:           %{goname}
Version:        0
Release:        %autorelease
Summary:        Immediate mode GUI programs in Go

License:        Unlicense or MIT

URL:            %{gourl}
Source0:        %{gosource}

BuildRequires:  golang(golang.org/x/exp/shiny/iconvg)
BuildRequires:  golang(golang.org/x/exp/shiny/materialdesign/icons)
BuildRequires:  golang(golang.org/x/image/draw)
BuildRequires:  golang(golang.org/x/image/font)
BuildRequires:  golang(golang.org/x/image/font/gofont/gobold)
BuildRequires:  golang(golang.org/x/image/font/gofont/gobolditalic)
BuildRequires:  golang(golang.org/x/image/font/gofont/goitalic)
BuildRequires:  golang(golang.org/x/image/font/gofont/gomedium)
BuildRequires:  golang(golang.org/x/image/font/gofont/gomediumitalic)
BuildRequires:  golang(golang.org/x/image/font/gofont/gomono)
BuildRequires:  golang(golang.org/x/image/font/gofont/gomonobold)
BuildRequires:  golang(golang.org/x/image/font/gofont/gomonobolditalic)
BuildRequires:  golang(golang.org/x/image/font/gofont/gomonoitalic)
BuildRequires:  golang(golang.org/x/image/font/gofont/goregular)
BuildRequires:  golang(golang.org/x/image/font/gofont/gosmallcaps)
BuildRequires:  golang(golang.org/x/image/font/gofont/gosmallcapsitalic)
BuildRequires:  golang(golang.org/x/image/font/sfnt)
BuildRequires:  golang(golang.org/x/image/math/fixed)
BuildRequires:  golang(golang.org/x/sync/errgroup)
BuildRequires:  golang(golang.org/x/sys/unix)
BuildRequires:  golang(golang.org/x/tools/go/packages)

%if %{with check}
# Tests
BuildRequires:  pkgconfig(glesv2)
BuildRequires:  pkgconfig(egl)
BuildRequires:  pkgconfig(wayland-egl)
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pkgconfig(wayland-cursor)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xkbcommon)
BuildRequires:  pkgconfig(xkbcommon-x11)
BuildRequires:  pkgconfig(x11-xcb)
BuildRequires:  pkgconfig(xcursor)
BuildRequires:  pkgconfig(xfixes)
BuildRequires:  golang(github.com/chromedp/cdproto/runtime)
BuildRequires:  golang(github.com/chromedp/chromedp)
BuildRequires:  golang(golang.org/x/image/colornames)
%endif

%description
%{common_description}

%gopkg

%prep
%goprep

%build
%gobuild -o %{gobuilddir}/bin/gogio %{goipath}/cmd/gogio

%install
%gopkginstall
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/

%if %{with check}
%check
%gocheck -t cmd
%endif

%files
%license LICENSE
%doc README.md
%{_bindir}/*

%gopkgfiles

%changelog
* Wed Aug 10 2022 Maxwell G <gotmax@e.email> 0-11
- Rebuild to fix FTBFS

* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> 0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Tue Jul 19 2022 Maxwell G <gotmax@e.email> 0-9
- Rebuild for
  CVE-2022-{1705,32148,30631,30633,28131,30635,30632,30630,1962} in golang

* Sun Jun 19 2022 Robert-André Mauchin <zebob.m@gmail.com> 0-8
- Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327,
  CVE-2022-27191, CVE-2022-29526, CVE-2022-30629

* Sat Apr 16 2022 Fabio Alessandro Locati <me@fale.io> 0-7
- Rebuilt for CVE-2022-27191

* Tue Feb 22 2022 Robert-André Mauchin <zebob.m@gmail.com> 0-6
- Add missing BR for tests Close: rhbz#2045461

* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Tue Dec 22 07:23:37 CET 2020 Robert-André Mauchin <zebob.m@gmail.com> - 0-0.1.20201222git18d4dbf
- Initial package