From 1c7d5fa331d23171f030de37a36194391d2b69c6 Mon Sep 17 00:00:00 2001 From: nschlia Date: Sat, 17 Dec 2016 00:57:14 +0100 Subject: Add neon --- docs/index.html | 4 ++++ src/neon-test.c | 26 ++++++++++++++++++++++++++ src/neon.mk | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 src/neon-test.c create mode 100644 src/neon.mk diff --git a/docs/index.html b/docs/index.html index 5b1f3cc..1b096dd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2091,6 +2091,10 @@ local-pkg-list: $(LOCAL_PKG_LIST) Ncurses + neon + HTTP and WebDAV client library (libneon) + + netcdf NetCDF diff --git a/src/neon-test.c b/src/neon-test.c new file mode 100644 index 0000000..9d66506 --- /dev/null +++ b/src/neon-test.c @@ -0,0 +1,26 @@ +/* + * This file is part of MXE. See LICENSE.md for licensing information. + */ + +// Based on: http://webdav.org/neon/doc/html/refresolve.html + +#include + +#include + +int main() { + ne_sock_addr* addr = ne_addr_resolve("yandex.ru", 0); + char buf[256]; + if (ne_addr_result(addr)) { + printf("Could not resolve yandex.ru: %s\n", + ne_addr_error(addr, buf, sizeof buf)); + } else { + printf("yandex.ru:"); + for (const ne_inet_addr* ia = ne_addr_first(addr); ia != NULL; ia = ne_addr_next(addr)) { + printf(" %s", ne_iaddr_print(ia, buf, sizeof buf)); + } + printf("\n"); + } + ne_addr_destroy(addr); + return 0; +} diff --git a/src/neon.mk b/src/neon.mk new file mode 100644 index 0000000..05e03bf --- /dev/null +++ b/src/neon.mk @@ -0,0 +1,56 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +PKG := neon +$(PKG)_IGNORE := +$(PKG)_VERSION := 0.30.2 +$(PKG)_CHECKSUM := db0bd8cdec329b48f53a6f00199c92d5ba40b0f015b153718d1b15d3d967fbca +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://webdav.org/$(PKG)/$(PKG)-$($(PKG)_VERSION).tar.gz +$(PKG)_DEPS := gcc openssl expat gettext + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://webdav.org/$(PKG)/' | \ + $(SED) -n 's,.*/\([0-9][^"]*\)/"\.tar.*,\1,p' | \ + sort | uniq | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(BUILD_DIR)' && \ + ne_cv_fmt_size_t=%lu \ + ne_cv_fmt_ssize_t=%lu \ + ne_cv_fmt_off64_t=%I64u \ + ne_cv_fmt_time_t=%lu \ + ne_cv_libsfor_socket=-lws2_32 \ + ne_cv_libsfor_gethostbyname=-lws2_32 \ + '$(SOURCE_DIR)'/configure \ + $(MXE_CONFIGURE_OPTS) \ + $(MXE_DISABLE_DOCS) \ + --with-ssl=yes + $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' + $(MAKE) -C '$(BUILD_DIR)' -j 1 install-lib install-headers install-nls + + # create pkg-config file + $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig' + (echo 'prefix=$(PREFIX)/$(TARGET)'; \ + echo 'exec_prefix=$${prefix}'; \ + echo 'libdir=$${exec_prefix}/lib'; \ + echo 'includedir=$${prefix}/include'; \ + echo ''; \ + echo 'Name: $(PKG)'; \ + echo 'Version: $($(PKG)_VERSION)'; \ + echo 'Description: neon is an HTTP and WebDAV client library'; \ + echo 'Requires.private: openssl'; \ + echo 'Libs: -L$${libdir} -lneon'; \ + echo 'Libs.private: -L$${libdir} -lintl -liconv'; \ + echo 'Cflags: -I$${includedir}'; \ + ) \ + > '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc' + + # create test binary + $(TARGET)-gcc \ + -W -Wall -Werror -std=c11 \ + '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \ + `$(TARGET)-pkg-config neon --cflags --libs` +endef -- cgit v0.12