net-analyzer/librespeed-cli - 1.0.13 (jacksonchen666)

Search

Install

Install this version:

emerge -a =net-analyzer/librespeed-cli-1.0.13

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =net-analyzer/librespeed-cli-1.0.13

Or alternatively:

emerge --autounmask-write -a =net-analyzer/librespeed-cli-1.0.13

Package Information

Description:
Command line interface for LibreSpeed speed test backends
Homepage:
https://github.com/librespeed/speedtest-cli
License:
LGPL-3 Apache-2.0 MIT BSD BSD-2

Ebuild Details

Version EAPI Keywords Slot
1.0.13 8 ~amd64 ~arm64 0
View Raw Ebuild
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="Command line interface for LibreSpeed speed test backends"
HOMEPAGE="https://github.com/librespeed/speedtest-cli"

SRC_URI="
	https://github.com/librespeed/speedtest-cli/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	https://files.jacksonchen666.com/gentoo/librespeed-cli-${PV}-vendor.tar.xz
"

# TODO: LGPL-3 or later?
LICENSE="LGPL-3"
# deps license checked as of 7573b65ebc89a4cf463334dbdfab5b3edc706149
LICENSE+=" Apache-2.0 MIT BSD BSD-2"
SLOT="0"
KEYWORDS="~amd64 ~arm64"

#DEPEND=""
RDEPEND="${DEPEND}"
# go version from go.mod
BDEPEND=">=dev-lang/go-1.18"
RESTRICT="mirror"

src_unpack() {
	# unpacks everything, including SRC_URI tarballs
	go-module_src_unpack
	# upstream uses "speedtest-cli", this ebuild uses librespeed-cli to
	# disambiguate from speedtest.net
	#
	# vendor tarball also uses the librespeed-cli in the folder name, so
	# that has to match i guess
	mv "${S}/vendor" "speedtest-cli-${PV}" || die
	rmdir "${P}" || die # remove dir to make sure it renames rather than moves lol
	mv "speedtest-cli-${PV}" "${P}" || die
}

src_compile() {
	DEFS_PATH="github.com/librespeed/speedtest-cli"
	ego build -ldflags "-w -s -X \"${DEFS_PATH}/defs.ProgName=${PN}\" \
		-X \"${DEFS_PATH}/defs.ProgVersion=${PV}\"
		-X \"${DEFS_PATH}/defs.BuildDate=$(date -u "+%Y-%m-%d %H:%M:%S %Z")\"" \
		-o librespeed-cli -trimpath main.go
}

src_install() {
	default

	dobin librespeed-cli
}

Inherited Eclasses

Dependencies

BDEPEND

>=dev-lang/go-1.18

Manifest for 1.0.13

Type File Size Source URLs
DIST librespeed-cli-1.0.13-vendor.tar.xz 692472 bytes https://files.jacksonchen666.com/gentoo/librespeed-cli-1.0.13-vendor.tar.xz
DIST librespeed-cli-1.0.13.tar.gz 27069 bytes https://github.com/librespeed/speedtest-cli/archive/refs/tags/v1.0.13.tar.gz