From 671a372d87ff8311956f9158e8885ffc254fe1bc Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 29 Jun 2021 13:14:14 +0200 Subject: compiler: add "portable" target This adds a build flag for generating a portable version of the compiler binary which make it look in its own runtime directory for its assets. This is useful in particular for the portable release tarballs which contain the web viewer at the same location instead of a pre-defined one in the FHS. GitHub: closes #286 --- compiler/package.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'compiler/package.yaml') diff --git a/compiler/package.yaml b/compiler/package.yaml index faa2174..b02a40a 100644 --- a/compiler/package.yaml +++ b/compiler/package.yaml @@ -5,7 +5,7 @@ github: "pacien/ldgallery" license: AGPL-3 author: "Pacien TRAN-GIRARD, Guillaume FOUET" maintainer: "" -copyright: "2019-2020 Pacien TRAN-GIRARD, Guillaume FOUET" +copyright: "2019-2021 Pacien TRAN-GIRARD, Guillaume FOUET" extra-source-files: - readme.md @@ -54,6 +54,15 @@ data-files: ["**/*"] library: source-dirs: src +flags: + portable: + description: > + Make the output binary portable. + It will look in its own runtime location for its assets instead of + absolute installation paths. + manual: true + default: false + executables: ldgallery: main: Main.hs @@ -64,6 +73,9 @@ executables: - -with-rtsopts=-N dependencies: - ldgallery-compiler + when: + - condition: flag(portable) + cpp-options: -DFLAG_PORTABLE tests: ldgallery-compiler-test: -- cgit v1.2.3