2021-01-01 21:49:51 +03:00
|
|
|
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2019-04-29 11:16:11 +03:00
|
|
|
# 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"]),
|
2019-09-06 12:01:09 +03:00
|
|
|
hackage_deps = [
|
2019-04-29 11:16:11 +03:00
|
|
|
"base",
|
2019-05-02 16:17:34 +03:00
|
|
|
"filepath",
|
2019-04-29 11:16:11 +03:00
|
|
|
"nsis",
|
|
|
|
],
|
|
|
|
src_strip_prefix = "src",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = ["//:sdk-version-hs-lib"],
|
|
|
|
)
|
|
|
|
|
2021-03-11 16:49:48 +03:00
|
|
|
[
|
|
|
|
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 = """
|
2019-04-29 11:16:11 +03:00
|
|
|
set -eou pipefail
|
2021-03-11 18:13:49 +03:00
|
|
|
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)
|
2019-04-29 11:16:11 +03:00
|
|
|
$(location @makensis_dev_env//:makensis) ./installer.nsi
|
2021-03-11 16:49:48 +03:00
|
|
|
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
|