git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #39684 from Ma27/fix-notary

notary: fix build

commit69d4bdc55788efb3a34a831cf341e5e69484fadc authorxeji <36407913+xeji@users.noreply.github.com> dateMon 30 Apr 2018, 10:47 (9 years ago) parentfd8dcdf6a32965
2 files changed+36−11
pkgs/tools/security/notary/default.nix+21−11 pkgs/tools/security/notary/no-git-usage.patch+15
pkgs/tools/security/notary/default.nix+21−11
@@ -1,32 +1,42 @@
1−{ stdenv, fetchFromGitHub, buildGoPackage, git, libtool }:
1+{ stdenv, fetchFromGitHub, buildGoPackage, libtool }:
22
33buildGoPackage rec {
44 name = "notary-${version}";
5− version = "0.6.0";
6− gitcommit = "34f53ad";
5+ version = "0.6.1";
6+ gitcommit = "d6e1431f";
77
88 src = fetchFromGitHub {
99 owner = "theupdateframework";
1010 repo = "notary";
1111 rev = "v${version}";
12− sha256 = "0lg7ab2agkk3rnladcvpdzk8cnf3m49qfm4sanh7yjvlvlv1wm4a";
12+ sha256 = "1ak9dk6vjny5069hp3w36dbjawcnaq82l3i2qvf7mn7zfglbsnf9";
1313 };
1414
15− buildInputs = [ libtool ];
16−
17− goPackagePath = "github.com/theupdateframework/notary";
15+ patches = [ ./no-git-usage.patch ];
1816
17+ buildInputs = [ libtool ];
1918 buildPhase = ''
19+ runHook preBuild
2020 cd go/src/github.com/theupdateframework/notary
21− make GITCOMMIT=${gitcommit} GITUNTRACKEDCHANGES= client
21+ make client GITCOMMIT=${gitcommit}
22+ runHook postBuild
2223 '';
2324
25+ goPackagePath = "github.com/theupdateframework/notary";
26+
2427 installPhase = ''
28+ runHook preInstall
2529 install -D bin/notary $bin/bin/notary
30+ runHook postInstall
31+ '';
32+
33+ doCheck = true;
34+ checkPhase = ''
35+ make test PKGS=github.com/theupdateframework/notary/cmd/notary
2636 '';
2737
2838 meta = with stdenv.lib; {
29− description = " Notary is a project that allows anyone to have trust over arbitrary collections of data";
39+ description = "Notary is a project that allows anyone to have trust over arbitrary collections of data";
3040 longDescription = ''
3141 The Notary project comprises a server and a client for running and
3242 interacting with trusted collections. See the service architecture
@@ -49,7 +59,7 @@ buildGoPackage rec {
4959 '';
5060 license = licenses.asl20;
5161 homepage = https://github.com/theupdateframework/notary;
52− maintainers = with maintainers; [ vdemeester ];
53− platforms = with platforms; unix;
62+ maintainers = with maintainers; [ vdemeester ma27 ];
63+ platforms = platforms.unix;
5464 };
5565}
pkgs/tools/security/notary/no-git-usage.patchnew file+15
@@ -0,0 +1,15 @@
1+diff --git a/Makefile b/Makefile
2+index ab794165..0cbd047f 100644
3+--- a/Makefile
4++++ b/Makefile
5+@@ -5,8 +5,8 @@ PREFIX?=$(shell pwd)
6+ # Add to compile time flags
7+ NOTARY_PKG := github.com/theupdateframework/notary
8+ NOTARY_VERSION := $(shell cat NOTARY_VERSION)
9+-GITCOMMIT := $(shell git rev-parse --short HEAD)
10+-GITUNTRACKEDCHANGES := $(shell git status --porcelain --untracked-files=no)
11++GITCOMMIT ?= $(shell git rev-parse --short HEAD)
12++GITUNTRACKEDCHANGES :=
13+ ifneq ($(GITUNTRACKEDCHANGES),)
14+ GITCOMMIT := $(GITCOMMIT)-dirty
15+ endif