Merge pull request #123378 from eduardosm/sip_6

python3Packages.sip: 5.5.0 -> 6.1.1;
pythonPackages.pyqt5: 5.15.2 -> 5.15.4;
python3Packages.pyqt-builder: 1.6.0 -> 1.10.1
This commit is contained in:
Anderson Torres 2021-06-27 01:41:19 -03:00 committed by GitHub
commit f5b9a25cdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 106 additions and 388 deletions

View file

@ -77,12 +77,12 @@ in mkDerivation rec {
# build to use PYQT5_SIP_DIR consistently.
postPatch = ''
substituteInPlace cmake/FindPyQt5.py \
--replace 'sip_dir = cfg.default_sip_dir' 'sip_dir = "${python3Packages.pyqt5}/share/sip/PyQt5"'
--replace 'sip_dir = cfg.default_sip_dir' 'sip_dir = "${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings"'
'';
cmakeFlags = [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DPYQT5_SIP_DIR=${python3Packages.pyqt5}/share/sip/PyQt5"
"-DPYQT5_SIP_DIR=${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings"
"-DQSCI_SIP_DIR=${python3Packages.qscintilla-qt5}/share/sip/PyQt5"
] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF"
++ lib.optional withGrass "-DGRASS_PREFIX7=${grass}/${grass.name}";

View file

@ -32,8 +32,8 @@ mkDerivation rec {
++ lib.optional stdenv.cc.isGNU "-Wno-deprecated-copy";
cmakeFlags = [
"-DPYQT5_SIP_DIR=${python3Packages.pyqt5}/share/sip/PyQt5"
"-DPYQT_SIP_DIR_OVERRIDE=${python3Packages.pyqt5}/share/sip/PyQt5"
"-DPYQT5_SIP_DIR=${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings"
"-DPYQT_SIP_DIR_OVERRIDE=${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings"
"-DCMAKE_BUILD_TYPE=RelWithDebInfo"
];

View file

@ -14,7 +14,7 @@ python3Packages.buildPythonApplication rec {
sha256 = "4ClgYwiU21wHDve2q9cItSAVb9hbR2F+fJc8znGI8OA=";
};
nativeBuildInputs = [ wrapQtAppsHook python3Packages.sip ];
nativeBuildInputs = [ wrapQtAppsHook python3Packages.sip_4 ];
buildInputs = [ qtbase ];
@ -25,21 +25,21 @@ python3Packages.buildPythonApplication rec {
wrapQtApp "$out/bin/veusz"
'';
# For some reason, if sip5 is found on the PATH, the option --sip-dir is
# ignored in setupPyBuildFlags, see
# https://github.com/veusz/veusz/blob/53b99dffa999f2bc41fdc5335d7797ae857c761f/pyqtdistutils.py#L292
# Since sip 6 (we use sip 4 here, but pyqt5 is built with sip 6), sip files are
# placed in a different directory layout and --sip-dir won't work anymore.
# --sip-dir expects a directory with a PyQt5 subdirectory (where sip files are located),
# but the new directory layout places sip files in a subdirectory named 'bindings'.
# To workaround this, we patch the full path into pyqtdistutils.py.
postPatch = ''
substituteInPlace pyqtdistutils.py \
--replace "'-I', pyqt5_include_dir," "'-I', '${python3Packages.pyqt5}/share/sip/PyQt5',"
--replace "'-I', pyqt5_include_dir," "'-I', '${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings',"
patchShebangs tests/runselftest.py
'';
# you can find these options at
# https://github.com/veusz/veusz/blob/53b99dffa999f2bc41fdc5335d7797ae857c761f/pyqtdistutils.py#L71
# --sip-dir cannot be used here for the reasons explained above
setupPyBuildFlags = [
# --sip-dir does nothing here, but it should be the correct way to set the
# sip_dir, so I'm leaving it here for future versions
"--sip-dir=${python3Packages.pyqt5}/share/sip"
"--qt-include-dir=${qtbase.dev}/include"
# veusz tries to find a libinfix and fails without one
# but we simply don't need a libinfix, so set it to empty here

View file

@ -41,7 +41,7 @@ mkDerivation rec {
++ lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch;
prePatch = ''
sed -i "s@\[tool.sip.project\]@[tool.sip.project]\nsip-include-dirs = [\"${python3Packages.pyqt5}/share/sip/PyQt5\"]@g" \
sed -i "s@\[tool.sip.project\]@[tool.sip.project]\nsip-include-dirs = [\"${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings\"]@g" \
setup/build.py
sed -i "s/\[tool.sip.bindings.pictureflow\]/[tool.sip.bindings.pictureflow]\ntags = [\"${python3Packages.sip.platform_tag}\"]/g" \
setup/build.py

View file

@ -2,12 +2,12 @@
buildPythonPackage rec {
pname = "pyqt-builder";
version = "1.6.0";
version = "1.10.1";
src = fetchPypi {
pname = "PyQt-builder";
inherit version;
sha256 = "0g51yak53zzjs4gpq65i01cmpz7w8cjny9wfyxlgr2vi0wag107v";
sha256 = "05vyckg4pq95s3b23drhd24sjwzic1k36nwckxz5jc83mixhqywn";
};
propagatedBuildInputs = [ packaging sip ];
@ -21,5 +21,6 @@ buildPythonPackage rec {
description = "PEP 517 compliant build system for PyQt";
homepage = "https://pypi.org/project/PyQt-builder/";
license = licenses.gpl3Only;
maintainers = with maintainers; [ eduardosm ];
};
}

View file

@ -1,65 +1,52 @@
{ lib, pythonPackages, pkg-config
{ lib
, buildPythonPackage
, isPy27
, fetchPypi
, pkg-config
, dbus
, qmake, lndir
, qtbase
, qtsvg
, qtdeclarative
, qtwebchannel
, withConnectivity ? false, qtconnectivity
, withMultimedia ? false, qtmultimedia
, withWebKit ? false, qtwebkit
, withWebSockets ? false, qtwebsockets
, lndir
, python
, dbus-python
, sip
, pyqt-builder
, libsForQt5
, withConnectivity ? false
, withMultimedia ? false
, withWebKit ? false
, withWebSockets ? false
}:
let
inherit (pythonPackages) buildPythonPackage python isPy3k dbus-python enum34;
sip = if isPy3k then
pythonPackages.sip
else
(pythonPackages.sip_4.override { sip-module = "PyQt5.sip"; }).overridePythonAttrs(oldAttrs: {
# If we install sip in another folder, then we need to create a __init__.py as well
# if we want to be able to import it with Python 2.
# Python 3 could rely on it being an implicit namespace package, however,
# PyQt5 we made an explicit namespace package so sip should be as well.
postInstall = ''
cat << EOF > $out/${python.sitePackages}/PyQt5/__init__.py
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
EOF
'';
});
pyqt5_sip = buildPythonPackage rec {
pname = "PyQt5_sip";
version = "12.8.1";
version = "12.9.0";
src = pythonPackages.fetchPypi {
src = fetchPypi {
inherit pname version;
sha256 = "30e944db9abee9cc757aea16906d4198129558533eb7fadbe48c5da2bd18e0bd";
sha256 = "0cmfxb7igahxy74qkq199l6zdxrr75bnxris42fww3ibgjflir6k";
};
# There is no test code and the check phase fails with:
# > error: could not create 'PyQt5/sip.cpython-38-x86_64-linux-gnu.so': No such file or directory
doCheck = false;
};
in buildPythonPackage rec {
pname = "PyQt5";
version = "5.15.2";
format = "other";
version = "5.15.4";
format = "pyproject";
src = pythonPackages.fetchPypi {
disabled = isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "1z74295i69cha52llsqffzhb5zz7qnbjc64h8qg21l91jgf0harp";
sha256 = "1gp5jz71nmg58zsm1h4vzhcphf36rbz37qgsfnzal76i1mz5js9a";
};
outputs = [ "out" "dev" ];
dontWrapQtApps = true;
nativeBuildInputs = [
nativeBuildInputs = with libsForQt5; [
pkg-config
qmake
lndir
@ -75,11 +62,12 @@ in buildPythonPackage rec {
++ lib.optional withWebSockets qtwebsockets
;
buildInputs = [
buildInputs = with libsForQt5; [
dbus
qtbase
qtsvg
qtdeclarative
pyqt-builder
]
++ lib.optional withConnectivity qtconnectivity
++ lib.optional withWebKit qtwebkit
@ -88,10 +76,11 @@ in buildPythonPackage rec {
propagatedBuildInputs = [
dbus-python
] ++ (if isPy3k then [ pyqt5_sip ] else [ sip enum34 ]);
pyqt5_sip
];
patches = [
# Fix some wrong assumptions by ./configure.py
# Fix some wrong assumptions by ./project.py
# TODO: figure out how to send this upstream
./pyqt5-fix-dbus-mainloop-support.patch
];
@ -103,36 +92,7 @@ in buildPythonPackage rec {
WebSocketsEnabled = withWebSockets;
};
configurePhase = ''
runHook preConfigure
export PYTHONPATH=$PYTHONPATH:$out/${python.sitePackages}
${python.executable} configure.py -w \
--confirm-license \
--dbus-moduledir=$out/${python.sitePackages}/dbus/mainloop \
--no-qml-plugin \
--bindir=$out/bin \
--destdir=$out/${python.sitePackages} \
--stubsdir=$out/${python.sitePackages}/PyQt5 \
--sipdir=$out/share/sip/PyQt5 \
--designer-plugindir=$out/plugins/designer
runHook postConfigure
'';
postInstall = lib.optionalString (!isPy3k) ''
ln -s ${sip}/${python.sitePackages}/PyQt5/sip.* $out/${python.sitePackages}/PyQt5/
for i in $out/bin/*; do
wrapProgram $i --prefix PYTHONPATH : "$PYTHONPATH"
done
# Let's make it a namespace package
cat << EOF > $out/${python.sitePackages}/PyQt5/__init__.py
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
EOF
'';
dontConfigure = true;
# Checked using pythonImportsCheck
doCheck = false;
@ -150,12 +110,10 @@ in buildPythonPackage rec {
++ lib.optional withConnectivity "PyQt5.QtConnectivity"
;
enableParallelBuilding = true;
meta = with lib; {
description = "Python bindings for Qt5";
homepage = "http://www.riverbankcomputing.co.uk";
license = licenses.gpl3;
homepage = "https://riverbankcomputing.com/";
license = licenses.gpl3Only;
platforms = platforms.mesaPlatforms;
maintainers = with maintainers; [ sander ];
};

View file

@ -21,7 +21,7 @@ so I have decided to solve this with an extra configure flag.
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/configure.py b/configure.py
index a3450ca3..440d90a2 100644
index c6663e4..65e7da7 100644
--- a/configure.py
+++ b/configure.py
@@ -905,6 +905,9 @@ class TargetConfiguration:
@ -34,7 +34,7 @@ index a3450ca3..440d90a2 100644
if opts.pyuicinterpreter is not None:
self.pyuic_interpreter = opts.pyuicinterpreter
@@ -1184,6 +1187,11 @@ def create_optparser(target_config):
@@ -1191,6 +1194,11 @@ def create_optparser(target_config):
metavar="DIR",
help="the directory containing the dbus/dbus-python.h header is "
"DIR [default: supplied by pkg-config]")
@ -46,7 +46,7 @@ index a3450ca3..440d90a2 100644
p.add_option_group(g)
# Installation.
@@ -2149,7 +2157,7 @@ def check_dbus(target_config, verbose):
@@ -2277,7 +2285,7 @@ def check_dbus(target_config, verbose):
inform("Checking to see if the dbus support module should be built...")
@ -55,7 +55,7 @@ index a3450ca3..440d90a2 100644
if verbose:
sys.stdout.write(cmd + "\n")
@@ -2178,7 +2186,8 @@ def check_dbus(target_config, verbose):
@@ -2307,7 +2315,8 @@ def check_dbus(target_config, verbose):
inform("The Python dbus module doesn't seem to be installed.")
return
@ -65,6 +65,16 @@ index a3450ca3..440d90a2 100644
# Try and find dbus-python.h. We don't use pkg-config because it is broken
# for dbus-python (at least for versions up to and including v0.81.0).
--
2.18.0
diff --git a/project.py b/project.py
index fe9fbce..9ae1ca1 100644
--- a/project.py
+++ b/project.py
@@ -261,7 +261,7 @@ del find_qt
dbus_lib_dirs = []
dbus_libs = []
- args = ['pkg-config', '--cflags-only-I', '--libs dbus-1']
+ args = ['pkg-config', '--cflags-only-I', '--libs dbus-1', 'dbus-python']
for line in self.read_command_pipe(args, fatal=False):
for flag in line.strip().split():

View file

@ -4,25 +4,23 @@
}:
let
inherit (pythonPackages) buildPythonPackage python isPy3k pyqt5 enum34;
inherit (pyqt5) sip;
# source: https://www.riverbankcomputing.com/pipermail/pyqt/2020-June/042985.html
patches = lib.optional (lib.hasPrefix "5.14" pyqt5.version)
[ ./fix-build-with-qt-514.patch ]
;
inherit (pythonPackages) buildPythonPackage python isPy27 pyqt5 enum34 sip pyqt-builder;
in buildPythonPackage rec {
pname = "PyQtWebEngine";
version = "5.15.4";
format = "other";
format = "pyproject";
disabled = isPy27;
src = pythonPackages.fetchPypi {
inherit pname version;
sha256 = "06fc35hzg346a9c86dk7vzm1fakkgzn5l52jfq3bix3587sjip6f";
};
inherit patches;
postPatch = ''
substituteInPlace pyproject.toml \
--replace "[tool.sip.project]" "[tool.sip.project]''\nsip-include-dirs = [\"${pyqt5}/${python.sitePackages}/PyQt5/bindings\"]"
'';
outputs = [ "out" "dev" ];
@ -33,6 +31,7 @@ in buildPythonPackage rec {
qtbase
qtsvg
qtwebengine
pyqt-builder
];
buildInputs = [
@ -42,49 +41,20 @@ in buildPythonPackage rec {
qtwebengine
];
propagatedBuildInputs = [ pyqt5 ]
++ lib.optional (!isPy3k) enum34;
propagatedBuildInputs = [ pyqt5 ];
dontWrapQtApps = true;
configurePhase = ''
runHook preConfigure
# Avoid running qmake, which is in nativeBuildInputs
dontConfigure = true;
mkdir -p "$out/share/sip/PyQt5"
# Checked using pythonImportsCheck
doCheck = false;
# FIXME: Without --no-dist-info, I get
# unable to create /nix/store/yv4pzx3lxk3lscq0pw3hqzs7k4x76xsm-python3-3.7.2/lib/python3.7/site-packages/PyQtWebEngine-5.12.dist-info
${python.executable} configure.py -w \
--destdir="$out/${python.sitePackages}/PyQt5" \
--no-dist-info \
--apidir="$out/api/${python.libPrefix}" \
--sipdir="$out/share/sip/PyQt5" \
--pyqt-sipdir="${pyqt5}/share/sip/PyQt5" \
--stubsdir="$out/${python.sitePackages}/PyQt5"
runHook postConfigure
'';
postInstall = ''
# Let's make it a namespace package
cat << EOF > $out/${python.sitePackages}/PyQt5/__init__.py
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
EOF
'';
installCheckPhase = let
modules = [
"PyQt5.QtWebEngine"
"PyQt5.QtWebEngineWidgets"
];
imports = lib.concatMapStrings (module: "import ${module};") modules;
in ''
echo "Checking whether modules can be imported..."
PYTHONPATH=$PYTHONPATH:$out/${python.sitePackages} ${python.interpreter} -c "${imports}"
'';
doCheck = true;
pythonImportsCheck = [
"PyQt5.QtWebEngine"
"PyQt5.QtWebEngineWidgets"
];
enableParallelBuilding = true;

View file

@ -3,13 +3,17 @@
, qscintilla
, qtbase
}:
with pythonPackages;
buildPythonPackage {
let
inherit (pythonPackages) buildPythonPackage isPy3k python sip_4 pyqt5;
in buildPythonPackage rec {
pname = "qscintilla";
version = qscintilla.version;
src = qscintilla.src;
format = "other";
disabled = !isPy3k;
nativeBuildInputs = [ sip_4 qtbase ];
buildInputs = [ qscintilla ];
propagatedBuildInputs = [ pyqt5 ];
@ -38,11 +42,21 @@ buildPythonPackage {
--qsci-incdir=${qscintilla}/include \
--qsci-featuresdir=${qscintilla}/mkspecs/features \
--qsci-libdir=${qscintilla}/lib \
--pyqt-sipdir=${pyqt5}/share/sip/PyQt5 \
--pyqt-sipdir=${pyqt5}/${python.sitePackages}/PyQt5/bindings \
--qsci-sipdir=$out/share/sip/PyQt5 \
--sip-incdir=${sip_4}/include
'';
postInstall = ''
# Needed by pythonImportsCheck to find the module
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
'';
# Checked using pythonImportsCheck
doCheck = false;
pythonImportsCheck = [ "PyQt5.Qsci" ];
meta = with lib; {
description = "A Python binding to QScintilla, Qt based text editing control";
license = licenses.lgpl21Plus;

View file

@ -36,7 +36,7 @@ buildPythonPackage rec {
meta = with lib; {
description = "Creates C++ bindings for Python modules";
homepage = "http://www.riverbankcomputing.co.uk/";
homepage = "https://riverbankcomputing.com/";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ lovek323 sander ];
platforms = platforms.all;

View file

@ -2,12 +2,12 @@
buildPythonPackage rec {
pname = "sip";
version = "5.5.0";
version = "6.1.1";
src = fetchPypi {
pname = "sip";
inherit version;
sha256 = "1idaivamp1jvbbai9yzv471c62xbqxhaawccvskaizihkd0lq0jx";
sha256 = "083ykzg7zbvrfrg3ram2vx93zrmhpm817kf9bkhw8r6pzkr5mljj";
};
propagatedBuildInputs = [ packaging toml ];
@ -33,7 +33,7 @@ buildPythonPackage rec {
meta = with lib; {
description = "Creates C++ bindings for Python modules";
homepage = "http://www.riverbankcomputing.co.uk/";
homepage = "https://riverbankcomputing.com/";
license = licenses.gpl3Only;
maintainers = with maintainers; [ eduardosm ];
};

View file

@ -1,229 +0,0 @@
{ lib, stdenv, fetchurl, substituteAll
, pkg-config
, cups, zlib, libjpeg, libusb1, python2Packages, sane-backends
, dbus, file, ghostscript, usbutils
, net-snmp, openssl, perl, nettools
, bash, coreutils, util-linux
, withQt5 ? true
, withPlugin ? false
, withStaticPPDInstall ? false
}:
let
name = "hplip-${version}";
version = "3.18.5";
src = fetchurl {
url = "mirror://sourceforge/hplip/${name}.tar.gz";
sha256 = "0xb7ga2wgbwjxsss67mjn2y6fmqsfwzmv11ivvfzhnl36lh22hkb";
};
plugin = fetchurl {
url = "https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/${name}-plugin.run";
sha256 = "1jf74jya071zqvwhy9n0c3007pzgcxydkw7qdh4sx70brly81i7p";
};
hplipState = substituteAll {
inherit version;
src = ./hplip.state;
};
hplipPlatforms = {
i686-linux = "x86_32";
x86_64-linux = "x86_64";
armv6l-linux = "arm32";
armv7l-linux = "arm32";
aarch64-linux = "arm64";
};
hplipArch = hplipPlatforms.${stdenv.hostPlatform.system}
or (throw "HPLIP not supported on ${stdenv.hostPlatform.system}");
pluginArches = [ "x86_32" "x86_64" "arm32" "arm64" ];
in
assert withPlugin -> builtins.elem hplipArch pluginArches
|| throw "HPLIP plugin not supported on ${stdenv.hostPlatform.system}";
python2Packages.buildPythonApplication {
inherit name src;
format = "other";
buildInputs = [
libjpeg
cups
libusb1
sane-backends
dbus
file
ghostscript
net-snmp
openssl
perl
zlib
];
nativeBuildInputs = [
pkg-config
];
pythonPath = with python2Packages; [
dbus
pillow
pygobject2
reportlab
usbutils
sip_4
] ++ lib.optionals withQt5 [
pyqt5
];
makeWrapperArgs = [ "--prefix" "PATH" ":" "${nettools}/bin" ];
prePatch = ''
# HPLIP hardcodes absolute paths everywhere. Nuke from orbit.
find . -type f -exec sed -i \
-e s,/etc/hp,$out/etc/hp,g \
-e s,/etc/sane.d,$out/etc/sane.d,g \
-e s,/usr/include/libusb-1.0,${libusb1.dev}/include/libusb-1.0,g \
-e s,/usr/share/hal/fdi/preprobe/10osvendor,$out/share/hal/fdi/preprobe/10osvendor,g \
-e s,/usr/lib/systemd/system,$out/lib/systemd/system,g \
-e s,/var/lib/hp,$out/var/lib/hp,g \
-e s,/usr/bin/perl,${perl}/bin/perl,g \
-e s,/usr/bin/file,${file}/bin/file,g \
-e s,/usr/bin/gs,${ghostscript}/bin/gs,g \
-e s,/usr/share/cups/fonts,${ghostscript}/share/ghostscript/fonts,g \
-e "s,ExecStart=/usr/bin/python /usr/bin/hp-config_usb_printer,ExecStart=$out/bin/hp-config_usb_printer,g" \
{} +
'';
preConfigure = ''
export configureFlags="$configureFlags
--with-hpppddir=$out/share/cups/model/HP
--with-cupsfilterdir=$out/lib/cups/filter
--with-cupsbackenddir=$out/lib/cups/backend
--with-icondir=$out/share/applications
--with-systraydir=$out/xdg/autostart
--with-mimedir=$out/etc/cups
--enable-policykit
${lib.optionalString withStaticPPDInstall "--enable-cups-ppd-install"}
--disable-qt4
${lib.optionalString withQt5 "--enable-qt5"}
"
export makeFlags="
halpredir=$out/share/hal/fdi/preprobe/10osvendor
rulesdir=$out/etc/udev/rules.d
policykit_dir=$out/share/polkit-1/actions
policykit_dbus_etcdir=$out/etc/dbus-1/system.d
policykit_dbus_sharedir=$out/share/dbus-1/system-services
hplip_confdir=$out/etc/hp
hplip_statedir=$out/var/lib/hp
"
# Prevent 'ppdc: Unable to find include file "<font.defs>"' which prevent
# generation of '*.ppd' files.
# This seems to be a 'ppdc' issue when the tool is run in a hermetic sandbox.
# Could not find how to fix the problem in 'ppdc' so this is a workaround.
export CUPS_DATADIR="${cups}/share/cups"
'';
enableParallelBuilding = true;
#
# Running `hp-diagnose_plugin -g` can be used to diagnose
# issues with plugins.
#
postInstall = lib.optionalString withPlugin ''
sh ${plugin} --noexec --keep
cd plugin_tmp
cp plugin.spec $out/share/hplip/
mkdir -p $out/share/hplip/data/firmware
cp *.fw.gz $out/share/hplip/data/firmware
mkdir -p $out/share/hplip/data/plugins
cp license.txt $out/share/hplip/data/plugins
mkdir -p $out/share/hplip/prnt/plugins
for plugin in lj hbpl1; do
cp $plugin-${hplipArch}.so $out/share/hplip/prnt/plugins
chmod 0755 $out/share/hplip/prnt/plugins/$plugin-${hplipArch}.so
ln -s $out/share/hplip/prnt/plugins/$plugin-${hplipArch}.so \
$out/share/hplip/prnt/plugins/$plugin.so
done
mkdir -p $out/share/hplip/scan/plugins
for plugin in bb_soap bb_marvell bb_soapht bb_escl; do
cp $plugin-${hplipArch}.so $out/share/hplip/scan/plugins
chmod 0755 $out/share/hplip/scan/plugins/$plugin-${hplipArch}.so
ln -s $out/share/hplip/scan/plugins/$plugin-${hplipArch}.so \
$out/share/hplip/scan/plugins/$plugin.so
done
mkdir -p $out/share/hplip/fax/plugins
for plugin in fax_marvell; do
cp $plugin-${hplipArch}.so $out/share/hplip/fax/plugins
chmod 0755 $out/share/hplip/fax/plugins/$plugin-${hplipArch}.so
ln -s $out/share/hplip/fax/plugins/$plugin-${hplipArch}.so \
$out/share/hplip/fax/plugins/$plugin.so
done
mkdir -p $out/var/lib/hp
cp ${hplipState} $out/var/lib/hp/hplip.state
'';
# The installed executables are just symlinks into $out/share/hplip,
# but wrapPythonPrograms ignores symlinks. We cannot replace the Python
# modules in $out/share/hplip with wrapper scripts because they import
# each other as libraries. Instead, we emulate wrapPythonPrograms by
# 1. Calling patchPythonProgram on the original script in $out/share/hplip
# 2. Making our own wrapper pointing directly to the original script.
dontWrapPythonPrograms = true;
preFixup = ''
buildPythonPath "$out $pythonPath"
for bin in $out/bin/*; do
py=$(readlink -m $bin)
rm $bin
echo "patching \`$py'..."
patchPythonScript "$py"
echo "wrapping \`$bin'..."
makeWrapper "$py" "$bin" \
--prefix PATH ':' "$program_PATH" \
--set PYTHONNOUSERSITE "true" \
$makeWrapperArgs
done
'';
# There are some binaries there, which reference gcc-unwrapped otherwise.
stripDebugList = [
"share/hplip"
];
postFixup = ''
substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
# Patch udev rules:
# with plugin, they upload firmware to printers,
# without plugin, they complain about the missing plugin.
substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \
--replace {,${bash}}/bin/sh \
--replace /usr/bin/nohup "" \
--replace {,${util-linux}/bin/}logger \
--replace {/usr,$out}/bin
'';
meta = with lib; {
description = "Print, scan and fax HP drivers for Linux";
homepage = "https://developers.hp.com/hp-linux-imaging-and-printing";
downloadPage = "https://sourceforge.net/projects/hplip/files/hplip/";
license = if withPlugin
then licenses.unfree
else with licenses; [ mit bsd2 gpl2Plus ];
platforms = [ "i686-linux" "x86_64-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" ];
maintainers = with maintainers; [ jgeerds ttuegel ];
};
}

View file

@ -30745,10 +30745,6 @@ in
hplipWithPlugin_3_16_11 = hplip_3_16_11.override { withPlugin = true; };
hplip_3_18_5 = callPackage ../misc/drivers/hplip/3.18.5.nix { };
hplipWithPlugin_3_18_5 = hplip_3_18_5.override { withPlugin = true; };
hyperfine = callPackage ../tools/misc/hyperfine {
inherit (darwin.apple_sdk.frameworks) Security;
};

View file

@ -6349,9 +6349,7 @@ in {
pyqt4 = callPackage ../development/python-modules/pyqt/4.x.nix { };
pyqt5 = pkgs.libsForQt5.callPackage ../development/python-modules/pyqt/5.x.nix {
pythonPackages = self;
};
pyqt5 = callPackage ../development/python-modules/pyqt/5.x.nix { };
pyqt5_with_qtmultimedia = self.pyqt5.override {
withMultimedia = true;