getdns: update to version 1.6.0
authorJonathan G. Underwood <redacted>
Wed, 1 Jul 2020 20:09:34 +0000 (21:09 +0100)
committerJonathan G. Underwood <redacted>
Sun, 5 Jul 2020 11:27:01 +0000 (12:27 +0100)
This update also:
    - enables parallel builds
    - moves to the CMake build system
    - removes the redundant InstallDev stanza

Signed-off-by: Jonathan G. Underwood <redacted>
libs/getdns/Makefile
libs/getdns/patches/getdns-1.6.0-fix-crosscompile.patch [new file with mode: 0644]

index b26be3c7a0d40ad461d5970fb600423d0921f266..f8b41a2cbc3b11e3d3f121840179b7c44f6a5baf 100644 (file)
@@ -5,8 +5,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=getdns
-PKG_VERSION:=1.5.2
-PKG_RELEASE:=2
+PKG_VERSION:=1.6.0
+PKG_RELEASE:=1
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
@@ -14,17 +14,17 @@ PKG_MAINTAINER:=Jonathan Underwood <jonathan.underwood@gmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://getdnsapi.net/dist/
-PKG_HASH:=1826a6a221ea9e9301f2c1f5d25f6f5588e841f08b967645bf50c53b970694c0
+PKG_HASH:=40e5737471a3902ba8304b0fd63aa7c95802f66ebbc6eae53c487c8e8a380f4a
 
-PKG_FIXUP:=autoreconf
-
-PKG_INSTALL:=1
+CMAKE_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
 
 PKG_CONFIG_DEPENDS:= \
        CONFIG_GETDNS_ENABLE_STUB_ONLY \
        CONFIG_GETDNS_ENABLE_IDN_LIBIDN2
 
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
 
 define Package/getdns/Default
        TITLE:=getdns
@@ -49,26 +49,20 @@ define Package/getdns/config
        source "$(SOURCE)/Config.in"
 endef
 
-CONFIGURE_ARGS += \
-               $(if $(CONFIG_GETDNS_ENABLE_STUB_ONLY), --enable-stub-only, ) \
-               --without-libidn \
-               $(if $(CONFIG_GETDNS_ENABLE_IDN_LIBIDN2), , --without-libidn2 ) \
-               --with-ssl="$(STAGING_DIR)/usr" \
-
-# This will make 'configure' think that our libbsd.so is missing the
-# functions inet_pton, inet_ntop, strlcpy and use the builtin. This
-# removes the libbsd dependency
-CONFIGURE_VARS += LIBBSD_LIBS=-lc
+# CMAKE options for GetDNS are described in this document:
+# https://getdnsapi.net/quick-start/cmake-quick-start/
+CMAKE_OPTIONS += -DBUILD_LIBEV=OFF
+CMAKE_OPTIONS += -DBUILD_LIBEVENT2=OFF
+CMAKE_OPTIONS += -DBUILD_LIBUV=OFF
 
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/include/getdns/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/getdns/getdns*.h $(1)/usr/include/getdns/
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgetdns*.{a,so*} $(1)/usr/lib/
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/getdns*.pc $(1)/usr/lib/pkgconfig/
-endef
+CMAKE_OPTIONS += -DENABLE_STUB_ONLY=$(if $(CONFIG_GETDNS_ENABLE_STUB_ONLY),ON,OFF)
+CMAKE_OPTIONS += -DUSE_LIBIDN2=$(if $(CONFIG_GETDNS_ENABLE_IDN_LIBIDN2),ON,OFF)
 
+# getdns will use libbsd for the functions inet_pton, inet_ntop, strlcpy if
+# present, otherwise it will use builtin code for these functions. In order to
+# force the use of the built in code and remove the libbsd dependency disable
+# the test for libbsd.
+CMAKE_OPTIONS += -DCMAKE_DISABLE_FIND_PACKAGE_BSD=ON
 
 define Package/getdns/install
        $(INSTALL_DIR) $(1)/usr/lib
diff --git a/libs/getdns/patches/getdns-1.6.0-fix-crosscompile.patch b/libs/getdns/patches/getdns-1.6.0-fix-crosscompile.patch
new file mode 100644 (file)
index 0000000..71b5a0d
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt   2020-07-01 00:06:07.784792469 +0100
++++ b/CMakeLists.txt   2020-07-01 00:07:09.232511018 +0100
+@@ -520,7 +520,7 @@
+   res = strptime(\"20070207111842\", \"%Y%m%d%H%M%S\", &tm);\n
+   if (!res) return 1; return 0; }")
+-if (HAVE_STRPTIME)
++if (HAVE_STRPTIME AND NOT CMAKE_CROSSCOMPILING)
+   check_c_source_runs("${STRPTIME_TEST_SOURCE}" STRPTIME_WORKS)
+ endif ()
git clone https://git.99rst.org/PROJECT