DotNET: Difference between revisions
imported>Milahu add XML namespace error |
imported>Milahu add example build file |
||
| Line 1: | Line 1: | ||
dotnet packages can be built with <code>buildDotnetPackage</code> | dotnet packages can be built with <code>buildDotnetPackage</code> | ||
example build file: | |||
<syntaxHighlight lang=nix> | |||
/* | |||
some_program/default.nix | |||
nix-build -E 'with import <nixpkgs> { }; callPackage ./default.nix { }' | |||
*/ | |||
{ lib | |||
, stdenv | |||
, fetchFromGitHub | |||
, buildDotnetPackage | |||
, dotnetPackages | |||
, pkg-config | |||
}: | |||
buildDotnetPackage rec { | |||
pname = "some_program"; | |||
baseName = pname; # workaround for "called without baseName" | |||
version = "some_version"; | |||
src = fetchFromGitHub { | |||
owner = "some_owner"; | |||
repo = pname; | |||
rev = "v${version}"; | |||
sha256 = ""; # todo | |||
}; | |||
projectFile = ["path/to/some_project.csproj"]; | |||
propagatedBuildInputs = [ | |||
]; | |||
buildInputs = [ | |||
# unit tests | |||
dotnetPackages.NUnit | |||
dotnetPackages.NUnitRunners | |||
]; | |||
nativeBuildInputs = [ | |||
pkg-config | |||
]; | |||
meta = with lib; { | |||
homepage = "some_homepage"; | |||
description = "some_description"; | |||
license = licenses.mit; | |||
}; | |||
} | |||
</syntaxHighlight> | |||
== XML namespace error == | == XML namespace error == | ||