This repository has been archived by the owner on Sep 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
elmi-to-json.nix
63 lines (56 loc) · 1.89 KB
/
elmi-to-json.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{ pkgs ? import <nixpkgs> {}, compiler ? "ghc864" }:
let
version = "0.19.4";
cabalPkg =
{ mkDerivation, aeson, async, base, binary, bytestring, containers
, directory, filepath, hpack, optparse-applicative, safe-exceptions
, stdenv, text
}:
mkDerivation {
pname = "elmi-to-json";
version = version;
src = pkgs.fetchFromGitHub {
owner = "stoeffel";
repo = "elmi-to-json";
rev = version;
sha256 = "1hcggk4p3slhmfhzi6ah1h1jap34kiidbbf92jr4b7i0rwv1s18r";
};
patches = [ ./patches/elmi-to-json.patch ];
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson async base binary bytestring containers directory filepath
optparse-applicative safe-exceptions text
];
libraryToolDepends = [ hpack ];
executableHaskellDepends = [ base ];
testHaskellDepends = [ base ];
preConfigure = "hpack";
homepage = "https://github.com/stoeffel/elmi-to-json#readme";
license = stdenv.lib.licenses.bsd3;
};
blob = with pkgs;
stdenv.mkDerivation {
name = "elmi-to-json-${version}";
inherit version;
src =
if stdenv.isDarwin then
fetchurl {
url = "https://github.com/stoeffel/elmi-to-json/releases/download/${version}/elmi-to-json-${version}-osx.tar.gz";
sha256 = "1l0ny081lr3lvndcqfzrgznz9xajarjbihiwbf4hvb13bg3ngbj3";
}
else
fetchurl {
url = "https://github.com/stoeffel/elmi-to-json/releases/download/${version}/elmi-to-json-${version}-linux.tar.gz";
sha256 = "1gccza38wfgyyhpb98710lwam85v1a3wnzjsbpkihs6cvwkwyj32";
};
unpackPhase = ''
mkdir -p $out/bin
tar xf $src -C $out/bin
'';
dontInstall = true;
};
in {
inherit blob;
fromSource = pkgs.haskell.packages.${compiler}.callPackage cabalPkg {};
}