about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/c-ares
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/c-ares
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/c-ares')
-rw-r--r--nixpkgs/pkgs/development/libraries/c-ares/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/c-ares/release.patch19
2 files changed, 61 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/c-ares/default.nix b/nixpkgs/pkgs/development/libraries/c-ares/default.nix
new file mode 100644
index 000000000000..9e38398dfad1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/c-ares/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, writeTextDir }:
+
+let self =
+stdenv.mkDerivation rec {
+  name = "c-ares-1.15.0";
+
+  src = fetchurl {
+    url = "https://c-ares.haxx.se/download/${name}.tar.gz";
+    sha256 = "0lk8knip4xk6qzksdkn7085mmgm4ixfczdyyjw656c193y3rgnvc";
+  };
+
+  meta = with stdenv.lib; {
+    description = "A C library for asynchronous DNS requests";
+    homepage = https://c-ares.haxx.se;
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+
+  # Adapted from running a cmake build
+  passthru.cmake-config = writeTextDir "c-ares-config.cmake"
+    ''
+      set(c-ares_INCLUDE_DIR "${self}/include")
+
+      set(c-ares_LIBRARY c-ares::cares)
+
+      add_library(c-ares::cares SHARED IMPORTED)
+
+      set_target_properties(c-ares::cares PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${self}/include"
+        ${stdenv.lib.optionalString stdenv.isLinux ''INTERFACE_LINK_LIBRARIES "nsl;rt"''}
+      )
+      set_property(TARGET c-ares::cares APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+      set_target_properties(c-ares::cares PROPERTIES
+        IMPORTED_LOCATION_RELEASE "${self}/lib/libcares${stdenv.targetPlatform.extensions.sharedLibrary}"
+        IMPORTED_SONAME_RELEASE "libcares${stdenv.targetPlatform.extensions.sharedLibrary}"
+        )
+      add_library(c-ares::cares_shared INTERFACE IMPORTED)
+      set_target_properties(c-ares::cares_shared PROPERTIES INTERFACE_LINK_LIBRARIES "c-ares::cares")
+      set(c-ares_SHARED_LIBRARY c-ares::cares_shared)
+    '';
+
+}; in self
diff --git a/nixpkgs/pkgs/development/libraries/c-ares/release.patch b/nixpkgs/pkgs/development/libraries/c-ares/release.patch
new file mode 100644
index 000000000000..e745648062a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/c-ares/release.patch
@@ -0,0 +1,19 @@
+diff -aur c-ares-cares-1_13_0/ares_version.h c-ares-1.13.0/ares_version.h
+--- c-ares-cares-1_13_0/ares_version.h	2017-06-20 02:00:21.000000000 -0400
++++ c-ares-1.13.0/ares_version.h	2017-06-20 02:03:54.000000000 -0400
+@@ -6,12 +6,12 @@
+ #define ARES_COPYRIGHT "2004 - 2016 Daniel Stenberg, <daniel@haxx.se>."
+ 
+ #define ARES_VERSION_MAJOR 1
+-#define ARES_VERSION_MINOR 12
+-#define ARES_VERSION_PATCH 1
++#define ARES_VERSION_MINOR 13
++#define ARES_VERSION_PATCH 0
+ #define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
+                        (ARES_VERSION_MINOR<<8)|\
+                        (ARES_VERSION_PATCH))
+-#define ARES_VERSION_STR "1.12.1-DEV"
++#define ARES_VERSION_STR "1.13.0"
+ 
+ #if (ARES_VERSION >= 0x010700)
+ #  define CARES_HAVE_ARES_LIBRARY_INIT 1