-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgodoc.nix
More file actions
54 lines (45 loc) · 1.24 KB
/
godoc.nix
File metadata and controls
54 lines (45 loc) · 1.24 KB
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
{ pkgs }:
let
name = "godocdown";
version = "0.0.1";
description = "Go Doc Writer";
in
pkgs.stdenvNoCC.mkDerivation {
pname = name;
inherit version;
src = pkgs.fetchgit {
url = "https://github.com/robertkrimen/godocdown";
rev = "refs/heads/master";
sha256 = "sha256-5gGun9CTvI3VNsMudJ6zjrViy6Zk00NuJ4pZJbzY/Uk=";
};
nativeBuildInputs = with pkgs; [
go
];
buildPhase = ''
runHook preBuild
# Set up GOPATH and cache for legacy Go project
export GOPATH=$TMPDIR/go
export GOCACHE=$TMPDIR/go-cache
export GO111MODULE=off
mkdir -p $GOPATH/src/github.com/robertkrimen
mkdir -p $GOCACHE
cp -r $src $GOPATH/src/github.com/robertkrimen/godocdown
chmod -R +w $GOPATH/src/github.com/robertkrimen/godocdown
cd $GOPATH/src/github.com/robertkrimen/godocdown/godocdown
go build -o $TMPDIR/godocdown-bin .
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp $TMPDIR/godocdown-bin $out/bin/godocdown
runHook postInstall
'';
meta = with pkgs.lib; {
inherit description;
homepage = "https://github.com/robertkrimen/godocdown";
platforms = platforms.unix;
maintainers = [ ];
license = licenses.mit;
};
}