2016-10-06 20:34:35 +02:00
|
|
|
{ stdenv, fetchgit, libuuid, python, iasl }:
|
2012-03-14 05:18:52 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2012-03-14 07:57:58 +01:00
|
|
|
targetArch = if stdenv.isi686 then
|
|
|
|
"IA32"
|
|
|
|
else if stdenv.isx86_64 then
|
|
|
|
"X64"
|
|
|
|
else
|
|
|
|
throw "Unsupported architecture";
|
2012-03-14 05:18:52 +01:00
|
|
|
|
2012-03-14 07:57:58 +01:00
|
|
|
edk2 = stdenv.mkDerivation {
|
2014-12-11 06:46:05 +01:00
|
|
|
name = "edk2-2014-12-10";
|
2016-02-09 00:07:09 +01:00
|
|
|
|
2013-10-09 16:30:44 +02:00
|
|
|
src = fetchgit {
|
|
|
|
url = git://github.com/tianocore/edk2;
|
2014-12-11 06:46:05 +01:00
|
|
|
rev = "684a565a04";
|
2016-06-02 13:26:44 +02:00
|
|
|
sha256 = "0s9ywb8w7xzlnmm4kwzykxkrdaw53b7pky121cc9wjkllzqwyxrb";
|
2012-03-14 05:18:52 +01:00
|
|
|
};
|
|
|
|
|
2016-10-06 20:34:35 +02:00
|
|
|
buildInputs = [ libuuid python python.tkinter ];
|
2012-03-14 05:18:52 +01:00
|
|
|
|
2016-02-09 00:07:09 +01:00
|
|
|
makeFlags = "-C BaseTools";
|
|
|
|
|
2016-02-26 18:38:15 +01:00
|
|
|
hardeningDisable = [ "format" "fortify" ];
|
2012-03-14 05:18:52 +01:00
|
|
|
|
2012-03-14 07:57:58 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -vp $out
|
|
|
|
mv -v BaseTools $out
|
|
|
|
mv -v EdkCompatibilityPkg $out
|
|
|
|
mv -v edksetup.sh $out
|
|
|
|
'';
|
2012-03-14 05:18:52 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Intel EFI development kit";
|
2014-12-21 00:00:35 +01:00
|
|
|
homepage = http://sourceforge.net/projects/edk2/;
|
|
|
|
license = stdenv.lib.licenses.bsd2;
|
2012-03-14 05:18:52 +01:00
|
|
|
platforms = ["x86_64-linux" "i686-linux"];
|
|
|
|
};
|
2012-03-14 07:57:58 +01:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
setup = projectDscPath: attrs: {
|
2016-10-06 20:34:35 +02:00
|
|
|
buildInputs = [ python python.tkinter ] ++
|
2012-03-14 07:57:58 +01:00
|
|
|
stdenv.lib.optionals (attrs ? buildInputs) attrs.buildInputs;
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
mkdir -v Conf
|
|
|
|
sed -e 's|Nt32Pkg/Nt32Pkg.dsc|${projectDscPath}|' -e \
|
2015-07-20 08:01:20 +02:00
|
|
|
's|MYTOOLS|GCC49|' -e 's|IA32|${targetArch}|' -e 's|DEBUG|RELEASE|'\
|
2012-03-14 07:57:58 +01:00
|
|
|
< ${edk2}/BaseTools/Conf/target.template > Conf/target.txt
|
2014-02-04 00:32:21 +01:00
|
|
|
sed -e 's|DEFINE GCC48_IA32_PREFIX = /usr/bin/|DEFINE GCC48_IA32_PREFIX = ""|' \
|
|
|
|
-e 's|DEFINE GCC48_X64_PREFIX = /usr/bin/|DEFINE GCC48_X64_PREFIX = ""|' \
|
2012-03-14 07:57:58 +01:00
|
|
|
-e 's|DEFINE UNIX_IASL_BIN = /usr/bin/iasl|DEFINE UNIX_IASL_BIN = ${iasl}/bin/iasl|' \
|
|
|
|
< ${edk2}/BaseTools/Conf/tools_def.template > Conf/tools_def.txt
|
|
|
|
export WORKSPACE="$PWD"
|
|
|
|
export EFI_SOURCE="$PWD/EdkCompatibilityPkg"
|
|
|
|
ln -sv ${edk2}/BaseTools BaseTools
|
|
|
|
ln -sv ${edk2}/EdkCompatibilityPkg EdkCompatibilityPkg
|
|
|
|
. ${edk2}/edksetup.sh BaseTools
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = "
|
|
|
|
build
|
|
|
|
";
|
|
|
|
|
2012-03-14 23:43:07 +01:00
|
|
|
installPhase = "mv -v Build/*/* $out";
|
2012-03-14 07:57:58 +01:00
|
|
|
} // (removeAttrs attrs [ "buildInputs" ] );
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
edk2
|