|
| 1 | +using BinaryBuilder |
| 2 | + |
| 3 | +# Collection of pre-build Bitwarden CLI binaries |
| 4 | +name = "bitwarden_cli" |
| 5 | +version = v"1.17.1" |
| 6 | + |
| 7 | +url_prefix = "https://github.com/bitwarden/cli/releases/download/v$(version)" |
| 8 | +sources = [ |
| 9 | + ArchiveSource("$(url_prefix)/bw-linux-$(version).zip", "4704297B438041D39774AA7B077DB72A184A50223FAAE906D2C238D14E2056E9"; unpack_target = "x86_64-linux-gnu"), |
| 10 | + ArchiveSource("$(url_prefix)/bw-macos-$(version).zip", "9d5c5a997c73b84aeb43db4c7be93d3fa6443f83ade35a4953b0f1c6862c00c2"; unpack_target = "x86_64-apple-darwin14"), |
| 11 | + ArchiveSource("$(url_prefix)/bw-windows-$(version).zip", "38FE9F5126BC723FB3C0FC00DC15B013826030D6A9F54539B18DBB56EB6FB5EE"; unpack_target = "x86_64-w64-mingw32"), |
| 12 | + FileSource("https://raw.githubusercontent.com/bitwarden/cli/v$(version)/LICENSE.txt", "b98fbb37db5b23bc5cfdcd16793206a5a7120a7b01f75374e5e0888376e4691c") |
| 13 | +] |
| 14 | + |
| 15 | +# Bash recipe for building across all platforms |
| 16 | +script = raw""" |
| 17 | +cd ${WORKSPACE}/srcdir/ |
| 18 | +mkdir -p "${bindir}" |
| 19 | +cp ${target}/bw${exeext} ${bindir} |
| 20 | +chmod +x ${bindir}/* |
| 21 | +install_license LICENSE.txt |
| 22 | +""" |
| 23 | + |
| 24 | +# These are the platforms we will build for by default, unless further |
| 25 | +# platforms are passed in on the command line |
| 26 | +platforms = [ |
| 27 | + Platform("x86_64", "linux"; cxxstring_abi="cxx11"), |
| 28 | + Platform("x86_64", "macos"), |
| 29 | + Platform("x86_64", "windows") |
| 30 | +] |
| 31 | + |
| 32 | +# The products that we will ensure are always built |
| 33 | +products = [ |
| 34 | + ExecutableProduct("bw", :bw) |
| 35 | +] |
| 36 | + |
| 37 | +# Dependencies that must be installed before this package can be built |
| 38 | +dependencies = Dependency[ |
| 39 | +] |
| 40 | + |
| 41 | +# Build the tarballs, and possibly a `build.jl` as well. |
| 42 | +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) |
0 commit comments