From bfa32800c3df6dd3a8e23bd239ec102173407249 Mon Sep 17 00:00:00 2001 From: Kamil Chmielewski Date: Thu, 21 Apr 2016 11:49:33 +0200 Subject: [PATCH] First programs extracted from go-packages: deis and gawp --- pkgs/development/go-modules/libs.json | 29 ++++++++++++++++++++ pkgs/development/tools/deis/default.nix | 36 +++++++++++++++++++++++++ pkgs/tools/misc/gawp/default.nix | 29 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +-- pkgs/top-level/go-packages.nix | 32 ---------------------- 5 files changed, 96 insertions(+), 34 deletions(-) create mode 100644 pkgs/development/go-modules/libs.json create mode 100644 pkgs/development/tools/deis/default.nix create mode 100644 pkgs/tools/misc/gawp/default.nix diff --git a/pkgs/development/go-modules/libs.json b/pkgs/development/go-modules/libs.json new file mode 100644 index 000000000000..8e5fee179bf2 --- /dev/null +++ b/pkgs/development/go-modules/libs.json @@ -0,0 +1,29 @@ +[ + { + "goPackagePath": "golang.org/x/sys", + "fetch": { + "type": "git", + "url": "https://go.googlesource.com/sys", + "rev": "7a56174f0086b32866ebd746a794417edbc678a1", + "sha256": "13jaz47wyrfak066ywkrvqnk1ijxik0nlvi7vkpi3gaiwcrlb5g2" + } + }, + { + "goPackagePath": "gopkg.in/fsnotify.v1", + "fetch": { + "type": "git", + "url": "https://gopkg.in/fsnotify.v1", + "rev": "30411dbcefb7a1da7e84f75530ad3abe4011b4f8", + "sha256": "1ljkdzbj9ll3jx1dggslzpm475prvsg22hdpxnb6kxqyk3z8dqdj" + } + }, + { + "goPackagePath": "gopkg.in/yaml.v2", + "fetch": { + "type": "git", + "url": "https://gopkg.in/yaml.v2", + "rev": "a83829b6f1293c91addabc89d0571c246397bbf4", + "sha256": "1m4dsmk90sbi17571h6pld44zxz7jc4lrnl4f27dpd1l8g5xvjhh" + } + } +] \ No newline at end of file diff --git a/pkgs/development/tools/deis/default.nix b/pkgs/development/tools/deis/default.nix new file mode 100644 index 000000000000..3787e30fbf43 --- /dev/null +++ b/pkgs/development/tools/deis/default.nix @@ -0,0 +1,36 @@ +# This file was generated by go2nix. +{ stdenv, lib, goPackages, fetchgit, fetchhg, fetchbzr, fetchsvn }: + +with goPackages; + +buildGoPackage rec { + name = "deis-${version}"; + version = "1.13.0"; + rev = "v${version}"; + + goPackagePath = "github.com/deis/deis"; + subPackages = [ "client" ]; + + postInstall = '' + if [ -f "$bin/bin/client" ]; then + mv "$bin/bin/client" "$bin/bin/deis" + fi + ''; + + src = fetchgit { + inherit rev; + url = "https://github.com/deis/deis"; + sha256 = "1fblg3gf7dh5hhm4ajq7yl7iy6gw8p5xlh4z8kvfy542m1fzr0dc"; + }; + + extraSrcs = map ( jsonDep: + { + inherit (jsonDep) goPackagePath; + src = if jsonDep.fetch.type == "git" then + fetchgit { + inherit (jsonDep.fetch) url rev sha256; + } + else {}; + } + ) (builtins.fromJSON (builtins.readFile ../../go-modules/libs.json)); +} diff --git a/pkgs/tools/misc/gawp/default.nix b/pkgs/tools/misc/gawp/default.nix new file mode 100644 index 000000000000..608b1764887a --- /dev/null +++ b/pkgs/tools/misc/gawp/default.nix @@ -0,0 +1,29 @@ +# This file was generated by go2nix. +{ stdenv, lib, goPackages, fetchgit, fetchhg, fetchbzr, fetchsvn }: + +with goPackages; + +buildGoPackage rec { + name = "gawp-${version}"; + version = "20160121-${stdenv.lib.strings.substring 0 7 rev}"; + rev = "5db2d8faa220e8d6eaf8677354bd197bf621ff7f"; + + goPackagePath = "github.com/martingallagher/gawp"; + + src = fetchgit { + inherit rev; + url = "https://github.com/martingallagher/gawp"; + sha256 = "0r4bp4w3s9rkmg3cz9jb7d6ngh7vfj31p9kbim6mhilxvmgjk4ly"; + }; + + extraSrcs = map ( jsonDep: + { + inherit (jsonDep) goPackagePath; + src = if jsonDep.fetch.type == "git" then + fetchgit { + inherit (jsonDep.fetch) url rev sha256; + } + else {}; + } + ) (builtins.fromJSON (builtins.readFile ../../../development/go-modules/libs.json)); +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9cead489cf25..a45a56161617 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -730,7 +730,7 @@ in ddate = callPackage ../tools/misc/ddate { }; - deis = goPackages.deis.bin // { outputs = [ "bin" ]; }; + deis = (callPackage ../development/tools/deis {}).bin; dfilemanager = self.kde5.dfilemanager; @@ -1644,7 +1644,7 @@ in gawkInteractive = appendToName "interactive" (gawk.override { interactive = true; }); - gawp = goPackages.gawp.bin // { outputs = [ "bin" ]; }; + gawp = (callPackage ../tools/misc/gawp {}).bin; gazeboSimulator = recurseIntoAttrs { sdformat = gazeboSimulator.sdformat4; diff --git a/pkgs/top-level/go-packages.nix b/pkgs/top-level/go-packages.nix index 95337accf6b4..619d4c60f1d6 100644 --- a/pkgs/top-level/go-packages.nix +++ b/pkgs/top-level/go-packages.nix @@ -669,20 +669,6 @@ let sha256 = "1wxv2cbihzcsz2z7iycyzl7f3arhhgagcc5kqln1k1mkm4l85z0q"; }; - deis = buildFromGitHub { - rev = "v1.12.2"; - owner = "deis"; - repo = "deis"; - sha256 = "03lznzcij3gn08kqj2p6skifcdv5aw09dm6zxgvqw7nxx2n1j2ib"; - subPackages = [ "client" ]; - buildInputs = [ docopt-go crypto yaml-v2 ]; - postInstall = '' - if [ -f "$bin/bin/client" ]; then - mv "$bin/bin/client" "$bin/bin/deis" - fi - ''; - }; - dns = buildFromGitHub { rev = "7e024ce8ce18b21b475ac6baf8fa3c42536bf2fa"; version = "2016-03-28"; @@ -934,24 +920,6 @@ let sha256 = "1p4p8755v2nrn54rik7yifpg9szyg44y5rpp0kryx4ycl72307rj"; }; - gawp = buildFromGitHub { - rev = "488705639109de54d38974cc31353d34cc2cd609"; - version = "2015-08-31"; - owner = "martingallagher"; - repo = "gawp"; - sha256 = "0iqqd63nqdijdskdb9f0jwnm6akkh1p2jw4p2w7r1dbaqz1znyay"; - dontInstallSrc = true; - buildInputs = [ fsnotify.v1 yaml-v2 ]; - - meta = with stdenv.lib; { - homepage = "https://github.com/martingallagher/gawp"; - description = "A simple, configurable, file watching, job execution tool implemented in Go"; - maintainers = with maintainers; [ kamilchm ]; - license = licenses.asl20 ; - platforms = platforms.all; - }; - }; - gcloud-golang = buildFromGitHub { rev = "6335269abf9002cf5a84613c13cda6010842b834"; owner = "GoogleCloudPlatform";