summary refs log tree commit diff
path: root/pkgs/applications/editors/texworks/default.nix
blob: b27ab8bbb69bdba76d4b53215b55f4ecf7b5cb2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, wrapQtAppsHook
, hunspell
, poppler
, qt5compat
, qttools
, qtwayland
, withLua ? true, lua
, withPython ? true, python3 }:

stdenv.mkDerivation rec {
  pname = "texworks";
  version = "0.6.8";

  src = fetchFromGitHub {
    owner = "TeXworks";
    repo = "texworks";
    rev = "release-${version}";
    sha256 = "sha256-X0VuXNghHoNsNNDfZJXXJ++nfUa5ofjW8rv3CHOUzxQ=";
  };

  patches = [ ./0001-fix-build-with-qt-6.5.patch ];

  nativeBuildInputs = [
    cmake
    pkg-config
    wrapQtAppsHook
  ];

  buildInputs = [
    hunspell
    poppler
    qt5compat
    qttools
  ] ++ lib.optional withLua lua
    ++ lib.optional withPython python3
    ++ lib.optional stdenv.isLinux qtwayland;

  cmakeFlags = [
    "-DQT_DEFAULT_MAJOR_VERSION=6"
  ] ++ lib.optional withLua "-DWITH_LUA=ON"
    ++ lib.optional withPython "-DWITH_PYTHON=ON";

  meta = with lib; {
    changelog = "https://github.com/TeXworks/texworks/blob/${src.rev}/NEWS";
    description = "Simple TeX front-end program inspired by TeXShop";
    homepage = "http://www.tug.org/texworks/";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ dotlambda ];
    platforms = with platforms; linux;
  };
}