* [gentoo-commits] repo/proj/guru:dev commit in: sys-power/fan2go/, sys-power/fan2go/files/
@ 2024-10-08 14:30 David Roman
2024-10-08 14:36 ` [gentoo-commits] repo/proj/guru:master " David Roman
0 siblings, 1 reply; 2+ messages in thread
From: David Roman @ 2024-10-08 14:30 UTC (permalink / raw
To: gentoo-commits
commit: b25e9666b20098ea831896160eb0f80aa5f89fcb
Author: David Roman <davidroman96 <AT> gmail <DOT> com>
AuthorDate: Tue Oct 8 14:30:00 2024 +0000
Commit: David Roman <davidroman96 <AT> gmail <DOT> com>
CommitDate: Tue Oct 8 14:30:09 2024 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b25e9666
sys-power/fan2go: add 0.9.0
Signed-off-by: David Roman <davidroman96 <AT> gmail.com>
sys-power/fan2go/Manifest | 2 +
sys-power/fan2go/fan2go-0.9.0.ebuild | 55 ++++++++++++++++
.../fan2go/files/fan2go-0.9.0-fix-tests.patch | 74 ++++++++++++++++++++++
3 files changed, 131 insertions(+)
diff --git a/sys-power/fan2go/Manifest b/sys-power/fan2go/Manifest
index 0d684a03e..f6e8c46ec 100644
--- a/sys-power/fan2go/Manifest
+++ b/sys-power/fan2go/Manifest
@@ -1,2 +1,4 @@
DIST fan2go-0.8.1-vendor.tar.xz 2062496 BLAKE2B 7518b55ea01f9aeb4563ade1d24d79a5a4c64b573d53c72a1fa72e9de0ee05db82daee509e5a5e2a35d0b21916136901d5104c353d538bc8ea40a2f950c9f29e SHA512 8c1ffdeb9146de3a70ae8730180ddb7766b9d8123a4e34c740902d8f65ac82a46519f3adfa79d05a408d578e2d155aee5a1a8f8c0537a69e5d01a58bd68c2cf3
DIST fan2go-0.8.1.tar.gz 200094 BLAKE2B f649ad32466a636682a4cd02d03db2b0b9e4c3692611eede5e38ee0a93dd8c2d848467bd101cfca7b1a3765045269f8f832c574023151b65e80f0060c758f56b SHA512 eab8b0ff0f45a98c086fac8530a48ed3bb892cf80bd03fce9e4f6806ed7bbd3edd0d82e715bd9330f3083a69b1afbe236a0925cc752f2dcae643f63163317354
+DIST fan2go-0.9.0-vendor.tar.xz 2429896 BLAKE2B 02ac2b8d224ff214c807d168a6d096c52f808afae978c66e454cd2812deac4667bcf9a858103fcc6c5c712e5c90880461ca118b2d6f17f61c8a7514cb4d6898a SHA512 091025437685d2ad8dbb1f93aa4ddd097146b38e83d7b48058b7f01e8c1316e5a0e8f19fd1bc44953c911a61e897f9edd43d30261d6d50d831eec578b8ffaaf5
+DIST fan2go-0.9.0.tar.gz 196986 BLAKE2B a8f44354ad94e4535168bd27dfd71c9661ed75b1db2b92d4e563f1a21eebf2d32ed87392aec719b27705b23fecebc9e4c72297d158a629a9e1c4cebeb034e17a SHA512 86b5658e2a4e1b20ac2b3d031c3308e62c0820d1fb0da2fcc4ce8b3bf6bf96ac5e587fe290cd82bcd99315f7561ca2e82907dcf88161729a355cca2b327b181a
diff --git a/sys-power/fan2go/fan2go-0.9.0.ebuild b/sys-power/fan2go/fan2go-0.9.0.ebuild
new file mode 100644
index 000000000..cc4fa49fb
--- /dev/null
+++ b/sys-power/fan2go/fan2go-0.9.0.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module shell-completion systemd
+
+DESCRIPTION="A simple daemon providing dynamic fan speed control"
+HOMEPAGE="https://github.com/markusressel/fan2go"
+SRC_URI="https://github.com/markusressel/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
+SRC_URI+=" https://gentoo.kropotkin.rocks/go-pkgs/${P}-vendor.tar.xz"
+
+LICENSE="AGPL-3 Apache-2.0 MIT BSD BSD-2 MIT MPL-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="sys-apps/lm-sensors"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-fix-tests.patch" )
+
+src_compile() {
+ SOURCE_DATE_EPOCH=$(date +%s || die)
+ DATE=$(date -u -d @${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:%M:%SZ" || die)
+
+ ego \
+ build \
+ -o fan2go \
+ -x \
+ -v \
+ ${GOFLAGS} \
+ -ldflags "-X fan2go/cmd.version=${PV} -X fan2go/cmd.date=${DATE}" \
+ -a \
+ -tags netgo \
+ .
+
+ ./fan2go completion fish > fan2go.fish || die
+ ./fan2go completion bash > fan2go.bash || die
+ ./fan2go completion zsh > fan2go.zsh || die
+}
+
+src_install() {
+ dobin fan2go
+ dodoc README.md
+ systemd_dounit fan2go.service
+ insinto /etc/fan2go
+ doins fan2go.yaml
+ newbashcomp "${PN}.bash" "${PN}"
+ dofishcomp "${PN}.fish"
+ newzshcomp "${PN}.zsh" "_${PN}"
+}
+
+src_test() {
+ ego test -v ./... || die
+}
diff --git a/sys-power/fan2go/files/fan2go-0.9.0-fix-tests.patch b/sys-power/fan2go/files/fan2go-0.9.0-fix-tests.patch
new file mode 100644
index 000000000..b6c847480
--- /dev/null
+++ b/sys-power/fan2go/files/fan2go-0.9.0-fix-tests.patch
@@ -0,0 +1,74 @@
+diff --git a/internal/fans/cmd_test.go b/internal/fans/cmd_test.go
+index cb94f26..1a086e9 100644
+--- a/internal/fans/cmd_test.go
++++ b/internal/fans/cmd_test.go
+@@ -5,8 +5,15 @@ import (
+ "github.com/markusressel/fan2go/internal/util"
+ "github.com/stretchr/testify/assert"
+ "testing"
++ "os/exec"
+ )
+
++func getEchoPath() string {
++ // unlikely to fail
++ p, _ := exec.LookPath("echo")
++ return p
++}
++
+ func TestCmdFan_NewFan(t *testing.T) {
+ // GIVEN
+ config := configuration.FanConfig{
+@@ -132,7 +139,7 @@ func TestCmdFan_GetRpm(t *testing.T) {
+ config := configuration.FanConfig{
+ Cmd: &configuration.CmdFanConfig{
+ GetRpm: &configuration.ExecConfig{
+- Exec: "/usr/bin/echo",
++ Exec: getEchoPath(),
+ Args: []string{"1000"},
+ },
+ },
+@@ -171,7 +178,7 @@ func TestCmdFan_GetRpm_ParseError(t *testing.T) {
+ config := configuration.FanConfig{
+ Cmd: &configuration.CmdFanConfig{
+ GetRpm: &configuration.ExecConfig{
+- Exec: "/usr/bin/echo",
++ Exec: getEchoPath(),
+ Args: []string{"not_a_number"},
+ },
+ },
+@@ -226,7 +233,7 @@ func TestCmdFan_GetRpmAvg(t *testing.T) {
+ config := configuration.FanConfig{
+ Cmd: &configuration.CmdFanConfig{
+ GetRpm: &configuration.ExecConfig{
+- Exec: "/usr/bin/echo",
++ Exec: getEchoPath(),
+ Args: []string{"1000"},
+ },
+ },
+@@ -262,7 +269,7 @@ func TestCmdFan_GetPwm(t *testing.T) {
+ config := configuration.FanConfig{
+ Cmd: &configuration.CmdFanConfig{
+ GetPwm: &configuration.ExecConfig{
+- Exec: "/usr/bin/echo",
++ Exec: getEchoPath(),
+ Args: []string{"255"},
+ },
+ },
+@@ -282,7 +289,7 @@ func TestCmdFan_SetPwm(t *testing.T) {
+ config := configuration.FanConfig{
+ Cmd: &configuration.CmdFanConfig{
+ SetPwm: &configuration.ExecConfig{
+- Exec: "/usr/bin/echo",
++ Exec: getEchoPath(),
+ Args: []string{"%pwm%"},
+ },
+ },
+@@ -476,7 +483,7 @@ func TestCmdFan_Supports_RpmSensor_True(t *testing.T) {
+ config := configuration.FanConfig{
+ Cmd: &configuration.CmdFanConfig{
+ GetRpm: &configuration.ExecConfig{
+- Exec: "/usr/bin/echo",
++ Exec: getEchoPath(),
+ Args: []string{"1000"},
+ },
+ },
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/proj/guru:master commit in: sys-power/fan2go/, sys-power/fan2go/files/
2024-10-08 14:30 [gentoo-commits] repo/proj/guru:dev commit in: sys-power/fan2go/, sys-power/fan2go/files/ David Roman
@ 2024-10-08 14:36 ` David Roman
0 siblings, 0 replies; 2+ messages in thread
From: David Roman @ 2024-10-08 14:36 UTC (permalink / raw
To: gentoo-commits
commit: b25e9666b20098ea831896160eb0f80aa5f89fcb
Author: David Roman <davidroman96 <AT> gmail <DOT> com>
AuthorDate: Tue Oct 8 14:30:00 2024 +0000
Commit: David Roman <davidroman96 <AT> gmail <DOT> com>
CommitDate: Tue Oct 8 14:30:09 2024 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b25e9666
sys-power/fan2go: add 0.9.0
Signed-off-by: David Roman <davidroman96 <AT> gmail.com>
sys-power/fan2go/Manifest | 2 +
sys-power/fan2go/fan2go-0.9.0.ebuild | 55 ++++++++++++++++
.../fan2go/files/fan2go-0.9.0-fix-tests.patch | 74 ++++++++++++++++++++++
3 files changed, 131 insertions(+)
diff --git a/sys-power/fan2go/Manifest b/sys-power/fan2go/Manifest
index 0d684a03e..f6e8c46ec 100644
--- a/sys-power/fan2go/Manifest
+++ b/sys-power/fan2go/Manifest
@@ -1,2 +1,4 @@
DIST fan2go-0.8.1-vendor.tar.xz 2062496 BLAKE2B 7518b55ea01f9aeb4563ade1d24d79a5a4c64b573d53c72a1fa72e9de0ee05db82daee509e5a5e2a35d0b21916136901d5104c353d538bc8ea40a2f950c9f29e SHA512 8c1ffdeb9146de3a70ae8730180ddb7766b9d8123a4e34c740902d8f65ac82a46519f3adfa79d05a408d578e2d155aee5a1a8f8c0537a69e5d01a58bd68c2cf3
DIST fan2go-0.8.1.tar.gz 200094 BLAKE2B f649ad32466a636682a4cd02d03db2b0b9e4c3692611eede5e38ee0a93dd8c2d848467bd101cfca7b1a3765045269f8f832c574023151b65e80f0060c758f56b SHA512 eab8b0ff0f45a98c086fac8530a48ed3bb892cf80bd03fce9e4f6806ed7bbd3edd0d82e715bd9330f3083a69b1afbe236a0925cc752f2dcae643f63163317354
+DIST fan2go-0.9.0-vendor.tar.xz 2429896 BLAKE2B 02ac2b8d224ff214c807d168a6d096c52f808afae978c66e454cd2812deac4667bcf9a858103fcc6c5c712e5c90880461ca118b2d6f17f61c8a7514cb4d6898a SHA512 091025437685d2ad8dbb1f93aa4ddd097146b38e83d7b48058b7f01e8c1316e5a0e8f19fd1bc44953c911a61e897f9edd43d30261d6d50d831eec578b8ffaaf5
+DIST fan2go-0.9.0.tar.gz 196986 BLAKE2B a8f44354ad94e4535168bd27dfd71c9661ed75b1db2b92d4e563f1a21eebf2d32ed87392aec719b27705b23fecebc9e4c72297d158a629a9e1c4cebeb034e17a SHA512 86b5658e2a4e1b20ac2b3d031c3308e62c0820d1fb0da2fcc4ce8b3bf6bf96ac5e587fe290cd82bcd99315f7561ca2e82907dcf88161729a355cca2b327b181a
diff --git a/sys-power/fan2go/fan2go-0.9.0.ebuild b/sys-power/fan2go/fan2go-0.9.0.ebuild
new file mode 100644
index 000000000..cc4fa49fb
--- /dev/null
+++ b/sys-power/fan2go/fan2go-0.9.0.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module shell-completion systemd
+
+DESCRIPTION="A simple daemon providing dynamic fan speed control"
+HOMEPAGE="https://github.com/markusressel/fan2go"
+SRC_URI="https://github.com/markusressel/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
+SRC_URI+=" https://gentoo.kropotkin.rocks/go-pkgs/${P}-vendor.tar.xz"
+
+LICENSE="AGPL-3 Apache-2.0 MIT BSD BSD-2 MIT MPL-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="sys-apps/lm-sensors"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-fix-tests.patch" )
+
+src_compile() {
+ SOURCE_DATE_EPOCH=$(date +%s || die)
+ DATE=$(date -u -d @${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:%M:%SZ" || die)
+
+ ego \
+ build \
+ -o fan2go \
+ -x \
+ -v \
+ ${GOFLAGS} \
+ -ldflags "-X fan2go/cmd.version=${PV} -X fan2go/cmd.date=${DATE}" \
+ -a \
+ -tags netgo \
+ .
+
+ ./fan2go completion fish > fan2go.fish || die
+ ./fan2go completion bash > fan2go.bash || die
+ ./fan2go completion zsh > fan2go.zsh || die
+}
+
+src_install() {
+ dobin fan2go
+ dodoc README.md
+ systemd_dounit fan2go.service
+ insinto /etc/fan2go
+ doins fan2go.yaml
+ newbashcomp "${PN}.bash" "${PN}"
+ dofishcomp "${PN}.fish"
+ newzshcomp "${PN}.zsh" "_${PN}"
+}
+
+src_test() {
+ ego test -v ./... || die
+}
diff --git a/sys-power/fan2go/files/fan2go-0.9.0-fix-tests.patch b/sys-power/fan2go/files/fan2go-0.9.0-fix-tests.patch
new file mode 100644
index 000000000..b6c847480
--- /dev/null
+++ b/sys-power/fan2go/files/fan2go-0.9.0-fix-tests.patch
@@ -0,0 +1,74 @@
+diff --git a/internal/fans/cmd_test.go b/internal/fans/cmd_test.go
+index cb94f26..1a086e9 100644
+--- a/internal/fans/cmd_test.go
++++ b/internal/fans/cmd_test.go
+@@ -5,8 +5,15 @@ import (
+ "github.com/markusressel/fan2go/internal/util"
+ "github.com/stretchr/testify/assert"
+ "testing"
++ "os/exec"
+ )
+
++func getEchoPath() string {
++ // unlikely to fail
++ p, _ := exec.LookPath("echo")
++ return p
++}
++
+ func TestCmdFan_NewFan(t *testing.T) {
+ // GIVEN
+ config := configuration.FanConfig{
+@@ -132,7 +139,7 @@ func TestCmdFan_GetRpm(t *testing.T) {
+ config := configuration.FanConfig{
+ Cmd: &configuration.CmdFanConfig{
+ GetRpm: &configuration.ExecConfig{
+- Exec: "/usr/bin/echo",
++ Exec: getEchoPath(),
+ Args: []string{"1000"},
+ },
+ },
+@@ -171,7 +178,7 @@ func TestCmdFan_GetRpm_ParseError(t *testing.T) {
+ config := configuration.FanConfig{
+ Cmd: &configuration.CmdFanConfig{
+ GetRpm: &configuration.ExecConfig{
+- Exec: "/usr/bin/echo",
++ Exec: getEchoPath(),
+ Args: []string{"not_a_number"},
+ },
+ },
+@@ -226,7 +233,7 @@ func TestCmdFan_GetRpmAvg(t *testing.T) {
+ config := configuration.FanConfig{
+ Cmd: &configuration.CmdFanConfig{
+ GetRpm: &configuration.ExecConfig{
+- Exec: "/usr/bin/echo",
++ Exec: getEchoPath(),
+ Args: []string{"1000"},
+ },
+ },
+@@ -262,7 +269,7 @@ func TestCmdFan_GetPwm(t *testing.T) {
+ config := configuration.FanConfig{
+ Cmd: &configuration.CmdFanConfig{
+ GetPwm: &configuration.ExecConfig{
+- Exec: "/usr/bin/echo",
++ Exec: getEchoPath(),
+ Args: []string{"255"},
+ },
+ },
+@@ -282,7 +289,7 @@ func TestCmdFan_SetPwm(t *testing.T) {
+ config := configuration.FanConfig{
+ Cmd: &configuration.CmdFanConfig{
+ SetPwm: &configuration.ExecConfig{
+- Exec: "/usr/bin/echo",
++ Exec: getEchoPath(),
+ Args: []string{"%pwm%"},
+ },
+ },
+@@ -476,7 +483,7 @@ func TestCmdFan_Supports_RpmSensor_True(t *testing.T) {
+ config := configuration.FanConfig{
+ Cmd: &configuration.CmdFanConfig{
+ GetRpm: &configuration.ExecConfig{
+- Exec: "/usr/bin/echo",
++ Exec: getEchoPath(),
+ Args: []string{"1000"},
+ },
+ },
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-08 14:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-08 14:30 [gentoo-commits] repo/proj/guru:dev commit in: sys-power/fan2go/, sys-power/fan2go/files/ David Roman
2024-10-08 14:36 ` [gentoo-commits] repo/proj/guru:master " David Roman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox