about summary refs log tree commit diff
path: root/pkgs/applications/misc/huggle/default.nix
blob: 3a6f25ede695d90d3e95dc5953b159f112d8acb9 (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
57
58
59
60
61
62
63
64
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, ncurses
, which
, cmake
, unzip
, wrapQtAppsHook
, qtwebengine
, yaml-cpp
, libirc
}:

stdenv.mkDerivation rec {
  pname = "huggle";
  version = "3.4.12";

  src = fetchFromGitHub {
    owner = "huggle";
    repo = "huggle3-qt-lx";
    rev = version;
    sha256 = "scNGmMVZ6z9FTQuZCdwRYk0WP5qKfdb/M9Co8TbiMDE=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
    wrapQtAppsHook
    pkg-config
    which
    cmake
  ];
  buildInputs = [ ncurses yaml-cpp qtwebengine libirc ];

  patches = [ ./00-remove-third-party.patch ./01-extensions.patch ];
  postPatch = ''
    rm -r src/3rd
    echo ${version} > src/huggle_core/version.txt
    substituteInPlace src/huggle_core/definitions_prod.hpp --subst-var out
    substituteInPlace src/CMakeLists.txt --replace '@libirc_includes@' '${libirc.out}'
  '';

  cmakeBuildType = "None";

  cmakeFlags = [
    "-S" "/build/source/src"
    "-DINSTALL_DATA_DIR=bin"
    "-DQT5_BUILD=ON"
    "-DWEB_ENGINE=ON"
    "-DBUILD_SHARED_LIBS=OFF"
    "-Wno-dev"
    "-DHUGGLE_EXT=TRUE"
  ];

  installTargets = [ "install" ];

  meta = with lib; {
    description = "Anti-vandalism tool for use on MediaWiki-based projects";
    homepage = "https://github.com/huggle/huggle3-qt-lx";
    license = licenses.gpl3Only;
    maintainers = [ maintainers.fee1-dead ];
    platforms = platforms.x86_64;
  };
}