diff options
author | Shea Levy <shea@shealevy.com> | 2012-03-14 06:57:58 +0000 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2012-03-14 06:57:58 +0000 |
commit | 6cf8e4f81530f96a67061aa411e2270334725ecd (patch) | |
tree | 98381e05b579988ef33966285a719aa8bda852c4 /pkgs/development | |
parent | 853dd7266b4c54f71ad2c413b471785eb2091f45 (diff) | |
download | nixlib-6cf8e4f81530f96a67061aa411e2270334725ecd.tar nixlib-6cf8e4f81530f96a67061aa411e2270334725ecd.tar.gz nixlib-6cf8e4f81530f96a67061aa411e2270334725ecd.tar.bz2 nixlib-6cf8e4f81530f96a67061aa411e2270334725ecd.tar.lz nixlib-6cf8e4f81530f96a67061aa411e2270334725ecd.tar.xz nixlib-6cf8e4f81530f96a67061aa411e2270334725ecd.tar.zst nixlib-6cf8e4f81530f96a67061aa411e2270334725ecd.zip |
EDK2: Significant cleanup and
modularization, and add OVMF as an example of how to use it svn path=/nixpkgs/trunk/; revision=33059
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/compilers/edk2/default.nix | 73 |
1 files changed, 47 insertions, 26 deletions
diff --git a/pkgs/development/compilers/edk2/default.nix b/pkgs/development/compilers/edk2/default.nix index c93c7b8630f3..047834bbb627 100644 --- a/pkgs/development/compilers/edk2/default.nix +++ b/pkgs/development/compilers/edk2/default.nix @@ -2,16 +2,14 @@ let - targetArch = if stdenv.isi686 then - "IA32" - else if stdenv.isx86_64 then - "X64" - else - throw "Unsupported architecture"; +targetArch = if stdenv.isi686 then + "IA32" +else if stdenv.isx86_64 then + "X64" +else + throw "Unsupported architecture"; -in - -stdenv.mkDerivation { +edk2 = stdenv.mkDerivation { name = "edk2-2012-03-13"; src = fetchsvn { @@ -24,24 +22,14 @@ stdenv.mkDerivation { buildPhase = '' make -C BaseTools - build="$(pwd)" - cd .. - mv $build $out - export EDK_TOOLS_PATH="$out"/BaseTools - cd $out - . edksetup.sh BaseTools - sed -e 's|Nt32Pkg/Nt32Pkg.dsc|MdeModulePkg/MdeModulePkg.dsc|' -e \ - 's|MYTOOLS|GCC46|' -e 's|IA32|${targetArch}|' -e 's|DEBUG|RELEASE|'\ - < $out/Conf/target.txt > target.txt.tmp - mv target.txt.tmp $out/Conf/target.txt - sed -e 's|DEFINE GCC46_IA32_PREFIX = /usr/bin/|DEFINE GCC46_IA32_PREFIX = ""|' \ - -e 's|DEFINE GCC46_X64_PREFIX = /usr/bin/|DEFINE GCC46_X64_PREFIX = ""|' \ - -e 's|DEFINE UNIX_IASL_BIN = /usr/bin/iasl|DEFINE UNIX_IASL_BIN = ${iasl}/bin/iasl|' < $out/Conf/tools_def.txt > tools_def.txt.tmp - mv tools_def.txt.tmp $out/Conf/tools_def.txt - build ''; - installPhase = "true"; + installPhase = '' + mkdir -vp $out + mv -v BaseTools $out + mv -v EdkCompatibilityPkg $out + mv -v edksetup.sh $out + ''; meta = { description = "Intel EFI development kit"; @@ -50,4 +38,37 @@ stdenv.mkDerivation { maintainers = [ stdenv.lib.maintainers.shlevy ]; platforms = ["x86_64-linux" "i686-linux"]; }; -} + + 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 \ + 's|MYTOOLS|GCC46|' -e 's|IA32|${targetArch}|' -e 's|DEBUG|RELEASE|'\ + < ${edk2}/BaseTools/Conf/target.template > Conf/target.txt + sed -e 's|DEFINE GCC46_IA32_PREFIX = /usr/bin/|DEFINE GCC46_IA32_PREFIX = ""|' \ + -e 's|DEFINE GCC46_X64_PREFIX = /usr/bin/|DEFINE GCC46_X64_PREFIX = ""|' \ + -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 + "; + + installPhase = "mv -v Build $out"; + } // (removeAttrs attrs [ "buildInputs" ] ); + }; +}; + +in + +edk2 |