aboutsummaryrefslogtreecommitdiffstats
path: root/community/hledger-stockquotes/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/hledger-stockquotes/APKBUILD')
-rw-r--r--community/hledger-stockquotes/APKBUILD45
1 files changed, 36 insertions, 9 deletions
diff --git a/community/hledger-stockquotes/APKBUILD b/community/hledger-stockquotes/APKBUILD
index 9b09accc447..31cb120f22b 100644
--- a/community/hledger-stockquotes/APKBUILD
+++ b/community/hledger-stockquotes/APKBUILD
@@ -1,21 +1,48 @@
# Contributor: Dhruvin Gandhi <contact@dhruvin.dev>
# Maintainer: Dhruvin Gandhi <contact@dhruvin.dev>
pkgname=hledger-stockquotes
-pkgver=0.1.2.1
-pkgrel=0
+pkgver=0.1.2.2
+pkgrel=2
pkgdesc="hledger addon that pulls historical stock prices for commodities"
-url="https://github.com/prikhi/hledger-stockquotes#readme"
+url="https://github.com/prikhi/hledger-stockquotes"
arch="x86_64" # limited by GHC
license="BSD-3-Clause"
-makedepends="ghc cabal libffi-dev zlib-dev"
-source="https://hackage.haskell.org/package/hledger-stockquotes-$pkgver/hledger-stockquotes-$pkgver.tar.gz
- cabal.project.freeze"
+makedepends="ghc cabal libffi-dev ncurses-dev zlib-dev"
+source="$pkgname-$pkgver.tar.gz::https://github.com/prikhi/hledger-stockquotes/archive/refs/tags/$pkgver.tar.gz
+ cabal.config
+ "
+options="!check" # fail to build for some reason
export CABAL_DIR="$srcdir"/cabal
+cabal_update() {
+ msg "Freezing $pkgname dependencies"
+
+ # Resolve deps and generate fresh cabal.config with version constraints.
+ (
+ cd "$builddir"
+ cabal update
+ cabal v1-freeze --strong-flags --shadow-installed-packages
+
+ # Add version tag at the first line.
+ sed -i "1i--$pkgver" "cabal.config"
+
+ mv "cabal.config" "$startdir/"
+ )
+
+ if ! abuild checksum; then
+ die "Failed to update checksum, run 'abuild checksum' manually"
+ fi
+}
+
prepare() {
default_prepare
- cp "$srcdir"/cabal.project.freeze .
+
+ if [ "$(head -n 1 "$srcdir/cabal.config")" != "--$pkgver" ]; then
+ die "Requirements file is outdated, run 'abuild cabal_update'"
+ fi
+
+ ln -sf "$srcdir/cabal.config" "$builddir/cabal.project.freeze"
}
build() {
@@ -35,6 +62,6 @@ package() {
}
sha512sums="
-7e1015e137765dce96ac289bef0d0bcc3344342285d33b1b3653ede9b9773582b5427e5d7ca6d2bacda8e3223e442d13ba304404a86f6358fd1660218a84c744 hledger-stockquotes-0.1.2.1.tar.gz
-68a108247dad9ff53469a561855aee486e2d41567c9ec25299260652a41b60ac369a67b167ba3177ef639af811028dd04e17617115ef3286fa9e39d7707b4868 cabal.project.freeze
+0b637efc9d99f1b283b53cd45331603a8badd30d91692a854786e91c536ddf2d336973f7c2b8f1d8e439dc730893d91fbd1c2a040bed448a59f1006bfee79653 hledger-stockquotes-0.1.2.2.tar.gz
+1f22cf36724aebc303d9f11c068d4778332364c5d55ab835b4ed757619ce9a4648601d0a85261172327a30fb923c3cd3492b52778998f70694cc889847539ddf cabal.config
"