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