2018-02-05 21:58:25 +00:00
|
|
|
{ lib
|
|
|
|
, fetchPypi
|
|
|
|
, fetchNuGet
|
|
|
|
, buildPythonPackage
|
|
|
|
, python
|
|
|
|
, pytest
|
|
|
|
, pycparser
|
2019-08-03 22:48:56 +01:00
|
|
|
, psutil
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2018-02-05 21:58:25 +00:00
|
|
|
, dotnetbuildhelpers
|
|
|
|
, clang
|
2020-06-14 11:56:52 +01:00
|
|
|
, glib
|
2018-02-05 21:58:25 +00:00
|
|
|
, mono
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
UnmanagedExports127 = fetchNuGet {
|
|
|
|
baseName = "UnmanagedExports";
|
|
|
|
version = "1.2.7";
|
|
|
|
sha256 = "0bfrhpmq556p0swd9ssapw4f2aafmgp930jgf00sy89hzg2bfijf";
|
|
|
|
outputFiles = [ "*" ];
|
|
|
|
};
|
|
|
|
|
2019-08-03 22:48:56 +01:00
|
|
|
NUnit371 = fetchNuGet {
|
2018-02-05 21:58:25 +00:00
|
|
|
baseName = "NUnit";
|
2019-08-03 22:48:56 +01:00
|
|
|
version = "3.7.1";
|
|
|
|
sha256 = "1yc6dwaam4w2ss1193v735nnl79id78yswmpvmjr1w4bgcbdza4l";
|
2018-02-05 21:58:25 +00:00
|
|
|
outputFiles = [ "*" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pythonnet";
|
2019-08-03 22:48:56 +01:00
|
|
|
version = "2.4.0";
|
2018-02-05 21:58:25 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-08-03 22:48:56 +01:00
|
|
|
sha256 = "1ach9jic7a9rd3vmc4bphkr9fq01a0qk81f8a7gr9npwzmkqx8x3";
|
2018-02-05 21:58:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py --replace 'self._install_packages()' '#self._install_packages()'
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
2019-10-31 16:50:15 +00:00
|
|
|
[ -z "''${dontPlacateNuget-}" ] && placate-nuget.sh
|
|
|
|
[ -z "''${dontPlacatePaket-}" ] && placate-paket.sh
|
2018-02-05 21:58:25 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pytest
|
|
|
|
pycparser
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2018-02-05 21:58:25 +00:00
|
|
|
dotnetbuildhelpers
|
|
|
|
clang
|
|
|
|
|
2019-08-03 22:48:56 +01:00
|
|
|
mono
|
|
|
|
|
|
|
|
NUnit371
|
2018-02-05 21:58:25 +00:00
|
|
|
UnmanagedExports127
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2020-06-14 11:56:52 +01:00
|
|
|
glib
|
2018-02-05 21:58:25 +00:00
|
|
|
mono
|
2019-08-03 22:48:56 +01:00
|
|
|
psutil # needed for memory leak tests
|
2018-02-05 21:58:25 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
rm -rf packages
|
|
|
|
mkdir packages
|
|
|
|
|
2019-08-03 22:48:56 +01:00
|
|
|
ln -s ${NUnit371}/lib/dotnet/NUnit/ packages/NUnit.3.7.1
|
2018-02-05 21:58:25 +00:00
|
|
|
ln -s ${UnmanagedExports127}/lib/dotnet/NUnit/ packages/UnmanagedExports.1.2.7
|
2019-08-03 22:48:56 +01:00
|
|
|
|
|
|
|
# Setting TERM=xterm fixes an issue with terminfo in mono: System.Exception: Magic number is wrong: 542
|
|
|
|
export TERM=xterm
|
2018-02-05 21:58:25 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m pytest
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = ".Net and Mono integration for Python";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://pythonnet.github.io";
|
2018-02-05 21:58:25 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jraygauthier ];
|
2019-10-07 16:20:23 +01:00
|
|
|
broken = true;
|
2018-02-05 21:58:25 +00:00
|
|
|
};
|
|
|
|
}
|