New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
explore snap for gnu/linux packaging #595
Comments
I dropped this, help welcome. I was using this config in
|
As an aside, I would also recommend considering using nix for packaging. It has decent support on macOS and good support on Linuxy systems: https://nixos.org/nix/. |
Related:
|
I would like it if hledger had snap packaging: my distro's regular packaging system is a few versions behind (1.2 at time of writing). Apologies in advance for my ignorance: I'm still learning Haskell and don't know a whole lot about how to build / run anything except small example files from the Haskell documentation, so I don't know where I'd put a This is also my first time working with a packaging system like Snap; but my understanding is that the maintainer (i.e.: @simonmichael ) should be the one to register the snap for hledger. Nonetheless, I tested generating a local Snap package using the @simonmichael's file from 2018-12-23 failed because Github has changed where you download the tarball and the name of the folder it produces; but both items were easily corrected (I will include my changed Once I fixed the download location and where the Given the lack of In the meantime, here's how I set up my environment...
... and here's my name: 'hledger'
version: '1.12.1'
summary: 'A command-line based accounting program.'
type: 'app'
description: |
hledger is an accounting program, for tracking money, time, or other
commodities. With simple yet powerful functionality accessed from command
line, terminal or web browser, hledger is a fast, secure, dependable
alternative to spreadsheets, Quickbooks, GnuCash, Xero etc.
grade: 'stable'
confinement: 'strict'
apps:
hledger:
command: 'env LC_ALL=C.UTF-8 ${SNAP}/bin/hledger'
plugs: ['home']
parts:
hledger:
source: .
plugin: nil
build-packages: []
stage-packages: []
build-attributes:
- no-system-libraries
prepare: |
build: |
install: |
export _HLEDGER_VERSION=$SNAPCRAFT_PROJECT_NAME-$SNAPCRAFT_PROJECT_VERSION
wget https://github.com/simonmichael/hledger/archive/$_HLEDGER_VERSION.tar.gz
tar -zxvf $_HLEDGER_VERSION.tar.gz
mkdir -p $SNAPCRAFT_PART_INSTALL/usr/
cd hledger-$_HLEDGER_VERSION/
cp -RP . $SNAPCRAFT_PART_INSTALL/usr/
prime:
- -home/* |
A couple of follow-up notes:
snapcraft cleanbuild --debug
sudo snap install --devmode hledger_1.12.1_amd64.snap
name: 'hledger'
version: '1.12.1'
summary: 'A command-line based accounting program.'
type: 'app'
description: |
hledger is an accounting program, for tracking money, time, or other
commodities. With simple yet powerful functionality accessed from command
line, terminal or web browser, hledger is a fast, secure, dependable
alternative to spreadsheets, Quickbooks, GnuCash, Xero etc.
grade: 'stable'
confinement: 'strict'
apps:
hledger:
command: 'env LC_ALL=C.UTF-8 ${SNAP}/bin/hledger'
plugs: ['home']
parts:
hledger:
source: '.'
plugin: 'nil'
build-packages: []
stage-packages: []
build-attributes:
- 'no-system-libraries'
override-build:
export _HLEDGER_VERSION=$SNAPCRAFT_PROJECT_NAME-$SNAPCRAFT_PROJECT_VERSION
wget https://github.com/simonmichael/hledger/archive/$_HLEDGER_VERSION.tar.gz
tar -zxvf $_HLEDGER_VERSION.tar.gz
mkdir -p $SNAPCRAFT_PART_INSTALL/usr/
cd hledger-$_HLEDGER_VERSION/
wget -qO- https://get.haskellstack.org/ | sh
stack build
cp -RP . $SNAPCRAFT_PART_INSTALL/usr/
prime:
- '-home/*' |
Thanks for working on this @mparker17. It's probably a good idea to find another haskell project that has been snap-packaged. I think pandoc, xmonad, postgrest, elm, purescript, stack, cabal, ghc are possibilities. |
At least, there are a few projects at https://snapcraft.io/search?category=&q=haskell |
snapcraft.yaml, snapcraft.yaml - these ones download a binary released on github I think. |
I'm going to be looking into this! I asked for advise on #snapcraft if they have any example. |
Make it snappy. Fixes simonmichael#595
We explored it. If anyone wants to package hledger as snaps, that is welcome. |
I forgot to follow up, sorry, I wrote the initial snap in 2021 @ julian-klode@ebea47a but never finished it, it's published in the snap store as hledger-jak for testing, but also I never updated it. I guess it works fine enough ,it just manages your journal in $HOME/snap/hledger//.hledger.journal and doesn't have write access to $HOME directly, or the permission to create sockets for hledger web yet. |
Thanks @julian-klode. I guess we won't add it to the Install page unless it's maintained, tested, people asking for it etc. |
https://snapcraft.io
https://snapcraft.io/docs/build-snaps/your-first-snap
https://snapcraft.io/docs/reference/plugins/
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: