Last active
February 6, 2024 20:26
-
-
Save aryairani/891e1d445b4ec180411361c1abb897c3 to your computer and use it in GitHub Desktop.
home brew formula for unison
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UnisonFromSrc < Formula | |
desc "Unison Language and Codebase Manager" | |
homepage "https://unisonweb.org" | |
url "https://github.com/unisonweb/unison/archive/refs/tags/release/0.5.15.tar.gz" | |
sha256 "03b2334fc75edafbe5300284ae19d0b9abeaf4e8c5c13d1c899c80c9e6050990" | |
license "MIT" | |
version_scheme 1 | |
depends_on "[email protected]" => :build | |
depends_on "haskell-stack" => :build | |
depends_on "npm" => :build | |
depends_on "fzf" => :recommended | |
depends_on "minimal-racket" => :optional | |
uses_from_macos "less" => :recommended | |
resource "local-ui" do | |
url "https://github.com/unisonweb/unison-local-ui/archive/refs/tags/release/0.5.15.tar.gz" | |
sha256 "fcc74ef9f41388588e9c29ebdf6759ee27168a8c650408dd695b7c65d117b1f5" | |
end | |
def install | |
localui = libexec/"ui" | |
resource("local-ui").stage do | |
system "npm", "ci" | |
system "npm", "run", "ui-core-install" | |
system "npm", "run", "build" | |
localui.install Dir["dist/unisonLocal/*"] | |
end | |
system "stack", "--no-terminal", "build", "--flag", "unison-parser-typechecker:optimized" | |
libexec.install `stack exec which unison`.strip "ucm" | |
end | |
test do | |
(testpath/"getbase.md").write <<~EOS | |
```ucm | |
.> project.create test | |
``` | |
```unison | |
> "Hello, World!" | |
``` | |
EOS | |
system "#{bin}/ucm", "transcript", testpath/"getbase.md" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Unisonlang < Formula | |
desc "Unison Language and Codebase Manager" | |
homepage "https://unisonweb.org" | |
url "https://github.com/unisonweb/unison/archive/refs/tags/release/0.5.15.tar.gz" | |
sha256 "03b2334fc75edafbe5300284ae19d0b9abeaf4e8c5c13d1c899c80c9e6050990" | |
license "MIT" | |
depends_on "[email protected]" => :build | |
depends_on "haskell-stack" => :build | |
depends_on "npm" => :build | |
depends_on "unison-local-ui" | |
depends_on "fzf" => :recommended | |
depends_on "minimal-racket" => :optional | |
uses_from_macos "less" => :recommended | |
def install | |
system "stack", "--no-terminal", "build", "--flag", "unison-parser-typechecker:optimized" | |
libexec.install `stack exec which unison`.strip | |
libexec.install_symlink Formula["unison-local-ui"].opt_share/"ui" | |
(bin/"ucm").write <<~EOS | |
#!/bin/bash | |
#{libexec}/unison $@ | |
EOS | |
end | |
test do | |
(testpath/"getbase.md").write <<~EOS | |
```ucm | |
.> project.create test | |
``` | |
```unison | |
> "Hello, World!" | |
``` | |
EOS | |
system "#{bin}/ucm", "transcript", testpath/"getbase.md" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UnisonLocalUi < Formula | |
desc "Unison Language and Codebase Manager" | |
homepage "https://unisonweb.org" | |
url "https://github.com/unisonweb/unison-local-ui/archive/refs/tags/release/0.5.15.tar.gz" | |
sha256 "fcc74ef9f41388588e9c29ebdf6759ee27168a8c650408dd695b7c65d117b1f5" | |
license "MIT" | |
depends_on "npm" => :build | |
def install | |
system "npm", "ci" | |
system "npm", "run", "ui-core-install" | |
system "npm", "run", "build" | |
(pkgshare/"ui").install Dir["dist/unisonLocal/*"] | |
end | |
test do | |
assert_predicate opt_share/"ui"/"index.html", :exist? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment