summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/xm/xmlcopyeditor/package.nix
blob: 2baaf2ac1837e01ead57e86cc07a8349fb2a3992 (plain)
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
65
66
67
68
{
  lib,
  stdenv,
  fetchurl,
  aspell,
  boost,
  expat,
  intltool,
  pkg-config,
  libxml2,
  libxslt,
  pcre2,
  wxwidgets_3_2,
  xercesc,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "xmlcopyeditor";
  version = "1.3.1.0";

  src = fetchurl {
    url = "mirror://sourceforge/xml-copy-editor/xmlcopyeditor-${finalAttrs.version}.tar.gz";
    hash = "sha256-6HHKl7hqyvF3gJ9vmjLjTT49prJ8KhEEV0qPsJfQfJE=";
  };

  patches = [ ./xmlcopyeditor.patch ];

  # error: cannot initialize a variable of type 'xmlErrorPtr' (aka '_xmlError *')
  #        with an rvalue of type 'const xmlError *' (aka 'const _xmlError *')
  postPatch = ''
    substituteInPlace src/wraplibxml.cpp \
      --replace-fail "xmlErrorPtr err" "const xmlError *err"
  ''
  # error: invalid type argument of unary '*' (have 'long int')
  + ''
    substituteInPlace src/wraplibxml.cpp \
      --replace-fail "initGenericErrorDefaultFunc ( NULL )" "xmlSetGenericErrorFunc( nullptr , nullptr )"
  '';

  nativeBuildInputs = [
    intltool
    pkg-config
  ];

  buildInputs = [
    aspell
    boost
    expat
    libxml2
    libxslt
    pcre2
    wxwidgets_3_2
    xercesc
  ];

  env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-liconv";

  enableParallelBuilding = true;

  meta = {
    description = "Fast, free, validating XML editor";
    homepage = "https://xml-copy-editor.sourceforge.io/";
    license = lib.licenses.gpl2Plus;
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [ wegank ];
    mainProgram = "xmlcopyeditor";
  };
})