interlock: extracted from goPackages

This commit is contained in:
Kamil Chmielewski 2016-06-02 22:22:21 +02:00
parent dbf48cd10b
commit 89a256e463
5 changed files with 99 additions and 27 deletions

View File

@ -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"
}
}
]
]

View File

@ -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|'
'';
}

View File

@ -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"
]
}
]

View File

@ -819,7 +819,7 @@ in
heatseeker = callPackage ../tools/misc/heatseeker { };
interlock = goPackages.interlock.bin // { outputs = [ "bin" ]; };
interlock = (callPackage ../servers/interlock {}).bin;
mathics = pythonPackages.mathics;

View File

@ -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";