You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for package defined local vars.
This removes a lot of boilerplate from packages with less 1:1 mappings
of version to URL.
eg. This
description = "A tool to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# code."
binaries = ["clang-format"]
version "10.0.0-20211020" {
platform linux {
source = "https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-f3a37dd2/clang-format-10_linux-amd64"
on unpack { rename { from = "${root}/clang-format-10_linux-amd64" to = "${root}/clang-format" } }
}
platform darwin {
source = "https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-f3a37dd2/clang-format-10_macosx-amd64"
on unpack { rename { from = "${root}/clang-format-${release}_macosx-amd64" to = "${root}/clang-format" } }
}
}
version "11.0.0-20211020" {
platform linux {
source = "https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-f3a37dd2/clang-format-11_linux-amd64"
on unpack { rename { from = "${root}/clang-format-11_linux-amd64" to = "${root}/clang-format" } }
}
platform darwin {
source = "https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-f3a37dd2/clang-format-11_macosx-amd64"
on unpack { rename { from = "${root}/clang-format-11_macosx-amd64" to = "${root}/clang-format" } }
}
}
version "12.0.0-20211020" {
vars = { hash: "f3a37dd2", release: "12" }
platform linux {
source = "https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-f3a37dd2/clang-format-12_linux-amd64"
on unpack { rename { from = "${root}/clang-format-12_linux-amd64" to = "${root}/clang-format" } }
}
platform darwin {
source = "https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-f3a37dd2/clang-format-12_macosx-amd64"
on unpack { rename { from = "${root}/clang-format-12_macosx-amd64" to = "${root}/clang-format" } }
}
}
Can become this:
description = "A tool to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# code."
binaries = ["clang-format"]
platform linux {
source = "https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-${hash}/clang-format-${release}_linux-amd64"
on unpack { rename { from = "${root}/clang-format-${release}_linux-amd64" to = "${root}/clang-format" } }
}
platform darwin {
source = "https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-${hash}/clang-format-${release}_macosx-amd64"
on unpack { rename { from = "${root}/clang-format-${release}_macosx-amd64" to = "${root}/clang-format" } }
}
version "10.0.0-20211020" {
vars = { hash: "f3a37dd2", release: "10" }
}
version "11.0.0-20211020" {
vars = { hash: "f3a37dd2", release: "11" }
}
version "12.0.0-20211020" {
vars = { hash: "f3a37dd2", release: "12" }
}