diff --git a/.gitignore b/.gitignore index 13b11da..efe8f6e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/glow-*.tar.gz +/glow-*-vendored.tar.gz diff --git a/0001-test-skip-networked-tests-if-no-connection-661.patch b/0001-test-skip-networked-tests-if-no-connection-661.patch new file mode 100644 index 0000000..f4f0a8e --- /dev/null +++ b/0001-test-skip-networked-tests-if-no-connection-661.patch @@ -0,0 +1,59 @@ +From 0f0295723213d1da702602450ef75dc8a26dab60 Mon Sep 17 00:00:00 2001 +From: bashbunni <15822994+bashbunni@users.noreply.github.com> +Date: Wed, 18 Dec 2024 11:10:03 -0800 +Subject: [PATCH] test: skip networked tests if no connection (#661) + +* test: skip networked tests if no connection + +* fix: handle unexpected http responses + +* fix: return if a valid URL is generated + +* test: delete networked test + +(cherry picked from commit 7b3bfac3068c5501adc83c2c1a3914c84b0cb136) +--- + glow_test.go | 24 ------------------------ + 1 file changed, 24 deletions(-) + +diff --git a/glow_test.go b/glow_test.go +index 1a8ad18..8743be2 100644 +--- a/glow_test.go ++++ b/glow_test.go +@@ -1,33 +1,9 @@ + package main + + import ( +- "bytes" + "testing" + ) + +-func TestGlowSources(t *testing.T) { +- tt := []string{ +- ".", +- "README.md", +- "github.com/charmbracelet/glow", +- "github://charmbracelet/glow", +- "https://github.com/charmbracelet/glow", +- } +- +- for _, v := range tt { +- t.Run(v, func(t *testing.T) { +- buf := &bytes.Buffer{} +- err := executeArg(rootCmd, v, buf) +- if err != nil { +- t.Errorf("Error during execution (args: %s): %v", v, err) +- } +- if buf.Len() == 0 { +- t.Errorf("Output buffer should not be empty (args: %s)", v) +- } +- }) +- } +-} +- + func TestGlowFlags(t *testing.T) { + tt := []struct { + args []string +-- +2.47.1 + diff --git a/README.md b/README.md new file mode 100644 index 0000000..0be7659 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# glow + +The glow package diff --git a/create-vendor-tarball.sh b/create-vendor-tarball.sh index d930bf4..593d7ce 100755 --- a/create-vendor-tarball.sh +++ b/create-vendor-tarball.sh @@ -9,9 +9,6 @@ fi set -euo pipefail -PKG="glow" -REPO="https://github.com/charmbracelet/$PKG" - # transform tag into version # v2.0.0 -> 2.0.0 version=${tag#v} @@ -19,8 +16,9 @@ version=${tag#v} echo "Using tag: $tag" echo "Using version: $version" -git -c advice.detachedHead=false clone --branch $tag --depth 1 $REPO.git $PKG-$version -pushd $PKG-$version +git -c advice.detachedHead=false clone --branch $tag --depth 1 https://github.com/charmbracelet/glow.git glow-$version +pushd glow-$version GOPROXY='https://proxy.golang.org,direct' go mod vendor popd -tar -C $PKG-$version -czf $PKG-$version-vendor.tar.gz vendor +tar --exclude .git -czf glow-$version-vendored.tar.gz glow-$version +#rm -r glow-$version diff --git a/glow.spec b/glow.spec index f0443df..78c271d 100644 --- a/glow.spec +++ b/glow.spec @@ -1,155 +1,153 @@ -%define goipath github.com/charmbracelet/glow/v2 +%global goipath github.com/charmbracelet/glow Name: glow -Version: 2.1.1 +Version: 2.0.0 Release: %autorelease Summary: Terminal based markdown reader -URL: https://github.com/charmbracelet/glow - # main source code is MIT -# Apache-2.0: -# github.com/inconshreveable/mousetrap -# github.com/spf13/afero -# github.com/spf13/cobra -# BSD-3-Clause: -# github.com/atotto/clipboard -# github.com/fsnotify/fsnotify -# github.com/gorilla/css -# github.com/microcosm-cc/bluemonday -# github.com/spf13/pflag -# golang.org/x/exp -# golang.org/x/net -# golang.org/x/sync -# golang.org/x/sys -# golang.org/x/term -# golang.org/x/text -# MIT: -# github.com/aymanbagabas/go-osc52/v2 -# github.com/aymerick/douceur -# github.com/caarlos0/env/v11 -# github.com/charmbracelet/bubbles -# github.com/charmbracelet/bubbletea -# github.com/charmbracelet/colorprofile -# github.com/charmbracelet/glamour -# github.com/charmbracelet/lipgloss -# github.com/charmbracelet/log -# github.com/charmbracelet/x/ansi -# github.com/charmbracelet/x/cellbuf -# github.com/charmbracelet/x/editor -# github.com/charmbracelet/x/exp/slice -# github.com/charmbracelet/x/term -# github.com/dlclark/regexp2 -# github.com/dustin/go-humanize -# github.com/erikgeiser/coninput -# github.com/go-logfmt/logfmt -# github.com/go-viper/mapstructure/v2 -# github.com/lucasb-eyer/go-colorful -# github.com/mattn/go-isatty -# github.com/mattn/go-localereader -# github.com/mattn/go-runewidth -# github.com/mitchellh/go-homedir -# github.com/muesli/ansi -# github.com/muesli/cancelreader -# github.com/muesli/gitcha -# github.com/muesli/go-app-paths -# github.com/muesli/mango -# github.com/muesli/mango-cobra -# github.com/muesli/mango-pflag -# github.com/muesli/reflow -# github.com/muesli/roff -# github.com/muesli/termenv -# github.com/pelletier/go-toml/v2 -# github.com/rivo/uniseg -# github.com/sabhiram/go-gitignore -# github.com/sagikazarmark/locafero -# github.com/sahilm/fuzzy -# github.com/sourcegraph/conc -# github.com/spf13/cast -# github.com/spf13/viper -# github.com/subosito/gotenv -# github.com/xo/terminfo -# github.com/yuin/goldmark -# github.com/yuin/goldmark-emoji -# go.uber.org/atomic -# go.uber.org/multierr -# Apache-2.0 AND MIT -# gopkg.in/yaml.v3 -# MIT AND OFL-1.1: -# github.com/alecthomas/chroma/v2 -License: Apache-2.0 AND BSD-3-Clause AND MIT AND OFL-1.1 - -Source0: %{url}/archive/v%{version}/glow-%{version}.tar.gz -Source1: glow-%{version}-vendor.tar.gz -Source2: create-vendor-tarball.sh +# see comments above provides tags for bundled license breakdown +License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT AND MPL-2.0 AND OFL-1.1 +URL: https://github.com/charmbracelet/glow BuildRequires: go-rpm-macros ExclusiveArch: %{golang_arches_future} -# https://github.com/charmbracelet/glow/commit/546b6287d80af885cc3069de895083af36aa91e3 -BuildRequires: golang >= 1.23.6 +# see create-vendor-tarball.sh for how to create this +Source0: glow-%{version}-vendored.tar.gz + +# Script that creates vendor tarball +Source100: create-vendor-tarball.sh + +# https://github.com/charmbracelet/glow/pull/661 +Patch: 0001-test-skip-networked-tests-if-no-connection-661.patch + +BuildRequires: golang + +# MIT AND OFL-1.1 Provides: bundled(golang(github.com/alecthomas/chroma/v2)) = 2.14.0 +# BSD-3-Clause Provides: bundled(golang(github.com/atotto/clipboard)) = 0.1.4 +# MIT Provides: bundled(golang(github.com/aymanbagabas/go-osc52/v2)) = 2.0.1 +# MIT Provides: bundled(golang(github.com/aymerick/douceur)) = 0.2.0 -Provides: bundled(golang(github.com/caarlos0/env/v11)) = 11.3.1 -Provides: bundled(golang(github.com/charmbracelet/bubbles)) = 0.21.0 -Provides: bundled(golang(github.com/charmbracelet/bubbletea)) = 1.3.5 -Provides: bundled(golang(github.com/charmbracelet/colorprofile)) = f60798e -Provides: bundled(golang(github.com/charmbracelet/glamour)) = 0.10.0 -Provides: bundled(golang(github.com/charmbracelet/lipgloss)) = 76690c6 -Provides: bundled(golang(github.com/charmbracelet/log)) = 0.4.2 -Provides: bundled(golang(github.com/charmbracelet/x/ansi)) = 0.8.0 -Provides: bundled(golang(github.com/charmbracelet/x/cellbuf)) = 0.0.13 -Provides: bundled(golang(github.com/charmbracelet/x/editor)) = 0.1.0 -Provides: bundled(golang(github.com/charmbracelet/x/exp/slice)) = 2fdc977 -Provides: bundled(golang(github.com/charmbracelet/x/term)) = 0.2.1 +# MIT +Provides: bundled(golang(github.com/caarlos0/env/v11)) = 11.0.1 +# MIT +Provides: bundled(golang(github.com/charmbracelet/bubbles)) = 0.18.0 +# MIT +Provides: bundled(golang(github.com/charmbracelet/bubbletea)) = ea13ffb +# MIT +Provides: bundled(golang(github.com/charmbracelet/glamour)) = 0.8.0 +# MIT +Provides: bundled(golang(github.com/charmbracelet/lipgloss)) = 87dd58d +# MIT +Provides: bundled(golang(github.com/charmbracelet/log)) = 0.4.0 +# MIT +Provides: bundled(golang(github.com/charmbracelet/x/ansi)) = 0.1.4 +# MIT +Provides: bundled(golang(github.com/charmbracelet/x/editor)) = 2627ec1 +# MIT +Provides: bundled(golang(github.com/charmbracelet/x/input)) = 0.1.2 +# MIT +Provides: bundled(golang(github.com/charmbracelet/x/term)) = 0.1.1 +# MIT +Provides: bundled(golang(github.com/charmbracelet/x/windows)) = 0.1.2 +# MIT Provides: bundled(golang(github.com/dlclark/regexp2)) = 1.11.0 +# MIT Provides: bundled(golang(github.com/dustin/go-humanize)) = 1.0.1 +# MIT Provides: bundled(golang(github.com/erikgeiser/coninput)) = 1c3628e -Provides: bundled(golang(github.com/fsnotify/fsnotify)) = 1.9.0 +# BSD-3-Clause +Provides: bundled(golang(github.com/fsnotify/fsnotify)) = 1.6.0 +# MIT Provides: bundled(golang(github.com/go-logfmt/logfmt)) = 0.6.0 -Provides: bundled(golang(github.com/go-viper/mapstructure/v2)) = 2.2.1 +# BSD-3-Clause Provides: bundled(golang(github.com/gorilla/css)) = 1.0.1 +# MPL-2.0 +Provides: bundled(golang(github.com/hashicorp/hcl)) = 1.0.0 +# Apache-2.0 Provides: bundled(golang(github.com/inconshreveable/mousetrap)) = 1.1.0 +# MIT Provides: bundled(golang(github.com/lucasb-eyer/go-colorful)) = 1.2.0 +# BSD-2-Clause +Provides: bundled(golang(github.com/magiconair/properties)) = 1.8.7 +# MIT Provides: bundled(golang(github.com/mattn/go-isatty)) = 0.0.20 +# MIT Provides: bundled(golang(github.com/mattn/go-localereader)) = 0.0.1 -Provides: bundled(golang(github.com/mattn/go-runewidth)) = 0.0.16 +# MIT +Provides: bundled(golang(github.com/mattn/go-runewidth)) = 0.0.15 +# BSD-3-Clause Provides: bundled(golang(github.com/microcosm-cc/bluemonday)) = 1.0.27 +# MIT Provides: bundled(golang(github.com/mitchellh/go-homedir)) = 1.1.0 +# MIT +Provides: bundled(golang(github.com/mitchellh/mapstructure)) = 1.5.0 +# MIT Provides: bundled(golang(github.com/muesli/ansi)) = 276c624 +# MIT Provides: bundled(golang(github.com/muesli/cancelreader)) = 0.2.2 +# MIT Provides: bundled(golang(github.com/muesli/gitcha)) = 0.3.0 +# MIT Provides: bundled(golang(github.com/muesli/go-app-paths)) = 0.2.2 +# MIT Provides: bundled(golang(github.com/muesli/mango)) = 0.1.0 +# MIT Provides: bundled(golang(github.com/muesli/mango-cobra)) = 1.2.0 +# MIT Provides: bundled(golang(github.com/muesli/mango-pflag)) = 0.1.0 +# MIT Provides: bundled(golang(github.com/muesli/reflow)) = 0.3.0 +# MIT Provides: bundled(golang(github.com/muesli/roff)) = 0.1.0 -Provides: bundled(golang(github.com/muesli/termenv)) = 0.16.0 -Provides: bundled(golang(github.com/pelletier/go-toml/v2)) = 2.2.3 +# MIT +Provides: bundled(golang(github.com/muesli/termenv)) = 98d742f +# MIT +Provides: bundled(golang(github.com/pelletier/go-toml/v2)) = 2.0.6 +# MIT Provides: bundled(golang(github.com/rivo/uniseg)) = 0.4.7 +# MIT Provides: bundled(golang(github.com/sabhiram/go-gitignore)) = d310757 -Provides: bundled(golang(github.com/sagikazarmark/locafero)) = 0.7.0 +# MIT Provides: bundled(golang(github.com/sahilm/fuzzy)) = 0.1.1 -Provides: bundled(golang(github.com/sourcegraph/conc)) = 0.3.0 -Provides: bundled(golang(github.com/spf13/afero)) = 1.12.0 -Provides: bundled(golang(github.com/spf13/cast)) = 1.7.1 -Provides: bundled(golang(github.com/spf13/cobra)) = 1.9.1 -Provides: bundled(golang(github.com/spf13/pflag)) = 1.0.6 -Provides: bundled(golang(github.com/spf13/viper)) = 1.20.1 -Provides: bundled(golang(github.com/subosito/gotenv)) = 1.6.0 +# Apache-2.0 +Provides: bundled(golang(github.com/spf13/afero)) = 1.9.3 +# MIT +Provides: bundled(golang(github.com/spf13/cast)) = 1.5.0 +# Apache-2.0 +Provides: bundled(golang(github.com/spf13/cobra)) = 1.7.0 +# MIT +Provides: bundled(golang(github.com/spf13/jwalterweatherman)) = 1.1.0 +# BSD-3-Clause +Provides: bundled(golang(github.com/spf13/pflag)) = 1.0.5 +# MIT +Provides: bundled(golang(github.com/spf13/viper)) = 1.15.0 +# MIT +Provides: bundled(golang(github.com/subosito/gotenv)) = 1.4.2 +# MIT Provides: bundled(golang(github.com/xo/terminfo)) = abceb7e -Provides: bundled(golang(github.com/yuin/goldmark)) = 1.7.8 -Provides: bundled(golang(github.com/yuin/goldmark-emoji)) = 1.0.5 -Provides: bundled(golang(go.uber.org/atomic)) = 1.9.0 -Provides: bundled(golang(go.uber.org/multierr)) = 1.9.0 +# MIT +Provides: bundled(golang(github.com/yuin/goldmark)) = 1.7.4 +# MIT +Provides: bundled(golang(github.com/yuin/goldmark-emoji)) = 1.0.3 +# BSD-3-Clause Provides: bundled(golang(golang.org/x/exp)) = fc45aab -Provides: bundled(golang(golang.org/x/net)) = 0.40.0 -Provides: bundled(golang(golang.org/x/sync)) = 0.14.0 -Provides: bundled(golang(golang.org/x/sys)) = 0.33.0 -Provides: bundled(golang(golang.org/x/term)) = 0.32.0 -Provides: bundled(golang(golang.org/x/text)) = 0.25.0 +# BSD-3-Clause +Provides: bundled(golang(golang.org/x/net)) = 0.27.0 +# BSD-3-Clause +Provides: bundled(golang(golang.org/x/sync)) = 0.7.0 +# BSD-3-Clause +Provides: bundled(golang(golang.org/x/sys)) = 0.22.0 +# BSD-3-Clause +Provides: bundled(golang(golang.org/x/term)) = 0.22.0 +# BSD-3-Clause +Provides: bundled(golang(golang.org/x/text)) = 0.16.0 +# Apache-2.0 +Provides: bundled(golang(gopkg.in/ini.v1)) = 1.67.0 +# Apache-2.0 AND MIT Provides: bundled(golang(gopkg.in/yaml.v3)) = 3.0.1 @@ -161,15 +159,16 @@ files in subdirectories or a local Git repository. %prep -%autosetup -p 1 -a 1 +%autosetup -p 1 mkdir -p src/$(dirname %{goipath}) ln -s $PWD src/%{goipath} # set the program version -sed -e '/Version = / s/""/"v%{version}"/' -i main.go +sed -e '/Version = / s/""/"%{version}"/' -i main.go %build +export GO111MODULE=off export GOPATH=$PWD %gobuild -o bin/glow %{goipath} @@ -193,7 +192,7 @@ install -d -m 0755 %{buildroot}%{fish_completions_dir} %check # ensure that the version was embedded correctly -[[ "$(./bin/glow --version)" == "glow version v%{version}" ]] || exit 1 +[[ "$(./bin/glow --version)" == "glow version %{version}" ]] || exit 1 # run the upstream tests export GOPATH=$PWD diff --git a/sources b/sources index 0a44534..b96891f 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -SHA512 (glow-2.1.1.tar.gz) = 6a01ff0f9c29de28f55a467fc2041afbe6bd25b06053da9fc62fa73e800c05a452b695e242e8605ef686f72a3f048ef6e2cd7206530e356a6cad669ac4c57a10 -SHA512 (glow-2.1.1-vendor.tar.gz) = c9c03aeedfcf19162954c07c7e6aed1d2b5ef886ea74db57c398ddb53139c1c10c706f507d6429e89533a5144580446c8baef0e350e24b5dce5ce22cb383ebd5 +SHA512 (glow-2.0.0-vendored.tar.gz) = 0ffaab8c67f69983ea2ce958cc7c6f052f88e50bac26b3239c7ecfb94f935bee4327b61d6ffb01ed0fc233faa8c2ea3dc76a1ec00c93baec0bf0719b13b00c77