about summary refs log tree commit diff
path: root/pkgs/applications/editors/texworks/default.nix
blob: 4ddd4c9cb6c115b164a1d79f13055e966f358f51 (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
{ 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.9";

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

  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;
    mainProgram = "texworks";
  };
}