From dccc6a3a69c13021059667804d29b94905b3fff6 Mon Sep 17 00:00:00 2001 From: Ivan Baidakou Date: Tue, 31 Oct 2017 06:53:04 +0300 Subject: [PATCH] Add pugixml package (#1948) * Add pugixml package * Use macros in description * Add copyright * Use GH_CONF --- src/pugixml-test.cpp | 16 ++++++++++++++++ src/pugixml.mk | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/pugixml-test.cpp create mode 100644 src/pugixml.mk diff --git a/src/pugixml-test.cpp b/src/pugixml-test.cpp new file mode 100644 index 00000000..aba3552d --- /dev/null +++ b/src/pugixml-test.cpp @@ -0,0 +1,16 @@ +/* + * This file is part of MXE. See LICENSE.md for licensing information. + */ + +#include +#include + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + pugi::xml_document doc; + std::string source( "test"); + pugi::xml_parse_result result = doc.load_string(source.c_str(), source.size()); + return result ? 0 : 1; +} diff --git a/src/pugixml.mk b/src/pugixml.mk new file mode 100644 index 00000000..67977fdd --- /dev/null +++ b/src/pugixml.mk @@ -0,0 +1,33 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +PKG := pugixml +$(PKG)_WEBSITE := https://pugixml.org/ +$(PKG)_DESCR := Light-weight, simple, and fast XML parser for C++ with XPath support +$(PKG)_IGNORE := +$(PKG)_VERSION := 1.8 +$(PKG)_CHECKSUM := 9823684a9600e9ab6d1bc7685d01d07c56f9df41ed3ebf8541aa3dfe8d4074b2 +$(PKG)_DEPS := gcc +$(PKG)_GH_CONF := zeux/pugixml,v + + +define $(PKG)_BUILD + # build and install the library + cd '$(BUILD_DIR)' && $(TARGET)-cmake \ + '$(SOURCE_DIR)' + $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' + $(MAKE) -C '$(BUILD_DIR)' -j 1 install + + # create pkg-config files + $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig' + (echo 'Name: $(PKG)'; \ + echo 'Version: $($(PKG)_VERSION)'; \ + echo 'Description: $($(PKG)_DESCR)'; \ + echo 'Libs: -lpugixml';) \ + > '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc' + + # compile test + '$(TARGET)-g++' \ + -W -Wall -Werror -ansi -pedantic \ + '$(PWD)/src/$(PKG)-test.cpp' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \ + `'$(TARGET)-pkg-config' $(PKG) --cflags --libs` +endef