2020-11-06 00:33:48 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, check, validatePkgConfig, shared ? false }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pugixml";
|
2022-03-05 16:20:37 +00:00
|
|
|
version = "1.12.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zeux";
|
|
|
|
repo = "pugixml";
|
|
|
|
rev = "v${version}";
|
2022-03-05 16:20:37 +00:00
|
|
|
sha256 = "sha256-Udjx84mhLPJ1bU5WYDo73PAeeufS+vBLXZP0YbBvqLE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
outputs = [ "out" ] ++ lib.optionals shared [ "dev" ];
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake validatePkgConfig ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_TESTS=ON"
|
|
|
|
"-DBUILD_SHARED_LIBS=${if shared then "ON" else "OFF"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
checkInputs = [ check ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# Enable long long support (required for filezilla)
|
|
|
|
sed -ire '/PUGIXML_HAS_LONG_LONG/ s/^\/\///' src/pugiconfig.hpp
|
|
|
|
'';
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Light-weight, simple and fast XML parser for C++ with XPath support";
|
|
|
|
homepage = "https://pugixml.org";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ pSub ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|