nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1307B)


      1 { mkDerivation
      2 , stdenv
      3 , lib
      4 , fetchFromGitHub
      5 , pkg-config
      6 , qmake
      7 , qtbase
      8 , qtmultimedia
      9 , qtsvg
     10 , qttools
     11 , qtx11extras
     12 , libX11
     13 , libXext
     14 , libXtst
     15 , withI18n ? true
     16 }:
     17 
     18 mkDerivation rec {
     19   pname = "redict";
     20   version = "2019-06-21";
     21 
     22   src = fetchFromGitHub {
     23     owner = "rekols";
     24     repo = pname;
     25     rev = "525aac01ed5fc0f74f8393dc5b5b3bb57c9b0c5f";
     26     hash = "sha256-VGYhcQqnK50NqF6MFcKDyaPECDnAjVRzhMR7Wldoiv4=";
     27   };
     28 
     29   nativeBuildInputs = [ qmake pkg-config ]
     30     ++ lib.optional withI18n qttools;
     31   buildInputs = [ qtmultimedia qtsvg ]
     32     ++ lib.optionals stdenv.isLinux [ qtx11extras libX11 libXext libXtst ];
     33 
     34   postPatch = ''
     35     substituteInPlace redict.pro \
     36       --replace "unix " "unix:!mac "
     37     sed -i '1i#include <QPainterPath>' src/widgets/spinner.cpp
     38   '';
     39 
     40   preConfigure = lib.optionalString withI18n ''
     41     lupdate redict.pro
     42     lrelease redict.pro
     43   '';
     44 
     45   qmakeFlags = [
     46     "PREFIX=${placeholder "out"}"
     47     "BINDIR=${placeholder "out"}/bin"
     48     "APPDIR=${placeholder "out"}/share/applications"
     49   ];
     50 
     51   meta = with lib; {
     52     description = "A dictionary for Linux, based on C++/Qt development";
     53     inherit (src.meta) homepage;
     54     license = licenses.gpl3;
     55     maintainers = [ maintainers.sikmir ];
     56     platforms = platforms.unix;
     57     broken = stdenv.isDarwin;
     58   };
     59 }