daml/release/windows-installer/BUILD.bazel

51 lines
1.7 KiB
Python
Raw Normal View History

# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("//bazel_tools:haskell.bzl", "da_haskell_binary")
load("@os_info//:os_info.bzl", "is_linux", "is_windows")
da_haskell_binary(
name = "windows-installer-gen",
srcs = glob(["src/**/*.hs"]),
hackage_deps = [
"base",
"filepath",
"nsis",
],
src_strip_prefix = "src",
visibility = ["//visibility:public"],
deps = ["//:sdk-version-hs-lib"],
)
[
genrule(
name = "windows-installer-{}".format(edition),
# daml-logo.ico was created with the following command:
# convert \
# docs/theme/da_theme_skeleton/static/images/favicon/apple-touch-icon.png \
# -define icon:auto-resize=64,48,32,16 release/windows-installer/daml-logo.ico
srcs = [
"//release:sdk-release-tarball-{}.tar.gz".format(edition),
":daml-logo.ico",
],
outs = ["daml-sdk-installer-{}.exe".format(edition)],
cmd = """
set -eou pipefail
RELEASE_DIR=$$(mktemp -d)
trap "rm -rf $$RELEASE_DIR" EXIT
tar xf $(location //release:sdk-release-tarball-{edition}.tar.gz) --strip-components=1 -C $$RELEASE_DIR
$(location :windows-installer-gen) ./installer.nsi $$RELEASE_DIR $(location :daml-logo.ico)
$(location @makensis_dev_env//:makensis) ./installer.nsi
cp ./daml-sdk-installer.exe $(location daml-sdk-installer-{edition}.exe)
""".format(edition = edition),
tools = [
":windows-installer-gen",
"@makensis_dev_env//:makensis",
],
)
for edition in [
"ce",
"ee",
]
] if is_windows else None