forked from zedapp/zed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
50 lines (49 loc) · 1.28 KB
/
default.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
{ pkgs ? import <nixpkgs> {}
, stdenv ? pkgs.stdenv
}:
let
gopkg = { name, rootPackagePath, src }:
stdenv.mkDerivation {
inherit name src;
installPhase = ''
mkdir -p $out/src/${rootPackagePath}
cp -r * $out/src/${rootPackagePath}/
'';
};
websocket = gopkg {
name = "go.net";
rootPackagePath = "code.google.com/p/go.net";
src = pkgs.fetchhg {
url = https://code.google.com/p/go.net;
tag = "bc411e2ac33f";
};
};
gcfg = gopkg {
name = "gcfg";
rootPackagePath = "code.google.com/p/gcfg";
src = pkgs.fetchgit {
url = https://code.google.com/p/gcfg/;
rev = "4bedf9880f04908ce2c654950503e40563291f52";
};
};
uuid = gopkg {
name = "uuid";
rootPackagePath = "code.google.com/p/go-uuid";
src = pkgs.fetchhg {
url = https://code.google.com/p/go-uuid/;
tag = "5fac954758f5";
};
};
in stdenv.mkDerivation {
name = "zed-0.3";
src = ./.;
buildInputs = [ pkgs.go ];
GOPATH = "${websocket}:${gcfg}:${uuid}";
buildPhase = ''
go build
'';
installPhase = ''
mkdir -p $out/bin
cp zed $out/bin/
'';
}