This commit is contained in:
nschlia 2016-12-17 00:57:14 +01:00 committed by Boris Nagaev
parent cc4f26395b
commit 1c7d5fa331
3 changed files with 86 additions and 0 deletions

View File

@ -2090,6 +2090,10 @@ local-pkg-list: $(LOCAL_PKG_LIST)</pre>
<td class="package">ncurses</td>
<td class="website"><a href="https://www.gnu.org/software/ncurses/">Ncurses</a></td>
</tr>
<tr>
<td class="package">neon</td>
<td class="website"><a href="http://webdav.org/neon/">HTTP and WebDAV client library (libneon)</a></td>
</tr>
<tr>
<td class="package">netcdf</td>
<td class="website"><a href="http://www.unidata.ucar.edu/software/netcdf/">NetCDF</a></td>

26
src/neon-test.c Normal file
View File

@ -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 <stdio.h>
#include <neon/ne_basic.h>
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;
}

56
src/neon.mk Normal file
View File

@ -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