Skip to content

Commit 75f746b

Browse files
committed
Add with-static option to install static clojure-lsp binary
1 parent 7fa2a3f commit 75f746b

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Diff for: clojure-lsp-native.rb.tmpl

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ class ClojureLspNative < Formula
33
homepage "https://github.com/clojure-lsp/clojure-lsp"
44
version "<version>"
55

6+
option "with-static", "Installs statically built binary."
7+
68
if OS.mac?
79
if Hardware::CPU.arm?
810
url "https://github.com/clojure-lsp/clojure-lsp/releases/download/<version>/clojure-lsp-native-macos-aarch64.zip"
@@ -12,8 +14,13 @@ class ClojureLspNative < Formula
1214
sha256 "<mac-amd-sha>"
1315
end
1416
elsif OS.linux?
15-
url "https://github.com/clojure-lsp/clojure-lsp/releases/download/<version>/clojure-lsp-native-linux-amd64.zip"
16-
sha256 "<linux-sha>"
17+
if build.with? "static"
18+
url "https://github.com/clojure-lsp/clojure-lsp/releases/download/<version>/clojure-lsp-native-static-linux-amd64.zip"
19+
sha256 "<static-linux-sha>"
20+
else
21+
url "https://github.com/clojure-lsp/clojure-lsp/releases/download/<version>/clojure-lsp-native-linux-amd64.zip"
22+
sha256 "<linux-sha>"
23+
end
1724
end
1825

1926
def install

Diff for: render.clj

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
[nil "--linux-sha SHA" "The sha256 of the linux artifact"
1414
:default ""
1515
:missing "--linux-sha must be specified"]
16+
[nil "--static-linux-sha SHA" "The sha256 of the static linux artifact"
17+
:default ""
18+
:missing "--static-linux-sha must be specified"]
1619
[nil "--version VERSION" "The new version to publish"
1720
:default ""
1821
:missing "--linux-sha must be specified"]
@@ -21,10 +24,11 @@
2124

2225

2326
(defn render
24-
[{:keys [version linux-sha mac-amd-sha mac-arm-sha template]}]
27+
[{:keys [version linux-sha static-linux-sha mac-amd-sha mac-arm-sha template]}]
2528
(-> (slurp template)
2629
(str/replace #"<version>" version)
2730
(str/replace #"<linux-sha>" linux-sha)
31+
(str/replace #"<static-linux-sha>" static-linux-sha)
2832
(str/replace #"<mac-arm-sha>" mac-arm-sha)
2933
(str/replace #"<mac-amd-sha>" mac-amd-sha)))
3034

0 commit comments

Comments
 (0)