62 lines
1.6 KiB
Nix
62 lines
1.6 KiB
Nix
{ stdenv, pkgconfig, autoconf, automake, file, git, libtool, perl, python,
|
|
unzip, imagemagick, bash, which, glibc, gettext, bison, flex, ncurses,
|
|
readline, acl, zlib, libcap }:
|
|
|
|
with stdenv.lib;
|
|
|
|
let
|
|
ncursesInc = makeSearchPathOutput "dev" "include" [ ncurses ];
|
|
zlibInc = makeSearchPathOutput "dev" "include" [ zlib ];
|
|
readlineInc = makeSearchPathOutput "dev" "include" [ readline ];
|
|
aclInc = makeSearchPathOutput "dev" "include" [ acl ];
|
|
libcapInc = makeSearchPathOutput "dev" "include" [ libcap ];
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
name = "freetz-tools";
|
|
version = "0.1";
|
|
|
|
src = /home/christian/Downloads/Openwrt-Router/freetz;
|
|
|
|
patchPhase = ''
|
|
patchShebangs tools
|
|
|
|
substituteInPlace tools/check_prerequisites \
|
|
--replace "/sbin/ldconfig" "${glibc}/bin/ldconfig" \
|
|
--replace "/usr/include/ /usr/local/include/" "${ncursesInc} \
|
|
${zlibInc} \
|
|
${readlineInc} \
|
|
${aclInc} \
|
|
${libcapInc}"
|
|
'';
|
|
|
|
buildInputs = [
|
|
which
|
|
autoconf
|
|
automake
|
|
file
|
|
git
|
|
libtool
|
|
perl
|
|
python
|
|
unzip
|
|
imagemagick
|
|
gettext
|
|
pkgconfig
|
|
bison
|
|
flex
|
|
ncurses
|
|
readline
|
|
];
|
|
|
|
buildPhase = ''
|
|
make tools
|
|
'';
|
|
|
|
installPhase = ''
|
|
install -D tools/unsquashfs4-avm-be $out/bin/unsquashfs4-avm-be
|
|
install -D tools/unsquashfs4-avm-le $out/bin/unsquashfs4-avm-le
|
|
install -D tools/mksquashfs4-avm-be $out/bin/mksquashfs4-avm-be
|
|
install -D tools/mksquashfs4-avm-le $out/bin/mksquashfs4-avm-le
|
|
'';
|
|
}
|