on master help sign in
Merge branch 'develop' into eac@update-rp-0.6.0.0
commita048a73288a2ec9a563ccf9ed9ab592ce50e16af author3noch <eacameron@gmail.com> dateTue 7 Jul 2020, 10:21 (6 years ago) parenta9768d57bf7c50
4 files changed+30−21
default.nix+17−13 skeleton/.gitignore+12−6 skeleton/backend/backend.cabal+1−1 skeleton/shell.nix−1
default.nix+17−13
@@ -74,16 +74,20 @@ in rec {
7474 '';
7575
7676 compressedJs = frontend: optimizationLevel: pkgs.runCommand "compressedJs" {} ''
77− mkdir $out
78− cd $out
79− # TODO profiling + static shouldn't break and need an ad-hoc workaround like that
80− ln -s "${haskellLib.justStaticExecutables frontend}/bin/frontend.jsexe/all.js" all.unminified.js
81− ${if optimizationLevel == null then ''
82− ln -s all.unminified.js all.js
83− '' else ''
84− ${pkgs.closurecompiler}/bin/closure-compiler --externs "${reflex-platform.ghcjsExternsJs}" -O ${optimizationLevel} --jscomp_warning=checkVars --create_source_map="all.js.map" --source_map_format=V3 --js_output_file="all.js" all.unminified.js
85− echo "//# sourceMappingURL=all.js.map" >> all.js
86− ''}
77+ set -euo pipefail
78+ cd '${haskellLib.justStaticExecutables frontend}'
79+ shopt -s globstar
80+ for f in **/all.js; do
81+ dir="$out/$(basename "$(dirname "$f")")"
82+ mkdir -p "$dir"
83+ ln -s "$(realpath "$f")" "$dir/all.unminified.js"
84+ ${if optimizationLevel == null then ''
85+ ln -s "$dir/all.unminified.js" "$dir/all.js"
86+ '' else ''
87+ '${pkgs.closurecompiler}/bin/closure-compiler' --externs '${reflex-platform.ghcjsExternsJs}' -O '${optimizationLevel}' --jscomp_warning=checkVars --create_source_map="$dir/all.js.map" --source_map_format=V3 --js_output_file="$dir/all.js" "$dir/all.unminified.js"
88+ echo '//# sourceMappingURL=all.js.map' >> "$dir/all.js"
89+ ''}
90+ done
8791 '';
8892
8993 serverModules = {
@@ -173,9 +177,9 @@ in rec {
173177 pkgs.runCommand "serverExe" {} ''
174178 mkdir $out
175179 set -eux
176− ln -s "${if profiling then backend else haskellLib.justStaticExecutables backend}"/bin/* $out/
177− ln -s "${mkAssets assets}" $out/static.assets
178− ln -s ${mkAssets (compressedJs frontend optimizationLevel)} $out/frontend.jsexe.assets
180+ ln -s '${if profiling then backend else haskellLib.justStaticExecutables backend}'/bin/* $out/
181+ ln -s '${mkAssets assets}' $out/static.assets
182+ ln -s '${mkAssets (compressedJs frontend optimizationLevel)}'/* $out
179183 echo ${version} > $out/version
180184 '';
181185
skeleton/.gitignore+12−6
@@ -1,9 +1,15 @@
1−dist-newstyle
2−result
3−result-*
4−result-android
5−result-ios
6−result-exe
71.attr-cache
2+.cabal-sandbox
3+*.hi
4+*.o
5+cabal.project.local
6+cabal.sandbox.config
7+ctags
8+dist-newstyle/
9+dist/
810ghcid-output.txt
911profile/
12+result
13+result-*
14+tags
15+TAGS
skeleton/backend/backend.cabal+1−1
@@ -19,7 +19,7 @@ library
1919executable backend
2020 main-is: main.hs
2121 hs-source-dirs: src-bin
22− ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O
22+ ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O -threaded
2323 if impl(ghcjs)
2424 buildable: False
2525 build-depends: base
skeleton/shell.nixdeleted−1
@@ -1 +0,0 @@
1−(import ./. {}).shells.ghc