File deepin-gir-generator.spec of Package deepin-gir-generator
#
# spec file for package deepin-gir-generator
#
# Copyright (c) 2019 SUSE LINUX Products 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 _name go-gir
%define import_path github.com/linuxdeepin/go-gir
Name: deepin-gir-generator
Version: 3.0.5
Release: 0
Summary: Go-gir-generator imeplement static golang bindings for GObject
License: MIT
Group: Development/Languages/Golang
Url: https://github.com/linuxdeepin/go-gir
Source0: https://github.com/linuxdeepin/go-gir/archive/v%{version}/%{_name}-%{version}.tar.gz
Source99: %{name}-rpmlintrc
AutoReqProv: Off
BuildRequires: golang-packaging
BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(gudev-1.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(gdk-2.0)
BuildRequires: pkgconfig(gdk-3.0)
BuildRequires: pkgconfig(gudev-1.0)
BuildRequires: fdupes
Provides: %{_name}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Go-gir-generator imeplement static golang bindings for GObject.
There has many go bindings for GObject/Gtk libraries, but almost all of them
are written by hand. It's bored and error-prone when the binding C libaray
changed.
Go-gir-geneator's object is like python-gobject's that binding the newest
library without need change binding codes.
Currently it only official support Gobject-2.0, Glib-2.0, Gio-2.0. Because
generate the gdkpixbuf binding hasn't completed, so Gdk/Gtk were also in blocking.
%package -n golang-github-linuxdeepin-go-gir-generator
Summary: Additional mobile libraries
Group: Development/Languages/Golang
AutoReqProv: On
BuildRequires: golang-packaging
BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(gudev-1.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(gdk-2.0)
BuildRequires: pkgconfig(gdk-3.0)
BuildRequires: pkgconfig(gudev-1.0)
Requires: pkgconfig(gobject-introspection-1.0)
Requires: pkgconfig(gudev-1.0)
Requires: pkgconfig(glib-2.0)
Requires: pkgconfig(gobject-2.0)
Requires: pkgconfig(gio-2.0)
Requires: pkgconfig(gdk-2.0)
Requires: pkgconfig(gdk-3.0)
Requires: pkgconfig(gudev-1.0)
Provides: golang(github.com/linuxdeepin/go-gir/glib-2.0)
Provides: golang(github.com/linuxdeepin/go-gir/gio-2.0)
Provides: golang(github.com/linuxdeepin/go-gir/gobject-2.0)
Provides: golang(github.com/linuxdeepin/go-gir/gudev-1.0)
BuildArch: noarch
%{go_exclusivearch}
%description -n golang-github-linuxdeepin-go-gir-generator
Go-gir-generator imeplement static golang bindings for GObject.
There has many go bindings for GObject/Gtk libraries, but almost all of them
are written by hand. It's bored and error-prone when the binding C libaray
changed.
Go-gir-geneator's object is like python-gobject's that binding the newest
library without need change binding codes.
Currently it only official support Gobject-2.0, Glib-2.0, Gio-2.0. Because
generate the gdkpixbuf binding hasn't completed, so Gdk/Gtk were also in blocking.
%prep
%autosetup -p1 -n %{_name}-%{version}
%build
export GO111MODULE=off
export CGO_ENABLED=1
%goprep %{import_path}
%gobuild ...
%install
%goinstall
%gosrc
install -m 0644 gio-2.0/gio.gen.c %{buildroot}%{go_contribsrcdir}/%{import_path}/gio-2.0
install -m 0644 glib-2.0/glib.gen.c %{buildroot}%{go_contribsrcdir}/%{import_path}/glib-2.0
install -m 0644 gobject-2.0/fix_gobject.c %{buildroot}%{go_contribsrcdir}/%{import_path}/gobject-2.0
install -m 0644 gobject-2.0/gobject.gen.c %{buildroot}%{go_contribsrcdir}/%{import_path}/gobject-2.0
install -m 0644 gudev-1.0/gudev.gen.c %{buildroot}%{go_contribsrcdir}/%{import_path}/gudev-1.0
%gofilelist
mv %{buildroot}%{_bindir}/generator %{buildroot}%{_bindir}/gir-generator
mv %{buildroot}%{_bindir}/test %{buildroot}%{_bindir}/gir-test
%fdupes %{buildroot}
%files
%defattr(-,root,root,-)
%doc README.md documentation/WhyWaf.txt documentation/Design.txt
%license LICENSE
%{_bindir}/gir-generator
%{_bindir}/gir-test
%files -n golang-github-linuxdeepin-go-gir-generator
%defattr(-,root,root,-)
%{go_contribsrcdir}/*
%changelog