From 02d007b4621cd3c354a06567ee60c9f210816384 Mon Sep 17 00:00:00 2001 From: Pavel Solovev Date: Jul 30 2023 07:54:36 +0000 Subject: add conditions to build for epel --- diff --git a/.gitignore b/.gitignore index c21dffc..f396b3a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ /kitty-0.29.1.tar.xz.sig /kitty-0.29.2.tar.xz /kitty-0.29.2.tar.xz.sig +/kitty-0.29.2-vendor.tar.gz diff --git a/kitty.spec b/kitty.spec index 68dc866..5e04cdb 100644 --- a/kitty.spec +++ b/kitty.spec @@ -2,6 +2,13 @@ %bcond_without test %bcond_without doc +%bcond_with bundled +%if 0%{?epel} +%bcond_without bundled +%endif +%if %{with bundled} +%global gomodulesmode GO111MODULE=on +%endif Name: kitty Version: 0.29.2 @@ -13,12 +20,39 @@ Summary: Cross-platform, fast, feature full, GPU based terminal emulator # LGPL-2.1-or-later: kitty/iqsort.h # BSD-1-Clause: kitty/uthash.h # MIT: docs/_static/custom.css, shell-integration/ssh/bootstrap-utils.sh -License: GPL-3.0-only AND LGPL-2.1-or-later AND Zlib AND BSD-1-Clause AND MIT +# Go dependencies: +# github.com/alecthomas/chroma: MIT +# github.com/ALTree/bigfloat: MIT +# github.com/bmatcuk/doublestar: MIT +# github.com/disintegration/imaging: MIT +# github.com/dlclark/regexp2: MIT +# github.com/google/go-cmp/cmp: BSD-3-Clause +# github.com/google/uuid: BSD-3-Clause +# github.com/go-ole/go-ole: MIT +# github.com/jamesruan/go-rfc1924/base85: MIT +# github.com/lufia/plan9stats: BSD-3-Clause +# github.com/power-devops/perfstat: MIT +# github.com/seancfoley/bintree: Apache-2.0 +# github.com/seancfoley/ipaddress-go/ipaddr: Apache-2.0 +# github.com/shirou/gopsutil: BSD-3-Clause +# github.com/shoenig/go-m1cpu: MPL-2.0 +# github.com/tklauser/go-sysconf: BSD-3-Clause +# github.com/tklauser/numcpus: Apache-2.0 +# golang.org/x/exp: BSD-3-Clause +# golang.org/x/image: BSD-3-Clause +# golang.org/x/sys: BSD-3-Clause +# howett.net/plist: BSD-2-Clause AND BSD-3-Clause +License: GPL-3.0-only AND LGPL-2.1-or-later AND Zlib AND BSD-1-Clause AND MIT AND BSD-3-Clause AND Apache-2.0 AND MPL-2.0 AND (BSD-2-Clause AND BSD-3-Clause) URL: https://sw.kovidgoyal.net/kitty Source0: https://github.com/kovidgoyal/kitty/releases/download/v%{version}/%{name}-%{version}.tar.xz Source4: https://github.com/kovidgoyal/kitty/releases/download/v%{version}/%{name}-%{version}.tar.xz.sig Source5: https://calibre-ebook.com/signatures/kovid.gpg - +# git clone https://github.com/kovidgoyal/kitty.git +# cd kitty +# git checkout v%%{version} +# go mod vendor +# tar czf kitty-%%{version}-vendor.tar.gz vendor +Source6: kitty-%{version}-vendor.tar.gz # Add AppData manifest file # * https://github.com/kovidgoyal/kitty/pull/2088 Source1: https://raw.githubusercontent.com/kovidgoyal/kitty/46c0951751444e4f4994008f0d2dcb41e49389f4/kitty/data/%{name}.appdata.xml @@ -58,6 +92,7 @@ BuildRequires: pkgconfig(xrandr) BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(libcrypto) +%if %{without bundled} BuildRequires: golang(github.com/alecthomas/chroma/v2) BuildRequires: golang(github.com/alecthomas/chroma/v2/lexers) BuildRequires: golang(github.com/alecthomas/chroma/v2/styles) @@ -78,6 +113,7 @@ BuildRequires: golang(golang.org/x/image/tiff) BuildRequires: golang(golang.org/x/image/webp) BuildRequires: golang(golang.org/x/sys/unix) BuildRequires: golang(howett.net/plist) +%endif %if %{with test} # For tests: @@ -153,6 +189,7 @@ Cross-platform, fast, feature full, GPU based terminal emulator. The terminfo file for Kitty Terminal. +# shell-integration package %package shell-integration Summary: Shell integration scripts for %{name} BuildArch: noarch @@ -181,6 +218,9 @@ This package contains the documentation for %{name}. %prep %{gpgverify} --keyring='%{SOURCE5}' --signature='%{SOURCE4}' --data='%{SOURCE0}' %autosetup -p1 +%if %{with bundled} +%autosetup -NDT -a6 +%endif # Changing sphinx theme to classic sed "s/html_theme = 'furo'/html_theme = 'classic'/" -i docs/conf.py @@ -204,7 +244,9 @@ ln -s ../../kittens src/kitty/kittens --verbose \ %{nil} +%if %{without bundled} export GOPATH=$(pwd):%{gopath} +%endif unset LDFLAGS mkdir -p _build/bin %gobuild -o _build/bin/kitten ./src/kitty/tools/cmd @@ -229,9 +271,15 @@ rm %{buildroot}%{_datadir}/doc/%{name}/html/.buildinfo \ %check %if %{with test} sed '/def test_ssh_shell_integration/a \ -\ self.skipTest("Skipping flaky test")' -i kitty_tests/ssh.py +\ self.skipTest("Skipping a flaky test")' -i kitty_tests/ssh.py +%if 0%{?epel} +sed '/def test_ssh_leading_data/a \ +\ self.skipTest("Skipping a failing test")' -i kitty_tests/ssh.py +%endif export %{gomodulesmode} +%if %{without bundled} export GOPATH=$(pwd):%{gopath} +%endif # Some tests ignores PATH env... mkdir -p kitty/launcher ln -s %{buildroot}%{_bindir}/%{name} kitty/launcher/ @@ -246,6 +294,10 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop %files +%if %{with bundled} +# Go bundled provides generator +%license vendor/modules.txt +%endif %license LICENSE %{_bindir}/%{name} %{_bindir}/kitten diff --git a/sources b/sources index 8e5ad0a..b068531 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ SHA512 (kitty-0.29.2.tar.xz) = a34d8b5bc817dd9d27f1afa190856d916576f52458ede2253655b294358b6b89b1f103acb90d8d66a494b346420ddedc9fcf1a3399f561268ded82e7b1954b06 SHA512 (kitty-0.29.2.tar.xz.sig) = ffcc63904a09148ddbf2eb761686942d1de3ce2c8c7c93b8a1c59ef704e0886bce972dd162e88de65912682233b21398970685cebbda785f7c4215f02ddbf9fd +SHA512 (kitty-0.29.2-vendor.tar.gz) = 6d7094d30b8ad0cc0c97cce4859bdf1adf47c389706dad24cdd8420beac2cbcc82e15bfbe2a9f48b7cd6431c2135ee026206fce1be3c250958bfd964d4f4f307