2023-01-11 07:51:40 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, python, qmake,
|
2020-04-24 23:36:52 +00:00
|
|
|
qtwebengine, qtxmlpatterns,
|
|
|
|
qttools, unzip }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "python-qt";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "3.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MeVisLab";
|
|
|
|
repo = "pythonqt";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-zbQ6X4Q2/QChaw3GAz/aVBj2JjWEz52YuPuHbBz935k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "remove-unneeded-pydebug-include.patch";
|
|
|
|
url = "https://github.com/MeVisLab/pythonqt/commit/a93104dea4d9c79351276ec963e931ca617625ec.patch";
|
|
|
|
includes = [ "src/PythonQt.cpp" ];
|
|
|
|
hash = "sha256-Tc4+6dIdvrda/z3Nz1s9Xz+ZWJLV2BQh8i552UynSI0=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
# https://github.com/CsoundQt/CsoundQt/blob/develop/BUILDING.md#pythonqt
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace build/python.prf \
|
|
|
|
--replace "unix:PYTHON_VERSION=2.7" "unix:PYTHON_VERSION=${python.pythonVersion}"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
hardeningDisable = [ "all" ];
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [ qmake qtwebengine qtxmlpatterns qttools unzip ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
buildInputs = [ python ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
qmakeFlags = [
|
|
|
|
"PythonQt.pro"
|
|
|
|
"PYTHON_DIR=${python}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
unpackCmd = "unzip $src";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/include/PythonQt
|
|
|
|
cp -r ./lib $out
|
|
|
|
cp -r ./src/* $out/include/PythonQt
|
|
|
|
cp -r ./build $out/include/PythonQt
|
|
|
|
cp -r ./extensions $out/include/PythonQt
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "PythonQt is a dynamic Python binding for the Qt framework. It offers an easy way to embed the Python scripting language into your C++ Qt applications";
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://pythonqt.sourceforge.net/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.lgpl21;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ hlolli ];
|
|
|
|
};
|
|
|
|
}
|