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