In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
67 lines
1.8 KiB
Nix
67 lines
1.8 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
python3,
|
|
qmake,
|
|
qtwebengine,
|
|
qtxmlpatterns,
|
|
qttools,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "python-qt";
|
|
version = "3.5.4";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "MeVisLab";
|
|
repo = "pythonqt";
|
|
rev = "v${finalAttrs.version}";
|
|
hash = "sha256-uzOSm1Zcm5La0mDAbJko5YtxJ4WesPr9lRas+cwhNH4=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
qmake
|
|
qttools
|
|
qtxmlpatterns
|
|
qtwebengine
|
|
];
|
|
|
|
buildInputs = [ python3 ];
|
|
|
|
qmakeFlags = [
|
|
"PYTHON_DIR=${python3}"
|
|
"PYTHON_VERSION=3.${python3.sourceVersion.minor}"
|
|
];
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
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
|
|
'';
|
|
|
|
preFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
install_name_tool -id \
|
|
$out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.dylib \
|
|
$out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.dylib
|
|
install_name_tool -change \
|
|
libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.3.dylib \
|
|
$out/lib/libPythonQt-Qt5-Python3.${python3.sourceVersion.minor}.3.dylib \
|
|
-id \
|
|
$out/lib/libPythonQt_QtAll-Qt5-Python3.${python3.sourceVersion.minor}.dylib \
|
|
$out/lib/libPythonQt_QtAll-Qt5-Python3.${python3.sourceVersion.minor}.dylib
|
|
'';
|
|
|
|
meta = with lib; {
|
|
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";
|
|
homepage = "https://pythonqt.sourceforge.net/";
|
|
license = licenses.lgpl21;
|
|
platforms = platforms.all;
|
|
maintainers = with maintainers; [ hlolli ];
|
|
};
|
|
})
|