mirror of
https://github.com/unclechu/gRPC-haskell.git
synced 2024-11-23 03:29:42 +01:00
Support building with GHC 8.4.x
This commit is contained in:
parent
28288a17b7
commit
306838d6ff
12 changed files with 131 additions and 103 deletions
|
@ -1,60 +0,0 @@
|
||||||
{ rev # The Git revision of nixpkgs to fetch
|
|
||||||
, sha256 # The SHA256 of the downloaded data
|
|
||||||
, outputSha256 ? null # The SHA256 output hash
|
|
||||||
, system ? builtins.currentSystem # This is overridable if necessary
|
|
||||||
}:
|
|
||||||
|
|
||||||
with {
|
|
||||||
ifThenElse = { bool, thenValue, elseValue }: (
|
|
||||||
if bool then thenValue else elseValue);
|
|
||||||
};
|
|
||||||
|
|
||||||
ifThenElse {
|
|
||||||
bool = (0 <= builtins.compareVersions builtins.nixVersion "1.12");
|
|
||||||
|
|
||||||
# In Nix 1.12, we can just give a `sha256` to `builtins.fetchTarball`.
|
|
||||||
thenValue = (
|
|
||||||
builtins.fetchTarball {
|
|
||||||
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
|
|
||||||
|
|
||||||
# builtins.fetchTarball does not need the sha256 hash of the
|
|
||||||
# packed and compressed tarball but it _does_ need the
|
|
||||||
# fixed-output sha256 hash.
|
|
||||||
sha256 = outputSha256;
|
|
||||||
});
|
|
||||||
|
|
||||||
# This hack should at least work for Nix 1.11
|
|
||||||
elseValue = (
|
|
||||||
(rec {
|
|
||||||
tarball = import <nix/fetchurl.nix> {
|
|
||||||
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
|
|
||||||
inherit sha256;
|
|
||||||
};
|
|
||||||
|
|
||||||
builtin-paths = import <nix/config.nix>;
|
|
||||||
|
|
||||||
script = builtins.toFile "nixpkgs-unpacker" ''
|
|
||||||
"$coreutils/mkdir" "$out"
|
|
||||||
cd "$out"
|
|
||||||
"$gzip" --decompress < "$tarball" | "$tar" -x --strip-components=1
|
|
||||||
'';
|
|
||||||
|
|
||||||
nixpkgs = builtins.derivation ({
|
|
||||||
name = "nixpkgs-${builtins.substring 0 6 rev}";
|
|
||||||
|
|
||||||
builder = builtins.storePath builtin-paths.shell;
|
|
||||||
|
|
||||||
args = [ script ];
|
|
||||||
|
|
||||||
inherit tarball system;
|
|
||||||
|
|
||||||
tar = builtins.storePath builtin-paths.tar;
|
|
||||||
gzip = builtins.storePath builtin-paths.gzip;
|
|
||||||
coreutils = builtins.storePath builtin-paths.coreutils;
|
|
||||||
} // (if null == outputSha256 then { } else {
|
|
||||||
outputHashMode = "recursive";
|
|
||||||
outputHashAlgo = "sha256";
|
|
||||||
outputHash = outputSha256;
|
|
||||||
}));
|
|
||||||
}).nixpkgs);
|
|
||||||
}
|
|
|
@ -199,7 +199,7 @@ test-suite tests
|
||||||
, transformers
|
, transformers
|
||||||
, safe
|
, safe
|
||||||
, clock >=0.6.0 && <0.8.0
|
, clock >=0.6.0 && <0.8.0
|
||||||
, turtle >= 1.2.0
|
, turtle >= 1.5.0
|
||||||
, text
|
, text
|
||||||
, QuickCheck >=2.8 && <3.0
|
, QuickCheck >=2.8 && <3.0
|
||||||
other-modules:
|
other-modules:
|
||||||
|
|
14
nix/base-compat-batteries.nix
Normal file
14
nix/base-compat-batteries.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{ mkDerivation, base, base-compat, bifunctors, contravariant, hspec
|
||||||
|
, QuickCheck, stdenv
|
||||||
|
}:
|
||||||
|
mkDerivation {
|
||||||
|
pname = "base-compat-batteries";
|
||||||
|
version = "0.10.5";
|
||||||
|
sha256 = "175dcfd1453bd02ec955c05181cbf4278af145183b5899c62d3be29d866170ee";
|
||||||
|
libraryHaskellDepends = [
|
||||||
|
base base-compat bifunctors contravariant
|
||||||
|
];
|
||||||
|
testHaskellDepends = [ base hspec QuickCheck ];
|
||||||
|
description = "base-compat with extra batteries";
|
||||||
|
license = stdenv.lib.licenses.mit;
|
||||||
|
}
|
9
nix/base-compat.nix
Normal file
9
nix/base-compat.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{ mkDerivation, base, stdenv, unix }:
|
||||||
|
mkDerivation {
|
||||||
|
pname = "base-compat";
|
||||||
|
version = "0.10.5";
|
||||||
|
sha256 = "990aea21568956d44ab018c5dbfbaea014b9a0d5295d29ca7550149419a6fb41";
|
||||||
|
libraryHaskellDepends = [ base unix ];
|
||||||
|
description = "A compatibility layer for base";
|
||||||
|
license = stdenv.lib.licenses.mit;
|
||||||
|
}
|
10
nix/contravariant.nix
Normal file
10
nix/contravariant.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{ mkDerivation, base, StateVar, stdenv, transformers }:
|
||||||
|
mkDerivation {
|
||||||
|
pname = "contravariant";
|
||||||
|
version = "1.5";
|
||||||
|
sha256 = "6ef067b692ad69ffff294b953aa85f3ded459d4ae133c37896222a09280fc3c2";
|
||||||
|
libraryHaskellDepends = [ base StateVar transformers ];
|
||||||
|
homepage = "http://github.com/ekmett/contravariant/";
|
||||||
|
description = "Contravariant functors";
|
||||||
|
license = stdenv.lib.licenses.bsd3;
|
||||||
|
}
|
49
nix/fetchNixpkgs.nix
Normal file
49
nix/fetchNixpkgs.nix
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{ rev # The Git revision of nixpkgs to fetch
|
||||||
|
, sha256 # The SHA256 of the downloaded data
|
||||||
|
, outputSha256 ? null # The SHA256 fixed-output hash
|
||||||
|
, system ? builtins.currentSystem # This is overridable if necessary
|
||||||
|
}:
|
||||||
|
|
||||||
|
if (0 <= builtins.compareVersions builtins.nixVersion "1.12")
|
||||||
|
|
||||||
|
# In Nix 1.12, we can just give a `sha256` to `builtins.fetchTarball`.
|
||||||
|
then (
|
||||||
|
builtins.fetchTarball {
|
||||||
|
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
|
||||||
|
sha256 = outputSha256;
|
||||||
|
})
|
||||||
|
|
||||||
|
# This hack should at least work for Nix 1.11
|
||||||
|
else (
|
||||||
|
(rec {
|
||||||
|
tarball = import <nix/fetchurl.nix> {
|
||||||
|
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
|
||||||
|
inherit sha256;
|
||||||
|
};
|
||||||
|
|
||||||
|
builtin-paths = import <nix/config.nix>;
|
||||||
|
|
||||||
|
script = builtins.toFile "nixpkgs-unpacker" ''
|
||||||
|
"$coreutils/mkdir" "$out"
|
||||||
|
cd "$out"
|
||||||
|
"$gzip" --decompress < "$tarball" | "$tar" -x --strip-components=1
|
||||||
|
'';
|
||||||
|
|
||||||
|
nixpkgs = builtins.derivation ({
|
||||||
|
name = "nixpkgs-${builtins.substring 0 6 rev}";
|
||||||
|
|
||||||
|
builder = builtins.storePath builtin-paths.shell;
|
||||||
|
|
||||||
|
args = [ script ];
|
||||||
|
|
||||||
|
inherit tarball system;
|
||||||
|
|
||||||
|
tar = builtins.storePath builtin-paths.tar;
|
||||||
|
gzip = builtins.storePath builtin-paths.gzip;
|
||||||
|
coreutils = builtins.storePath builtin-paths.coreutils;
|
||||||
|
} // (if null == outputSha256 then { } else {
|
||||||
|
outputHashMode = "recursive";
|
||||||
|
outputHashAlgo = "sha256";
|
||||||
|
outputHash = outputSha256;
|
||||||
|
}));
|
||||||
|
}).nixpkgs)
|
|
@ -3,8 +3,8 @@
|
||||||
}:
|
}:
|
||||||
mkDerivation {
|
mkDerivation {
|
||||||
pname = "optparse-applicative";
|
pname = "optparse-applicative";
|
||||||
version = "0.14.0.0";
|
version = "0.14.3.0";
|
||||||
sha256 = "06iwp1qsq0gjhnhxwyhdhldwvhlgcik6lx5jxpbb40fispyk4nxm";
|
sha256 = "72476302fe555a508917b2d7d6121c7b58ea5434cdc08aeb5d4b652e8f0e7663";
|
||||||
libraryHaskellDepends = [
|
libraryHaskellDepends = [
|
||||||
ansi-wl-pprint base process transformers transformers-compat
|
ansi-wl-pprint base process transformers transformers-compat
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
{ mkDerivation, base, bytestring, optparse-applicative, semigroups
|
{ mkDerivation, base, bytestring, Only, optparse-applicative
|
||||||
, stdenv, system-filepath, text, time, transformers, void
|
, semigroups, stdenv, system-filepath, text, time, transformers
|
||||||
|
, void
|
||||||
}:
|
}:
|
||||||
mkDerivation {
|
mkDerivation {
|
||||||
pname = "optparse-generic";
|
pname = "optparse-generic";
|
||||||
version = "1.2.1";
|
version = "1.3.0";
|
||||||
sha256 = "1dk945dp98mwk1v4y0cky3z0ngmd29nbg6fbaaxnigcrgpbvkjml";
|
sha256 = "80929958606e4a73672b570ba1a23493fbf46268666d14ab5af53623301c398f";
|
||||||
libraryHaskellDepends = [
|
libraryHaskellDepends = [
|
||||||
base bytestring optparse-applicative semigroups system-filepath
|
base bytestring Only optparse-applicative semigroups
|
||||||
text time transformers void
|
system-filepath text time transformers void
|
||||||
];
|
];
|
||||||
description = "Auto-generate a command-line parser for your datatype";
|
description = "Auto-generate a command-line parser for your datatype";
|
||||||
license = stdenv.lib.licenses.bsd3;
|
license = stdenv.lib.licenses.bsd3;
|
||||||
|
|
|
@ -6,9 +6,9 @@ mkDerivation {
|
||||||
pname = "proto3-wire";
|
pname = "proto3-wire";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "https://github.com/awakenetworks/proto3-wire.git";
|
url = "git@github.com:awakesecurity/proto3-wire.git";
|
||||||
sha256 = "14n0d16an782ayipirm5v2mvp58jgf65xvffqzp08p50sksil3gi";
|
sha256 = "1ps1lijjbwzps2axr94r4k9c6cw9c9s5cy2izf2867hgavxrjs6k";
|
||||||
rev = "a938330bf794cf3fa05591d03906915df98d157c";
|
rev = "4f715b29031566878333d81ff0845be766a5d381";
|
||||||
};
|
};
|
||||||
libraryHaskellDepends = [
|
libraryHaskellDepends = [
|
||||||
base bytestring cereal containers deepseq hashable QuickCheck safe
|
base bytestring cereal containers deepseq hashable QuickCheck safe
|
||||||
|
|
|
@ -1,25 +1,29 @@
|
||||||
{ mkDerivation, aeson, aeson-qq, base, base-compat, bytestring
|
{ mkDerivation, aeson, base, base-compat-batteries, bytestring
|
||||||
, Cabal, cabal-doctest, containers, doctest, generics-sop, Glob
|
, Cabal, cabal-doctest, containers, doctest, generics-sop, Glob
|
||||||
, hashable, hspec, http-media, HUnit, insert-ordered-containers
|
, hashable, hspec, http-media, HUnit, insert-ordered-containers
|
||||||
, lens, mtl, network, QuickCheck, scientific, stdenv
|
, lens, mtl, network, QuickCheck, quickcheck-instances, scientific
|
||||||
, template-haskell, text, time, transformers, transformers-compat
|
, stdenv, template-haskell, text, time, transformers
|
||||||
, unordered-containers, uuid-types, vector
|
, transformers-compat, unordered-containers, utf8-string
|
||||||
|
, uuid-types, vector
|
||||||
}:
|
}:
|
||||||
mkDerivation {
|
mkDerivation {
|
||||||
pname = "swagger2";
|
pname = "swagger2";
|
||||||
version = "2.1.6";
|
version = "2.3.0.1";
|
||||||
sha256 = "01a29h56vfyw0ilij1pn6qwy50ca90kyj884vs1q52vvh572758j";
|
sha256 = "2ee44e05a953c5a25f0e948a89bfdac9940550a31c29fbf2c0135178c58e17d1";
|
||||||
|
revision = "2";
|
||||||
|
editedCabalFile = "0dfxf47mzzb5rmln2smsk0qx53kj1lc3a087r52g2rzz6971zivb";
|
||||||
setupHaskellDepends = [ base Cabal cabal-doctest ];
|
setupHaskellDepends = [ base Cabal cabal-doctest ];
|
||||||
libraryHaskellDepends = [
|
libraryHaskellDepends = [
|
||||||
aeson base base-compat bytestring containers generics-sop hashable
|
aeson base base-compat-batteries bytestring containers generics-sop
|
||||||
http-media insert-ordered-containers lens mtl network scientific
|
hashable http-media insert-ordered-containers lens mtl network
|
||||||
template-haskell text time transformers transformers-compat
|
scientific template-haskell text time transformers
|
||||||
unordered-containers uuid-types vector
|
transformers-compat unordered-containers uuid-types vector
|
||||||
];
|
];
|
||||||
testHaskellDepends = [
|
testHaskellDepends = [
|
||||||
aeson aeson-qq base base-compat bytestring containers doctest Glob
|
aeson base base-compat-batteries bytestring containers doctest Glob
|
||||||
hashable hspec HUnit insert-ordered-containers lens mtl QuickCheck
|
hashable hspec HUnit insert-ordered-containers lens mtl QuickCheck
|
||||||
text time unordered-containers vector
|
quickcheck-instances template-haskell text time
|
||||||
|
unordered-containers utf8-string vector
|
||||||
];
|
];
|
||||||
homepage = "https://github.com/GetShopTV/swagger2";
|
homepage = "https://github.com/GetShopTV/swagger2";
|
||||||
description = "Swagger 2.0 data model";
|
description = "Swagger 2.0 data model";
|
||||||
|
|
38
release.nix
38
release.nix
|
@ -58,13 +58,24 @@
|
||||||
# run:
|
# run:
|
||||||
#
|
#
|
||||||
# $ cabal2nix path/to/dependency/repo > nix/${package-name}.nix
|
# $ cabal2nix path/to/dependency/repo > nix/${package-name}.nix
|
||||||
|
|
||||||
let
|
let
|
||||||
nixpkgs = import ./nixpkgs.nix;
|
fetchNixpkgs = import ./nix/fetchNixpkgs.nix;
|
||||||
|
|
||||||
|
nixpkgs = fetchNixpkgs {
|
||||||
|
rev = "a8ff2616603a6ff6bfb060368c12a973c8e007f6";
|
||||||
|
sha256 = "15l57ra62w9imqv3cfx9qp1fag3mqp95x0hdh81cqjb663qxihlg";
|
||||||
|
outputSha256 = "1nkpbwdx1jgr2pv5arllk6k56h3xc61jal7qi66g21qsx6daf0g3";
|
||||||
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
packageOverrides = pkgs: rec {
|
packageOverrides = pkgs: rec {
|
||||||
protobuf3_2NoCheck =
|
protobuf3_2NoCheck =
|
||||||
pkgs.stdenv.lib.overrideDerivation
|
pkgs.stdenv.lib.overrideDerivation
|
||||||
pkgs.pythonPackages.protobuf3_2
|
(pkgs.pythonPackages.callPackage "${nixpkgs}/pkgs/development/python-modules/protobuf" {
|
||||||
|
disabled = false;
|
||||||
|
protobuf = pkgs.protobuf3_4;
|
||||||
|
})
|
||||||
(oldAttrs : {doCheck = false; doInstallCheck = false;});
|
(oldAttrs : {doCheck = false; doInstallCheck = false;});
|
||||||
|
|
||||||
cython = pkgs.pythonPackages.buildPythonPackage rec {
|
cython = pkgs.pythonPackages.buildPythonPackage rec {
|
||||||
|
@ -189,21 +200,15 @@ let
|
||||||
|
|
||||||
haskellPackages = pkgs.haskellPackages.override {
|
haskellPackages = pkgs.haskellPackages.override {
|
||||||
overrides = haskellPackagesNew: haskellPackagesOld: rec {
|
overrides = haskellPackagesNew: haskellPackagesOld: rec {
|
||||||
aeson =
|
|
||||||
pkgs.haskell.lib.dontCheck
|
|
||||||
(haskellPackagesNew.callPackage ./nix/aeson.nix {});
|
|
||||||
|
|
||||||
cabal-doctest =
|
base-compat-batteries =
|
||||||
haskellPackagesNew.callPackage ./nix/cabal-doctest.nix { };
|
haskellPackagesNew.callPackage ./nix/base-compat-batteries.nix { };
|
||||||
|
|
||||||
insert-ordered-containers =
|
base-compat =
|
||||||
haskellPackagesNew.callPackage ./nix/insert-ordered-containers.nix { };
|
haskellPackagesNew.callPackage ./nix/base-compat.nix { };
|
||||||
|
|
||||||
optparse-applicative =
|
contravariant =
|
||||||
haskellPackagesNew.callPackage ./nix/optparse-applicative.nix { };
|
haskellPackagesNew.callPackage ./nix/contravariant.nix { };
|
||||||
|
|
||||||
optparse-generic =
|
|
||||||
haskellPackagesNew.callPackage ./nix/optparse-generic.nix { };
|
|
||||||
|
|
||||||
proto3-wire =
|
proto3-wire =
|
||||||
haskellPackagesNew.callPackage ./nix/proto3-wire.nix { };
|
haskellPackagesNew.callPackage ./nix/proto3-wire.nix { };
|
||||||
|
@ -240,7 +245,6 @@ let
|
||||||
]);
|
]);
|
||||||
|
|
||||||
python = pkgs.python.withPackages (pkgs: [
|
python = pkgs.python.withPackages (pkgs: [
|
||||||
# pkgs.protobuf3_0
|
|
||||||
grpcio-tools
|
grpcio-tools
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -290,10 +294,6 @@ let
|
||||||
|
|
||||||
swagger2 =
|
swagger2 =
|
||||||
pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.dontHaddock (haskellPackagesNew.callPackage ./nix/swagger2.nix { }));
|
pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.dontHaddock (haskellPackagesNew.callPackage ./nix/swagger2.nix { }));
|
||||||
|
|
||||||
turtle =
|
|
||||||
haskellPackagesNew.callPackage ./nix/turtle.nix { };
|
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
1
shell.nix
Normal file
1
shell.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(import ./release.nix).grpc-haskell.env
|
Loading…
Reference in a new issue