File wails.spec of Package wails

#
# spec file for package wails
#
# Copyright (c) 2026 SUSE LLC
#
# 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/
#


Name:           wails
Version:        2.12.0
Release:        0
Summary:        Create desktop apps using Go and Web Technologies
License:        MIT
Group:          Productivity/Publishing/Other
URL:            https://github.com/wailsapp/wails
Source0:        %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        vendor.tar.xz
BuildRequires:  golang(API)
BuildRequires:  golang-packaging
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(webkit2gtk-4.0)
%{go_nostrip}

%description
The traditional method of providing web interfaces to Go programs is via a
built-in web server. Wails offers a different approach: it provides the
ability to wrap both Go code and a web frontend into a single binary. Tools
are provided to make this easy for you by handling project creation,
compilation and bundling. All you have to do is get creative!

%prep
%autosetup -p1
tar xf %{SOURCE1} -C v2/

%build
pushd v2
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
go build  -mod=vendor -buildmode=pie -v -o build/ ./cmd/wails
popd

%install
install -Dm 0755 v2/build/%{name} -t %{buildroot}%{_bindir}

%files
%doc {CHANGELOG,CONTRIBUT*,README*}.md
%{_bindir}/%{name}
%license LICENSE

%changelog
openSUSE Build Service is sponsored by