2013-10-09 18:30:44 +04:00
|
|
|
{ stdenv, fetchgit, libuuid, pythonFull, iasl }:
|
2012-03-14 08:18:52 +04:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2012-03-14 10:57:58 +04:00
|
|
|
targetArch = if stdenv.isi686 then
|
|
|
|
"IA32"
|
|
|
|
else if stdenv.isx86_64 then
|
|
|
|
"X64"
|
|
|
|
else
|
|
|
|
throw "Unsupported architecture";
|
2012-03-14 08:18:52 +04:00
|
|
|
|
2012-03-14 10:57:58 +04:00
|
|
|
edk2 = stdenv.mkDerivation {
|
2014-02-04 03:32:21 +04:00
|
|
|
name = "edk2-2014-02-01";
|
2012-03-14 08:18:52 +04:00
|
|
|
|
2013-10-09 18:30:44 +04:00
|
|
|
src = fetchgit {
|
|
|
|
url = git://github.com/tianocore/edk2;
|
2014-02-04 03:32:21 +04:00
|
|
|
rev = "2818c158de6a164d012e6afb0fc145656aed4e4b";
|
|
|
|
sha256 = "a756b5de3a3e71d82ce1de8c7832bc69d2affb98d704894b26540571f9f5e214";
|
2012-03-14 08:18:52 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ libuuid pythonFull ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make -C BaseTools
|
|
|
|
'';
|
|
|
|
|
2012-03-14 10:57:58 +04:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -vp $out
|
|
|
|
mv -v BaseTools $out
|
|
|
|
mv -v EdkCompatibilityPkg $out
|
|
|
|
mv -v edksetup.sh $out
|
|
|
|
'';
|
2012-03-14 08:18:52 +04:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Intel EFI development kit";
|
|
|
|
homepage = http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=EDK2;
|
|
|
|
license = "BSD";
|
|
|
|
maintainers = [ stdenv.lib.maintainers.shlevy ];
|
|
|
|
platforms = ["x86_64-linux" "i686-linux"];
|
|
|
|
};
|
2012-03-14 10:57:58 +04:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
setup = projectDscPath: attrs: {
|
|
|
|
buildInputs = [ pythonFull ] ++
|
|
|
|
stdenv.lib.optionals (attrs ? buildInputs) attrs.buildInputs;
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
mkdir -v Conf
|
|
|
|
sed -e 's|Nt32Pkg/Nt32Pkg.dsc|${projectDscPath}|' -e \
|
2014-02-04 03:32:21 +04:00
|
|
|
's|MYTOOLS|GCC48|' -e 's|IA32|${targetArch}|' -e 's|DEBUG|RELEASE|'\
|
2012-03-14 10:57:58 +04:00
|
|
|
< ${edk2}/BaseTools/Conf/target.template > Conf/target.txt
|
2014-02-04 03:32:21 +04: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 10:57:58 +04: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-15 02:43:07 +04:00
|
|
|
installPhase = "mv -v Build/*/* $out";
|
2012-03-14 10:57:58 +04:00
|
|
|
} // (removeAttrs attrs [ "buildInputs" ] );
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
edk2
|