diff options
author | Andrew Sun | 2018-06-21 08:24:45 -0400 |
---|---|---|
committer | Andrew Sun | 2018-06-21 08:24:45 -0400 |
commit | 9d173cbc1757acdd7b80da2e2deb98f666608777 (patch) | |
tree | 738d2b578bb1340e2c932a7158729f673a991774 | |
download | aur-9d173cbc1757acdd7b80da2e2deb98f666608777.tar.gz |
mingw-w64-c-ares: version 1.14.0
-rw-r--r-- | .SRCINFO | 24 | ||||
-rw-r--r-- | 0001-Use-RPM-compiler-options.patch | 41 | ||||
-rw-r--r-- | 0002-Add-static-pkg-config.patch | 83 | ||||
-rw-r--r-- | 0003-fix-cmake-targets.patch | 19 | ||||
-rw-r--r-- | PKGBUILD | 78 |
5 files changed, 245 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..cd2d56f93d01 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,24 @@ +pkgbase = mingw-w64-c-ares + pkgdesc = C library that performs DNS requests and name resolves asynchronously (mingw-w64) + pkgver = 1.14.0 + pkgrel = 1 + url = https://c-ares.haxx.se/ + arch = any + license = custom + makedepends = mingw-w64-configure + makedepends = mingw-w64-cmake + depends = mingw-w64-crt + options = !strip + options = !buildflags + options = staticlibs + source = https://github.com/c-ares/c-ares/archive/cares-1_14_0.tar.gz + source = 0001-Use-RPM-compiler-options.patch + source = 0002-Add-static-pkg-config.patch + source = 0003-fix-cmake-targets.patch + sha256sums = 62dd12f0557918f89ad6f5b759f0bf4727174ae9979499f5452c02be38d9d3e8 + sha256sums = f00faa8723fd530b027f96b987ef19138628a49afdf52ffb0554b36156fc9d74 + sha256sums = dc785a9786172ca64aea3c90b3b491089bf952dae1317be0d757f2dcc5645996 + sha256sums = 5810001abdd4acb8ae725dedb4d67874c3e2935775ecba30469a2a79c76fd6a0 + +pkgname = mingw-w64-c-ares + diff --git a/0001-Use-RPM-compiler-options.patch b/0001-Use-RPM-compiler-options.patch new file mode 100644 index 000000000000..721b71373b7f --- /dev/null +++ b/0001-Use-RPM-compiler-options.patch @@ -0,0 +1,41 @@ +From 7dada62a77e061c752123e672e844386ff3b01ea Mon Sep 17 00:00:00 2001 +From: Stephen Gallagher <sgallagh@redhat.com> +Date: Wed, 10 Apr 2013 12:32:44 -0400 +Subject: [PATCH] Use RPM compiler options + +--- + m4/cares-compilers.m4 | 19 ++++++------------- + 1 file changed, 6 insertions(+), 13 deletions(-) + +diff --git a/m4/cares-compilers.m4 b/m4/cares-compilers.m4 +index 7ee8e0dbe741c1a64149a0d20b826f507b3ec620..d7708230fb5628ae80fbf1052da0d2c78ebbc160 100644 +--- a/m4/cares-compilers.m4 ++++ b/m4/cares-compilers.m4 +@@ -143,19 +143,12 @@ AC_DEFUN([CARES_CHECK_COMPILER_GNU_C], [ + gccvhi=`echo $gccver | cut -d . -f1` + gccvlo=`echo $gccver | cut -d . -f2` + compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null` +- flags_dbg_all="-g -g0 -g1 -g2 -g3" +- flags_dbg_all="$flags_dbg_all -ggdb" +- flags_dbg_all="$flags_dbg_all -gstabs" +- flags_dbg_all="$flags_dbg_all -gstabs+" +- flags_dbg_all="$flags_dbg_all -gcoff" +- flags_dbg_all="$flags_dbg_all -gxcoff" +- flags_dbg_all="$flags_dbg_all -gdwarf-2" +- flags_dbg_all="$flags_dbg_all -gvms" +- flags_dbg_yes="-g" +- flags_dbg_off="-g0" +- flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" +- flags_opt_yes="-O2" +- flags_opt_off="-O0" ++ flags_dbg_all="" ++ flags_dbg_yes="" ++ flags_dbg_off="" ++ flags_opt_all="" ++ flags_opt_yes="" ++ flags_opt_off="" + CURL_CHECK_DEF([_WIN32], [], [silent]) + else + AC_MSG_RESULT([no]) +-- +1.8.1.4 diff --git a/0002-Add-static-pkg-config.patch b/0002-Add-static-pkg-config.patch new file mode 100644 index 000000000000..1999fc2cd31b --- /dev/null +++ b/0002-Add-static-pkg-config.patch @@ -0,0 +1,83 @@ + Makefile.am | 4 ++-- + buildconf | 1 + + configure.ac | 2 +- + libcares-static.pc.in | 11 +++++++++++ + libcares.pc.in | 2 +- + 5 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 364db1a..3fa6ddc 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -54,7 +54,7 @@ noinst_PROGRAMS =$(PROGS) + # regular sources and headers + EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj \ + Makefile.m32 Makefile.netware Makefile.msvc Makefile.Watcom $(man_MANS) \ +- config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz \ ++ config-win32.h RELEASE-NOTES libcares.pc.in libcares-static.pc.in buildconf get_ver.awk maketgz \ + TODO ares_build.h.in cares.rc README.msvc $(MSVCFILES) \ + $(CSOURCES) $(HHEADERS) config-dos.h acountry.1 adig.1 ahost.1 INSTALL.md \ + CMakeLists.txt ares_build.h.cmake ares_config.h.cmake c-ares-config.cmake.in \ +@@ -67,7 +67,7 @@ DIST_SUBDIRS = test + + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = libcares.pc +- ++pkgconfig_DATA += libcares-static.pc + CARES_VERSION_INFO = -version-info 4:0:2 + # This flag accepts an argument of the form current[:revision[:age]]. So, + # passing -version-info 3:12:1 sets current to 3, revision to 12, and age to +diff --git a/buildconf b/buildconf +index a779d86..2bc10e5 100755 +--- a/buildconf ++++ b/buildconf +@@ -162,6 +162,7 @@ for fname in .deps \ + configure \ + depcomp \ + libcares.pc \ ++ libcares-static.pc \ + libtool \ + libtool.m4 \ + libtool.m4.tmp \ +diff --git a/configure.ac b/configure.ac +index 7e86ad6..e970960 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -900,6 +900,6 @@ if test "x$build_tests" = "xyes" ; then + AC_CONFIG_SUBDIRS([test]) + fi + +-AC_CONFIG_FILES([Makefile libcares.pc]) ++AC_CONFIG_FILES([Makefile libcares.pc libcares-static.pc]) + AC_OUTPUT + XC_AMEND_DISTCLEAN(['.']) +diff --git a/libcares-static.pc.in b/libcares-static.pc.in +new file mode 100644 +index 0000000..4612712 +--- /dev/null ++++ b/libcares-static.pc.in +@@ -0,0 +1,11 @@ ++#*************************************************************************** ++# Project ___ __ _ _ __ ___ ___ ++# / __|____ / _` | '__/ _ \/ __| ++# | (_|_____| (_| | | | __/\__ \ ++# \___| \__,_|_| \___||___/ ++# ++Name: c-ares-static ++URL: http://daniel.haxx.se/projects/c-ares/ ++Description: asynchronous DNS lookup library ++Version: @VERSION@ ++Cflags: -DCARES_STATICLIB +diff --git a/libcares.pc.in b/libcares.pc.in +index e757c1b..99fdbba 100644 +--- a/libcares.pc.in ++++ b/libcares.pc.in +@@ -14,7 +14,7 @@ URL: http://daniel.haxx.se/projects/c-ares/ + Description: asynchronous DNS lookup library + Version: @VERSION@ + Requires: +-Requires.private: ++Requires.private: libcares-static + Cflags: -I${includedir} @CPPFLAG_CARES_STATICLIB@ + Libs: -L${libdir} -lcares + Libs.private: @CARES_PRIVATE_LIBS@ diff --git a/0003-fix-cmake-targets.patch b/0003-fix-cmake-targets.patch new file mode 100644 index 000000000000..620b8bc78ecd --- /dev/null +++ b/0003-fix-cmake-targets.patch @@ -0,0 +1,19 @@ +--- c-ares-cares-1_13_0/CMakeLists.txt.orig 2017-11-14 10:37:45.399929800 +0300 ++++ c-ares-cares-1_13_0/CMakeLists.txt 2017-11-14 10:40:39.555223600 +0300 +@@ -545,6 +545,7 @@ + EXPORT_NAME cares + OUTPUT_NAME cares + VERSION "${CARES_LIB_VERSION_MAJOR}.${CARES_LIB_VERSION_MINOR}.${CARES_LIB_VERSION_RELEASE}" ++ RUNTIME_OUTPUT_NAME cares-${CARES_LIB_VERSION_AGE} + SOVERSION "${CARES_LIB_VERSION_MAJOR}" + ) + +@@ -574,7 +575,7 @@ + + SET_TARGET_PROPERTIES (${LIBNAME} PROPERTIES + EXPORT_NAME cares${STATIC_SUFFIX} +- OUTPUT_NAME cares${STATIC_SUFFIX} ++ OUTPUT_NAME cares + ) + + IF (CARES_STATIC_PIC) diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..7326d37ce164 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,78 @@ +pkgname=mingw-w64-c-ares +pkgver=1.14.0 +pkgrel=1 +pkgdesc="C library that performs DNS requests and name resolves asynchronously (mingw-w64)" +arch=('any') +url="https://c-ares.haxx.se/" +license=('custom') +makedepends=('mingw-w64-configure' 'mingw-w64-cmake') +depends=('mingw-w64-crt') +options=('!strip' '!buildflags' 'staticlibs') +source=("https://github.com/c-ares/c-ares/archive/cares-${pkgver//./_}.tar.gz" + "0001-Use-RPM-compiler-options.patch" + "0002-Add-static-pkg-config.patch" + "0003-fix-cmake-targets.patch") +sha256sums=('62dd12f0557918f89ad6f5b759f0bf4727174ae9979499f5452c02be38d9d3e8' + 'f00faa8723fd530b027f96b987ef19138628a49afdf52ffb0554b36156fc9d74' + 'dc785a9786172ca64aea3c90b3b491089bf952dae1317be0d757f2dcc5645996' + '5810001abdd4acb8ae725dedb4d67874c3e2935775ecba30469a2a79c76fd6a0') + +_architectures="i686-w64-mingw32 x86_64-w64-mingw32" + +# Helper macros to help make tasks easier # +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying $_patch" + patch -Nbp1 -i "${srcdir}/$_patch" + done +} + +del_file_exists() { + for _fname in "$@" + do + if [ -f $_fname ]; then + rm -rf $_fname + fi + done +} +# =========================================== # + +prepare() { + cd "${srcdir}/c-ares-cares-${pkgver//./_}" + del_file_exists libcares-static.pc.in + apply_patch_with_msg 0001-Use-RPM-compiler-options.patch \ + 0002-Add-static-pkg-config.patch \ + 0003-fix-cmake-targets.patch + + autoreconf -fi +} + +build() { + cd "${srcdir}/c-ares-cares-${pkgver//./_}" + for _arch in ${_architectures}; do + mkdir -p build-${_arch} && pushd build-${_arch} + ${_arch}-configure .. + ${_arch}-cmake -DCARES_STATIC=ON -DCARES_SHARED=ON .. + make + popd + done +} + +package() { + for _arch in ${_architectures}; do + cd "${srcdir}/c-ares-cares-${pkgver//./_}/build-${_arch}" + make DESTDIR="${pkgdir}" install + + cp ${srcdir}/c-ares-cares-${pkgver//./_}/nameser.h ${pkgdir}/usr/${_arch}/include + + # provide pkgconfig files + sed -i -e "s|Version: -|Version: ${pkgver}|g" libcares.pc libcares-static.pc + install -Dm644 libcares.pc ${pkgdir}/usr/${_arch}/lib/pkgconfig/libcares.pc + install -Dm644 libcares-static.pc ${pkgdir}/usr/${_arch}/lib/pkgconfig/libcares-static.pc + + ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.exe + ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll + ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a + done +} |