Package Details: hledger-git 20191113-2

Git Clone URL: https://aur.archlinux.org/hledger-git.git (read-only, click to copy)
Package Base: hledger-git
Description: The hledger command-line and web-based accounting tool
Upstream URL: http://hledger.org
Licenses: GPL3
Conflicts: hledger, hledger-ui, hledger-web
Provides: hledger, hledger-ui, hledger-web
Submitter: atweiden
Maintainer: harrisonthorne
Last Packager: harrisonthorne
Votes: 10
Popularity: 0.000000
First Submitted: 2015-11-17 19:39 (UTC)
Last Updated: 2020-03-05 23:11 (UTC)

Dependencies (3)

Required by (3)

Sources (1)

Latest Comments

1 2 3 Next › Last »

gesh commented on 2025-01-08 15:32 (UTC)

BTW, namcap does not like people using msg2 -- it is meant to be internal to makepkg, so using it to log progress might confuse people between makepkg output and PKGBUILD output

gesh commented on 2025-01-05 15:29 (UTC) (edited on 2025-01-05 15:29 (UTC) by gesh)

Packaging comments:

  • Given that upstream has their own versioning scheme, why are you substituting your own? The version should be a massaged version of git describe --tags --long (with the caveat that upstream has forgotten to push the tag for 1.41.99, but that should be fixed soon1.
  • The PKGBUILD format gives you separate build() and package() functions, use them (stack --build in one, stack install in the other)
  • Upstream provides tests, use them. This is especially important in a VCS package, where you're dependent on upstream's discipline not to break master.
  • Most haskell packages depend on gmp, so unless you know it's not needed..?
  • License is GPL-3.0-or-later, see the manual
  • There's an optdepend on asciinema, cf hledger-bin
  • Why options=(strip)?
  • pkgdesc unnecessarily repeats $pkgname, and misses hledger's core value proposition. Perhaps "Plain text accounting software (cli and web)"?
  • Why forcibly clean up $pkgdir? makepkg -c does that itself

A patch fixing these:

commit cdf1f617f5c298ecadb1aa5f4654138316b2e791
Author: gesh <gesh@gesh.uni.cx>
Date:   Sun Jan 5 17:15:25 2025 +0200

    Suggested packaging improvements

    - Use upstream versioning
    - Split into build/package()
    - Add tests
    - Add dep: gmp (provisional, but likely)
    - License is GPL3+, not GPL3
    - Add optdep: asciinema (cf hledger-bin)
    - Remove unnecessary options=(strip)
    - Remove $pkgname from $pkgdesc
    - Don't duplicate makepkg -c -- remove $pkgdir cleanup

diff --git a/PKGBUILD b/PKGBUILD
index 47915a1..1dcef13 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,35 +3,47 @@
 # Contributor: Xander van der Goot <xandervandergoot@gmail.com>

 pkgname=hledger-git
-pkgver=20191113
-pkgrel=2
-pkgdesc="The hledger command-line and web-based accounting tool"
+_pkgname="${pkgname%-git}"
+pkgver=1.41.99.r50.g4c4650234
+pkgrel=1
+pkgdesc='Plain text accounting software (cli and web)'
 arch=('i686' 'x86_64')
-depends=('ncurses')
+depends=('gmp' 'ncurses')
 makedepends=('git' 'stack')
+optdepends=('asciinema: hledger demo support')
 url="http://hledger.org"
-license=('GPL3')
-options=('strip')
+license=('GPL-3.0-or-later')
 source=(git+https://github.com/simonmichael/hledger)
 sha256sums=('SKIP')
 provides=('hledger' 'hledger-ui' 'hledger-web')
 conflicts=('hledger' 'hledger-ui' 'hledger-web')

 pkgver() {
-  cd ${pkgname%-git}
-  git log -1 --format="%cd" --date=short | sed "s|-||g"
+  cd "$_pkgname"
+  git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+  cd "$_pkgname"
+  git tag --force "$(cat .version)" "$(git rev-list -1 @ -- .version)"
+}
+
+build() {
+  cd "$_pkgname"
+  stack build --verbose
+}
+
+check() {
+  cd "$_pkgname"
+  stack test
 }

 package() {
-  cd ${pkgname%-git}
+  cd "$_pkgname"

   msg2 'Installing license...'
-  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/hledger"
+  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$_pkgname"

   msg2 'Installing...'
-  mkdir -p "$pkgdir/usr/bin"
   stack --local-bin-path "$pkgdir/usr/bin" install
-
-  msg2 'Cleaning up pkgdir...'
-  find "$pkgdir" -type f -name .gitignore -exec rm -r '{}' +
 }

gesh commented on 2025-01-05 14:52 (UTC)

@msnspk that is possibly due to GHC defaulting to ld.gold when LD is unset, try adding export LD=ld.bfd to build(). See https://gitlab.haskell.org/ghc/ghc/-/issues/24565 for details.

msnspk commented on 2024-07-19 04:33 (UTC)

Package fails to build with this error:

2024-07-18 23:28:22.175544: [error] configure: error: Failed to determine machine word size. Does your toolchain actually work?
2024-07-18 23:28:22.187821: [error] Received ExitFailure 1 when running
Raw command: /home/ullr/.stack/programs/x86_64-linux/ghc-tinfo6-9.8.2.temp/ghc-9.8.2-x86_64-unknown-linux/configure --prefix=/home/ullr/.stack/programs/x86_64-linux/ghc-tinfo6-9.8.2/
Run from: /home/ullr/.stack/programs/x86_64-linux/ghc-tinfo6-9.8.2.temp/ghc-9.8.2-x86_64-unknown-linux/

2024-07-18 23:28:22.187902: [error]
Error: Error encountered while configuring GHC with
         /home/ullr/.stack/programs/x86_64-linux/ghc-tinfo6-9.8.2.temp/ghc-9.8.2-x86_64-unknown-linux/configure --prefix=/home/ullr/.stack/programs/x86_64-linux/ghc-tinfo6-9.8.2/
         run in /home/ullr/.stack/programs/x86_64-linux/ghc-tinfo6-9.8.2.temp/ghc-9.8.2-x86_64-unknown-linux/

       The following directories may now contain files, but won't be used by stack:
         - /home/ullr/.stack/programs/x86_64-linux/ghc-tinfo6-9.8.2.temp/
         - /home/ullr/.stack/programs/x86_64-linux/ghc-tinfo6-9.8.2/

       For more information consider rerunning with --verbose flag

Configuring GHC ...
==> ERROR: A failure occurred in package().
    Aborting...

entidi commented on 2020-03-26 08:44 (UTC)

@harrisonthorne Sorry for the late reply: I did not see your answer.

The package did not update automatically: I had to manually force the installation to trigger the building, probably because in the last commit you also changed pkgver to an older version.

Other than that, the package now builds just fine (at least on my system).

harrisonthorne commented on 2020-03-05 22:29 (UTC)

@entidi Just pushed a fix bumping pkgrel to 2. Give it a shot and let me know if it still doesn't work. :)

entidi commented on 2020-03-03 07:26 (UTC)

@harrisonthorne For some reason this package it is still depending on haskell-stack (you can see that on the AUR page) and my AUR helper tool (yay) is unable to install it. Manually using makepkg instead seems to work as expected ("seems" because I'm still building it).

Can you bump pkgrel to 2 to see if this solves the issue?

harrisonthorne commented on 2019-11-18 06:34 (UTC) (edited on 2019-11-18 06:57 (UTC) by harrisonthorne)

The 'haskell-stack' dependency needs to be changed to 'stack' I believe. The build doesn't work with the currently missing 'haskell-stack' dep.

Edit: I've adopted this package and have fixed the dependency issue. I'm new to this whole process, so please feel free to point out any mistakes I make :)

nurfz commented on 2019-01-27 10:26 (UTC)

Would the package maintainer for this package add some lines to install the bash completion script for the next release of hledger?

The source code of hledger has the file shell-completion/hledger-completion.bash

It's in https://github.com/simonmichael/hledger/tree/master/shell-completion

Can this be installed into /etc/bash_completion.d or /usr/local/etc/bash_completion.d (I'm not sure how this is normally done)?

Thank you!

fbn commented on 2017-10-06 00:03 (UTC) (edited on 2017-10-06 00:53 (UTC) by fbn)

The haskell-stack dependency package has been removed, so it's impossible to build this package. I couldn't compile hledger using stack from the arch repo. But stack-static(AUR) and libtinfo(AUR, to fix -ltinfo issues) works!