1{ lib 2, fetchPypi 3, buildPythonPackage 4, pytestCheckHook 5, dotnetCorePackages 6, setuptools 7, setuptools-scm 8, wheel 9, buildDotnetModule 10, cffi 11}: 12 13let 14 pname = "clr-loader"; 15 version = "0.2.6"; 16 src = fetchPypi { 17 pname = "clr_loader"; 18 inherit version; 19 hash = "sha256-AZNIrmtqg8ekBtFFN8J3zs96OlOyY+w0LIHe1YRaZ+4="; 20 }; 21 22 # This buildDotnetModule is used only to get nuget sources, the actual 23 # build is done in `buildPythonPackage` below. 24 dotnet-build = buildDotnetModule { 25 inherit pname version src; 26 projectFile = [ "netfx_loader/ClrLoader.csproj" "example/example.csproj" ]; 27 nugetDeps = ./deps.nix; 28 }; 29in 30buildPythonPackage { 31 inherit pname version src; 32 33 format = "pyproject"; 34 35 nativeBuildInputs = [ 36 setuptools 37 setuptools-scm 38 wheel 39 dotnetCorePackages.sdk_6_0 40 ]; 41 42 propagatedBuildInputs = [ 43 cffi 44 ]; 45 46 nativeCheckInputs = [ 47 pytestCheckHook 48 ]; 49 50 disabledTests = [ 51 # TODO: mono does not work due to https://github.com/NixOS/nixpkgs/issues/7307 52 "test_mono" 53 "test_mono_debug" 54 "test_mono_signal_chaining" 55 "test_mono_set_dir" 56 ]; 57 58 # Perform dotnet restore based on the nuget-source 59 preConfigure = '' 60 dotnet restore "netfx_loader/ClrLoader.csproj" \ 61 -p:ContinuousIntegrationBuild=true \ 62 -p:Deterministic=true \ 63 --source "${dotnet-build.nuget-source}" 64 65 dotnet restore "example/example.csproj" \ 66 -p:ContinuousIntegrationBuild=true \ 67 -p:Deterministic=true \ 68 --source "${dotnet-build.nuget-source}" 69 ''; 70 71 passthru.fetch-deps = dotnet-build.fetch-deps; 72 73 meta = with lib; { 74 description = "Generic pure Python loader for .NET runtimes"; 75 homepage = "https://pythonnet.github.io/clr-loader/"; 76 license = licenses.mit; 77 maintainers = with maintainers; [ mdarocha ]; 78 }; 79}