diff options
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 17 | ||||
-rw-r--r-- | fix_font_path.patch | 20 |
3 files changed, 34 insertions, 7 deletions
@@ -1,6 +1,6 @@ pkgbase = diagram pkgdesc = CLI app to convert ascii arts into hand drawn diagrams written in go. - pkgver = 20170819 + pkgver = 20170903 pkgrel = 1 url = https://github.com/esimov/diagram arch = x86_64 @@ -10,6 +10,8 @@ pkgbase = diagram makedepends = git options = !strip options = !emptydirs + source = fix_font_path.patch + sha1sums = 4fbd6599370ecd7d41ce5d6f5abc3f63ae60ffe8 pkgname = diagram @@ -1,27 +1,32 @@ # Maintainer: orumin <dev at orum.in> pkgname=diagram -pkgver=20170819 +pkgver=20170903 pkgrel=1 pkgdesc="CLI app to convert ascii arts into hand drawn diagrams written in go." arch=('x86_64' 'i686') url="https://github.com/esimov/diagram" +source=(fix_font_path.patch) +sha1sums=(4fbd6599370ecd7d41ce5d6f5abc3f63ae60ffe8) license=('MIT') makedepends=('go' 'git') options=('!strip' '!emptydirs') _gourl=github.com/esimov/diagram +_commit=40a4b96485b35e0bd70554f5d24fca84e4348d05 build() { - GOPATH="$srcdir" go get -v -x ${_gourl} -} + GOPATH="$srcdir" go get -v -x $_gourl -check() { - GOPATH="/usr/lib/go:$srcdir" go test -v -x ${_gourl} + cd "$srcdir/src/$_gourl" + git checkout "$_commit" + patch -p1 < "$srcdir"/fix_font_path.patch + GOPATH="/usr/lib/go:$srcdir" go build } package() { mkdir -p "$pkgdir/usr/bin" - install -p -m755 "$srcdir/bin/"* "$pkgdir/usr/bin" + install -p -m755 "$srcdir/src/$_gourl/diagram" "$pkgdir/usr/bin" + install -Dm644 "$srcdir/src/$_gourl/font/gloriahallelujah.ttf" "$pkgdir/usr/share/diagram/gloriahallelujah.ttf" mkdir -p "$pkgdir/usr/lib/go" cp -Rv --preserve=timestamps "$srcdir/"{src,pkg} "$pkgdir/usr/lib/go" diff --git a/fix_font_path.patch b/fix_font_path.patch new file mode 100644 index 000000000000..643591f6f2f6 --- /dev/null +++ b/fix_font_path.patch @@ -0,0 +1,20 @@ +diff --git a/canvas/generator.go b/canvas/generator.go +index c24e566..abd340a 100644 +--- a/canvas/generator.go ++++ b/canvas/generator.go +@@ -333,7 +333,7 @@ func DrawDiagram(content string, output string) error { + } + + ctx := gg.NewContext(width, height) +- canvas := NewCanvas(ctx, "./font/gloriahallelujah.ttf", 3) ++ canvas := NewCanvas(ctx, "/usr/share/diagram/gloriahallelujah.ttf", 3) + canvas.DrawRectangle(0, 0, float64(width), float64(height)) + canvas.SetRGBA(1, 1, 1, 1) + canvas.Fill() +@@ -349,4 +349,4 @@ func DrawDiagram(content string, output string) error { + return err + } + return nil +-} +\ No newline at end of file ++} |