blob: 7f6e8978588cc6e05de89d4daf4da57123719f14 (
plain)
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
|
{ buildGoModule, pkgs, fetchFromGitHub }:
with import <nixpkgs> {}; # bring all of Nixpkgs into scope
# stdenv.mkDerivation rec {
buildGoModule rec {
pname = "zeit";
version = "0.0.7";
src = fetchFromGitHub {
owner = "mrusme";
repo = "zeit";
rev = "v0.0.7";
sha256 = "SCBNMgFBmyeJHC8VU1K2zDhhvdYi9RqaKIcJ4ziKNa0=";
};
vendorHash = "sha256-gn5fwwBO4eUUYG1PJD7o8xS+tZO+P5M33fVvg2NDANw=";
# meta = with stdenv.lib; {
# description = "";
# homepage = "";
# license = licenses.gpl;
# maintainers = with maintainers; [];
# platforms = [];
# };
nativeBuildInputs = with pkgs.buildPackages; [ go ];
buildInputs = [ ];
patchPhase = ''
sed -i 's/VERSION=0.0/VERSION=${version}/g' Makefile
'';
buildPhase = ''
# gcc program.c -o myprogram
# PREFIX=$out
make
# go build -ldflags "-X github.com/mrusme/zeit/z.VERSION=$(version)"
'';
installPhase = ''
mkdir -p $out/bin
cp zeit $out/bin
'';
}
|