Getting a formula written to build haskell-language-server #386
Replies: 4 comments 11 replies
-
I think the answer here is that you're not meant to download any of them: https://docs.brew.sh/Acceptable-Formulae#we-dont-like-binary-formulae The only exception is when the binary you're downloading is for the purposes of bootstrapping at build-time. These binaries are thrown away when the build is complete. (Still, we try to avoid these where we can.) If that's the case here, I don't know if there's a better way than using multiple |
Beta Was this translation helpful? Give feedback.
-
Okay, I've done a little more investigation into this. I'm a newbie, so I don't know if I'll be able to complete this process myself, but maybe somebody coming through later can benefit from my investigation. The problem here is mostly that:
Upstream, this is solved by shipping Further complicating this, is "what GHC versions is a given Joe Enduser on Homebrew using" is actually non-trivial:
Upstream, the project handles this with a custom build-system that queries Stack and cabal, attempting to determine what versions of GHC it should build against. /= So, tl;dr I'm not sure how to solve this in a single Formula, that we can put in homebrew-core, that supports all three of the above categories. I'm guessing we'd have to have CI build all of the possible GHC versions, so that the single I hope somebody smarter than me, or more familiar with Haskell than me, or more familiar with Homebrew than me, can figure this out! Here's my initial naive attempt, although I haven't had much luck getting it to work: class HaskellLanguageServer < Formula
desc "Integration point for ghcide and haskell-ide-engine. One IDE to rule them all."
homepage "https://github.com/haskell/haskell-language-server"
license "Apache-2.0"
# Use the tag instead of the tarball to get submodules
url "https://github.com/haskell/haskell-language-server.git",
tag: "0.7.1",
revision: "e4f677e1780fe85a02b99a09404a0a3c3ab5ce7c"
head "https://github.com/haskell/haskell-language-server.git"
livecheck do
url :stable
strategy :github_latest
end
depends_on "cabal-install" => :build
depends_on "ghc" => :build
depends_on "icu4c"
def install
system "cabal", "v2-update"
system "cabal", "v2-run", *std_cabal_v2_args,
"./install.hs", "--project-file", "install/shake.project"
end
end |
Beta Was this translation helpful? Give feedback.
-
haskell-language-server is on hackage now and can be installed in a more friendly way with cabal install: https://hackage.haskell.org/package/haskell-language-server |
Beta Was this translation helpful? Give feedback.
-
Solution suggestion: Homebrew/homebrew-cask#100527. Inconveniences
Alternative solution might be to create a cask for each binary (available as part official releases too: https://github.com/haskell/haskell-language-server/releases/tag/1.0.0) so that users can pick specific ones... |
Beta Was this translation helpful? Give feedback.
-
I'm attempting to write a formula for
haskell-language-server
; I haven't written a formula in many years, so please forgive me if I say anything dumb!HLS requires several downloads, per version: https://github.com/haskell/haskell-language-server/releases/tag/0.7.1
haskell-language-server-wrapper
binary,haskell-language-server-8.8.2
(or similar) binary for each version of GHC being used in conjunction.Realistically, I think the best solution is to download all of them — there's only a half-dozen or so, and I don't think having a few
haskell-language-server-macOS-N.N.N
copies in/usr/local/bin
is a huge deal.That said, is there a best way to go about this in a formula? Any directions or advice? I don't want to do a huge hack if I don't have to!
Beta Was this translation helpful? Give feedback.
All reactions