-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into cross-compile
- Loading branch information
Showing
16 changed files
with
576 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
deploy: | ||
name: Nix build and deploy GHCJS web app | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: cachix/install-nix-action@v16 | ||
with: | ||
extra_nix_config: | | ||
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8= haskell-pretty-simple.cachix.org-1:AWHkzPidwcDzWUIUjKcx/PYgud2OBAa9SNUEoIOsATY= | ||
substituters = https://cache.nixos.org/ https://miso-haskell.cachix.org https://haskell-pretty-simple.cachix.org | ||
- name: Build | ||
run: | | ||
nix-build ./web | ||
cp -rL result result-no-symlinks | ||
- name: Deploy | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: result-no-symlinks/bin/web.jsexe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ cabal.sandbox.config | |
*.hp | ||
*.eventlog | ||
.stack-work/ | ||
web/result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
packages: | ||
. | ||
web | ||
|
||
constraints: miso +jsaddle | ||
|
||
-- https://github.com/ghcjs/jsaddle/pull/136 | ||
source-repository-package | ||
type: git | ||
location: https://github.com/avanov/jsaddle | ||
tag: 0011573a2bafb0c2c17fe95d1212374f13e1b629 | ||
subdir: jsaddle | ||
|
||
allow-newer: | ||
jsaddle:aeson, | ||
jsaddle:attoparsec, | ||
jsaddle:base-compat, | ||
jsaddle:base64-bytestring, | ||
jsaddle:bytestring, | ||
jsaddle:lens, | ||
jsaddle:text, | ||
jsaddle:time, | ||
jsaddle-warp:aeson, | ||
jsaddle-warp:bytestring, | ||
jsaddle-warp:jsaddle, | ||
jsaddle-warp:text, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
# pretty-simple Web Page | ||
|
||
This directory contains an interactive web page that can be compiled with GHCJS | ||
to show how `pretty-simple` works. | ||
|
||
This Haskell package can be built with GHCJS with the command `nix-build`. | ||
You'll need Nix [installed](https://nixos.org/download.html) for this to work. | ||
You'll also need to setup the Miso Nix cache, as explained | ||
[here](https://github.com/cdepillabout/pretty-simple/pull/117#issuecomment-1258023974). | ||
|
||
This Haskell package can also be built with GHC with the command `cabal build web`. | ||
Running this executable with `cabal run web` will start a web server listening on | ||
`0.0.0.0:8000`. You should be able to see the web page by opening | ||
<http://localhost:8000> in a web browser. _Note_ that you will need to run | ||
`cabal run web` within this current directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
with (import | ||
(builtins.fetchTarball { | ||
url = | ||
"https://github.com/dmjio/miso/archive/refs/tags/1.8.3.tar.gz"; | ||
sha256 = "0kcr5agbcynm003zj70yfkhsc169ahdcp9pkyr795p5mc3ykycjl"; | ||
}) | ||
{ }); | ||
#TODO we can remove all these patches once we're not stuck on such old tools | ||
# unfortunately GHCJS 8.10.7 has serious performance issues: https://github.com/dmjio/miso/pull/693 | ||
let | ||
hp = pkgs.haskell.packages.ghcjs86.override { | ||
all-cabal-hashes = builtins.fetchurl { | ||
url = | ||
"https://github.com/commercialhaskell/all-cabal-hashes/archive/ead1bd926a1b10b04a5c07c8f15827091fa98b38.tar.gz"; | ||
sha256 = "15i7ia241wb3s9f6l9n2bqldb4ii73xrj49rfr02q43iqbmdjddv"; | ||
}; | ||
}; | ||
prettyprinter = hp.callHackage "prettyprinter" "1.7.0" { }; | ||
prettyprinter-ansi-terminal = | ||
hp.callHackage "prettyprinter-ansi-terminal" "1.1.2" { | ||
prettyprinter = prettyprinter; | ||
}; | ||
app = hp.callCabal2nix "web" ./. { | ||
prettyprinter = prettyprinter; | ||
pretty-simple = hp.callCabal2nix "pretty-simple" ./.. { | ||
prettyprinter = prettyprinter; | ||
prettyprinter-ansi-terminal = prettyprinter-ansi-terminal; | ||
}; | ||
}; | ||
in | ||
pkgs.buildEnv { | ||
name = "pretty-simple-web"; | ||
paths = [ | ||
app | ||
(pkgs.runCommand "css" { } '' | ||
mkdir -p $out/bin/web.jsexe | ||
cp ${./style.css} $out/bin/web.jsexe/style.css | ||
'') | ||
]; | ||
} |
Oops, something went wrong.