Blame delve.spec

22020a0
# Run tests in check section
22020a0
%bcond_without check
22020a0
22020a0
# https://github.com/go-delve/delve
22020a0
%global goipath         github.com/go-delve/delve
359f9e6
Version:                1.21.0
22020a0
22020a0
%global common_description %{expand:
22020a0
Delve is a debugger for the Go programming language. The goal of the project 
22020a0
is to provide a simple, full featured debugging tool for Go. Delve should be 
22020a0
easy to invoke and easy to use. Chances are if you're using a debugger, things 
22020a0
aren't going your way. With that in mind, Delve should stay out of your way as 
22020a0
much as possible.}
22020a0
0d79aa4
# Currently Delve only supports x86_64 and aarch64
0d79aa4
%global golang_arches x86_64 aarch64
0d79aa4
22020a0
%gometa
22020a0
22020a0
Name:           delve
0d79aa4
Release:        %autorelease
22020a0
Summary:        A debugger for the Go programming language
22020a0
# Detected licences
22020a0
# - Expat License at 'LICENSE'
adee8e6
# It is a SPDX license already
22020a0
License:        MIT
22020a0
URL:            %{gourl}
22020a0
Source0:        %{gosource}
22020a0
9ad48fa
# RHEL builds with vendored dependencies
9ad48fa
%if %{undefined rhel}
0d79aa4
# This dependencies are only in use in x86_64
0d79aa4
%ifarch x86_64
0d79aa4
BuildRequires:  golang(github.com/cilium/ebpf)
0d79aa4
BuildRequires:  golang(github.com/cilium/ebpf/link)
0d79aa4
BuildRequires:  golang(github.com/cilium/ebpf/ringbuf)
0d79aa4
%endif
0d79aa4
BuildRequires:  golang(github.com/cosiner/argv)
0d79aa4
BuildRequires:  golang(github.com/creack/pty)
0d79aa4
BuildRequires:  golang(github.com/derekparker/trie)
0d79aa4
BuildRequires:  golang(github.com/go-delve/liner)
0d79aa4
BuildRequires:  golang(github.com/google/go-dap)
0d79aa4
BuildRequires:  golang(github.com/hashicorp/golang-lru/simplelru)
0d79aa4
BuildRequires:  golang(github.com/mattn/go-isatty)
0d79aa4
BuildRequires:  golang(github.com/sirupsen/logrus)
0d79aa4
BuildRequires:  golang(github.com/spf13/cobra)
0d79aa4
BuildRequires:  golang(github.com/spf13/cobra/doc)
0d79aa4
BuildRequires:  golang(golang.org/x/arch/arm64/arm64asm)
0d79aa4
BuildRequires:  golang(golang.org/x/arch/ppc64/ppc64asm)
0d79aa4
BuildRequires:  golang(golang.org/x/arch/x86/x86asm)
0d79aa4
BuildRequires:  golang(golang.org/x/sys/unix)
0d79aa4
BuildRequires:  golang(golang.org/x/tools/go/packages)
0d79aa4
BuildRequires:  golang(gopkg.in/yaml.v2)
0d79aa4
BuildRequires:  golang(go.starlark.net/resolve)
0d79aa4
BuildRequires:  golang(go.starlark.net/starlark)
0d79aa4
BuildRequires:  golang(go.starlark.net/syntax)
9ad48fa
%endif
0d79aa4
BuildRequires:  lsof
0d79aa4
BuildRequires:  git
0d79aa4
359f9e6
Patch1: 0001-Skip-TestCgoStacktrace2.patch
359f9e6
22020a0
%description
22020a0
%{common_description}
22020a0
22020a0
%prep
0d79aa4
echo "=== Start prep ==="
9ad48fa
%if %{defined rhel}
9ad48fa
%goprep -k
9ad48fa
# unpack vendored dependencies to GOPATH
9ad48fa
tar c -C vendor/ . | tar x -C %{gobuilddir}/src
359f9e6
%autopatch -v -p1
9ad48fa
%else
0d79aa4
%goprep
359f9e6
%autopatch -v -p1
22020a0
0d79aa4
%generate_buildrequires
0d79aa4
%go_generate_buildrequires
9ad48fa
%endif
22020a0
22020a0
%build
0d79aa4
echo "=== Start build ==="
0d79aa4
%gobuild -o %{gobuilddir}/bin/dlv %{goipath}/cmd/dlv
0d79aa4
echo "=== End build ==="
22020a0
22020a0
%install
0d79aa4
%gopkginstall
0d79aa4
install -m 0755 -vd %{buildroot}%{_bindir}
0d79aa4
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
22020a0
22020a0
%if %{with check}
22020a0
%check
22020a0
export GO111MODULE=off
9ad48fa
export GOPATH=%{buildroot}/%{gopath}:%{gobuilddir}:%{gopath}
22020a0
delvepath=%{buildroot}/%{gopath}/src/%{goipath}
22020a0
cp -r _fixtures $delvepath
22020a0
cp -r pkg/dwarf/line/_testdata $delvepath/pkg/dwarf/line
0d79aa4
cp -r pkg/proc/internal/ebpf $delvepath/pkg/proc/internal/
0d79aa4
22020a0
pushd $delvepath
0d79aa4
echo "=== Start tests ==="
0d79aa4
%gotest $(go list ./... | awk '!/(cmd|scripts)/ {print $1}')
0d79aa4
echo "=== End tests ==="
0d79aa4
rm -rf $delvepath
22020a0
popd
22020a0
%endif
22020a0
22020a0
%files
9ad48fa
%license LICENSE %{?rhel:vendor/modules.txt}
22020a0
%doc CONTRIBUTING.md CHANGELOG.md
22020a0
%doc Documentation/*
22020a0
%{_bindir}/dlv
22020a0
22020a0
%changelog
0d79aa4
%autochangelog