From 76ad2796be28c5fbe8f8fe2b9bada12c3e1360e2 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Tue, 19 Feb 2019 11:43:55 +0800 Subject: [PATCH 1/3] qscintilla: 2.9.4 -> 2.11.2 We strip the library suffix as we don't need it and it confuses various downstream consumers. Also replace calls to sed with substituteInPlace as the latter will complain in case it doesn't perform a substitution. --- .../libraries/qscintilla/default.nix | 58 ++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/pkgs/development/libraries/qscintilla/default.nix b/pkgs/development/libraries/qscintilla/default.nix index 43f0e431bb1..c75f324bf26 100644 --- a/pkgs/development/libraries/qscintilla/default.nix +++ b/pkgs/development/libraries/qscintilla/default.nix @@ -4,22 +4,26 @@ , fixDarwinDylibNames }: -# Fix Xcode 8 compilation problem -let xcodePatch = - fetchurl { url = "https://raw.githubusercontent.com/Homebrew/formula-patches/a651d71/qscintilla2/xcode-8.patch"; - sha256 = "1a88309fdfd421f4458550b710a562c622d72d6e6fdd697107e4a43161d69bc9"; }; -in -stdenv.mkDerivation rec { - pname = "qscintilla"; - version = "2.9.4"; +let + # Fix Xcode 8 compilation problem + xcodePatch = fetchurl { + url = "https://raw.githubusercontent.com/Homebrew/formula-patches/a651d71/qscintilla2/xcode-8.patch"; + sha256 = "1a88309fdfd421f4458550b710a562c622d72d6e6fdd697107e4a43161d69bc9"; + }; - name = "${pname}-${if withQt5 then "qt5" else "qt4"}-${version}"; + pname = "qscintilla-qt${if withQt5 then "5" else "4"}"; + version = "2.11.2"; + +in stdenv.mkDerivation rec { + inherit pname version; src = fetchurl { - url = "mirror://sourceforge/pyqt/QScintilla2/QScintilla-${version}/QScintilla_gpl-${version}.zip"; - sha256 = "04678skipydx68zf52vznsfmll2v9aahr66g50lcqbr6xsmgr1yi"; + url = "https://www.riverbankcomputing.com/static/Downloads/QScintilla/${version}/QScintilla_gpl-${version}.tar.gz"; + sha256 = "18glb2v07mwfz6p8qmwhzcaaczyc36x3gn9wx8ndm7q6d93xr6q2"; }; + sourceRoot = "QScintilla_gpl-${version}/Qt4Qt5"; + buildInputs = [ (if withQt5 then qtbase else qt4) ]; propagatedBuildInputs = lib.optional (withQt5 && stdenv.isDarwin) qtmacextras; @@ -28,24 +32,23 @@ stdenv.mkDerivation rec { ++ (if withQt5 then [ qmake ] else [ qmake4Hook ]) ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; - patches = lib.optional (stdenv.isDarwin && withQt5) [ xcodePatch ]; enableParallelBuilding = true; - preConfigure = '' - cd Qt4Qt5 - sed -i qscintilla.pro \ - -e "s,\$\$\\[QT_INSTALL_LIBS\\],$out/lib," \ - -e "s,\$\$\\[QT_INSTALL_HEADERS\\],$out/include/," \ - -e "s,\$\$\\[QT_INSTALL_TRANSLATIONS\\],$out/translations," \ - ${if withQt5 then '' - -e "s,\$\$\\[QT_HOST_DATA\\]/mkspecs,$out/mkspecs," \ - -e "s,\$\$\\[QT_INSTALL_DATA\\]/mkspecs,$out/mkspecs," \ - -e "s,\$\$\\[QT_INSTALL_DATA\\],$out/share," - '' else '' - -e "s,\$\$\\[QT_INSTALL_DATA\\],$out/share/qt," - ''} + # By default qscintilla will name the library with a qt version suffix which + # confuses the crap out of sqlitebrowser and possibly others so we simply + # strip the suffix as we don't need it and the various FindQScintilla.cmake + # files floating around *should* look for the un-suffixed version. + postPatch = '' + substituteInPlace qscintilla.pro \ + --replace '_qt$''${QT_MAJOR_VERSION}' "" \ + --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"} ''; meta = with stdenv.lib; { @@ -64,9 +67,10 @@ stdenv.mkDerivation rec { proportional fonts, bold and italics, multiple foreground and background colours and multiple fonts. ''; - homepage = http://www.riverbankcomputing.com/software/qscintilla/intro; + homepage = https://www.riverbankcomputing.com/software/qscintilla/intro; license = with licenses; [ gpl2 gpl3 ]; # and commercial - platforms = platforms.unix; maintainers = with maintainers; [ peterhoeg ]; + platforms = platforms.unix; + broken = !withQt5; }; } From 96f5d7941a3c96c0b6e36b2a314c087dfe015afd Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Mon, 26 Aug 2019 19:03:42 +0800 Subject: [PATCH 2/3] sqlitebrowser: do not use vendored qscintilla --- .../tools/database/sqlitebrowser/default.nix | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pkgs/development/tools/database/sqlitebrowser/default.nix b/pkgs/development/tools/database/sqlitebrowser/default.nix index 7813eba0436..fe2db3ff79f 100644 --- a/pkgs/development/tools/database/sqlitebrowser/default.nix +++ b/pkgs/development/tools/database/sqlitebrowser/default.nix @@ -1,25 +1,20 @@ { mkDerivation, lib, fetchFromGitHub, cmake, antlr -, qtbase, qttools, sqlite }: +, qtbase, qttools, qscintilla, sqlite }: mkDerivation rec { - version = "3.11.2"; pname = "sqlitebrowser"; + version = "3.11.2"; src = fetchFromGitHub { - repo = pname; owner = pname; + repo = pname; rev = "v${version}"; sha256 = "0ydd5fg76d5d23byac1f7f8mzx3brmd0cnnkd58qpmlzi7p9hcvx"; }; - buildInputs = [ qtbase sqlite ]; + buildInputs = [ antlr qtbase qscintilla sqlite ]; - nativeBuildInputs = [ cmake antlr qttools ]; - - # Use internal `qscintilla` rather than our package to fix the build - # (https://github.com/sqlitebrowser/sqlitebrowser/issues/1348#issuecomment-374170936). - # This can probably be removed when https://github.com/NixOS/nixpkgs/pull/56034 is merged. - cmakeFlags = [ "-DFORCE_INTERNAL_QSCINTILLA=ON" ]; + nativeBuildInputs = [ cmake qttools ]; NIX_LDFLAGS = [ "-lQt5PrintSupport" From ffbf1db5c26f5f48e534c678ef28c42491a6663a Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Mon, 26 Aug 2019 19:20:59 +0800 Subject: [PATCH 3/3] sqlitebrowser: build on darwin too --- pkgs/development/tools/database/sqlitebrowser/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/database/sqlitebrowser/default.nix b/pkgs/development/tools/database/sqlitebrowser/default.nix index fe2db3ff79f..aa29277281d 100644 --- a/pkgs/development/tools/database/sqlitebrowser/default.nix +++ b/pkgs/development/tools/database/sqlitebrowser/default.nix @@ -27,6 +27,6 @@ mkDerivation rec { homepage = http://sqlitebrowser.org/; license = licenses.gpl3; maintainers = with maintainers; [ ma27 ]; - platforms = platforms.linux; # can only test on linux + platforms = platforms.unix; }; }