diff options
author | pacien | 2021-06-29 13:14:14 +0200 |
---|---|---|
committer | pacien | 2021-06-29 13:14:14 +0200 |
commit | 671a372d87ff8311956f9158e8885ffc254fe1bc (patch) | |
tree | 67283cf21bc4e1264587633199d523ff372cbe4f /compiler/package.yaml | |
parent | 622af23bb3ce8d6dc8dc1d658cb7f01bc905ef2c (diff) | |
download | ldgallery-671a372d87ff8311956f9158e8885ffc254fe1bc.tar.gz |
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
Diffstat (limited to 'compiler/package.yaml')
-rw-r--r-- | compiler/package.yaml | 14 |
1 files changed, 13 insertions, 1 deletions
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" | |||
5 | license: AGPL-3 | 5 | license: AGPL-3 |
6 | author: "Pacien TRAN-GIRARD, Guillaume FOUET" | 6 | author: "Pacien TRAN-GIRARD, Guillaume FOUET" |
7 | maintainer: "" | 7 | maintainer: "" |
8 | copyright: "2019-2020 Pacien TRAN-GIRARD, Guillaume FOUET" | 8 | copyright: "2019-2021 Pacien TRAN-GIRARD, Guillaume FOUET" |
9 | 9 | ||
10 | extra-source-files: | 10 | extra-source-files: |
11 | - readme.md | 11 | - readme.md |
@@ -54,6 +54,15 @@ data-files: ["**/*"] | |||
54 | library: | 54 | library: |
55 | source-dirs: src | 55 | source-dirs: src |
56 | 56 | ||
57 | flags: | ||
58 | portable: | ||
59 | description: > | ||
60 | Make the output binary portable. | ||
61 | It will look in its own runtime location for its assets instead of | ||
62 | absolute installation paths. | ||
63 | manual: true | ||
64 | default: false | ||
65 | |||
57 | executables: | 66 | executables: |
58 | ldgallery: | 67 | ldgallery: |
59 | main: Main.hs | 68 | main: Main.hs |
@@ -64,6 +73,9 @@ executables: | |||
64 | - -with-rtsopts=-N | 73 | - -with-rtsopts=-N |
65 | dependencies: | 74 | dependencies: |
66 | - ldgallery-compiler | 75 | - ldgallery-compiler |
76 | when: | ||
77 | - condition: flag(portable) | ||
78 | cpp-options: -DFLAG_PORTABLE | ||
67 | 79 | ||
68 | tests: | 80 | tests: |
69 | ldgallery-compiler-test: | 81 | ldgallery-compiler-test: |