summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorgesh2021-03-09 17:02:11 +0200
committergesh2021-10-28 00:49:31 +0300
commit7e2060b9457a79dbf81307f08bc6c4a7897e2f41 (patch)
tree28c971d9e3970d4582f67916d5bb402d3aa67fba
parentf384cf52aae9f06f7145b4d5b899031010e167f6 (diff)
downloadaur-7e2060b9457a79dbf81307f08bc6c4a7897e2f41.tar.gz
Convert to static build
* Decouple from `pandoc-bin` * NOTE: `pandoc-crossref` _only_ works with the `pandoc` version it was built for * Make into -git package
-rw-r--r--.SRCINFO18
-rw-r--r--.gitattributes1
-rw-r--r--PKGBUILD60
3 files changed, 52 insertions, 27 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 799913195ba1..332b6ac0648f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,19 @@
-pkgbase = haskell-pandoc-crossref-bin
- pkgdesc = Pandoc filter for cross-references - executable only
+pkgbase = pandoc-crossref-static-git
+ pkgdesc = Pandoc filter for cross-references (static build)
pkgver = 0.3.12.0c
pkgrel = 1
- url = https://hackage.haskell.org/package/pandoc-crossref
+ url = https://github.com/lierdakil/pandoc-crossref
arch = x86_64
license = GPL2
- depends = pandoc-bin>=2.14.2
- provides = pandoc-crossref
+ makedepends = stack
+ makedepends = pandoc
+ depends = pandoc=
+ provides = pandoc-crossref=0.3.12.0c
conflicts = pandoc-crossref
replaces = pandoc-crossref-bin
replaces = pandoc-crossref-static
replaces = pandoc-crossref-lite
- source = pandoc-crossref-0.3.12.0c.tar.xz::https://github.com/lierdakil/pandoc-crossref/releases/download/v0.3.12.0c/pandoc-crossref-Linux.tar.xz
- sha256sums = 90d058d6dffa109a31418301c8e56e41d116bd6f444e9cdacf2840434f6edb7f
+ source = pandoc-crossref-static-git::git+https://github.com/lierdakil/pandoc-crossref.git
+ sha256sums = SKIP
-pkgname = haskell-pandoc-crossref-bin
+pkgname = pandoc-crossref-static-git
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000000..a4dab8edd10c
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+.SRCINFO binary
diff --git a/PKGBUILD b/PKGBUILD
index 387483fa68c6..efe51929eaaa 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,29 +1,51 @@
-pkgname=haskell-pandoc-crossref-bin
-_pkgname=pandoc-crossref
+pkgname=pandoc-crossref-static-git
+_pkgname="${pkgname%-static-git}"
pkgver=0.3.12.0c
-_pandoc_pkgver=2.14.2
+_pandoc_ver=2.14.2
pkgrel=1
-pkgdesc="Pandoc filter for cross-references - executable only"
-url="https://hackage.haskell.org/package/${_pkgname}"
+pkgdesc="Pandoc filter for cross-references (static build)"
+url="https://github.com/lierdakil/pandoc-crossref"
license=("GPL2")
arch=('x86_64')
conflicts=("pandoc-crossref")
-provides=("pandoc-crossref")
+provides=("$_pkgname=$pkgver")
replaces=('pandoc-crossref-bin' 'pandoc-crossref-static' 'pandoc-crossref-lite')
-depends=("pandoc-bin>=${_pandoc_pkgver}")
+depends=("pandoc=$_pandoc_ver")
+makedepends=('stack' 'pandoc')
+source=("$pkgname::git+$url.git")
+sha256sums=('SKIP')
-source=(
- "pandoc-crossref-${pkgver}.tar.xz::https://github.com/lierdakil/pandoc-crossref/releases/download/v${pkgver}/pandoc-crossref-Linux.tar.xz"
-)
-sha256sums=('90d058d6dffa109a31418301c8e56e41d116bd6f444e9cdacf2840434f6edb7f')
+pkgver() {
+ cd "$pkgname"
+ git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
-package() {
- cd "${srcdir}"
+prepare() {
+ cd "$pkgname"
+ sed -i "s/pandoc-\([1-9]\+\.\)\{3\}[1-9]\+/pandoc-$_pandoc_ver/" stack.yaml
+}
+
+check() {
+ cd "$pkgname"
+
+ stack test
+}
+
+build() {
+ cd "$pkgname"
- # To avoid having to download over a gigabyte of haskell makedepends (400-ish for ghc, plus 750 in libs), we
- # just yoink the binary from static compiled binary distributed by pandoc:
- mkdir -p "${pkgdir}/usr/bin"
- cp pandoc-crossref "${pkgdir}/usr/bin/"
- mkdir -p "${pkgdir}/usr/share/man/man1/"
- cp pandoc-crossref.1 "${pkgdir}/usr/share/man/man1/"
+ stack setup
+ stack build \
+ --install-ghc \
+ --ghc-options='-fdiagnostics-color=always' \
+ --flag 'pandoc:embed_data_files' \
+ --fast
+ pandoc -s -t man docs/index.md -o pandoc-crossref.1
+}
+
+package() {
+ cd "$pkgname"
+ stack install --local-bin-path "$pkgdir/usr/bin"
+ install -Dm644 pandoc-crossref.1 \
+ "${pkgdir}"/usr/share/man/man1/pandoc-crossref.1
}