diff options
author | Ben Siraphob <bensiraphob@gmail.com> | 2022-01-06 23:51:55 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-06 23:51:55 +0700 |
commit | 88d7e0ff334177f5a5494ed2616dae195adf6136 (patch) | |
tree | ac2433284ff1940d8f608fe8c602e4957083b6ea /pkgs/development | |
parent | 28880f4fe7d50e9640289d24666ea9cfd5d57382 (diff) | |
parent | a98370af81bd86f2ef3d2177536bb905b10af450 (diff) | |
download | nixpkgs-88d7e0ff334177f5a5494ed2616dae195adf6136.tar nixpkgs-88d7e0ff334177f5a5494ed2616dae195adf6136.tar.gz nixpkgs-88d7e0ff334177f5a5494ed2616dae195adf6136.tar.bz2 nixpkgs-88d7e0ff334177f5a5494ed2616dae195adf6136.tar.lz nixpkgs-88d7e0ff334177f5a5494ed2616dae195adf6136.tar.xz nixpkgs-88d7e0ff334177f5a5494ed2616dae195adf6136.tar.zst nixpkgs-88d7e0ff334177f5a5494ed2616dae195adf6136.zip |
Merge pull request #150595 from willcohen/qscintilla
qscintilla: fix build on darwin
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/libraries/qscintilla-qt4/default.nix | 60 | ||||
-rw-r--r-- | pkgs/development/libraries/qscintilla-qt4/fix-qt4-build.patch (renamed from pkgs/development/libraries/qscintilla/fix-qt4-build.patch) | 0 | ||||
-rw-r--r-- | pkgs/development/libraries/qscintilla/default.nix | 33 | ||||
-rw-r--r-- | pkgs/development/python-modules/qscintilla-qt4/default.nix | 42 | ||||
-rw-r--r-- | pkgs/development/python-modules/qscintilla-qt5/default.nix | 54 |
5 files changed, 143 insertions, 46 deletions
diff --git a/pkgs/development/libraries/qscintilla-qt4/default.nix b/pkgs/development/libraries/qscintilla-qt4/default.nix new file mode 100644 index 00000000000..7cefdec97ca --- /dev/null +++ b/pkgs/development/libraries/qscintilla-qt4/default.nix @@ -0,0 +1,60 @@ +{ stdenv, lib, fetchurl, unzip, qt4, qmake4Hook +}: + +stdenv.mkDerivation rec { + pname = "qscintilla-qt4"; + version = "2.11.6"; + + 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; + }; +} diff --git a/pkgs/development/libraries/qscintilla/fix-qt4-build.patch b/pkgs/development/libraries/qscintilla-qt4/fix-qt4-build.patch index 520a55b1ea2..520a55b1ea2 100644 --- a/pkgs/development/libraries/qscintilla/fix-qt4-build.patch +++ b/pkgs/development/libraries/qscintilla-qt4/fix-qt4-build.patch diff --git a/pkgs/development/libraries/qscintilla/default.nix b/pkgs/development/libraries/qscintilla/default.nix index fc2ef6c09a6..3dcbc22e15f 100644 --- a/pkgs/development/libraries/qscintilla/default.nix +++ b/pkgs/development/libraries/qscintilla/default.nix @@ -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"; 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.optionals stdenv.isDarwin [ qtmacextras ]; - 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 = '' @@ -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; { diff --git a/pkgs/development/python-modules/qscintilla-qt4/default.nix b/pkgs/development/python-modules/qscintilla-qt4/default.nix new file mode 100644 index 00000000000..bc3f3596923 --- /dev/null +++ b/pkgs/development/python-modules/qscintilla-qt4/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, disabledIf +, isPy3k +, isPyPy +, pkgs +, python +, pyqt4 +}: + +disabledIf (isPy3k || isPyPy) + (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; + }; + }) diff --git a/pkgs/development/python-modules/qscintilla-qt5/default.nix b/pkgs/development/python-modules/qscintilla-qt5/default.nix index 70ee4308913..11445c99f4f 100644 --- a/pkgs/development/python-modules/qscintilla-qt5/default.nix +++ b/pkgs/development/python-modules/qscintilla-qt5/default.nix @@ -2,51 +2,53 @@ , pythonPackages , qscintilla , qtbase +, qmake +, qtmacextras +, 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.optionals stdenv.isDarwin [ qtmacextras ]; 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" |