summary refs log tree commit diff
path: root/pkgs/tools/filesystems/go-mtpfs
diff options
context:
space:
mode:
authorLuca Bruno <lethalman88@gmail.com>2015-02-04 15:53:59 +0100
committerLuca Bruno <lethalman88@gmail.com>2015-02-04 15:53:59 +0100
commit8fd42c55a9d7a0dfc442296258811a5af4d09f03 (patch)
treeb7353d1f3353f6914ca535d368db66e4625b1e6f /pkgs/tools/filesystems/go-mtpfs
parentee905777049bf546c42be3af3f7c232ef25678ad (diff)
downloadnixpkgs-8fd42c55a9d7a0dfc442296258811a5af4d09f03.tar
nixpkgs-8fd42c55a9d7a0dfc442296258811a5af4d09f03.tar.gz
nixpkgs-8fd42c55a9d7a0dfc442296258811a5af4d09f03.tar.bz2
nixpkgs-8fd42c55a9d7a0dfc442296258811a5af4d09f03.tar.lz
nixpkgs-8fd42c55a9d7a0dfc442296258811a5af4d09f03.tar.xz
nixpkgs-8fd42c55a9d7a0dfc442296258811a5af4d09f03.tar.zst
nixpkgs-8fd42c55a9d7a0dfc442296258811a5af4d09f03.zip
Port go-mtpfs to buildGoPackage
Diffstat (limited to 'pkgs/tools/filesystems/go-mtpfs')
-rw-r--r--pkgs/tools/filesystems/go-mtpfs/default.nix62
1 files changed, 13 insertions, 49 deletions
diff --git a/pkgs/tools/filesystems/go-mtpfs/default.nix b/pkgs/tools/filesystems/go-mtpfs/default.nix
index 2dd37acfe84..7b92f98d5f3 100644
--- a/pkgs/tools/filesystems/go-mtpfs/default.nix
+++ b/pkgs/tools/filesystems/go-mtpfs/default.nix
@@ -1,57 +1,21 @@
-{ stdenv, lib, pkgconfig, libmtp, go, fetchFromGitHub }:
+{ lib, goPackages, pkgconfig, libmtp, fetchFromGitHub }:
 
-let
-  goDeps = [
-    {
-      root = "github.com/hanwen/go-mtpfs";
-      src = fetchFromGitHub {
-        owner = "hanwen";
-        repo = "go-mtpfs";
-        rev = "9c2b46050e8ea8574eaec2124867ac7b11e6471d";
-        sha256 = "0kxi18cb078q4wikfajp3yvp802wzfsfdp431j0dg2jdw8y7gfii";
-      };
-    }
-    {
-      root = "github.com/hanwen/go-fuse";
-      src = fetchFromGitHub {
-        owner = "hanwen";
-        repo = "go-fuse";
-        rev = "5d16aa11eef4643de2d91e88a64dcb6138705d58";
-        sha256 = "0lycfhchn88kbs81ypz8m5jh032fpbv14gldrjirf32wm1d4f8pj";
-      };
-    }
-    {
-      root = "github.com/hanwen/usb";
-      src = fetchFromGitHub {
-        owner = "hanwen";
-        repo = "usb";
-        rev = "69aee4530ac705cec7c5344418d982aaf15cf0b1";
-        sha256 = "01k0c2g395j65vm1w37mmrfkg6nm900khjrrizzpmx8f8yf20dky";
-      };
-    }
-  ];
+with goPackages;
 
-  sources = stdenv.mkDerivation rec {
-    name = "go-deps";
-    buildCommand =
-      lib.concatStrings
-        (map (dep: ''
-                mkdir -p $out/src/`dirname ${dep.root}`
-                ln -s ${dep.src} $out/src/${dep.root}
-              '') goDeps);
+buildGoPackage rec {
+  rev = "9c2b46050e8ea8574eaec2124867ac7b11e6471d";
+  name = "go-mtpfs-${lib.strings.substring 0 7 rev}";
+  goPackagePath = "github.com/hanwen/go-mtpfs";
+  src = fetchFromGitHub {
+    inherit rev;
+    owner = "hanwen";
+    repo = "go-mtpfs";
+    sha256 = "0kxi18cb078q4wikfajp3yvp802wzfsfdp431j0dg2jdw8y7gfii";
   };
-in stdenv.mkDerivation rec {
-  name = "go-mtpfs";
 
-  src = sources;
+  buildInputs = [ go-fuse libmtp usb ];
 
-  buildInputs = [ go pkgconfig libmtp ];
-
-  installPhase = ''
-    mkdir -p $out/bin
-    export GOPATH=$src
-    go build -v -o $out/bin/go-mtpfs github.com/hanwen/go-mtpfs
-  '';
+  subPackages = [ "./" ];
 
   meta = with lib; {
     description = "A simple FUSE filesystem for mounting Android devices as a MTP device";