From c78216067b1153cf9ca65493b18ae121960ad2d2 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Mon, 26 Aug 2019 20:43:18 +0800 Subject: [PATCH] xxdiff: drop the old qt4 version in favour of qt5 --- .../development/tools/misc/xxdiff/default.nix | 51 ++++++++++++++----- pkgs/development/tools/misc/xxdiff/tip.nix | 36 ------------- pkgs/top-level/all-packages.nix | 7 ++- 3 files changed, 40 insertions(+), 54 deletions(-) delete mode 100644 pkgs/development/tools/misc/xxdiff/tip.nix diff --git a/pkgs/development/tools/misc/xxdiff/default.nix b/pkgs/development/tools/misc/xxdiff/default.nix index 51f4de8eacce..c187ad42c0e9 100644 --- a/pkgs/development/tools/misc/xxdiff/default.nix +++ b/pkgs/development/tools/misc/xxdiff/default.nix @@ -1,28 +1,51 @@ -{ stdenv, fetchurl, qt4, flex, bison, docutils }: +{ lib, mkDerivation, fetchFromBitbucket, docutils, bison, flex, qmake +, qtbase +}: -stdenv.mkDerivation rec { - name = "xxdiff-4.0.1"; +mkDerivation rec { + pname = "xxdiff"; + version = "5.0b1"; - src = fetchurl { - url = "mirror://sourceforge/xxdiff/${name}.tar.bz2"; - sha256 = "0050qd12fvlcfdh0iwjsaxgxdq7jsl70f85fbi7pz23skpddsn5z"; + src = fetchFromBitbucket { + owner = "blais"; + repo = pname; + rev = "5e5f885dfc43559549a81c59e9e8c9525306356a"; + sha256 = "0gbvxrkwkbvag3298j89smszghpr8ilxxfb0cvsknfqdf15b296w"; }; - nativeBuildInputs = [ flex bison qt4 docutils ]; + nativeBuildInputs = [ bison docutils flex qmake ]; - buildInputs = [ qt4 ]; + buildInputs = [ qtbase ]; - QMAKE = "qmake"; + dontUseQmakeConfigure = true; - configurePhase = "cd src; make -f Makefile.bootstrap"; + # c++11 and above is needed for building with Qt 5.9+ + NIX_CFLAGS_COMPILE = [ "-std=c++14" ]; - installPhase = "mkdir -pv $out/bin; cp -v ../bin/xxdiff $out/bin"; + sourceRoot = "source/src"; - meta = with stdenv.lib; { - homepage = http://furius.ca/xxdiff/; + postPatch = '' + substituteInPlace xxdiff.pro --replace ../bin ./bin + ''; + + preConfigure = '' + make -f Makefile.bootstrap + ''; + + installPhase = '' + runHook preInstall + + install -Dm555 -t $out/bin ./bin/xxdiff + install -Dm444 -t $out/share/doc/${pname} ${src}/README + + runHook postInstall + ''; + + meta = with lib; { description = "Graphical file and directories comparator and merge tool"; + homepage = "http://furius.ca/xxdiff/"; license = licenses.gpl2; + maintainers = with maintainers; [ pSub raskin ]; platforms = platforms.linux; - maintainers = with maintainers; [ pSub ]; }; } diff --git a/pkgs/development/tools/misc/xxdiff/tip.nix b/pkgs/development/tools/misc/xxdiff/tip.nix deleted file mode 100644 index 04827fade70d..000000000000 --- a/pkgs/development/tools/misc/xxdiff/tip.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ stdenv, fetchFromBitbucket, qtbase, flex, bison, docutils }: - -stdenv.mkDerivation { - name = "xxdiff-5.0b1"; - - src = fetchFromBitbucket { - owner = "blais"; - repo = "xxdiff"; - rev = "5e5f885dfc43559549a81c59e9e8c9525306356a"; - sha256 = "0gbvxrkwkbvag3298j89smszghpr8ilxxfb0cvsknfqdf15b296w"; - }; - - nativeBuildInputs = [ flex bison docutils ]; - - buildInputs = [ qtbase ]; - - # Fixes build with Qt 5.9 - NIX_CFLAGS_COMPILE = [ "-std=c++11" ]; - - preConfigure = '' - cd src - make -f Makefile.bootstrap - ''; - - postInstall = '' - install -D ../bin/xxdiff $out/bin/xxdiff - ''; - - meta = with stdenv.lib; { - homepage = http://furius.ca/xxdiff/; - description = "Graphical file and directories comparator and merge tool"; - license = licenses.gpl2; - platforms = platforms.linux; - maintainers = with maintainers; [ pSub raskin ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ca37025f7f31..382802f0cd68 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10192,10 +10192,9 @@ in xpwn = callPackage ../development/mobile/xpwn {}; - xxdiff = callPackage ../development/tools/misc/xxdiff { - bison = bison2; - }; - xxdiff-tip = libsForQt5.callPackage ../development/tools/misc/xxdiff/tip.nix { }; + xxdiff = libsForQt5.callPackage ../development/tools/misc/xxdiff { }; + + xxdiff-tip = xxdiff; yaml2json = callPackage ../development/tools/yaml2json { };