From 970ce3a878b288b311e7bb16728c88fed42dbd1b Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Tue, 15 Jun 2010 11:16:35 +0000 Subject: Commited my experimental Visual C# build function. Currently, it should only be used by brave people svn path=/nixpkgs/trunk/; revision=22272 --- pkgs/build-support/dotnetenv/buildSolution.nix | 61 ++++++++++++++++++++++++++ pkgs/build-support/dotnetenv/default.nix | 10 +++++ 2 files changed, 71 insertions(+) create mode 100644 pkgs/build-support/dotnetenv/buildSolution.nix create mode 100644 pkgs/build-support/dotnetenv/default.nix (limited to 'pkgs/build-support/dotnetenv') diff --git a/pkgs/build-support/dotnetenv/buildSolution.nix b/pkgs/build-support/dotnetenv/buildSolution.nix new file mode 100644 index 00000000000..495f2f116ea --- /dev/null +++ b/pkgs/build-support/dotnetenv/buildSolution.nix @@ -0,0 +1,61 @@ +{stdenv, dotnetfx}: +{ name +, src +, baseDir ? "." +, slnFile +, targets ? "ReBuild" +, verbosity ? "detailed" +, options ? "/p:Configuration=Debug;Platform=Win32" +, assemblyInputs ? [] +, runtimeAssemblies ? [] +, preBuild ? "" +}: + +stdenv.mkDerivation { + inherit name src preBuild; + + buildInputs = [ dotnetfx ]; + preConfigure = '' + cd ${baseDir} + ''; + + installPhase = '' + for i in ${toString assemblyInputs} + do + windowsPath=$(cygpath --windows $i) + echo "Using assembly path: $windowsPath" + + if [ "$assemblySearchPaths" = "" ] + then + assemblySearchPaths="$windowsPath" + else + assemblySearchPaths="$assemblySearchPaths;$windowsPath" + fi + done + + echo "Assembly search paths are: $assemblySearchPaths" + + if [ "$assemblySearchPaths" != "" ] + then + echo "Using assembly search paths args: $assemblySearchPathsArg" + export AssemblySearchPaths=$assemblySearchPaths + fi + + ensureDir $out + MSBuild.exe ${slnFile} /nologo /t:${targets} /p:IntermediateOutputPath=$(cygpath --windows $out)\\ /p:OutputPath=$(cygpath --windows $out)\\ /verbosity:${verbosity} ${options} + + # Create references to runtime dependencies + # !!! Should be more efficient (e.g. symlinking) + + for i in ${toString runtimeAssemblies} + do + cd $i + + for j in $(find . -type f) + do + mkdir -p $out/$(dirname $j) + cp $j $out/$(dirname $j) + done + done + ''; +} diff --git a/pkgs/build-support/dotnetenv/default.nix b/pkgs/build-support/dotnetenv/default.nix new file mode 100644 index 00000000000..7483672aca7 --- /dev/null +++ b/pkgs/build-support/dotnetenv/default.nix @@ -0,0 +1,10 @@ +{stdenv, dotnetfx}: + +{ + buildSolution = import ./buildSolution.nix { + inherit stdenv; + dotnetfx = dotnetfx.pkg; + }; + + inherit (dotnetfx) assembly20Path wcfPath referenceAssembly30Path referenceAssembly35Path; +} -- cgit 1.4.1