diff options
author | fossdd <fossdd@pwned.life> | 2024-04-19 11:37:12 +0000 |
---|---|---|
committer | Patrycja Rosa <alpine@ptrcnull.me> | 2024-04-19 14:10:57 +0000 |
commit | 17b96123329dabf834c6fe5c02c4925036785539 (patch) | |
tree | aad582e194c38899d484b88714a12160a2646727 | |
parent | e44f223f7f2ec509ba80e48b1318183a3d054a0c (diff) |
-rw-r--r-- | community/hugo/APKBUILD | 6 | ||||
-rw-r--r-- | community/hugo/Fix-TestColorLuminance-on-s390x.patch | 63 |
2 files changed, 67 insertions, 2 deletions
diff --git a/community/hugo/APKBUILD b/community/hugo/APKBUILD index e1744427806..01755468300 100644 --- a/community/hugo/APKBUILD +++ b/community/hugo/APKBUILD @@ -2,7 +2,7 @@ # Contributor: Michał Polański <michal@polanski.me> # Maintainer: Thomas Boerger <thomas@webhippie.de> pkgname=hugo -pkgver=0.124.1 +pkgver=0.125.1 pkgrel=0 pkgdesc="Fast and flexible static site generator written in Go" url="https://gohugo.io/" @@ -17,6 +17,7 @@ subpackages=" $pkgname-zsh-completion " source="https://github.com/gohugoio/hugo/archive/v$pkgver/hugo-$pkgver.tar.gz + Fix-TestColorLuminance-on-s390x.patch skip-para-test.patch " @@ -49,6 +50,7 @@ package() { } sha512sums=" -29f51a08f9e757a716c2f7845efc08b1ca3b0bf8e70fd06491735a123ca7da8e169116fa003c147be08d2d5f9752473e9a569085728ec0a9ed7850bd57ba8f93 hugo-0.124.1.tar.gz +9aaa4d1bfb1fcd9238a3774b749494af035974fdee52f8959ece08cd4e7ae1e37c351af593ab0b6d2a7407823656373e15a08e8e0f196c32ec69fe8d32e7978d hugo-0.125.1.tar.gz +dbb6ae8e691c634d8c3ab42c4bd8cf0e57ea114f9a6d6e1d2d479f78df38c9f1c01f98878f9e72710d64108141d0146a7cf6eb915a34bad2f8040cda9cba9e46 Fix-TestColorLuminance-on-s390x.patch 6ba192d8cb67f115f7ce596c297a55fc64713a4cdb0077cfbb7e45051c7560f5b668da88f513d4f34d8e0eeb4a9d991c5312d62e454c85e95960d8a33f0f8f69 skip-para-test.patch " diff --git a/community/hugo/Fix-TestColorLuminance-on-s390x.patch b/community/hugo/Fix-TestColorLuminance-on-s390x.patch new file mode 100644 index 00000000000..bb5f91ef87e --- /dev/null +++ b/community/hugo/Fix-TestColorLuminance-on-s390x.patch @@ -0,0 +1,63 @@ +Can be removed in newer versions (0.125.1+), because it is in the master +branch. +--- +From faf9fedc3d39cf226a26cbd41e0152359c46968a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= + <bjorn.erik.pedersen@gmail.com> +Date: Fri, 19 Apr 2024 11:21:50 +0200 +Subject: [PATCH] resources/images: Fix TestColorLuminance on s390x + +--- + htesting/hqt/checkers.go | 6 ++++++ + resources/images/color_test.go | 9 +++++---- + 2 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/htesting/hqt/checkers.go b/htesting/hqt/checkers.go +index 7655d6a6337..bf2cb942820 100644 +--- a/htesting/hqt/checkers.go ++++ b/htesting/hqt/checkers.go +@@ -16,6 +16,7 @@ package hqt + import ( + "errors" + "fmt" ++ "math" + "reflect" + "strings" + +@@ -38,6 +39,11 @@ var IsSameType qt.Checker = &typeChecker{ + argNames: []string{"got", "want"}, + } + ++// IsSameFloat64 asserts that two float64 values are equal within a small delta. ++var IsSameFloat64 = qt.CmpEquals(cmp.Comparer(func(a, b float64) bool { ++ return math.Abs(a-b) < 0.0001 ++})) ++ + type argNames []string + + func (a argNames) ArgNames() []string { +diff --git a/resources/images/color_test.go b/resources/images/color_test.go +index cbbc76cf92f..3a75c068e45 100644 +--- a/resources/images/color_test.go ++++ b/resources/images/color_test.go +@@ -18,6 +18,7 @@ import ( + "testing" + + qt "github.com/frankban/quicktest" ++ "github.com/gohugoio/hugo/htesting/hqt" + ) + + func TestHexStringToColor(t *testing.T) { +@@ -119,8 +120,8 @@ func TestReplaceColorInPalette(t *testing.T) { + + func TestColorLuminance(t *testing.T) { + c := qt.New(t) +- c.Assert(hexStringToColor("#000000").Luminance(), qt.Equals, 0.0) +- c.Assert(hexStringToColor("#768a9a").Luminance(), qt.Equals, 0.24361603589088263) +- c.Assert(hexStringToColor("#d5bc9f").Luminance(), qt.Equals, 0.5261577672685374) +- c.Assert(hexStringToColor("#ffffff").Luminance(), qt.Equals, 1.0) ++ c.Assert(hexStringToColor("#000000").Luminance(), hqt.IsSameFloat64, 0.0) ++ c.Assert(hexStringToColor("#768a9a").Luminance(), hqt.IsSameFloat64, 0.24361603589088263) ++ c.Assert(hexStringToColor("#d5bc9f").Luminance(), hqt.IsSameFloat64, 0.5261577672685374) ++ c.Assert(hexStringToColor("#ffffff").Luminance(), hqt.IsSameFloat64, 1.0) + } |