summaryrefslogtreecommitdiffstats
path: root/makefu/5pkgs/_4nxci
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2018-11-10 19:52:37 +0100
committertv <tv@krebsco.de>2018-11-10 19:52:37 +0100
commit5ea1c2fcbb5756ef99d5fade8a7cd9e33b04a0c6 (patch)
treef6edbd9d1ff68773f413065a1f1c5dd71150be1a /makefu/5pkgs/_4nxci
parent9a801fa642a60a2c46240670b4e3ad66ea77d995 (diff)
parent05b288604e7e653efb6035b9953aa849e6e6bc19 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'makefu/5pkgs/_4nxci')
-rw-r--r--makefu/5pkgs/_4nxci/default.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/makefu/5pkgs/_4nxci/default.nix b/makefu/5pkgs/_4nxci/default.nix
new file mode 100644
index 000000000..dafa37ff6
--- /dev/null
+++ b/makefu/5pkgs/_4nxci/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, lib, fetchFromGitHub, mbedtls, python2, perl }:
+let
+ version = "1.35";
+ src = fetchFromGitHub {
+ owner = "The-4n";
+ repo = "4NXCI";
+ rev = "v${version}";
+ sha256 = "0yq0irxzi4wi71ajw8ld01zfpkrgknpq7g3m76pbnwmdzkm7dra6";
+ };
+
+ mymbedtls = stdenv.mkDerivation {
+ name = "mbedtls-${version}";
+ version = "2.6.1";
+ doCheck = false;
+ inherit src;
+ buildInputs = [ perl ];
+ phases = [ "unpackPhase" "buildPhase" "installPhase" ];
+ makeFlags = [ "DESTDIR=$(out)" ];
+ buildPhase = ''
+ cp config.mk.template config.mk
+ cd mbedtls
+ make
+ '';
+ };
+in stdenv.mkDerivation rec {
+ name = "4nxci-${version}";
+
+ inherit src version;
+ buildPhase = ''
+ cp config.mk.template config.mk
+ sed -i 's#\(INCLUDE =\).*#\1${mymbedtls}/include#' Makefile
+ sed -i 's#\(LIBDIR =\).*#\1${mymbedtls}/lib#' Makefile
+ make 4nxci
+ '';
+
+ installPhase = ''
+ install -m755 -D 4nxci $out/bin/4nxci
+ '';
+
+ #preInstall = ''
+ # mkdir -p $out/bin
+ #'';
+
+ buildInputs = [ mymbedtls ];
+
+ meta = {
+ description = "convert xci to nsp";
+ license = lib.licenses.isc;
+ };
+}