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

hledger should be installable with homebrew #321

Open
simonmichael opened this Issue Feb 3, 2016 · 14 comments

Comments

Projects
None yet
5 participants
@simonmichael
Owner

simonmichael commented Feb 3, 2016

For mac users, brew install hledger should work. This was blocked by homebrew's policy in the past, let's find that discussion and see if we can make it happen.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Feb 3, 2016

Owner

Discussion here: Homebrew/legacy-homebrew#4430 . Their policy has changed, so we just need someone to have another go at it.

Owner

simonmichael commented Feb 3, 2016

Discussion here: Homebrew/legacy-homebrew#4430 . Their policy has changed, so we just need someone to have another go at it.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Feb 3, 2016

Owner

Here's a homebrew recipe which works for me:

require "language/haskell"

class Hledger < Formula
  include Language::Haskell::Cabal

  desc "The hledger accounting tool, command-line version"
  homepage "http://hledger.org"
  url "http://hackage.haskell.org/package/hledger-0.27/hledger-0.27.tar.gz"
  sha256 "0aecdf586a46c24d6d67659157d1edbfc0d78afb50ea7cfbec1a01bf86b792b0"

  # head "https://github.com/simonmichael/hledger.git"

  bottle do
    sha256 "56c7bb47a4a0f3014c734fd65c7b44b060313bfef54a5c06462b56ee000df970" => :el_capitan
    sha256 "ecfa1ad7312544f079496d428fb7c3a16bed77206a218e98bce0ade2fe5ffa9e" => :yosemite
    sha256 "ef597e53f05f99f84309b300ccf573d339cf0809537bcd665c5e980c3ad2f88a" => :mavericks
  end

  depends_on "ghc" => :build
  depends_on "cabal-install" => :build

  def install
    install_cabal_package :using => ["happy"]
  end

  test do
    system "#{bin}/hledger", "test"
  end
end

I've been following the Formula Cookbook. Perhaps it's good to retrace my steps:

  • brew update
  • brew create http://hackage.haskell.org/package/hledger-0.27/hledger-0.27.tar.gz
  • a starter recipe should appear in your editor, replace it with the one above
  • brew install --verbose --debug hledger
  • brew audit --strict --online hledger

and now proceed with Commit...

I think the bottle lines will be updated automatically by homebrew.

Owner

simonmichael commented Feb 3, 2016

Here's a homebrew recipe which works for me:

require "language/haskell"

class Hledger < Formula
  include Language::Haskell::Cabal

  desc "The hledger accounting tool, command-line version"
  homepage "http://hledger.org"
  url "http://hackage.haskell.org/package/hledger-0.27/hledger-0.27.tar.gz"
  sha256 "0aecdf586a46c24d6d67659157d1edbfc0d78afb50ea7cfbec1a01bf86b792b0"

  # head "https://github.com/simonmichael/hledger.git"

  bottle do
    sha256 "56c7bb47a4a0f3014c734fd65c7b44b060313bfef54a5c06462b56ee000df970" => :el_capitan
    sha256 "ecfa1ad7312544f079496d428fb7c3a16bed77206a218e98bce0ade2fe5ffa9e" => :yosemite
    sha256 "ef597e53f05f99f84309b300ccf573d339cf0809537bcd665c5e980c3ad2f88a" => :mavericks
  end

  depends_on "ghc" => :build
  depends_on "cabal-install" => :build

  def install
    install_cabal_package :using => ["happy"]
  end

  test do
    system "#{bin}/hledger", "test"
  end
end

I've been following the Formula Cookbook. Perhaps it's good to retrace my steps:

  • brew update
  • brew create http://hackage.haskell.org/package/hledger-0.27/hledger-0.27.tar.gz
  • a starter recipe should appear in your editor, replace it with the one above
  • brew install --verbose --debug hledger
  • brew audit --strict --online hledger

and now proceed with Commit...

I think the bottle lines will be updated automatically by homebrew.

@travisbhartwell

This comment has been minimized.

Show comment
Hide comment
@travisbhartwell

travisbhartwell Feb 4, 2016

Collaborator

Using the above instructions and formula from @simonmichael, I've created a pull request for Homebrew for hledger:

Homebrew/legacy-homebrew#48805

Collaborator

travisbhartwell commented Feb 4, 2016

Using the above instructions and formula from @simonmichael, I've created a pull request for Homebrew for hledger:

Homebrew/legacy-homebrew#48805

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Feb 4, 2016

Owner

brew install hledger now works! Thanks, @travisbhartwell !

Our next priority is to get hledger-ui and hledger-web into homebrew. We're not sure how to do this with the one formula, so while that might be convenient for users, we may end up making one brew formula per hledger package. Advice welcome.

Owner

simonmichael commented Feb 4, 2016

brew install hledger now works! Thanks, @travisbhartwell !

