nixpkgs/pkgs/development/python-modules/pythonnet/default.nix
Jonathan Ringer 9bb3fccb5b treewide: pkgs.pkgconfig -> pkgs.pkg-config, move pkgconfig to alias.nix
continuation of #109595

pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.

python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
2021-01-19 01:16:25 -08:00

95 lines
1.8 KiB
Nix

{ lib
, fetchPypi
, fetchNuGet
, buildPythonPackage
, python
, pytest
, pycparser
, psutil
, pkg-config
, dotnetbuildhelpers
, clang
, glib
, mono
}:
let
UnmanagedExports127 = fetchNuGet {
baseName = "UnmanagedExports";
version = "1.2.7";
sha256 = "0bfrhpmq556p0swd9ssapw4f2aafmgp930jgf00sy89hzg2bfijf";
outputFiles = [ "*" ];
};
NUnit371 = fetchNuGet {
baseName = "NUnit";
version = "3.7.1";
sha256 = "1yc6dwaam4w2ss1193v735nnl79id78yswmpvmjr1w4bgcbdza4l";
outputFiles = [ "*" ];
};
in
buildPythonPackage rec {
pname = "pythonnet";
version = "2.4.0";
src = fetchPypi {
inherit pname version;
sha256 = "1ach9jic7a9rd3vmc4bphkr9fq01a0qk81f8a7gr9npwzmkqx8x3";
};
postPatch = ''
substituteInPlace setup.py --replace 'self._install_packages()' '#self._install_packages()'
'';
preConfigure = ''
[ -z "''${dontPlacateNuget-}" ] && placate-nuget.sh
[ -z "''${dontPlacatePaket-}" ] && placate-paket.sh
'';
nativeBuildInputs = [
pytest
pycparser
pkg-config
dotnetbuildhelpers
clang
mono
NUnit371
UnmanagedExports127
];
buildInputs = [
glib
mono
psutil # needed for memory leak tests
];
preBuild = ''
rm -rf packages
mkdir packages
ln -s ${NUnit371}/lib/dotnet/NUnit/ packages/NUnit.3.7.1
ln -s ${UnmanagedExports127}/lib/dotnet/NUnit/ packages/UnmanagedExports.1.2.7
# Setting TERM=xterm fixes an issue with terminfo in mono: System.Exception: Magic number is wrong: 542
export TERM=xterm
'';
checkPhase = ''
${python.interpreter} -m pytest
'';
meta = with lib; {
description = ".Net and Mono integration for Python";
homepage = "https://pythonnet.github.io";
license = licenses.mit;
maintainers = with maintainers; [ jraygauthier ];
broken = true;
};
}