Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkgs/applications/audio/miniaudicle/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
, alsa-lib
, libsndfile
, qt4
, qscintilla
, qscintilla-qt4
, libpulseaudio
, libjack2
, audioBackend ? "pulse" # "pulse", "alsa", or "jack"
Expand Down Expand Up @@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
alsa-lib
libsndfile
qt4
qscintilla
qscintilla-qt4
] ++ lib.optional (audioBackend == "pulse") libpulseaudio
++ lib.optional (audioBackend == "jack") libjack2;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/gis/qgis/unwrapped.nix
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ in mkDerivation rec {
cmakeFlags = [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DPYQT5_SIP_DIR=${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings"
"-DQSCI_SIP_DIR=${python3Packages.qscintilla-qt5}/share/sip/PyQt5"
"-DQSCI_SIP_DIR=${python3Packages.qscintilla-qt5}/${python3Packages.python.sitePackages}/PyQt5/bindings"
] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF"
++ lib.optional withGrass "-DGRASS_PREFIX7=${grass}/${grass.name}";

Expand Down
8 changes: 4 additions & 4 deletions pkgs/applications/misc/sqliteman/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, qt4, qscintilla }:
{ lib, stdenv, fetchFromGitHub, cmake, qt4, qscintilla-qt4 }:

stdenv.mkDerivation rec {
pname = "sqliteman";
Expand All @@ -12,16 +12,16 @@ stdenv.mkDerivation rec {
};

nativeBuildInputs = [ cmake ];
buildInputs = [ qt4 qscintilla ];
buildInputs = [ qt4 qscintilla-qt4 ];

prePatch = ''
sed -i 's,m_file(0),m_file(QString()),' Sqliteman/sqliteman/main.cpp
'';

preConfigure = ''
cd Sqliteman
sed -i 's,/usr/include/Qsci,${qscintilla}/include/Qsci,' cmake/modules/FindQScintilla.cmake
sed -i 's,PATHS ''${QT_LIBRARY_DIR},PATHS ${qscintilla}/libs,' cmake/modules/FindQScintilla.cmake
sed -i 's,/usr/include/Qsci,${qscintilla-qt4}/include/Qsci,' cmake/modules/FindQScintilla.cmake
sed -i 's,PATHS ''${QT_LIBRARY_DIR},PATHS ${qscintilla-qt4}/libs,' cmake/modules/FindQScintilla.cmake
'';

meta = with lib; {
Expand Down
60 changes: 60 additions & 0 deletions pkgs/development/libraries/qscintilla-qt4/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{ stdenv, lib, fetchurl, unzip, qt4, qmake4Hook
}:

stdenv.mkDerivation rec {
pname = "qscintilla-qt4";
version = "2.11.6";
Comment thread
willcohen marked this conversation as resolved.
Outdated

src = fetchurl {
url = "https://www.riverbankcomputing.com/static/Downloads/QScintilla/${version}/QScintilla-${version}.tar.gz";
sha256 = "5zRgV9tH0vs4RGf6/M/LE6oHQTc8XVk7xytVsvDdIKc=";
};

sourceRoot = "QScintilla-${version}/Qt4Qt5";

buildInputs = [ qt4 ];

nativeBuildInputs = [ unzip qmake4Hook ];

patches = ./fix-qt4-build.patch;

# Make sure that libqscintilla2.so is available in $out/lib since it is expected
# by some packages such as sqlitebrowser
postFixup = ''
ln -s $out/lib/libqscintilla2_qt?.so $out/lib/libqscintilla2.so
'';

dontWrapQtApps = true;

postPatch = ''
substituteInPlace qscintilla.pro \
--replace '$$[QT_INSTALL_LIBS]' $out/lib \
--replace '$$[QT_INSTALL_HEADERS]' $out/include \
--replace '$$[QT_INSTALL_TRANSLATIONS]' $out/translations \
--replace '$$[QT_HOST_DATA]/mkspecs' $out/mkspecs \
--replace '$$[QT_INSTALL_DATA]/mkspecs' $out/mkspecs \
--replace '$$[QT_INSTALL_DATA]' $out/share
'';

meta = with lib; {
description = "A Qt port of the Scintilla text editing library";
longDescription = ''
QScintilla is a port to Qt of Neil Hodgson's Scintilla C++ editor
control.

As well as features found in standard text editing components,
QScintilla includes features especially useful when editing and
debugging source code. These include support for syntax styling,
error indicators, code completion and call tips. The selection
margin can contain markers like those used in debuggers to
indicate breakpoints and the current line. Styling choices are
more open than with many editors, allowing the use of
proportional fonts, bold and italics, multiple foreground and
background colours and multiple fonts.
'';
homepage = "https://www.riverbankcomputing.com/software/qscintilla/intro";
license = with licenses; [ gpl3 ]; # and commercial
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.linux;
};
}
33 changes: 13 additions & 20 deletions pkgs/development/libraries/qscintilla/default.nix
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
{ stdenv, lib, fetchurl, unzip
, qt4 ? null, qmake4Hook ? null
, withQt5 ? false, qtbase ? null, qtmacextras ? null, qmake ? null
, qtbase, qtmacextras
, qmake
, fixDarwinDylibNames
}:

let
pname = "qscintilla-qt${if withQt5 then "5" else "4"}";
version = "2.11.6";

in stdenv.mkDerivation rec {
inherit pname version;
stdenv.mkDerivation rec {
pname = "qscintilla-qt5";
version = "2.13.1";
Comment thread
willcohen marked this conversation as resolved.
Outdated

src = fetchurl {
url = "https://www.riverbankcomputing.com/static/Downloads/QScintilla/${version}/QScintilla-${version}.tar.gz";
sha256 = "5zRgV9tH0vs4RGf6/M/LE6oHQTc8XVk7xytVsvDdIKc=";
url = "https://www.riverbankcomputing.com/static/Downloads/QScintilla/${version}/QScintilla_src-${version}.tar.gz";
sha256 = "gA49IHGpa8zNdYE0avDS/ij8MM1oUwy4MCaF0BOv1Uo=";
};

sourceRoot = "QScintilla-${version}/Qt4Qt5";
sourceRoot = "QScintilla_src-${version}/src";

buildInputs = [ (if withQt5 then qtbase else qt4) ];
buildInputs = [ qtbase ];

propagatedBuildInputs = lib.optional (withQt5 && stdenv.isDarwin) qtmacextras;
propagatedBuildInputs = lib.optional stdenv.isDarwin qtmacextras;
Comment thread
willcohen marked this conversation as resolved.
Outdated

nativeBuildInputs = [ unzip ]
++ (if withQt5 then [ qmake ] else [ qmake4Hook ])
nativeBuildInputs = [ unzip qmake ]
++ lib.optional stdenv.isDarwin fixDarwinDylibNames;

patches = lib.optional (!withQt5) ./fix-qt4-build.patch;

# Make sure that libqscintilla2.so is available in $out/lib since it is expected
# by some packages such as sqlitebrowser
postFixup = ''
Expand All @@ -36,14 +30,13 @@ in stdenv.mkDerivation rec {

dontWrapQtApps = true;

postPatch = ''
preConfigure = ''
substituteInPlace qscintilla.pro \
--replace '$$[QT_INSTALL_LIBS]' $out/lib \
--replace '$$[QT_INSTALL_HEADERS]' $out/include \
--replace '$$[QT_INSTALL_TRANSLATIONS]' $out/translations \
--replace '$$[QT_HOST_DATA]/mkspecs' $out/mkspecs \
--replace '$$[QT_INSTALL_DATA]/mkspecs' $out/mkspecs \
--replace '$$[QT_INSTALL_DATA]' $out/share${lib.optionalString (! withQt5) "/qt"}
--replace '$$[QT_INSTALL_DATA]' $out/share
'';

meta = with lib; {
Expand Down
42 changes: 42 additions & 0 deletions pkgs/development/python-modules/qscintilla-qt4/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{ lib
, buildPythonPackage
, disabledIf
, isPy3k
, isPyPy
, pkgs
, python
, pyqt4
}:

disabledIf (isPy3k || isPyPy)

@prusnak prusnak Jan 6, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, where does this limitation come from? I don't see it in the previous code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was just a 100% copy of what was in https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/qscintilla/default.nix -- I didn't do any of the refactoring you're looking into now!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

(buildPythonPackage {
pname = "qscintilla";
version = pkgs.qscintilla.version;
format = "other";

src = pkgs.qscintilla.src;

nativeBuildInputs = [ pkgs.xorg.lndir ];

buildInputs = [ pyqt4.qt pyqt4 ];

preConfigure = ''
mkdir -p $out
lndir ${pyqt4} $out
rm -rf "$out/nix-support"
cd Python
${python.executable} ./configure-old.py \
--destdir $out/lib/${python.libPrefix}/site-packages/PyQt4 \
--apidir $out/api/${python.libPrefix} \
-n ${pkgs.qscintilla}/include \
-o ${pkgs.qscintilla}/lib \
--sipdir $out/share/sip
'';

meta = with lib; {
description = "A Python binding to QScintilla, Qt based text editing control";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ danbst ];
platforms = platforms.linux;
};
})
54 changes: 28 additions & 26 deletions pkgs/development/python-modules/qscintilla-qt5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,53 @@
, pythonPackages
, qscintilla
, qtbase
, qmake
, qtmacextras ? null
Comment thread
willcohen marked this conversation as resolved.
Outdated
, stdenv
}:

let
inherit (pythonPackages) buildPythonPackage isPy3k python sip_4 pyqt5;
inherit (pythonPackages) buildPythonPackage isPy3k python sip sipbuild pyqt5 pyqt-builder;
in buildPythonPackage rec {
pname = "qscintilla";
version = qscintilla.version;
src = qscintilla.src;
format = "other";
format = "pyproject";

disabled = !isPy3k;

nativeBuildInputs = [ sip_4 qtbase ];
buildInputs = [ qscintilla ];
propagatedBuildInputs = [ pyqt5 ];
nativeBuildInputs = [ sip qmake pyqt-builder qscintilla ];
buildInputs = [ qtbase ];
propagatedBuildInputs = [ pyqt5 ] ++ lib.optional (stdenv.isDarwin) qtmacextras;
Comment thread
willcohen marked this conversation as resolved.
Outdated

dontWrapQtApps = true;

postPatch = ''
substituteInPlace Python/configure.py \
cd Python
cp pyproject-qt5.toml pyproject.toml
echo '[tool.sip.project]' >> pyproject.toml
echo 'sip-include-dirs = [ "${pyqt5}/${python.sitePackages}/PyQt5/bindings"]' \
>> pyproject.toml
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace project.py \
--replace \
"target_config.py_module_dir" \
"'$out/${python.sitePackages}'"
'';
"if self.project.qsci_external_lib:
if self.qsci_features_dir is not None:" \
"if self.project.qsci_external_lib:
self.builder_settings.append('QT += widgets')

preConfigure = ''
# configure.py will look for this folder
mkdir -p $out/share/sip/PyQt5
self.builder_settings.append('QT += printsupport')

cd Python
substituteInPlace configure.py \
--replace "qmake = {'CONFIG': 'qscintilla2'}" "qmake = {'CONFIG': 'qscintilla2', 'QT': 'widgets printsupport'}"
${python.executable} ./configure.py \
--pyqt=PyQt5 \
--destdir=$out/${python.sitePackages}/PyQt5 \
--stubsdir=$out/${python.sitePackages}/PyQt5 \
--apidir=$out/api/${python.libPrefix} \
--qsci-incdir=${qscintilla}/include \
--qsci-featuresdir=${qscintilla}/mkspecs/features \
--qsci-libdir=${qscintilla}/lib \
--pyqt-sipdir=${pyqt5}/${python.sitePackages}/PyQt5/bindings \
--qsci-sipdir=$out/share/sip/PyQt5 \
--sip-incdir=${sip_4}/include
if self.qsci_features_dir is not None:"
'';

dontConfigure = true;

build = ''
sip-install --qsci-features-dir ${qscintilla}/mkspecs/features \
--qsci-include-dir ${qscintilla}/include \
--qsci-library-dir ${qscintilla}/lib --api-dir ${qscintilla}/share";
'';
postInstall = ''
# Needed by pythonImportsCheck to find the module
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
Expand Down
10 changes: 6 additions & 4 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9092,7 +9092,9 @@ with pkgs;

qprint = callPackage ../tools/text/qprint { };

qscintilla = callPackage ../development/libraries/qscintilla { };
qscintilla = libsForQt5.callPackage ../development/libraries/qscintilla { };

qscintilla-qt4 = callPackage ../development/libraries/qscintilla-qt4 { };

qshowdiff = callPackage ../tools/text/qshowdiff { };

Expand Down Expand Up @@ -19492,17 +19494,17 @@ with pkgs;
});

libsForQt512 = recurseIntoAttrs (import ./qt5-packages.nix {
inherit lib pkgs;
inherit lib pkgs stdenv;
Comment thread
willcohen marked this conversation as resolved.
Outdated
qt5 = qt512;
});

libsForQt514 = recurseIntoAttrs (import ./qt5-packages.nix {
inherit lib pkgs;
inherit lib pkgs stdenv;
Comment thread
willcohen marked this conversation as resolved.
Outdated
qt5 = qt514;
});

libsForQt515 = recurseIntoAttrs (import ./qt5-packages.nix {
inherit lib pkgs;
inherit lib pkgs stdenv;
Comment thread
willcohen marked this conversation as resolved.
Outdated
qt5 = qt515;
});

Expand Down
4 changes: 2 additions & 2 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8287,13 +8287,13 @@ in {

qreactor = callPackage ../development/python-modules/qreactor { };

qscintilla-qt4 = callPackage ../development/python-modules/qscintilla { };
qscintilla-qt4 = callPackage ../development/python-modules/qscintilla-qt4 { };

qscintilla-qt5 = pkgs.libsForQt5.callPackage ../development/python-modules/qscintilla-qt5 {
pythonPackages = self;
};

qscintilla = self.qscintilla-qt4;
qscintilla = self.qscintilla-qt5;

qtawesome = callPackage ../development/python-modules/qtawesome { };

Expand Down
5 changes: 2 additions & 3 deletions pkgs/top-level/qt5-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{ lib
, pkgs
, qt5
, stdenv
Comment thread
willcohen marked this conversation as resolved.
Outdated
}:

(lib.makeScope pkgs.newScope ( self:
Expand Down Expand Up @@ -190,9 +191,7 @@ in (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdParty // kdeGea

qoauth = callPackage ../development/libraries/qoauth { };

qscintilla = callPackage ../development/libraries/qscintilla {
withQt5 = true;
};
qscintilla = callPackage ../development/libraries/qscintilla { };

qt5ct = callPackage ../tools/misc/qt5ct { };

Expand Down