summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Baidakou <the.dmol@yandex.by>2017-10-31 03:53:04 (GMT)
committerTony Theodore <tonyt@logyst.com>2017-10-31 03:53:04 (GMT)
commitdccc6a3a69c13021059667804d29b94905b3fff6 (patch)
tree18d79151923bef19d9d472f512e930c5de99832a
parent13051fcf14c0cd1ad1dd8133db4fffbe13f11322 (diff)
downloadmxe-dccc6a3a69c13021059667804d29b94905b3fff6.zip
mxe-dccc6a3a69c13021059667804d29b94905b3fff6.tar.gz
mxe-dccc6a3a69c13021059667804d29b94905b3fff6.tar.bz2
Add pugixml package (#1948)
* Add pugixml package * Use macros in description * Add copyright * Use GH_CONF
-rw-r--r--src/pugixml-test.cpp16
-rw-r--r--src/pugixml.mk33
2 files changed, 49 insertions, 0 deletions
diff --git a/src/pugixml-test.cpp b/src/pugixml-test.cpp
new file mode 100644
index 0000000..aba3552
--- /dev/null
+++ b/src/pugixml-test.cpp
@@ -0,0 +1,16 @@
+/*
+ * This file is part of MXE. See LICENSE.md for licensing information.
+ */
+
+#include <string>
+#include <pugixml.hpp>
+
+int main(int argc, char *argv[])
+{
+ (void)argc;
+ (void)argv;
+ pugi::xml_document doc;
+ std::string source( "<node><child1 attr1='value1' attr2='value2'/><child2 attr1='value1'>test</child2></node>");
+ 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 0000000..67977fd
--- /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