Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it build with latest nixpkgs #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Broch/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Data.ByteArray.Encoding
import Data.ByteString (ByteString)
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Char8 as B
import qualified Data.HashMap.Strict as HM
import Data.Int (Int64)
import Data.List (intersect, (\\))
import qualified Data.Map.Strict as Map
Expand Down Expand Up @@ -46,7 +45,7 @@ import Broch.Server.Config
import Broch.Server.Internal
import Broch.Token
import Broch.URI

import qualified Data.Aeson.KeyMap as HM

userIdKey :: ByteString
userIdKey = "_uid"
Expand Down
2 changes: 1 addition & 1 deletion broch.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Library
Other-Modules: Broch.Scim
, Broch.Server.BlazeUI
Build-Depends: base >= 4.9 && < 5
, aeson >= 0.8.1.0
, aeson >= 2.0.0.0
, errors >= 2
, blaze-builder >= 0.3
, blaze-html >= 0.7
Expand Down
36 changes: 0 additions & 36 deletions broch.nix

This file was deleted.

20 changes: 18 additions & 2 deletions release.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
{ compiler ? "default" }:

let
pkgs = import <nixpkgs> {};
rev = "a790b646e0634695782876f45d98f93c38ceae1d";
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
pkgs = import (builtins.fetchTarball url) {};
dontCheck = pkgs.haskell.lib.dontCheck;
ignore =
let
owner = "hercules-ci";
repo = "gitignore";
rev = "c4662e662462e7bf3c2a968483478a665d00e717";
in
import (builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
sha256 = "sha256:1npnx0h6bd0d7ql93ka7azhj40zgjp815fw2r6smg8ch9p7mzdlx";
}) { inherit (pkgs) lib; };

hPkgs = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};

src = ignore.gitignoreSource ./.;
lib = pkgs.haskell.lib;
haskellPkgs = hPkgs.extend (self: super: {
broch = self.callPackage ./broch.nix {};
jose-jwt = lib.markUnbroken super.jose-jwt;
broch = self.callCabal2nix "broch" src {};
});
in
{
Expand Down
5 changes: 3 additions & 2 deletions tests/WaiTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Data.ByteArray.Encoding
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy as BL
import qualified Data.HashMap.Strict as H
import qualified Data.Aeson.KeyMap as H
import qualified Data.List as DL
import qualified Data.Map as M
import Data.Maybe (fromMaybe)
Expand All @@ -29,6 +29,7 @@ import Network.Wai.Internal
import Network.Wai.Test hiding (request)
import qualified Test.HUnit as HUnit
import qualified Web.Cookie as C
import Data.Aeson.Key

-- This code is influenced by yesod-test, but for plain Wai requests.
-- The wai-test module by itself only supports simple request testing,
Expand Down Expand Up @@ -166,7 +167,7 @@ jsonBody = do
Success a -> return a
_ -> error "Failed to decode JSON"

jsonField :: Text -> WaiTest Text
jsonField :: Key -> WaiTest Text
jsonField name = do
Object jsn <- jsonContent
case H.lookup name jsn of
Expand Down