2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchPypi,
|
|
|
|
buildPythonPackage,
|
|
|
|
pytestCheckHook,
|
|
|
|
dotnetCorePackages,
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
|
|
|
wheel,
|
|
|
|
buildDotnetModule,
|
|
|
|
cffi,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-08-10 07:59:29 +00:00
|
|
|
pname = "clr-loader";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.2.6";
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchPypi {
|
2023-08-10 07:59:29 +00:00
|
|
|
pname = "clr_loader";
|
|
|
|
inherit version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-AZNIrmtqg8ekBtFFN8J3zs96OlOyY+w0LIHe1YRaZ+4=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# This buildDotnetModule is used only to get nuget sources, the actual
|
|
|
|
# build is done in `buildPythonPackage` below.
|
|
|
|
dotnet-build = buildDotnetModule {
|
|
|
|
inherit pname version src;
|
2024-06-05 15:53:02 +00:00
|
|
|
projectFile = [
|
|
|
|
"netfx_loader/ClrLoader.csproj"
|
|
|
|
"example/example.csproj"
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
nugetDeps = ./deps.nix;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
buildPythonPackage {
|
|
|
|
inherit pname version src;
|
|
|
|
|
|
|
|
format = "pyproject";
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = dotnetCorePackages.sdk_6_0.packages ++ dotnet-build.nugetDeps;
|
2024-09-19 14:19:46 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
2023-08-10 07:59:29 +00:00
|
|
|
setuptools-scm
|
|
|
|
wheel
|
2023-07-15 17:15:38 +00:00
|
|
|
dotnetCorePackages.sdk_6_0
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ cffi ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# TODO: mono does not work due to https://github.com/NixOS/nixpkgs/issues/7307
|
|
|
|
"test_mono"
|
|
|
|
"test_mono_debug"
|
|
|
|
"test_mono_signal_chaining"
|
|
|
|
"test_mono_set_dir"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Perform dotnet restore based on the nuget-source
|
|
|
|
preConfigure = ''
|
|
|
|
dotnet restore "netfx_loader/ClrLoader.csproj" \
|
|
|
|
-p:ContinuousIntegrationBuild=true \
|
2024-09-19 14:19:46 +00:00
|
|
|
-p:Deterministic=true
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
dotnet restore "example/example.csproj" \
|
|
|
|
-p:ContinuousIntegrationBuild=true \
|
2024-09-19 14:19:46 +00:00
|
|
|
-p:Deterministic=true
|
2023-07-15 17:15:38 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.fetch-deps = dotnet-build.fetch-deps;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Generic pure Python loader for .NET runtimes";
|
|
|
|
homepage = "https://pythonnet.github.io/clr-loader/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ mdarocha ];
|
|
|
|
};
|
|
|
|
}
|