summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gumbo-test.c13
-rw-r--r--src/gumbo.mk35
2 files changed, 48 insertions, 0 deletions
diff --git a/src/gumbo-test.c b/src/gumbo-test.c
new file mode 100644
index 0000000..6d45f13
--- /dev/null
+++ b/src/gumbo-test.c
@@ -0,0 +1,13 @@
+/*
+ * This file is part of MXE. See LICENSE.md for licensing information.
+ */
+
+#include <gumbo.h>
+
+int main()
+{
+ GumboOutput *output = gumbo_parse("<blink>Hello world!</blink>");
+ gumbo_destroy_output(&kGumboDefaultOptions, output);
+
+ return 0;
+}
diff --git a/src/gumbo.mk b/src/gumbo.mk
new file mode 100644
index 0000000..319577c
--- /dev/null
+++ b/src/gumbo.mk
@@ -0,0 +1,35 @@
+# This file is part of MXE. See LICENSE.md for licensing information.
+
+PKG := gumbo
+$(PKG)_WEBSITE := https://github.com/google/gumbo-parser
+$(PKG)_DESCR := Gumbo, an HTML5 parsing library
+$(PKG)_IGNORE :=
+$(PKG)_VERSION := 0.10.1
+$(PKG)_CHECKSUM := 28463053d44a5dfbc4b77bcf49c8cee119338ffa636cc17fc3378421d714efad
+$(PKG)_GH_CONF := google/gumbo-parser, v
+$(PKG)_DEPS := gcc
+
+define $(PKG)_BUILD
+ # build and install the library
+ cd $(SOURCE_DIR) && ./autogen.sh
+ cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure $(MXE_CONFIGURE_OPTS)
+ $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
+ $(MAKE) -C '$(BUILD_DIR)' -j 1 install \
+ bin_PROGRAMS= \
+ sbin_PROGRAMS= \
+ noinst_PROGRAMS=
+
+ # create pkg-config files
+ $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
+ (echo 'Name: $(PKG)'; \
+ echo 'Version: $($(PKG)_VERSION)'; \
+ echo 'Description: Gumbo, an HTML5 parsing library'; \
+ echo 'Libs: -lgumbo';) \
+ > '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc'
+
+ # compile test
+ '$(TARGET)-gcc' \
+ -W -Wall -Werror -ansi -pedantic \
+ '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
+ `'$(TARGET)-pkg-config' $(PKG) --cflags --libs`
+endef