summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyfraeviolae <cyfraeviolae>2022-02-22 21:53:46 -0500
committercyfraeviolae <cyfraeviolae>2022-02-22 21:53:46 -0500
commit28eaf16f8ee1bcda3404c1e9461b13e6cc9c3ca7 (patch)
tree849a1dd76cd32b2dd32a4e33704cda05f4c2881f
parent22129a2fcb660a29e1ed6935713282bc78c8d62f (diff)
build
-rw-r--r--app/Web.hs9
-rwxr-xr-xbuild3
-rwxr-xr-xdeploy6
-rwxr-xr-xdist/sumcheck-exebin0 -> 21632280 bytes
-rw-r--r--lib/libgmp.abin0 -> 1311446 bytes
-rw-r--r--package.yaml6
-rw-r--r--static/style.css6
-rw-r--r--sumcheck.cabal6
8 files changed, 23 insertions, 13 deletions
diff --git a/app/Web.hs b/app/Web.hs
index a8a38ae..f64178f 100644
--- a/app/Web.hs
+++ b/app/Web.hs
@@ -30,10 +30,13 @@ import System.Timeout (timeout)
data HomeView = HomeDefault | HomeError String String | HomeResult String Bool
type HomeAPI =
+ "sumcheck" :>
QueryParam "theorem" String
:> Get '[HTML] HomeView
-type API = HomeAPI :<|> "static" :> Raw
+type StaticAPI = "sumcheck" :> "static" :> Raw
+
+type API = HomeAPI :<|> StaticAPI
startApp :: IO ()
startApp = run 9000 app
@@ -213,8 +216,8 @@ pageTemplate crumbs body = doctypehtml_ $ do
meta_ [charset_ "utf-8"]
meta_ [name_ "viewport", content_ "width=device-width, initial-scale=1.0"]
link_
- [rel_ "shortcut icon", type_ "image/x-icon", href_ "/static/favicon.ico"]
- link_ [rel_ "stylesheet", type_ "text/css", href_ "/static/style.css"]
+ [rel_ "shortcut icon", type_ "image/x-icon", href_ "/sumcheck/static/favicon.ico"]
+ link_ [rel_ "stylesheet", type_ "text/css", href_ "/sumcheck/static/style.css"]
body_ $
div_ [class_ "container"] $ do
div_ [class_ "row navbar"] $
diff --git a/build b/build
new file mode 100755
index 0000000..d7afb83
--- /dev/null
+++ b/build
@@ -0,0 +1,3 @@
+set -euo pipefail
+stack install
+cp ~/.local/bin/sumcheck-exe dist/
diff --git a/deploy b/deploy
deleted file mode 100755
index 3b3c728..0000000
--- a/deploy
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-stack install
-rsync ~/.local/bin/sumcheck-exe vps:/srv/sumcheck/staging
-rsync sumcheck.service vps:/srv/sumcheck/staging
-rsync -az static vps:/srv/sumcheck/staging
diff --git a/dist/sumcheck-exe b/dist/sumcheck-exe
new file mode 100755
index 0000000..2525870
--- /dev/null
+++ b/dist/sumcheck-exe
Binary files differ
diff --git a/lib/libgmp.a b/lib/libgmp.a
new file mode 100644
index 0000000..5886d4a
--- /dev/null
+++ b/lib/libgmp.a
Binary files differ
diff --git a/package.yaml b/package.yaml
index f954c47..02282a1 100644
--- a/package.yaml
+++ b/package.yaml
@@ -34,6 +34,12 @@ executables:
- -threaded
- -rtsopts
- -with-rtsopts=-N
+ - -static
+ - -Wall
+ - -O2
+ cc-options: -static
+ ld-options: -static -pthread
+ extra-lib-dirs: ./lib/
dependencies:
- sumcheck
- servant-server
diff --git a/static/style.css b/static/style.css
index 382da4f..86d1fed 100644
--- a/static/style.css
+++ b/static/style.css
@@ -1,18 +1,18 @@
@font-face {
font-family: EBGaramond;
- src: url(/static/EBGaramond-VariableFont_wght.ttf) format('woff2-variations');
+ src: url(/sumcheck/static/EBGaramond-VariableFont_wght.ttf) format('woff2-variations');
font-style: normal;
}
@font-face {
font-family: EBGaramond;
- src: url(/static/EBGaramond-Italic-VariableFont_wght.ttf) format('woff2-variations');
+ src: url(/sumcheck/static/EBGaramond-Italic-VariableFont_wght.ttf) format('woff2-variations');
font-style: italic;
}
@font-face {
font-family: FiraMono;
- src: url(/static/FiraMono-Regular.ttf);
+ src: url(/sumcheck/static/FiraMono-Regular.ttf);
font-style: normal;
}
diff --git a/sumcheck.cabal b/sumcheck.cabal
index 6c6495b..6e851cb 100644
--- a/sumcheck.cabal
+++ b/sumcheck.cabal
@@ -38,7 +38,11 @@ executable sumcheck-exe
Paths_sumcheck
hs-source-dirs:
app
- ghc-options: -threaded -rtsopts -with-rtsopts=-N
+ ghc-options: -threaded -rtsopts -with-rtsopts=-N -static -Wall -O2
+ cc-options: -static
+ extra-lib-dirs:
+ ./lib/
+ ld-options: -static -pthread
build-depends:
base >=4.7 && <5
, bytestring