1{ stdenv, fetchurl, cmake, shared ? false }:
2
3stdenv.mkDerivation rec {
4 name = "pugixml-${version}";
5 version = "1.9";
6
7 src = fetchurl {
8 url = "https://github.com/zeux/pugixml/releases/download/v${version}/${name}.tar.gz";
9 sha256 = "19nv3zhik3djp4blc4vrjwrl8dfhzmal8b21sq7y907nhddx6mni";
10 };
11
12 nativeBuildInputs = [ cmake ];
13
14 cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if shared then "ON" else "OFF"}" ];
15
16 preConfigure = ''
17 # Enable long long support (required for filezilla)
18 sed -ire '/PUGIXML_HAS_LONG_LONG/ s/^\/\///' src/pugiconfig.hpp
19 '';
20
21 meta = with stdenv.lib; {
22 description = "Light-weight, simple and fast XML parser for C++ with XPath support";
23 homepage = https://pugixml.org;
24 license = licenses.mit;
25 maintainers = with maintainers; [ pSub ];
26 platforms = platforms.unix;
27 };
28}