summaryrefslogtreecommitdiffstats
path: root/src/neon.mk
blob: 7446d6b97e5c846776301ebc5120244f89d472e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# This file is part of MXE. See LICENSE.md for licensing information.

PKG             := neon
$(PKG)_WEBSITE  := http://webdav.org/neon/
$(PKG)_DESCR    := HTTP and WebDAV client library (libneon)
$(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 \
        ne_cv_os_uname= \
        '$(SOURCE_DIR)'/configure \
              $(MXE_CONFIGURE_OPTS) \
              $(MXE_DISABLE_DOCS) \
              PKG_CONFIG='$(PREFIX)/bin/$(TARGET)-pkg-config' \
              --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