2020-12-29 00:36:50 +01:00
|
|
|
{ stdenv, fetchurl, lib, makeWrapper,
|
|
|
|
flex,
|
|
|
|
gnumake,
|
|
|
|
texinfo,
|
|
|
|
unzip,
|
|
|
|
help2man,
|
|
|
|
file,
|
|
|
|
gnused,
|
|
|
|
which,
|
|
|
|
libtool,
|
|
|
|
ncurses,
|
|
|
|
m4,
|
|
|
|
gnugrep,
|
|
|
|
coreutils,
|
|
|
|
bison,
|
|
|
|
binutils-unwrapped,
|
|
|
|
bash,
|
|
|
|
patch,
|
|
|
|
gawk,
|
|
|
|
autoconf,
|
|
|
|
automake,
|
|
|
|
python,
|
|
|
|
gcc,
|
|
|
|
wget,
|
|
|
|
curl,
|
2021-04-21 22:39:46 +02:00
|
|
|
withCurl ? false,
|
|
|
|
withWget ? true,
|
2020-12-29 00:36:50 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "crosstool-ng";
|
|
|
|
version = "1.24.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://crosstool-ng.org/download/crosstool-ng/${pname}-${version}.tar.bz2";
|
2021-04-21 22:39:46 +02:00
|
|
|
sha256 = "08zmw9j4h1yazbzm000ygs0kxr9h3mrg5cqi5c6wcmi0bvmd206j";
|
2020-12-29 00:36:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
flex
|
|
|
|
gnumake
|
|
|
|
texinfo
|
|
|
|
unzip
|
|
|
|
help2man
|
|
|
|
file
|
|
|
|
which
|
|
|
|
libtool
|
|
|
|
m4
|
|
|
|
ncurses
|
|
|
|
gnugrep
|
|
|
|
bison
|
|
|
|
binutils-unwrapped
|
|
|
|
bash
|
|
|
|
patch
|
|
|
|
gawk
|
|
|
|
gnused
|
|
|
|
gcc
|
|
|
|
] ++ lib.optional withWget wget
|
|
|
|
++ lib.optional withCurl curl;
|
|
|
|
|
2020-12-29 14:26:13 +01:00
|
|
|
configureFlags = [
|
|
|
|
# "speeds up one-time build"
|
|
|
|
"--disable-dependency-tracking"
|
|
|
|
];
|
|
|
|
|
2020-12-29 00:36:50 +01:00
|
|
|
preConfigure = ''
|
|
|
|
export INSTALL="${coreutils}/bin/install"
|
|
|
|
export GREP="${gnugrep}/bin/grep"
|
|
|
|
export EGREP="${gnugrep}/bin/egrep"
|
|
|
|
export SED="${gnused}/bin/sed"
|
|
|
|
export YACC="${bison}/bin/bison -y"
|
|
|
|
export OBJCOPY="${binutils-unwrapped}/bin/objcopy"
|
|
|
|
export OBJDUMP="${binutils-unwrapped}/bin/objdump"
|
|
|
|
export READELF="${binutils-unwrapped}/bin/readelf"
|
|
|
|
export PATCH="${patch}/bin/patch"
|
|
|
|
export BASH_SHELL="${bash}/bin/bash"
|
|
|
|
export AWK="${gawk}/bin/gawk"
|
|
|
|
export LIBTOOL="${libtool}/bin/libtool"
|
|
|
|
export LIBTOOLIZE="${libtool}/bin/libtoolize"
|
|
|
|
export AUTOCONF="${autoconf}/bin/autoconf"
|
|
|
|
export AUTORECONF="${autoconf}/bin/autoreconf"
|
|
|
|
export AUTOMAKE="${automake}/bin/automake"
|
|
|
|
export M4="${m4}/bin/m4"
|
|
|
|
export PYTHON="${python}/bin/python"
|
|
|
|
export BISON="${bison}/bin/bison"
|
|
|
|
export AR="${binutils-unwrapped}/bin/ar"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram "$out/bin/ct-ng" \
|
|
|
|
--prefix PATH : "${lib.strings.makeBinPath [ binutils-unwrapped m4 gcc ]}" \
|
|
|
|
${lib.optionalString withWget "--set-default CT_WGET '${wget}/bin/wget'"} \
|
|
|
|
${lib.optionalString withCurl "--set-default CT_CURL '${curl}/bin/curl'"}
|
2021-04-21 22:39:46 +02:00
|
|
|
'';
|
2020-12-29 00:36:50 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A versatile (cross-)toolchain generator";
|
|
|
|
homepage = "https://crosstool-ng.github.io/";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
};
|
|
|
|
}
|