1{
2 lib,
3 stdenv,
4 fetchurl,
5 aspell,
6 boost,
7 expat,
8 intltool,
9 pkg-config,
10 libxml2,
11 libxslt,
12 pcre2,
13 wxGTK32,
14 xercesc,
15}:
16
17stdenv.mkDerivation (finalAttrs: {
18 pname = "xmlcopyeditor";
19 version = "1.3.1.0";
20
21 src = fetchurl {
22 url = "mirror://sourceforge/xml-copy-editor/xmlcopyeditor-${finalAttrs.version}.tar.gz";
23 hash = "sha256-6HHKl7hqyvF3gJ9vmjLjTT49prJ8KhEEV0qPsJfQfJE=";
24 };
25
26 patches = [ ./xmlcopyeditor.patch ];
27
28 # error: cannot initialize a variable of type 'xmlErrorPtr' (aka '_xmlError *')
29 # with an rvalue of type 'const xmlError *' (aka 'const _xmlError *')
30 postPatch = ''
31 substituteInPlace src/wraplibxml.cpp \
32 --replace-fail "xmlErrorPtr err" "const xmlError *err"
33 ''
34 # error: invalid type argument of unary '*' (have 'long int')
35 + ''
36 substituteInPlace src/wraplibxml.cpp \
37 --replace-fail "initGenericErrorDefaultFunc ( NULL )" "xmlSetGenericErrorFunc( nullptr , nullptr )"
38 '';
39
40 nativeBuildInputs = [
41 intltool
42 pkg-config
43 ];
44
45 buildInputs = [
46 aspell
47 boost
48 expat
49 libxml2
50 libxslt
51 pcre2
52 wxGTK32
53 xercesc
54 ];
55
56 env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-liconv";
57
58 enableParallelBuilding = true;
59
60 meta = {
61 description = "Fast, free, validating XML editor";
62 homepage = "https://xml-copy-editor.sourceforge.io/";
63 license = lib.licenses.gpl2Plus;
64 platforms = lib.platforms.unix;
65 maintainers = with lib.maintainers; [
66 candeira
67 wegank
68 ];
69 mainProgram = "xmlcopyeditor";
70 };
71})