Merge pull request #19931 from mguentner/ipfs_update

ipfs: i20160112 -> 0.4.4, fetchgx
This commit is contained in:
Franz Pletz 2016-10-31 14:42:05 +01:00 committed by GitHub
commit aa2b8d25d6
4 changed files with 54 additions and 6 deletions

View file

@ -1,22 +1,31 @@
{ stdenv, buildGoPackage, fetchFromGitHub }: { stdenv, buildGoPackage, fetchFromGitHub, fetchgx }:
buildGoPackage rec { buildGoPackage rec {
name = "ipfs-${version}"; name = "ipfs-${version}";
version = "i20160112--${stdenv.lib.strings.substring 0 7 rev}"; version = "0.4.4";
rev = "7070b4d878baad57dcc8da80080dd293aa46cabd"; rev = "d905d485192616abaea25f7e721062a9e1093ab9";
goPackagePath = "github.com/ipfs/go-ipfs"; goPackagePath = "github.com/ipfs/go-ipfs";
extraSrcPaths = [
(fetchgx {
inherit name src;
sha256 = "0mm1rs2mbs3rmxfcji5yal9ai3v1w75kk05bfyhgzmcjvi6lwpyb";
})
];
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ipfs"; owner = "ipfs";
repo = "go-ipfs"; repo = "go-ipfs";
inherit rev; inherit rev;
sha256 = "1b7aimnbz287fy7p27v3qdxnz514r5142v3jihqxanbk9g384gcd"; sha256 = "06iq7fmq7p0854aqrnmd0f0jvnxy9958wvw7ibn754fdfii9l84l";
}; };
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A global, versioned, peer-to-peer filesystem"; description = "A global, versioned, peer-to-peer filesystem";
homepage = https://ipfs.io/;
license = licenses.mit; license = licenses.mit;
broken = true; platforms = platforms.unix;
maintainers = with maintainers; [ fpletz ];
}; };
} }

View file

@ -0,0 +1,30 @@
{ stdenv, gx, gx-go, go, cacert }:
{ name, src, sha256 }:
stdenv.mkDerivation {
name = "${name}-gxdeps";
inherit src;
buildInputs = [ go gx gx-go ];
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = sha256;
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
buildPhase = ''
export GOPATH=$(pwd)/vendor
mkdir vendor
gx install
'';
installPhase = ''
mv vendor $out
'';
preferLocalBuild = true;
}

View file

@ -1,4 +1,4 @@
{ go, govers, parallel, lib, fetchgit, fetchhg }: { go, govers, parallel, lib, fetchgit, fetchhg, rsync }:
{ name, buildInputs ? [], nativeBuildInputs ? [], passthru ? {}, preFixup ? "" { name, buildInputs ? [], nativeBuildInputs ? [], passthru ? {}, preFixup ? ""
@ -17,6 +17,10 @@
# Extra sources to include in the gopath # Extra sources to include in the gopath
, extraSrcs ? [ ] , extraSrcs ? [ ]
# Extra gopaths containing src subfolder
# with sources to include in the gopath
, extraSrcPaths ? [ ]
# go2nix dependency file # go2nix dependency file
, goDeps ? null , goDeps ? null
@ -86,6 +90,9 @@ go.stdenv.mkDerivation (
mv goPath/* "go/src/${goPackagePath}" mv goPath/* "go/src/${goPackagePath}"
rmdir goPath rmdir goPath
'') + (lib.optionalString (extraSrcPaths != []) ''
${rsync}/bin/rsync -a ${lib.concatMapStrings (p: "${p}/src") extraSrcPaths} go
'') + '' '') + ''
export GOPATH=$NIX_BUILD_TOP/go:$GOPATH export GOPATH=$NIX_BUILD_TOP/go:$GOPATH

View file

@ -250,6 +250,8 @@ in
fetchNuGet = callPackage ../build-support/fetchnuget { }; fetchNuGet = callPackage ../build-support/fetchnuget { };
buildDotnetPackage = callPackage ../build-support/build-dotnet-package { }; buildDotnetPackage = callPackage ../build-support/build-dotnet-package { };
fetchgx = callPackage ../build-support/fetchgx { };
resolveMirrorURLs = {url}: fetchurl { resolveMirrorURLs = {url}: fetchurl {
showURLs = true; showURLs = true;
inherit url; inherit url;