aboutsummaryrefslogtreecommitdiffstats
path: root/community/hugo
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2019-08-31 22:11:39 -0300
committerLeo <thinkabit.ukim@gmail.com>2019-09-01 10:13:13 -0300
commit1ff7b506b268a0d0957f3ebedd567edbf0908842 (patch)
treea4d743955aa54572801fdf636efe1d9382dbf505 /community/hugo
parent122b741869a5e377ae8cae1a857414a923f81b2f (diff)
downloadaports-1ff7b506b268a0d0957f3ebedd567edbf0908842.tar.bz2
aports-1ff7b506b268a0d0957f3ebedd567edbf0908842.tar.xz
community/hugo: upgrade to 0.57.2
Diffstat (limited to 'community/hugo')
-rw-r--r--community/hugo/0001-Remove-git-tests.patch154
-rw-r--r--community/hugo/APKBUILD21
2 files changed, 127 insertions, 48 deletions
diff --git a/community/hugo/0001-Remove-git-tests.patch b/community/hugo/0001-Remove-git-tests.patch
index f786271179..1d1076bea9 100644
--- a/community/hugo/0001-Remove-git-tests.patch
+++ b/community/hugo/0001-Remove-git-tests.patch
@@ -1,14 +1,16 @@
+diff --git a/hugolib/page_test.go b/hugolib/page_test.go
+index 6cf03b8..8e5ae96 100644
--- a/hugolib/page_test.go
+++ b/hugolib/page_test.go
-@@ -16,7 +16,6 @@
+@@ -16,7 +16,6 @@ package hugolib
import (
"fmt"
"html/template"
- "os"
- "github.com/gohugoio/hugo/common/loggers"
+ "github.com/gohugoio/hugo/config"
-@@ -25,12 +24,9 @@
+@@ -27,11 +26,8 @@ import (
"testing"
"time"
@@ -16,25 +18,25 @@
-
"github.com/gohugoio/hugo/resources/page"
"github.com/gohugoio/hugo/resources/resource"
-
- "github.com/spf13/afero"
"github.com/spf13/viper"
- "github.com/gohugoio/hugo/deps"
-@@ -760,63 +756,6 @@
- d, _ := time.Parse(time.RFC3339, "2013-05-17T16:59:30Z")
-
+ qt "github.com/frankban/quicktest"
+@@ -772,127 +768,6 @@ func TestPageWithDate(t *testing.T) {
checkPageDate(t, p, d)
--}
--
+ }
+
-func TestPageWithLastmodFromGitInfo(t *testing.T) {
-- assrt := require.New(t)
+- c := qt.New(t)
-
- // We need to use the OS fs for this.
- cfg := viper.New()
- fs := hugofs.NewFrom(hugofs.Os, cfg)
- fs.Destination = &afero.MemMapFs{}
-
+- wd, err := os.Getwd()
+- c.Assert(err, qt.IsNil)
+-
- cfg.Set("frontmatter", map[string]interface{}{
- "lastmod": []string{":git", "lastmod"},
- })
@@ -56,41 +58,104 @@
- cfg.Set("languages", langConfig)
- cfg.Set("enableGitInfo", true)
-
-- assrt.NoError(loadDefaultSettingsFor(cfg))
-- assrt.NoError(loadLanguageSettings(cfg, nil))
--
-- wd, err := os.Getwd()
-- assrt.NoError(err)
- cfg.Set("workingDir", filepath.Join(wd, "testsite"))
-
-- h, err := NewHugoSites(deps.DepsCfg{Fs: fs, Cfg: cfg})
+- b := newTestSitesBuilderFromDepsCfg(t, deps.DepsCfg{Fs: fs, Cfg: cfg}).WithNothingAdded()
-
-- assrt.NoError(err)
-- assrt.Len(h.Sites, 2)
+- b.Build(BuildCfg{SkipRender: true})
+- h := b.H
-
-- require.NoError(t, h.Build(BuildCfg{SkipRender: true}))
+- c.Assert(len(h.Sites), qt.Equals, 2)
-
- enSite := h.Sites[0]
-- assrt.Len(enSite.RegularPages(), 1)
+- c.Assert(len(enSite.RegularPages()), qt.Equals, 1)
-
- // 2018-03-11 is the Git author date for testsite/content/first-post.md
-- assrt.Equal("2018-03-11", enSite.RegularPages()[0].Lastmod().Format("2006-01-02"))
+- c.Assert(enSite.RegularPages()[0].Lastmod().Format("2006-01-02"), qt.Equals, "2018-03-11")
-
- nnSite := h.Sites[1]
-- assrt.Len(nnSite.RegularPages(), 1)
+- c.Assert(len(nnSite.RegularPages()), qt.Equals, 1)
-
- // 2018-08-11 is the Git author date for testsite/content_nn/first-post.md
-- assrt.Equal("2018-08-11", nnSite.RegularPages()[0].Lastmod().Format("2006-01-02"))
+- c.Assert(nnSite.RegularPages()[0].Lastmod().Format("2006-01-02"), qt.Equals, "2018-08-11")
-
- }
-
- func TestPageWithFrontMatterConfig(t *testing.T) {
+-}
+-
+-func TestPageWithFrontMatterConfig(t *testing.T) {
+- for _, dateHandler := range []string{":filename", ":fileModTime"} {
+- dateHandler := dateHandler
+- t.Run(fmt.Sprintf("dateHandler=%q", dateHandler), func(t *testing.T) {
+- t.Parallel()
+- c := qt.New(t)
+- cfg, fs := newTestCfg()
+-
+- pageTemplate := `
+----
+-title: Page
+-weight: %d
+-lastMod: 2018-02-28
+-%s
+----
+-Content
+-`
+-
+- cfg.Set("frontmatter", map[string]interface{}{
+- "date": []string{dateHandler, "date"},
+- })
+-
+- c1 := filepath.Join("content", "section", "2012-02-21-noslug.md")
+- c2 := filepath.Join("content", "section", "2012-02-22-slug.md")
+-
+- writeSource(t, fs, c1, fmt.Sprintf(pageTemplate, 1, ""))
+- writeSource(t, fs, c2, fmt.Sprintf(pageTemplate, 2, "slug: aslug"))
+-
+- c1fi, err := fs.Source.Stat(c1)
+- c.Assert(err, qt.IsNil)
+- c2fi, err := fs.Source.Stat(c2)
+- c.Assert(err, qt.IsNil)
+-
+- b := newTestSitesBuilderFromDepsCfg(t, deps.DepsCfg{Fs: fs, Cfg: cfg}).WithNothingAdded()
+- b.Build(BuildCfg{SkipRender: true})
+-
+- s := b.H.Sites[0]
+- c.Assert(len(s.RegularPages()), qt.Equals, 2)
+-
+- noSlug := s.RegularPages()[0]
+- slug := s.RegularPages()[1]
+-
+- c.Assert(noSlug.Lastmod().Day(), qt.Equals, 28)
+-
+- switch strings.ToLower(dateHandler) {
+- case ":filename":
+- c.Assert(noSlug.Date().IsZero(), qt.Equals, false)
+- c.Assert(slug.Date().IsZero(), qt.Equals, false)
+- c.Assert(noSlug.Date().Year(), qt.Equals, 2012)
+- c.Assert(slug.Date().Year(), qt.Equals, 2012)
+- c.Assert(noSlug.Slug(), qt.Equals, "noslug")
+- c.Assert(slug.Slug(), qt.Equals, "aslug")
+- case ":filemodtime":
+- c.Assert(noSlug.Date().Year(), qt.Equals, c1fi.ModTime().Year())
+- c.Assert(slug.Date().Year(), qt.Equals, c2fi.ModTime().Year())
+- fallthrough
+- default:
+- c.Assert(noSlug.Slug(), qt.Equals, "")
+- c.Assert(slug.Slug(), qt.Equals, "aslug")
+-
+- }
+- })
+- }
+-
+-}
+-
+ func TestWordCountWithAllCJKRunesWithoutHasCJKLanguage(t *testing.T) {
+ t.Parallel()
+ assertFunc := func(t *testing.T, ext string, pages page.Pages) {
diff --git a/releaser/git_test.go b/releaser/git_test.go
deleted file mode 100644
-index f0d6fd24..00000000
+index 1c5f788..0000000
--- a/releaser/git_test.go
+++ /dev/null
-@@ -1,75 +0,0 @@
+@@ -1,78 +0,0 @@
-// Copyright 2017-present The Hugo Authors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
@@ -109,19 +174,20 @@ index f0d6fd24..00000000
-import (
- "testing"
-
-- "github.com/stretchr/testify/require"
+- qt "github.com/frankban/quicktest"
-)
-
-func TestGitInfos(t *testing.T) {
+- c := qt.New(t)
- skipIfCI(t)
- infos, err := getGitInfos("v0.20", "hugo", "", false)
-
-- require.NoError(t, err)
-- require.True(t, len(infos) > 0)
--
+- c.Assert(err, qt.IsNil)
+- c.Assert(len(infos) > 0, qt.Equals, true)
-}
-
-func TestIssuesRe(t *testing.T) {
+- c := qt.New(t)
-
- body := `
-This is a commit message.
@@ -134,28 +200,30 @@ index f0d6fd24..00000000
-
- issues := extractIssues(body)
-
-- require.Len(t, issues, 4)
-- require.Equal(t, 123, issues[0])
-- require.Equal(t, 543, issues[2])
+- c.Assert(len(issues), qt.Equals, 4)
+- c.Assert(issues[0], qt.Equals, 123)
+- c.Assert(issues[2], qt.Equals, 543)
-
-}
-
-func TestGitVersionTagBefore(t *testing.T) {
- skipIfCI(t)
+- c := qt.New(t)
- v1, err := gitVersionTagBefore("v0.18")
-- require.NoError(t, err)
-- require.Equal(t, "v0.17", v1)
+- c.Assert(err, qt.IsNil)
+- c.Assert(v1, qt.Equals, "v0.17")
-}
-
-func TestTagExists(t *testing.T) {
- skipIfCI(t)
+- c := qt.New(t)
- b1, err := tagExists("v0.18")
-- require.NoError(t, err)
-- require.True(t, b1)
+- c.Assert(err, qt.IsNil)
+- c.Assert(b1, qt.Equals, true)
-
- b2, err := tagExists("adfagdsfg")
-- require.NoError(t, err)
-- require.False(t, b2)
+- c.Assert(err, qt.IsNil)
+- c.Assert(b2, qt.Equals, false)
-
-}
-
@@ -166,6 +234,4 @@ index f0d6fd24..00000000
- t.Skip("Skip git test on Linux to make Travis happy.")
- }
-}
---
-2.21.0
diff --git a/community/hugo/APKBUILD b/community/hugo/APKBUILD
index 596693b388..ff23ef4724 100644
--- a/community/hugo/APKBUILD
+++ b/community/hugo/APKBUILD
@@ -1,13 +1,14 @@
# Contributor: Thomas Boerger <thomas@webhippie.de>
# Maintainer: Thomas Boerger <thomas@webhippie.de>
pkgname=hugo
-pkgver=0.55.6
-pkgrel=1
+pkgver=0.57.2
+pkgrel=0
pkgdesc="A Fast and Flexible Static Site Generator built with love in GoLang"
url="https://gohugo.io/"
arch="all !x86" # tests fails on x86
license="Apache-2.0"
makedepends="go"
+subpackages="$pkgname-doc $pkgname-bash-completion:bashcomp:noarch"
source="
$pkgname-$pkgver.tar.gz::https://github.com/gohugoio/hugo/archive/v$pkgver.tar.gz
0001-Remove-git-tests.patch
@@ -15,6 +16,8 @@ source="
build() {
go build -v -o bin/$pkgname --tags extended
+ ./bin/hugo gen man
+ ./bin/hugo gen autocomplete --completionfile="$builddir"/hugo.bash
}
check() {
@@ -23,7 +26,17 @@ check() {
package() {
install -Dm755 "$builddir"/bin/$pkgname "$pkgdir"/usr/bin/$pkgname
+ install -Dm644 "$builddir"/man/*.1 -t "$pkgdir"/usr/share/man/man1
}
-sha512sums="b45d50ae109d1f5bbc1d52f1c8d46a1638fd83bec8a2600c3cfd6d303fdcf58db1d9201844174558e8dea62132ff146fbff9995ae0350ff2f7e4106adf07b861 hugo-0.55.6.tar.gz
-66ffa51fa50209542c5ef6af2daeccb0be9fa20812f1b83c81623859fd652d047eb5d6e57b967d705d23e8760218d7c9973897d0a05d5cf2c2f33ff2bd0615d1 0001-Remove-git-tests.patch"
+bashcomp() {
+ depends=""
+ pkgdesc="Bash completions for $pkgname"
+ install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
+
+ install -Dm644 "$builddir"/hugo.bash \
+ "$subpkgdir"/usr/share/bash-completion/completions/hugo
+}
+
+sha512sums="dda8d223ff84c24ef9ac29119d9a2e80dd4f8ecd38f955acfc5fbd9622084bcd1671d9a88b4b7d7b98ba23ae5409f1730fa7e1e50dec9666755af0884a287bab hugo-0.57.2.tar.gz
+54dc7012d67b7970bceb9d4423d9c5971fd9875b5e566f1ab8ae07a11fdb009c379b55ebbbb3a0f74d530de9075ed1794acc42274ef6460381db98116acfe0a7 0001-Remove-git-tests.patch"