Our next priority is to get hledger-ui and hledger-web into homebrew. We're not sure how to do this with the one formula, so while that might be convenient for users, we may end up making one brew formula per hledger package. Advice welcome.

@lucianf

This comment has been minimized.

Show comment
Hide comment
@lucianf

lucianf Jun 6, 2017

Is there an update on this front? I've installed hledger with brew but only ended up with core hledger, and there can't seem to be any way to get hledger-ui and hledger-web other than by installing from source with cabal (and ending up with a huge deployment of cabal-related stuff). Is there any way to install hledger-ui and hledger-web on OS X as binary packages?

lucianf commented Jun 6, 2017

Is there an update on this front? I've installed hledger with brew but only ended up with core hledger, and there can't seem to be any way to get hledger-ui and hledger-web other than by installing from source with cabal (and ending up with a huge deployment of cabal-related stuff). Is there any way to install hledger-ui and hledger-web on OS X as binary packages?

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Jun 6, 2017

Owner

No progress on this; we still need a homebrew packager.

Building from source is pretty easy these days - just follow the instructions on the download page. Once the binaries are installed in ~/.local/bin you can certainly rm -rf ~/.stack ~/hledger if the disk usage is a concern.

Owner

simonmichael commented Jun 6, 2017

No progress on this; we still need a homebrew packager.

Building from source is pretty easy these days - just follow the instructions on the download page. Once the binaries are installed in ~/.local/bin you can certainly rm -rf ~/.stack ~/hledger if the disk usage is a concern.

@skratchdot

This comment has been minimized.

Show comment
Hide comment
@skratchdot

skratchdot Jun 7, 2017

Although it is easy to install from source, it would be nice to use brew to install all the optional packages as well. I typically go to brew for my default installs, but install from source if absolutely needed (just easier to stay up-to-date that way).

Seems like we just need to tweak this line a bit:

install_cabal_package :using => ["happy"]

https://github.com/Homebrew/homebrew-core/blob/master/Formula/hledger.rb

I don't know enough about homebrew and cabal to tweak that file though :)

Thanks for this project @simonmichael!

skratchdot commented Jun 7, 2017

Although it is easy to install from source, it would be nice to use brew to install all the optional packages as well. I typically go to brew for my default installs, but install from source if absolutely needed (just easier to stay up-to-date that way).

Seems like we just need to tweak this line a bit:

install_cabal_package :using => ["happy"]

https://github.com/Homebrew/homebrew-core/blob/master/Formula/hledger.rb

I don't know enough about homebrew and cabal to tweak that file though :)

Thanks for this project @simonmichael!

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Jun 7, 2017

Owner

I thoroughly agree. Please do experiment. Between us, I'm sure we can figure it out. Maybe some of the other haskell homebrew recipes will give ideas ?

Owner

simonmichael commented Jun 7, 2017

I thoroughly agree. Please do experiment. Between us, I'm sure we can figure it out. Maybe some of the other haskell homebrew recipes will give ideas ?

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Jun 7, 2017

Owner

@travisbhartwell any ideas on how to add the other packages ?

Owner

simonmichael commented Jun 7, 2017

@travisbhartwell any ideas on how to add the other packages ?

@skratchdot

This comment has been minimized.

Show comment
Hide comment
@skratchdot

skratchdot Jun 7, 2017

I briefly perused https://github.com/Homebrew/homebrew-core/search?utf8=%E2%9C%93&q=install_cabal_package&type= but wasn't having much luck. I'm too unfamiliar with cabal.

skratchdot commented Jun 7, 2017

I briefly perused https://github.com/Homebrew/homebrew-core/search?utf8=%E2%9C%93&q=install_cabal_package&type= but wasn't having much luck. I'm too unfamiliar with cabal.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Jun 7, 2017

Owner

Here's the source for install_cabal_package.

It looks like you can pass arguments something like this:

install_cabal_package "hledger", "hledger-ui", "hledger-web", "hledger-api" :using => ["happy"]
Owner

simonmichael commented Jun 7, 2017

Here's the source for install_cabal_package.

It looks like you can pass arguments something like this:

install_cabal_package "hledger", "hledger-ui", "hledger-web", "hledger-api" :using => ["happy"]
@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Jun 7, 2017

Owner

But, that url declaration suggests it'll download only one of the packages.

Owner

simonmichael commented Jun 7, 2017

But, that url declaration suggests it'll download only one of the packages.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Jun 7, 2017

Owner

subformulas might be the answer.

Owner

simonmichael commented Jun 7, 2017

subformulas might be the answer.

@bz007

This comment has been minimized.

Show comment
Hide comment
@bz007

bz007 Jul 22, 2017

What about formulas for hledger-ui & hledger-web?

bz007 commented Jul 22, 2017

What about formulas for hledger-ui & hledger-web?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment