2018-09-30 01:25:06 +02:00
|
|
|
{ stdenv, lib, fetchFromGitHub, mbedtls, python2, perl }:
|
2018-09-29 23:40:32 +02:00
|
|
|
let
|
2019-10-17 02:28:06 +02:00
|
|
|
version = "4.03";
|
2018-09-29 23:40:32 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "The-4n";
|
|
|
|
repo = "4NXCI";
|
|
|
|
rev = "v${version}";
|
2019-10-17 02:28:06 +02:00
|
|
|
sha256 = "0n49sqv6s8cj2dw1dbcyskfc2zr92p27f1bdd6jqfbawv0fqr1wf";
|
2018-09-29 23:40:32 +02:00
|
|
|
};
|
|
|
|
|
2018-09-30 01:25:06 +02:00
|
|
|
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;
|
2018-09-29 23:40:32 +02:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|