Skip to content

Commit

Permalink
Merge pull request #19931 from mguentner/ipfs_update
Browse files Browse the repository at this point in the history
ipfs: i20160112 -> 0.4.4, fetchgx
  • Loading branch information
fpletz committed Oct 31, 2016
2 parents c4f5482 + f9c65a9 commit aa2b8d2
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 6 deletions.
19 changes: 14 additions & 5 deletions pkgs/applications/networking/ipfs/default.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, fetchgx }:

buildGoPackage rec {
name = "ipfs-${version}";
version = "i20160112--${stdenv.lib.strings.substring 0 7 rev}";
rev = "7070b4d878baad57dcc8da80080dd293aa46cabd";
version = "0.4.4";
rev = "d905d485192616abaea25f7e721062a9e1093ab9";

goPackagePath = "github.com/ipfs/go-ipfs";

extraSrcPaths = [
(fetchgx {
inherit name src;
sha256 = "0mm1rs2mbs3rmxfcji5yal9ai3v1w75kk05bfyhgzmcjvi6lwpyb";
})
];

src = fetchFromGitHub {
owner = "ipfs";
repo = "go-ipfs";
inherit rev;
sha256 = "1b7aimnbz287fy7p27v3qdxnz514r5142v3jihqxanbk9g384gcd";
sha256 = "06iq7fmq7p0854aqrnmd0f0jvnxy9958wvw7ibn754fdfii9l84l";
};

meta = with stdenv.lib; {
description = "A global, versioned, peer-to-peer filesystem";
homepage = https://ipfs.io/;
license = licenses.mit;
broken = true;
platforms = platforms.unix;
maintainers = with maintainers; [ fpletz ];
};
}
30 changes: 30 additions & 0 deletions pkgs/build-support/fetchgx/default.nix
Original file line number Diff line number Diff line change
@@ -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;
}
9 changes: 8 additions & 1 deletion pkgs/development/go-modules/generic/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ go, govers, parallel, lib, fetchgit, fetchhg }:
{ go, govers, parallel, lib, fetchgit, fetchhg, rsync }:

{ name, buildInputs ? [], nativeBuildInputs ? [], passthru ? {}, preFixup ? ""

Expand All @@ -17,6 +17,10 @@
# Extra sources to include in the gopath
, extraSrcs ? [ ]

# Extra gopaths containing src subfolder
# with sources to include in the gopath
, extraSrcPaths ? [ ]

# go2nix dependency file
, goDeps ? null

Expand Down Expand Up @@ -86,6 +90,9 @@ go.stdenv.mkDerivation (
mv goPath/* "go/src/${goPackagePath}"
rmdir goPath
'') + (lib.optionalString (extraSrcPaths != []) ''
${rsync}/bin/rsync -a ${lib.concatMapStrings (p: "${p}/src") extraSrcPaths} go
'') + ''
export GOPATH=$NIX_BUILD_TOP/go:$GOPATH
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ in
fetchNuGet = callPackage ../build-support/fetchnuget { };
buildDotnetPackage = callPackage ../build-support/build-dotnet-package { };

fetchgx = callPackage ../build-support/fetchgx { };

resolveMirrorURLs = {url}: fetchurl {
showURLs = true;
inherit url;
Expand Down

0 comments on commit aa2b8d2

Please sign in to comment.