Compare commits
7 Commits
frontend
...
1b678e5758
Author | SHA1 | Date | |
---|---|---|---|
1b678e5758 | |||
2a53bbfdbb | |||
5490065604 | |||
f9dbbf8321 | |||
44bc4d8832 | |||
2748efb0e8 | |||
f3004eb020 |
@ -8,5 +8,5 @@ before_script:
|
|||||||
- mkdir -p ~/.config/nixpkgs
|
- mkdir -p ~/.config/nixpkgs
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- nix-build ./release.nix --option trusted-public-keys "masser-ebook-manager.cachix.org-1:mtFSkQ2MO5MvjUpulZoFKjKUIa8g8CTcdPVuJaPKS1w= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" --option binary-caches "https://masser-ebook-manager.cachix.org https://cache.nixos.org" -A ghc.backend -A ghc.frontend
|
- nix-build ./release.nix --option trusted-public-keys "masser-ebook-manager.cachix.org-1:mtFSkQ2MO5MvjUpulZoFKjKUIa8g8CTcdPVuJaPKS1w= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" --option binary-caches "https://cache.nixos.org https://masser-ebook-manager.cachix.org" -A ghc.backend -A ghc.frontend
|
||||||
- nix-build ./release.nix --option trusted-public-keys "masser-ebook-manager.cachix.org-1:mtFSkQ2MO5MvjUpulZoFKjKUIa8g8CTcdPVuJaPKS1w= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" --option binary-caches "https://masser-ebook-manager.cachix.org https://cache.nixos.org" -A ghcjs.frontend
|
- nix-build ./release.nix --option trusted-public-keys "masser-ebook-manager.cachix.org-1:mtFSkQ2MO5MvjUpulZoFKjKUIa8g8CTcdPVuJaPKS1w= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" --option binary-caches "https://cache.nixos.org https://masser-ebook-manager.cachix.org" -A ghcjs.frontend
|
||||||
|
@ -23,7 +23,6 @@ executable backend
|
|||||||
, API.Catalogue
|
, API.Catalogue
|
||||||
, API.Channels
|
, API.Channels
|
||||||
, API.Users
|
, API.Users
|
||||||
, Configuration
|
|
||||||
, Database
|
, Database
|
||||||
, Database.Book
|
, Database.Book
|
||||||
, Database.Channel
|
, Database.Channel
|
||||||
@ -146,4 +145,4 @@ test-suite spec
|
|||||||
default-extensions: DeriveGeneric
|
default-extensions: DeriveGeneric
|
||||||
, NoImplicitPrelude
|
, NoImplicitPrelude
|
||||||
, OverloadedStrings
|
, OverloadedStrings
|
||||||
, RecordWildCards
|
, RecordWildCards
|
@ -1,27 +1,27 @@
|
|||||||
{-# LANGUAGE DataKinds #-}
|
{-# Language DataKinds #-}
|
||||||
{-# LANGUAGE DeriveGeneric #-}
|
{-# Language TypeFamilies #-}
|
||||||
{-# LANGUAGE FlexibleInstances #-}
|
{-# Language TypeOperators #-}
|
||||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
{-# Language NoImplicitPrelude #-}
|
||||||
{-# LANGUAGE NoImplicitPrelude #-}
|
{-# Language MultiParamTypeClasses #-}
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# Language OverloadedStrings #-}
|
||||||
{-# LANGUAGE QuasiQuotes #-}
|
{-# Language TemplateHaskell #-}
|
||||||
{-# LANGUAGE RecordWildCards #-}
|
{-# Language QuasiQuotes #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# Language RecordWildCards #-}
|
||||||
{-# LANGUAGE TypeFamilies #-}
|
{-# Language DeriveGeneric #-}
|
||||||
{-# LANGUAGE TypeOperators #-}
|
{-# Language FlexibleInstances #-}
|
||||||
module API (API, handler) where
|
module API (API, handler) where
|
||||||
|
|
||||||
|
|
||||||
import Servant
|
import Servant
|
||||||
import Servant.HTML.Lucid (HTML)
|
import Servant.HTML.Lucid (HTML)
|
||||||
import Types
|
import Types
|
||||||
|
|
||||||
import View
|
import View
|
||||||
|
|
||||||
import qualified API.Books as Books
|
import qualified API.Users as Users
|
||||||
import qualified API.Catalogue as Catalogue
|
import qualified API.Channels as Channels
|
||||||
import qualified API.Channels as Channels
|
import qualified API.Books as Books
|
||||||
import qualified API.Users as Users
|
import qualified API.Catalogue as Catalogue
|
||||||
|
|
||||||
data Index = Index
|
data Index = Index
|
||||||
|
|
||||||
|
@ -13,10 +13,13 @@ extra-source-files: ChangeLog.md
|
|||||||
cabal-version: >=1.10
|
cabal-version: >=1.10
|
||||||
|
|
||||||
library
|
library
|
||||||
exposed-modules: Data.Versioned
|
exposed-modules: Configuration
|
||||||
|
, Data.Versioned
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
build-depends: base >=4.10
|
build-depends: base >=4.10
|
||||||
, classy-prelude
|
, classy-prelude
|
||||||
|
, dhall
|
||||||
|
, foreign-store
|
||||||
, generic-lens
|
, generic-lens
|
||||||
, lens
|
, lens
|
||||||
, mtl
|
, mtl
|
||||||
@ -29,19 +32,20 @@ library
|
|||||||
, RecordWildCards
|
, RecordWildCards
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
-- test-suite spec
|
test-suite spec
|
||||||
-- type: exitcode-stdio-1.0
|
type: exitcode-stdio-1.0
|
||||||
-- main-is: Spec.hs
|
main-is: Spec.hs
|
||||||
-- hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
-- build-depends: base >=4.10
|
build-depends: base >=4.10
|
||||||
-- , classy-prelude
|
, classy-prelude
|
||||||
-- , foreign-store
|
, dhall
|
||||||
-- , generic-lens
|
, foreign-store
|
||||||
-- , lens
|
, generic-lens
|
||||||
-- , mtl
|
, lens
|
||||||
-- , text
|
, mtl
|
||||||
-- , transformers
|
, text
|
||||||
-- , validity
|
, transformers
|
||||||
-- , genvalidity-hspec
|
, validity
|
||||||
-- , genvalidity-property
|
, genvalidity-hspec
|
||||||
-- , hspec
|
, genvalidity-property
|
||||||
|
, hspec
|
@ -23,4 +23,3 @@ data Config = Config { database :: Pg
|
|||||||
instance Interpret Pg
|
instance Interpret Pg
|
||||||
instance Interpret Store
|
instance Interpret Store
|
||||||
instance Interpret Config
|
instance Interpret Config
|
||||||
|
|
64
default.nix
64
default.nix
@ -1,13 +1,18 @@
|
|||||||
{ nixpkgs, haskellPackages }:
|
{ nixpkgs, haskellPackages }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
jsaddle = nixpkgs.fetchFromGitHub {
|
||||||
|
owner = "ghcjs";
|
||||||
|
repo = "jsaddle";
|
||||||
|
rev = "68208be806c49a2a0c9f037dfac85feae10a8c80";
|
||||||
|
sha256 = "0acj0x716ikfb08ndib36jmwxkwq399lvkip46sfkh1ynn0pvc1c";
|
||||||
|
};
|
||||||
miso = nixpkgs.fetchFromGitHub {
|
miso = nixpkgs.fetchFromGitHub {
|
||||||
owner = "dmjio";
|
owner = "dmjio";
|
||||||
repo = "miso";
|
repo = "miso";
|
||||||
rev = "630e823dd40a434b73124e12b229a79d9fefb01d";
|
rev = "a9c4f0a3a6e7d87f9432dc6cf4b1d0c052bf7ef1";
|
||||||
sha256 = "046gdp3ah2lsipfcy89rh20mn08xbhcgrj549v8zzy69j33xjm2l";
|
sha256 = "1yq5y4vffslm6abnfnggp5m3k6vla6mzcwmhmm23l8yizsvdkwv2";
|
||||||
};
|
};
|
||||||
miso-jsaddle = super: if haskellPackages.ghc.isGhcjs or false then (super.callPackage (miso + "/miso-ghcjs.nix") {}) else (super.callPackage (miso + "/miso-ghc-jsaddle.nix") {});
|
|
||||||
|
|
||||||
dontCheck = nixpkgs.haskell.lib.dontCheck;
|
dontCheck = nixpkgs.haskell.lib.dontCheck;
|
||||||
|
|
||||||
@ -22,38 +27,27 @@ in
|
|||||||
};
|
};
|
||||||
overrides = self: super: {
|
overrides = self: super: {
|
||||||
generic-lens = nixpkgs.haskell.lib.dontCheck super.generic-lens;
|
generic-lens = nixpkgs.haskell.lib.dontCheck super.generic-lens;
|
||||||
miso = miso-jsaddle super;
|
jsaddle-warp = nixpkgs.haskell.lib.dontCheck (super.callPackage (jsaddle + "/jsaddle-warp") {});
|
||||||
# doctest = null; # Not compilable with ghcjs
|
jsaddle = super.callPackage (jsaddle + "/jsaddle") {};
|
||||||
# comonad = dontCheck super.comonad;
|
miso = super.callPackage (miso + "/miso-ghc-jsaddle.nix") {};
|
||||||
# Glob = dontCheck super.Glob;
|
doctest = null; # Not compilable with ghcjs
|
||||||
# SHA = dontCheck super.SHA;
|
comonad = dontCheck super.comonad;
|
||||||
# iproute = dontCheck super.iproute;
|
Glob = dontCheck super.Glob;
|
||||||
# semigroupoids = dontCheck super.semigroupoids;
|
SHA = dontCheck super.SHA;
|
||||||
# wai-app-static = dontCheck super.wai-app-static;
|
iproute = dontCheck super.iproute;
|
||||||
# attoparsec = dontCheck super.attoparsec;
|
semigroupoids = dontCheck super.semigroupoids;
|
||||||
# http-date = dontCheck super.http-date;
|
wai-app-static = dontCheck super.wai-app-static;
|
||||||
# lens = dontCheck super.lens;
|
attoparsec = dontCheck super.attoparsec;
|
||||||
# unix-time = dontCheck super.unix-time;
|
http-date = dontCheck super.http-date;
|
||||||
# http-types = dontCheck super.http-types;
|
lens = dontCheck super.lens;
|
||||||
# servant = dontCheck super.servant;
|
unix-time = dontCheck super.unix-time;
|
||||||
# servant-server = dontCheck super.servant-server;
|
http-types = dontCheck super.http-types;
|
||||||
# servant-auth-docs = dontCheck super.servant-auth-docs;
|
servant = dontCheck super.servant;
|
||||||
# lens-aeson = dontCheck super.lens-aeson;
|
word8 = dontCheck super.word8;
|
||||||
# word8 = dontCheck super.word8;
|
http2 = dontCheck super.http2;
|
||||||
# http2 = dontCheck super.http2;
|
wai-extra = dontCheck super.wai-extra;
|
||||||
# wai-extra = dontCheck super.wai-extra;
|
haskeline = super.callHackage "haskeline" "0.7.3.1" {};
|
||||||
# pgp-wordlist = dontCheck super.pgp-wordlist;
|
terminfo = super.callHackage "terminfo" "0.4.1.1" {};
|
||||||
# prettyprinter = dontCheck super.prettyprinter;
|
|
||||||
# unliftio = dontCheck super.unliftio;
|
|
||||||
# prettyprinter-ansi-terminal = dontCheck super.prettyprinter-ansi-terminal;
|
|
||||||
# distributive = dontCheck super.distributive;
|
|
||||||
# genvalidity-property = dontCheck super.genvalidity-property;
|
|
||||||
# genvalidity-hspec = dontCheck super.genvalidity-hspec;
|
|
||||||
# genvalidity = dontCheck super.genvalidity;
|
|
||||||
# megaparsec = dontCheck super.megaparsec;
|
|
||||||
# ncurses = null;
|
|
||||||
# haskeline = super.callHackage "haskeline" "0.7.4.2" {};
|
|
||||||
# terminfo = super.callHackage "terminfo" "0.4.1.1" {};
|
|
||||||
};
|
};
|
||||||
tools = with haskellPackages; [
|
tools = with haskellPackages; [
|
||||||
ghcid
|
ghcid
|
||||||
|
@ -20,9 +20,9 @@ executable frontend
|
|||||||
-- other-modules:
|
-- other-modules:
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
build-depends: base >=4.11 && <4.12
|
build-depends: base >=4.11 && <4.12
|
||||||
|
, common
|
||||||
, miso
|
, miso
|
||||||
, jsaddle-warp
|
, jsaddle-warp
|
||||||
, mtl
|
, mtl
|
||||||
, common
|
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
16
ghcjs.patch
16
ghcjs.patch
@ -1,16 +0,0 @@
|
|||||||
diff --git a/lib/boot/shims/src/string.js b/lib/boot/shims/src/string.js
|
|
||||||
index d82f75a..f16e55a 100644
|
|
||||||
--- a/lib/boot/shims/src/string.js
|
|
||||||
+++ b/lib/boot/shims/src/string.js
|
|
||||||
@@ -780,11 +780,7 @@ function h$throwJSException(e) {
|
|
||||||
// adding the Exception dictionary
|
|
||||||
var strVal = e.toString() + '\n' + Array.prototype.join.call(e.stack, '\n');
|
|
||||||
var someE = MK_SOMEEXCEPTION(HS_JSEXCEPTION_EXCEPTION,
|
|
||||||
-#ifdef GHCJS_PROF
|
|
||||||
- MK_JSEXCEPTION(MK_JSVAL(e), h$toHsString(strVal), h$CCS_SYSTEM))
|
|
||||||
-#else
|
|
||||||
MK_JSEXCEPTION(MK_JSVAL(e), h$toHsString(strVal))
|
|
||||||
-#endif
|
|
||||||
);
|
|
||||||
return h$throw(someE, true);
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
{ mkDerivation, base, fetchgit, stdenv }:
|
|
||||||
mkDerivation {
|
|
||||||
pname = "jsaddle-warp";
|
|
||||||
version = "0.9.5.0";
|
|
||||||
src = fetchgit {
|
|
||||||
url = "https://github.com/ghcjs/jsaddle.git";
|
|
||||||
rev = "34fe7d61b3f387b81aa748294ac8d993243f53b4";
|
|
||||||
sha256 = "0qdh5qdk23vcp1yp910zgw2hs4zpbx9ig25xgaax0iwj2m1ifh5x";
|
|
||||||
};
|
|
||||||
postUnpack = "sourceRoot+=/jsaddle-warp; echo source root reset to $sourceRoot";
|
|
||||||
libraryHaskellDepends = [ base ];
|
|
||||||
description = "Interface for JavaScript that works with GHCJS and GHC";
|
|
||||||
license = stdenv.lib.licenses.mit;
|
|
||||||
}
|
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"url": "https://github.com/nixos/nixpkgs.git",
|
"url": "https://github.com/nixos/nixpkgs.git",
|
||||||
"rev": "4507926b80c6b8f73053775ffee17f6781c7e7c8",
|
"rev": "e0d250e5cf6d179e1ccc775472d89718f61fcfd1",
|
||||||
"date": "2018-01-08T11:52:28+01:00",
|
"date": "2018-01-08T11:52:28+01:00",
|
||||||
"sha256": "068v9xh7d8klk62p2qwr76fyfqfh1bp08xc12x138g5q6pg6yfzb",
|
"sha256": "1iqpjz4czcpghbv924a5h4jvfmj6c8q6sl3b1z7blz3mi740aivs",
|
||||||
"fetchSubmodules": true
|
"fetchSubmodules": true
|
||||||
}
|
}
|
||||||
|
@ -18,17 +18,12 @@ let
|
|||||||
(self: super: mapAttrs (name: path: self.callCabal2nix name path {}) packages)
|
(self: super: mapAttrs (name: path: self.callCabal2nix name path {}) packages)
|
||||||
overrides
|
overrides
|
||||||
];
|
];
|
||||||
haskellPackages' = haskellPackages.extend overrides';
|
haskellPackages' = haskellPackages.override { overrides = overrides'; };
|
||||||
packages' = mapAttrs (name: _: haskellPackages'."${name}") packages;
|
packages' = mapAttrs (name: _: haskellPackages'."${name}") packages;
|
||||||
mkShell = name: pkg:
|
mkShell = name: pkg:
|
||||||
let
|
let
|
||||||
n = "${name}-shell";
|
n = "${name}-shell";
|
||||||
deps = with haskellPackages'; [
|
deps = haskellPackages'.ghcWithHoogle (pkgs: pkg.buildInputs ++ pkg.propagatedBuildInputs);
|
||||||
ghcid
|
|
||||||
cabal-install
|
|
||||||
hasktags
|
|
||||||
(haskellPackages'.ghcWithHoogle (pkgs: pkg.buildInputs ++ pkg.propagatedBuildInputs))
|
|
||||||
];
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
name = "${n}";
|
name = "${n}";
|
||||||
|
60
release.nix
60
release.nix
@ -2,71 +2,17 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
jsaddle = nixpkgs.fetchFromGitHub {
|
|
||||||
owner = "ghcjs";
|
|
||||||
repo = "jsaddle";
|
|
||||||
rev = "34fe7d61b3f387b81aa748294ac8d993243f53b4";
|
|
||||||
sha256 = "0qdh5qdk23vcp1yp910zgw2hs4zpbx9ig25xgaax0iwj2m1ifh5x";
|
|
||||||
};
|
|
||||||
config = {
|
|
||||||
packageOverrides = pkgs: with pkgs.haskell.lib; with pkgs.lib; {
|
|
||||||
haskell = pkgs.haskell // {
|
|
||||||
packages = pkgs.haskell.packages // {
|
|
||||||
ghccustom = pkgs.haskell.packages.ghc843.override {
|
|
||||||
overrides = self: super: {
|
|
||||||
jsaddle-warp = dontCheck (super.callPackage (jsaddle + "/jsaddle-warp") {});
|
|
||||||
# jsaddle-warp = super.callPackage ./jsaddle-warp-ghcjs.nix {};
|
|
||||||
jsaddle = dontCheck (super.callPackage (jsaddle + "/jsaddle") {});
|
|
||||||
};
|
|
||||||
};
|
|
||||||
ghcjscustom = pkgs.haskell.packages.ghcjs84.override {
|
|
||||||
overrides = self: super: {
|
|
||||||
doctest = null;
|
|
||||||
comonad = dontCheck (super.comonad);
|
|
||||||
classy-prelude = dontCheck (super.classy-prelude);
|
|
||||||
unliftio = dontCheck (super.unliftio);
|
|
||||||
semigroupoids = dontCheck (super.semigroupoids);
|
|
||||||
lens = dontCheck (super.lens);
|
|
||||||
directory-tree = dontCheck (super.directory-tree);
|
|
||||||
http-types = dontCheck (super.http-types);
|
|
||||||
tasty-quickcheck = dontCheck (super.tasty-quickcheck);
|
|
||||||
scientific = dontCheck (super.scientific);
|
|
||||||
servant = dontCheck (super.servant);
|
|
||||||
jsaddle-warp = super.callPackage ./jsaddle-warp-ghcjs.nix {};
|
|
||||||
ghc = overrideDerivation (super.ghc.override {
|
|
||||||
ghcjsSrc = pkgs.fetchgit {
|
|
||||||
url = "https://github.com/ghcjs/ghcjs.git";
|
|
||||||
rev = "dc190b1bb2453cfa484124e9f335ee3cad1492f7";
|
|
||||||
sha256 = "0dh52gj0f3700zfyrhisy44b6y9p1bsawwrmd5pllpdyw21zd9lw";
|
|
||||||
fetchSubmodules = true;
|
|
||||||
};
|
|
||||||
}) (drv: { patches = (drv.patches or []) ++ [ ./ghcjs.patch ]; });
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
pinnedVersion = nixpkgs.lib.importJSON ./nixpkgs-version.json;
|
pinnedVersion = nixpkgs.lib.importJSON ./nixpkgs-version.json;
|
||||||
pinnedPkgs = import (nixpkgs.fetchFromGitHub {
|
pinnedPkgs = import (nixpkgs.fetchFromGitHub {
|
||||||
owner = "NixOS";
|
owner = "NixOS";
|
||||||
repo = "nixpkgs";
|
repo = "nixpkgs";
|
||||||
inherit (pinnedVersion) rev sha256;
|
inherit (pinnedVersion) rev sha256;
|
||||||
}) { inherit config; };
|
}) {};
|
||||||
ghc = import ./default.nix { nixpkgs = pinnedPkgs; haskellPackages = pinnedPkgs.haskell.packages.ghccustom; };
|
|
||||||
ghcjs = import ./default.nix { nixpkgs = pinnedPkgs; haskellPackages = pinnedPkgs.haskell.packages.ghcjscustom; };
|
|
||||||
inherit (pinnedPkgs) pkgs;
|
inherit (pinnedPkgs) pkgs;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
inherit ghc ghcjs;
|
ghc = import ./default.nix { nixpkgs = pinnedPkgs; haskellPackages = pinnedPkgs.haskell.packages.ghc843; };
|
||||||
deps = pkgs.buildEnv {
|
ghcjs = import ./default.nix { nixpkgs = pinnedPkgs; haskellPackages = pinnedPkgs.haskell.packages.ghcjs84; };
|
||||||
name = "deps";
|
|
||||||
paths = [
|
|
||||||
(pkgs.haskell.packages.ghccustom.ghcWithPackages (_: ghc.backend.buildInputs ++ ghc.backend.propagatedBuildInputs))
|
|
||||||
(pkgs.haskell.packages.ghcjscustom.ghcWithPackages (_: ghcjs.frontend.buildInputs ++ ghcjs.frontend.propagatedBuildInputs))
|
|
||||||
];
|
|
||||||
buildInputs = [ ];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user