From 89a256e463403dab84d89b1bc4563c6b95951383 Mon Sep 17 00:00:00 2001 From: Kamil Chmielewski Date: Thu, 2 Jun 2016 22:22:21 +0200 Subject: [PATCH] interlock: extracted from goPackages --- pkgs/development/go-modules/libs.json | 47 ++++++++++++++++++++++++++- pkgs/servers/interlock/default.nix | 38 ++++++++++++++++++++++ pkgs/servers/interlock/deps.json | 14 ++++++++ pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/go-packages.nix | 25 -------------- 5 files changed, 99 insertions(+), 27 deletions(-) create mode 100644 pkgs/servers/interlock/default.nix create mode 100644 pkgs/servers/interlock/deps.json diff --git a/pkgs/development/go-modules/libs.json b/pkgs/development/go-modules/libs.json index 4336fcc44bc9..88d6f547fca6 100644 --- a/pkgs/development/go-modules/libs.json +++ b/pkgs/development/go-modules/libs.json @@ -43,5 +43,50 @@ "rev": "1f22c0103821b9390939b6776727195525381532", "sha256": "05ahvn9g9cj7797n8ryfxv2g26v3lx1pza9d9pg97iw0rvar9i1h" } + }, + { + "goPackagePath": "github.com/Sirupsen/logrus", + "fetch": { + "type": "git", + "url": "https://github.com/Sirupsen/logrus", + "rev": "a26f43589d737684363ff856c5a0f9f24b946510", + "sha256": "13vprfbrsrqky145k26vayl9209gldh2v79614m0qxpx0ln1w2bs" + } + }, + { + "goPackagePath": "github.com/agl/ed25519", + "fetch": { + "type": "git", + "url": "https://github.com/agl/ed25519", + "rev": "278e1ec8e8a6e017cd07577924d6766039146ced", + "sha256": "165d89cc6dl28j4hkn86pny0jz3sa6hamzdvpvwdj4iha3x6lzc9" + } + }, + { + "goPackagePath": "github.com/golang/protobuf", + "fetch": { + "type": "git", + "url": "https://github.com/golang/protobuf", + "rev": "dda510ac0fd43b39770f22ac6260eb91d377bce3", + "sha256": "0bmz87is9zvxvzycp3135l61ippjw6vmpjz0b9pq8gpxx6sj2vj4" + } + }, + { + "goPackagePath": "github.com/janimo/textsecure", + "fetch": { + "type": "git", + "url": "https://github.com/janimo/textsecure", + "rev": "c38f429e48d6b2776d17b4171f216f132185b0f6", + "sha256": "191pwgfgphr0x04dwpvniax4wilpv52l25bw7d3igvnw302y7i94" + } + }, + { + "goPackagePath": "golang.org/x/net", + "fetch": { + "type": "git", + "url": "https://go.googlesource.com/net", + "rev": "ef00b378c73f107bf44d5c9b69875255ce89b79a", + "sha256": "168dhvl0wqiac8xmy8mqkvspd7cq6vfjpj80zdnriwy169nykcyz" + } } -] +] \ No newline at end of file diff --git a/pkgs/servers/interlock/default.nix b/pkgs/servers/interlock/default.nix new file mode 100644 index 000000000000..9b49f051ac21 --- /dev/null +++ b/pkgs/servers/interlock/default.nix @@ -0,0 +1,38 @@ +# This file was generated by go2nix. +{ stdenv, lib, sudo, utillinux, coreutils, systemd, cryptsetup, + goPackages, fetchgit, fetchhg, fetchbzr, fetchsvn }: + +with goPackages; + +buildGoPackage rec { + name = "interlock-${version}"; + version = "2016.04.13"; + rev = "v${version}"; + + goPackagePath = "github.com/inversepath/interlock"; + + subPackages = [ "./cmd/interlock" ]; + + src = fetchgit { + inherit rev; + url = "https://github.com/inversepath/interlock"; + sha256 = "1lnaz0vdg0k21wipc6w8h580cbpymiyasah98yzyzrmwraclb2bb"; + }; + + goDeps = ./deps.json; + + nativeBuildInputs = [ sudo ]; + buildFlags = [ "-tags textsecure" ]; + postPatch = '' + grep -lr '/s\?bin/' | xargs sed -i \ + -e 's|/bin/mount|${utillinux}/bin/mount|' \ + -e 's|/bin/umount|${utillinux}/bin/umount|' \ + -e 's|/bin/cp|${coreutils}/bin/cp|' \ + -e 's|/bin/mv|${coreutils}/bin/mv|' \ + -e 's|/bin/chown|${coreutils}/bin/chown|' \ + -e 's|/bin/date|${coreutils}/bin/date|' \ + -e 's|/sbin/poweroff|${systemd}/sbin/poweroff|' \ + -e 's|/usr/bin/sudo|/var/setuid-wrappers/sudo|' \ + -e 's|/sbin/cryptsetup|${cryptsetup}/bin/cryptsetup|' + ''; +} diff --git a/pkgs/servers/interlock/deps.json b/pkgs/servers/interlock/deps.json new file mode 100644 index 000000000000..a501a3087d7b --- /dev/null +++ b/pkgs/servers/interlock/deps.json @@ -0,0 +1,14 @@ +[ + { + "include": "../../../go-modules/libs.json", + "packages": [ + "github.com/Sirupsen/logrus", + "github.com/agl/ed25519", + "github.com/golang/protobuf", + "github.com/janimo/textsecure", + "golang.org/x/crypto", + "golang.org/x/net", + "gopkg.in/yaml.v2" + ] + } +] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 73a52f005250..06a27fb52065 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -819,7 +819,7 @@ in heatseeker = callPackage ../tools/misc/heatseeker { }; - interlock = goPackages.interlock.bin // { outputs = [ "bin" ]; }; + interlock = (callPackage ../servers/interlock {}).bin; mathics = pythonPackages.mathics; diff --git a/pkgs/top-level/go-packages.nix b/pkgs/top-level/go-packages.nix index b8cde1700cb6..3907f8339f3b 100644 --- a/pkgs/top-level/go-packages.nix +++ b/pkgs/top-level/go-packages.nix @@ -4080,31 +4080,6 @@ let disabled = isGo14; }; - interlock = buildFromGitHub rec { - version = "2016.01.14"; - rev = "v${version}"; - owner = "inversepath"; - repo = "interlock"; - sha256 = "0wabx6vqdxh2aprsm2rd9mh71q7c2xm6xk9a6r1bn53r9dh5wrsb"; - buildInputs = [ crypto textsecure ]; - nativeBuildInputs = [ pkgs.sudo ]; - buildFlags = [ "-tags textsecure" ]; - subPackages = [ "./cmd/interlock" ]; - postPatch = '' - grep -lr '/s\?bin/' | xargs sed -i \ - -e 's|/bin/mount|${pkgs.utillinux}/bin/mount|' \ - -e 's|/bin/umount|${pkgs.utillinux}/bin/umount|' \ - -e 's|/bin/cp|${pkgs.coreutils}/bin/cp|' \ - -e 's|/bin/mv|${pkgs.coreutils}/bin/mv|' \ - -e 's|/bin/chown|${pkgs.coreutils}/bin/chown|' \ - -e 's|/bin/date|${pkgs.coreutils}/bin/date|' \ - -e 's|/sbin/poweroff|${pkgs.systemd}/sbin/poweroff|' \ - -e 's|/usr/bin/sudo|/var/setuid-wrappers/sudo|' \ - -e 's|/sbin/cryptsetup|${pkgs.cryptsetup}/bin/cryptsetup|' - ''; - disabled = isGo14; - }; - template = buildFromGitHub { rev = "14fd436dd20c3cc65242a9f396b61bfc8a3926fc"; owner = "alecthomas";