diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-08-08 16:04:42 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-08-13 06:35:37 +0000 |
commit | 12aaa58dac35800b5b7d77f81cf2a87c21ee55da (patch) | |
tree | be0add9e5c22a85d20b5d78206aa74f956eb2a1b /nixpkgs/pkgs/development/python-modules/pythonnet/default.nix | |
parent | 45892a5591202f75a1c2f1ca7c62a92c7566e3c5 (diff) | |
parent | 5a8e9243812ba528000995b294292d3b5e120947 (diff) | |
download | nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.gz nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.bz2 nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.lz nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.xz nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.zst nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.zip |
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts: nixpkgs/pkgs/applications/window-managers/sway/default.nix nixpkgs/pkgs/build-support/go/module.nix nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix nixpkgs/pkgs/development/libraries/mesa/default.nix nixpkgs/pkgs/servers/dict/dictd-db.nix Link: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/issues/391
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pythonnet/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/pythonnet/default.nix | 112 |
1 files changed, 44 insertions, 68 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pythonnet/default.nix b/nixpkgs/pkgs/development/python-modules/pythonnet/default.nix index 1f4142b3245f..91dc505a3d83 100644 --- a/nixpkgs/pkgs/development/python-modules/pythonnet/default.nix +++ b/nixpkgs/pkgs/development/python-modules/pythonnet/default.nix @@ -1,75 +1,54 @@ -{ stdenv -, lib +{ lib , fetchPypi -, fetchNuGet , buildPythonPackage , pytestCheckHook , pycparser , psutil -, pkg-config -, dotnetbuildhelpers -, clang -, glib -, mono +, dotnet-sdk +, buildDotnetModule +, clr-loader +, setuptools }: let - - dotnetPkgs = [ - (fetchNuGet { - pname = "UnmanagedExports"; - version = "1.2.7"; - sha256 = "0bfrhpmq556p0swd9ssapw4f2aafmgp930jgf00sy89hzg2bfijf"; - outputFiles = [ "*" ]; - }) - (fetchNuGet { - pname = "NUnit"; - version = "3.12.0"; - sha256 = "1880j2xwavi8f28vxan3hyvdnph4nlh5sbmh285s4lc9l0b7bdk2"; - outputFiles = [ "*" ]; - }) - (fetchNuGet { - pname = "System.ValueTuple"; - version = "4.5.0"; - sha256 = "00k8ja51d0f9wrq4vv5z2jhq8hy31kac2rg0rv06prylcybzl8cy"; - outputFiles = [ "*" ]; - }) - ]; - -in - -buildPythonPackage rec { pname = "pythonnet"; - version = "2.5.2"; - + version = "3.0.1"; src = fetchPypi { - inherit pname version; - sha256 = "1qzdc6jd7i9j7p6bcihnr98y005gv1358xqdr1plpbpnl6078a5p"; + pname = "pythonnet"; + inherit version; + sha256 = "sha256-7U9/f5VRVAQRLds9oWOOGhATy1bmTEjE+mAwPwKwo90="; }; - postPatch = '' - substituteInPlace setup.py --replace 'self._install_packages()' '#self._install_packages()' - ''; + # This buildDotnetModule is used only to get nuget sources, the actual + # build is done in `buildPythonPackage` below. + dotnet-build = buildDotnetModule { + inherit pname version src; + nugetDeps = ./deps.nix; + }; +in +buildPythonPackage { + inherit pname version src; - preConfigure = '' - [ -z "''${dontPlacateNuget-}" ] && placate-nuget.sh - [ -z "''${dontPlacatePaket-}" ] && placate-paket.sh + format = "pyproject"; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'dynamic = ["version"]' 'version = "${version}"' ''; nativeBuildInputs = [ - pycparser - - pkg-config - dotnetbuildhelpers - clang - - mono + setuptools + dotnet-sdk + ]; - ] ++ dotnetPkgs; + propagatedBuildInputs = [ + pycparser + clr-loader + ]; - buildInputs = [ - glib - mono + pytestFlagsArray = [ + # Run tests using .NET Core, Mono is unsupported for now due to find_library problem in clr-loader + "--runtime coreclr" ]; nativeCheckInputs = [ @@ -77,26 +56,23 @@ buildPythonPackage rec { psutil # needed for memory leak tests ]; - preBuild = '' - rm -rf packages - mkdir packages - - ${builtins.concatStringsSep "\n" ( - builtins.map ( - x: ''ln -s ${x}/lib/dotnet/${x.pname} ./packages/${x.pname}.${x.version}'' - ) dotnetPkgs)} - - # Setting TERM=xterm fixes an issue with terminfo in mono: System.Exception: Magic number is wrong: 542 - export TERM=xterm + # Perform dotnet restore based on the nuget-source + preConfigure = '' + dotnet restore \ + -p:ContinuousIntegrationBuild=true \ + -p:Deterministic=true \ + --source ${dotnet-build.nuget-source} ''; + # Rerun this when updating to refresh Nuget dependencies + passthru.fetch-deps = dotnet-build.fetch-deps; + meta = with lib; { - broken = stdenv.isDarwin; - description = ".Net and Mono integration for Python"; + description = ".NET integration for Python"; homepage = "https://pythonnet.github.io"; license = licenses.mit; # <https://github.com/pythonnet/pythonnet/issues/898> badPlatforms = [ "aarch64-linux" ]; - maintainers = with maintainers; [ jraygauthier ]; + maintainers = with maintainers; [ jraygauthier mdarocha ]; }; } |