summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Whited2019-01-09 12:14:08 -0600
committerSam Whited2019-01-09 12:14:47 -0600
commitcd7be0ae3aec5fad942376e49d02d36ec4553a0a (patch)
tree80d96a875d25011830ae698c4afa26a5bcec2647
parent123df88e231b055413e2b2d8c528b7afa6c27ef9 (diff)
downloadaur-cd7be0ae3aec5fad942376e49d02d36ec4553a0a.tar.gz
Build from source now that build issues are fixed
This is not a -bin package, but there were some build issues that we couldn't patch around before.
-rw-r--r--.SRCINFO9
-rw-r--r--64.patch64
-rw-r--r--PKGBUILD42
3 files changed, 103 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ac11e4b0fe9..cdaa740d150 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,11 +1,12 @@
pkgbase = writefreely
pkgdesc = Federated blogging from write.as
pkgver = 0.7.0
- pkgrel = 2
+ pkgrel = 3
url = https://writefreely.org/
install = writefreely.install
arch = x86_64
license = AGPL3
+ makedepends = go-bindata
makedepends = sqlite
optdepends = sqlite: For SQLite support,
optdepends = mariadb: For MariaDB support
@@ -13,11 +14,13 @@ pkgbase = writefreely
source = writefreely-sysusers.conf
source = writefreely.service
source = config.ini
- source = https://github.com/writeas/writefreely/releases/download/v0.7.0/writefreely_0.7.0_linux_amd64.tar.gz
+ source = 64.patch
+ source = https://github.com/writeas/writefreely/archive/v0.7.0.tar.gz
sha256sums = 6c74c81e27165851daf20d4bcf958227342f063aa3ec53b1cb86a56dac565f10
sha256sums = 142fcf18320a418b73ed0678acea58ae69287e47760d6abb5283376c21092dec
sha256sums = 6946f0211b25743451954d2c155222df2aeaf7f49c3fafcb9183c6fc62a95ef9
- sha256sums = 8d2e1eaa5db61080b328f2d6d8677bb68859346c6920db0bd4f7e8d7fc9149b7
+ sha256sums = 009c083488511d92b489337f7feb8bd17631a104907959d21b1f9b5df3ce0a70
+ sha256sums = a99d4fdc6fb3a52426f4b99fe1c18180ea35544d2267ec8ef82d868da5017fc9
pkgname = writefreely
diff --git a/64.patch b/64.patch
new file mode 100644
index 00000000000..b66787104d6
--- /dev/null
+++ b/64.patch
@@ -0,0 +1,64 @@
+From f9335a8fe9378b8013a27875085a5e19f0c0670a Mon Sep 17 00:00:00 2001
+From: Sam Whited <sam@samwhited.com>
+Date: Wed, 9 Jan 2019 12:00:10 -0600
+Subject: [PATCH] respect external $LDFLAGS on build
+
+---
+ Makefile | 28 ++++++++++++++++++++--------
+ 1 file changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5950dfd..b05a747 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,10 +1,22 @@
+-GITREV=`git describe --tags | cut -c 2-`
+-LDFLAGS=-ldflags="-X 'github.com/writeas/writefreely.softwareVer=$(GITREV)'"
++# make(1) from NetBSD (bmake on many Linux's) uses $(.CURDIR), but GNU Make uses
++# $(CURDIR). Normalize on $(.CURDIR) by setting it to $(CURDIR) if not set, and
++# then $(PWD) if still not set.
++.CURDIR ?= $(CURDIR)
++.CURDIR ?= $(PWD)
++
++# For reproducible builds, don't store the current build directory by default;
++# instead store only the path from the root of the repo (so there is still
++# enough info in debug messages to find the correct file).
++GCFLAGS = -gcflags="all=-trimpath=$(.CURDIR)"
++ASMFLAGS = -asmflags="all=-trimpath=$(.CURDIR)"
++
++GITREV!=git describe --tags | cut -c 2-
++GOLDFLAGS=-ldflags="-X 'github.com/writeas/writefreely.softwareVer=$(GITREV)' -extldflags '$(LDFLAGS)'"
+
+ GOCMD=go
+-GOINSTALL=$(GOCMD) install $(LDFLAGS)
+-GOBUILD=$(GOCMD) build $(LDFLAGS)
+-GOTEST=$(GOCMD) test $(LDFLAGS)
++GOINSTALL=$(GOCMD) install $(GOLDFLAGS) $(GCFLAGS) $(ASMFLAGS)
++GOBUILD=$(GOCMD) build $(GOLDFLAGS) $(GCFLAGS) $(ASMFLAGS)
++GOTEST=$(GOCMD) test $(GOLDFLAGS) $(GCFLAGS) $(ASMFLAGS)
+ GOGET=$(GOCMD) get
+ BINARY_NAME=writefreely
+ DOCKERCMD=docker
+@@ -19,19 +31,19 @@ build-linux: deps
+ @hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+ $(GOGET) -u github.com/karalabe/xgo; \
+ fi
+- xgo --targets=linux/amd64, -dest build/ $(LDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
++ xgo --targets=linux/amd64, -dest build/ $(GOLDFLAGS) $(GCFLAGS) $(ASMFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
+
+ build-windows: deps
+ @hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+ $(GOGET) -u github.com/karalabe/xgo; \
+ fi
+- xgo --targets=windows/amd64, -dest build/ $(LDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
++ xgo --targets=windows/amd64, -dest build/ $(GOLDFLAGS) $(GCFLAGS) $(ASMFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
+
+ build-darwin: deps
+ @hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+ $(GOGET) -u github.com/karalabe/xgo; \
+ fi
+- xgo --targets=darwin/amd64, -dest build/ $(LDFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
++ xgo --targets=darwin/amd64, -dest build/ $(GOLDFLAGS) $(GCFLAGS) $(ASMFLAGS) -tags='sqlite' -out writefreely ./cmd/writefreely
+
+ build-docker :
+ $(DOCKERCMD) build -t $(IMAGE_NAME):latest -t $(IMAGE_NAME):$(GITREV) .
diff --git a/PKGBUILD b/PKGBUILD
index 17c03345e5f..87c9382c070 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,12 +2,13 @@
pkgname=writefreely
pkgver=0.7.0
-pkgrel=2
+pkgrel=3
pkgdesc='Federated blogging from write.as'
arch=('x86_64')
url='https://writefreely.org/'
license=('AGPL3')
-makedepends=('sqlite')
+makedepends=('go-bindata'
+ 'sqlite')
optdepends=('sqlite: For SQLite support',
'mariadb: For MariaDB support')
backup=('var/lib/writefreely/config.ini')
@@ -15,29 +16,52 @@ install=writefreely.install
source=('writefreely-sysusers.conf'
'writefreely.service'
'config.ini'
- "https://github.com/writeas/writefreely/releases/download/v${pkgver}/writefreely_${pkgver}_linux_amd64.tar.gz")
+ '64.patch'
+ "https://github.com/writeas/writefreely/archive/v${pkgver}.tar.gz")
sha256sums=('6c74c81e27165851daf20d4bcf958227342f063aa3ec53b1cb86a56dac565f10'
'142fcf18320a418b73ed0678acea58ae69287e47760d6abb5283376c21092dec'
'6946f0211b25743451954d2c155222df2aeaf7f49c3fafcb9183c6fc62a95ef9'
- '8d2e1eaa5db61080b328f2d6d8677bb68859346c6920db0bd4f7e8d7fc9149b7')
+ '009c083488511d92b489337f7feb8bd17631a104907959d21b1f9b5df3ce0a70'
+ 'a99d4fdc6fb3a52426f4b99fe1c18180ea35544d2267ec8ef82d868da5017fc9')
+
+prepare() {
+ export GO111MODULE=on
+ cd "${srcdir}/${pkgname}-${pkgver}/"
+
+ # See: https://github.com/writeas/writefreely/pull/64
+ patch -p1 <../64.patch
+
+ rm -rf go.mod
+ go mod init github.com/writeas/writefreely
+
+ # Temporary manual override:
+ # Go picks v2 by default, which writefreely doesn't seem to support yet.
+ go get -u github.com/ikeikeikeike/go-sitemap-generator@v1.0.1
+ go mod tidy
+}
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}/"
+ GO111MODULE=on make build
+}
package() {
- # -o writefreely -g writefreely
install -dm750 "${pkgdir}"/var/lib/writefreely/data
install -dm750 "${pkgdir}"/var/lib/writefreely/keys
install -dm750 "${pkgdir}"/var/lib/writefreely/pages
install -dm750 "${pkgdir}"/var/lib/writefreely/static
install -dm750 "${pkgdir}"/var/lib/writefreely/templates
install -Dm644 writefreely.service -t "${pkgdir}"/usr/lib/systemd/system/
- install -Dm755 writefreely "${pkgdir}"/usr/bin/writefreely
+ install -Dm755 "${pkgname}-${pkgver}"/cmd/writefreely/writefreely "${pkgdir}"/usr/bin/writefreely
install -Dm644 writefreely-sysusers.conf "${pkgdir}"/usr/lib/sysusers.d/writefreely.conf
# These files should probably be in /usr/share and /etc but writefreely
# expects everything in the same directory.
+ # See: https://github.com/writeas/writefreely/issues/63
install -Dm644 config.ini "${pkgdir}"/var/lib/writefreely/config.ini
- cp -r pages/* "${pkgdir}"/var/lib/writefreely/pages
- cp -r static/* "${pkgdir}"/var/lib/writefreely/static
- cp -r templates/* "${pkgdir}"/var/lib/writefreely/templates
+ cp -r "${pkgname}-${pkgver}"/pages/* "${pkgdir}"/var/lib/writefreely/pages
+ cp -r "${pkgname}-${pkgver}"/static/* "${pkgdir}"/var/lib/writefreely/static
+ cp -r "${pkgname}-${pkgver}"/templates/* "${pkgdir}"/var/lib/writefreely/templates
}
# vim: ts=2 sw=2 et: