summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-02-03 16:54:03 +0100
committerVladimír Čunát <vcunat@gmail.com>2016-02-03 16:57:19 +0100
commitae74c356d94b795eb07dfe9978788b49b70f5959 (patch)
treec13c6894b75f95d3a4dc4627efef508bb03dfba8 /pkgs/development/libraries
parentc9790126312119ce5a2a8ac946d9f086e7ea9f55 (diff)
parent53e0f8b1cdf36574bfede6e62e2ac2739c3ef804 (diff)
downloadnixpkgs-ae74c356d94b795eb07dfe9978788b49b70f5959.tar
nixpkgs-ae74c356d94b795eb07dfe9978788b49b70f5959.tar.gz
nixpkgs-ae74c356d94b795eb07dfe9978788b49b70f5959.tar.bz2
nixpkgs-ae74c356d94b795eb07dfe9978788b49b70f5959.tar.lz
nixpkgs-ae74c356d94b795eb07dfe9978788b49b70f5959.tar.xz
nixpkgs-ae74c356d94b795eb07dfe9978788b49b70f5959.tar.zst
nixpkgs-ae74c356d94b795eb07dfe9978788b49b70f5959.zip
Merge recent 'staging' into closure-size
Let's get rid of those merge conflicts.
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/accounts-qt/default.nix18
-rw-r--r--pkgs/development/libraries/aterm/aterm-mingw-asm.patch498
-rw-r--r--pkgs/development/libraries/audiofile/default.nix7
-rw-r--r--pkgs/development/libraries/bobcat/default.nix21
-rw-r--r--pkgs/development/libraries/boost/boost-155-clang.patch90
-rw-r--r--pkgs/development/libraries/cpp-netlib/default.nix6
-rw-r--r--pkgs/development/libraries/fontconfig-ultimate/confd.nix19
-rw-r--r--pkgs/development/libraries/fontconfig/make-fonts-cache.nix27
-rw-r--r--pkgs/development/libraries/fontconfig/make-fonts-conf.xsl10
-rw-r--r--pkgs/development/libraries/freetype/default.nix29
-rw-r--r--pkgs/development/libraries/freetype/enable-validation.patch22
-rw-r--r--pkgs/development/libraries/freetype/fix-pcf.patch132
-rw-r--r--pkgs/development/libraries/glib-networking/default.nix6
-rw-r--r--pkgs/development/libraries/glib/default.nix9
-rw-r--r--pkgs/development/libraries/gmock/default.nix14
-rw-r--r--pkgs/development/libraries/gpgme/default.nix11
-rw-r--r--pkgs/development/libraries/id3lib/default.nix5
-rw-r--r--pkgs/development/libraries/id3lib/patch_id3lib_3.8.3_UTF16_writing_bug.diff39
-rw-r--r--pkgs/development/libraries/ijs/default.nix17
-rw-r--r--pkgs/development/libraries/ip2location-c/default.nix5
-rwxr-xr-xpkgs/development/libraries/java/jflex/builder.sh6
-rw-r--r--pkgs/development/libraries/java/jflex/default.nix25
-rw-r--r--pkgs/development/libraries/libcli/default.nix4
-rw-r--r--pkgs/development/libraries/libconfuse/default.nix37
-rw-r--r--pkgs/development/libraries/libedit/freebsd_weak_ref.patch20
-rw-r--r--pkgs/development/libraries/libgdiplus/default.nix5
-rw-r--r--pkgs/development/libraries/libkeyfinder/default.nix21
-rw-r--r--pkgs/development/libraries/libnetfilter_conntrack/default.nix3
-rw-r--r--pkgs/development/libraries/libpsl/default.nix12
-rw-r--r--pkgs/development/libraries/libressl/2.2.nix4
-rw-r--r--pkgs/development/libraries/libressl/2.3.nix6
-rw-r--r--pkgs/development/libraries/libsoup/default.nix8
-rw-r--r--pkgs/development/libraries/libspectre/default.nix2
-rw-r--r--pkgs/development/libraries/libspectre/libspectre-0.2.7-gs918.patch42
-rw-r--r--pkgs/development/libraries/libutempter/default.nix29
-rw-r--r--pkgs/development/libraries/libva/default.nix21
-rw-r--r--pkgs/development/libraries/libvdpau-va-gl/default.nix27
-rw-r--r--pkgs/development/libraries/libvdpau/default.nix12
-rw-r--r--pkgs/development/libraries/libxcomp/default.nix21
-rw-r--r--pkgs/development/libraries/mesa/default.nix4
-rw-r--r--pkgs/development/libraries/openssl/1.0.2.x.nix4
-rw-r--r--pkgs/development/libraries/openssl/default.nix4
-rw-r--r--pkgs/development/libraries/protobuf/3.0.nix41
-rw-r--r--pkgs/development/libraries/protobuf/generic.nix2
-rw-r--r--pkgs/development/libraries/qpdf/default.nix5
-rw-r--r--pkgs/development/libraries/rote/default.nix3
-rw-r--r--pkgs/development/libraries/snack/default.nix6
-rw-r--r--pkgs/development/libraries/telepathy/qt/default.nix3
-rw-r--r--pkgs/development/libraries/wcslib/default.nix27
49 files changed, 469 insertions, 920 deletions
diff --git a/pkgs/development/libraries/accounts-qt/default.nix b/pkgs/development/libraries/accounts-qt/default.nix
index 315aab074e5..e2e5f079606 100644
--- a/pkgs/development/libraries/accounts-qt/default.nix
+++ b/pkgs/development/libraries/accounts-qt/default.nix
@@ -1,8 +1,8 @@
 { stdenv, fetchFromGitLab, doxygen, glib, libaccounts-glib, pkgconfig, qtbase }:
 
-let version = "1.13"; in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "accounts-qt-${version}";
+  version = "1.13";
 
   src = fetchFromGitLab {
     sha256 = "1gpkgw05dwsf2wk5cy3skgss3kw6mqh7iv3fadrxqxfc1za1xmyl";
@@ -11,17 +11,17 @@ stdenv.mkDerivation {
     owner = "accounts-sso";
   };
 
-  meta = with stdenv.lib; {
-    description = "Qt library for accessing the online accounts database";
-    homepage = "http://code.google.com/p/accounts-sso/";
-    license = licenses.lgpl21;
-    maintainers = with maintainers; [ nckx ];
-  };
-
   buildInputs = [ glib libaccounts-glib qtbase ];
   nativeBuildInputs = [ doxygen pkgconfig ];
 
   configurePhase = ''
     qmake PREFIX=$out LIBDIR=$out/lib CMAKE_CONFIG_PATH=$out/lib/cmake
   '';
+
+  meta = with stdenv.lib; {
+    description = "Qt library for accessing the online accounts database";
+    homepage = "http://code.google.com/p/accounts-sso/";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ nckx ];
+  };
 }
diff --git a/pkgs/development/libraries/aterm/aterm-mingw-asm.patch b/pkgs/development/libraries/aterm/aterm-mingw-asm.patch
deleted file mode 100644
index ce09ead9042..00000000000
--- a/pkgs/development/libraries/aterm/aterm-mingw-asm.patch
+++ /dev/null
@@ -1,498 +0,0 @@
-diff -rc aterm-2.8/aterm/gc.c aterm-2.8-new/aterm/gc.c
-*** aterm-2.8/aterm/gc.c	2008-11-10 13:54:22.000000000 +0100
---- aterm-2.8-new/aterm/gc.c	2010-08-23 17:04:56.000000000 +0200
-***************
-*** 260,317 ****
-    AFun oddSym;
-  #endif
-  
-- #ifdef WIN32
-- 
--   unsigned int r_eax, r_ebx, r_ecx, r_edx, \
--     r_esi, r_edi, r_esp, r_ebp;
--   ATerm reg[8], real_term;
-- 
--   __asm {
--       /* Get the registers into local variables to check them
--          for aterms later. */
--     mov r_eax, eax
--       mov r_ebx, ebx
--       mov r_ecx, ecx
--       mov r_edx, edx
--       mov r_esi, esi
--       mov r_edi, edi
--       mov r_esp, esp
--       mov r_ebp, ebp
--       }
--     /* Put the register-values into an array */
--   reg[0] = (ATerm) r_eax;
--   reg[1] = (ATerm) r_ebx;
--   reg[2] = (ATerm) r_ecx;
--   reg[3] = (ATerm) r_edx;
--   reg[4] = (ATerm) r_esi;
--   reg[5] = (ATerm) r_edi;
--   reg[6] = (ATerm) r_esp;
--   reg[7] = (ATerm) r_ebp;
-- 
--   for(i=0; i<8; i++) {
--     real_term = AT_isInsideValidTerm(reg[i]);
--     if (real_term != NULL) {
--       AT_markTerm(real_term);
--     }
--     if (AT_isValidSymbol((Symbol)reg[i])) {
--       AT_markSymbol((Symbol)reg[i]);
--     }
--   }
-- 
--     /* The register variables are on the stack aswell
--        I set them to zero so they won't be processed again when
--        the stack is traversed. The reg-array is also in the stack
--        but that will be adjusted later */
--   r_eax = 0;
--   r_ebx = 0;
--   r_ecx = 0;
--   r_edx = 0;
--   r_esi = 0;
--   r_edi = 0;
--   r_esp = 0;
--   r_ebp = 0;
-- 
-- #else
-    jmp_buf env;
-  
-    /* Traverse possible register variables */
---- 260,265 ----
-***************
-*** 320,326 ****
-    start = (ATerm *)((char *)env);
-    stop  = ((ATerm *)(((char *)env) + sizeof(jmp_buf)));
-    mark_memory(start, stop);
-- #endif
-  
-    stackTop = stack_top();
-  
---- 268,273 ----
-***************
-*** 385,442 ****
-    AFun oddSym;
-  #endif
-  
-- #ifdef WIN32
-- 
--   unsigned int r_eax, r_ebx, r_ecx, r_edx, \
--     r_esi, r_edi, r_esp, r_ebp;
--   ATerm reg[8], real_term;
-- 
--   __asm {
--       /* Get the registers into local variables to check them
--          for aterms later. */
--     mov r_eax, eax
--       mov r_ebx, ebx
--       mov r_ecx, ecx
--       mov r_edx, edx
--       mov r_esi, esi
--       mov r_edi, edi
--       mov r_esp, esp
--       mov r_ebp, ebp
--       }
--     /* Put the register-values into an array */
--   reg[0] = (ATerm) r_eax;
--   reg[1] = (ATerm) r_ebx;
--   reg[2] = (ATerm) r_ecx;
--   reg[3] = (ATerm) r_edx;
--   reg[4] = (ATerm) r_esi;
--   reg[5] = (ATerm) r_edi;
--   reg[6] = (ATerm) r_esp;
--   reg[7] = (ATerm) r_ebp;
-- 
--   for(i=0; i<8; i++) {
--     real_term = AT_isInsideValidTerm(reg[i]);
--     if (real_term != NULL) {
--       AT_markTerm_young(real_term);
--     }
--     if (AT_isValidSymbol((Symbol)reg[i])) {
--        AT_markSymbol_young((Symbol)reg[i]);
--     }
--   }
-- 
--     /* The register variables are on the stack aswell
--        I set them to zero so they won't be processed again when
--        the stack is traversed. The reg-array is also in the stack
--        but that will be adjusted later */
--   r_eax = 0;
--   r_ebx = 0;
--   r_ecx = 0;
--   r_edx = 0;
--   r_esi = 0;
--   r_edi = 0;
--   r_esp = 0;
--   r_ebp = 0;
-- 
-- #else
-    jmp_buf env;
-  
-      /* Traverse possible register variables */
---- 332,337 ----
-***************
-*** 445,451 ****
-    start = (ATerm *)((char *)env);
-    stop  = ((ATerm *)(((char *)env) + sizeof(jmp_buf)));
-    mark_memory_young(start, stop);
-- #endif
-  
-    stackTop = stack_top();
-    start = MIN(stackTop, stackBot);
---- 340,345 ----
-Only in aterm-2.8-new/aterm: gc.c.orig
-diff -rc aterm-2.8/configure aterm-2.8-new/configure
-*** aterm-2.8/configure	2008-11-10 13:54:27.000000000 +0100
---- aterm-2.8-new/configure	2010-08-23 17:08:10.000000000 +0200
-***************
-*** 19970,20295 ****
-  CURDATE=`date`
-  
-  
-- echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-- echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
-- if test "${ac_cv_c_bigendian+set}" = set; then
--   echo $ECHO_N "(cached) $ECHO_C" >&6
-- else
--   # See if sys/param.h defines the BYTE_ORDER macro.
-- cat >conftest.$ac_ext <<_ACEOF
-- /* confdefs.h.  */
-- _ACEOF
-- cat confdefs.h >>conftest.$ac_ext
-- cat >>conftest.$ac_ext <<_ACEOF
-- /* end confdefs.h.  */
-- #include <sys/types.h>
-- #include <sys/param.h>
-- 
-- int
-- main ()
-- {
-- #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
--  bogus endian macros
-- #endif
-- 
--   ;
--   return 0;
-- }
-- _ACEOF
-- rm -f conftest.$ac_objext
-- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--   (eval $ac_compile) 2>conftest.er1
--   ac_status=$?
--   grep -v '^ *+' conftest.er1 >conftest.err
--   rm -f conftest.er1
--   cat conftest.err >&5
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); } &&
-- 	 { ac_try='test -z "$ac_c_werror_flag"
-- 			 || test ! -s conftest.err'
--   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--   (eval $ac_try) 2>&5
--   ac_status=$?
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); }; } &&
-- 	 { ac_try='test -s conftest.$ac_objext'
--   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--   (eval $ac_try) 2>&5
--   ac_status=$?
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); }; }; then
--   # It does; now see whether it defined to BIG_ENDIAN or not.
-- cat >conftest.$ac_ext <<_ACEOF
-- /* confdefs.h.  */
-- _ACEOF
-- cat confdefs.h >>conftest.$ac_ext
-- cat >>conftest.$ac_ext <<_ACEOF
-- /* end confdefs.h.  */
-- #include <sys/types.h>
-- #include <sys/param.h>
-- 
-- int
-- main ()
-- {
-- #if BYTE_ORDER != BIG_ENDIAN
--  not big endian
-- #endif
-- 
--   ;
--   return 0;
-- }
-- _ACEOF
-- rm -f conftest.$ac_objext
-- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--   (eval $ac_compile) 2>conftest.er1
--   ac_status=$?
--   grep -v '^ *+' conftest.er1 >conftest.err
--   rm -f conftest.er1
--   cat conftest.err >&5
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); } &&
-- 	 { ac_try='test -z "$ac_c_werror_flag"
-- 			 || test ! -s conftest.err'
--   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--   (eval $ac_try) 2>&5
--   ac_status=$?
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); }; } &&
-- 	 { ac_try='test -s conftest.$ac_objext'
--   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--   (eval $ac_try) 2>&5
--   ac_status=$?
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); }; }; then
--   ac_cv_c_bigendian=yes
-- else
--   echo "$as_me: failed program was:" >&5
-- sed 's/^/| /' conftest.$ac_ext >&5
-- 
-- ac_cv_c_bigendian=no
-- fi
-- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-- else
--   echo "$as_me: failed program was:" >&5
-- sed 's/^/| /' conftest.$ac_ext >&5
-- 
-- # It does not; compile a test program.
-- if test "$cross_compiling" = yes; then
--   # try to guess the endianness by grepping values into an object file
--   ac_cv_c_bigendian=unknown
--   cat >conftest.$ac_ext <<_ACEOF
-- /* confdefs.h.  */
-- _ACEOF
-- cat confdefs.h >>conftest.$ac_ext
-- cat >>conftest.$ac_ext <<_ACEOF
-- /* end confdefs.h.  */
-- short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-- short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-- void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-- short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-- short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-- void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
-- int
-- main ()
-- {
--  _ascii (); _ebcdic ();
--   ;
--   return 0;
-- }
-- _ACEOF
-- rm -f conftest.$ac_objext
-- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
--   (eval $ac_compile) 2>conftest.er1
--   ac_status=$?
--   grep -v '^ *+' conftest.er1 >conftest.err
--   rm -f conftest.er1
--   cat conftest.err >&5
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); } &&
-- 	 { ac_try='test -z "$ac_c_werror_flag"
-- 			 || test ! -s conftest.err'
--   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--   (eval $ac_try) 2>&5
--   ac_status=$?
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); }; } &&
-- 	 { ac_try='test -s conftest.$ac_objext'
--   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--   (eval $ac_try) 2>&5
--   ac_status=$?
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); }; }; then
--   if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
--   ac_cv_c_bigendian=yes
-- fi
-- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
--   if test "$ac_cv_c_bigendian" = unknown; then
--     ac_cv_c_bigendian=no
--   else
--     # finding both strings is unlikely to happen, but who knows?
--     ac_cv_c_bigendian=unknown
--   fi
-- fi
-- else
--   echo "$as_me: failed program was:" >&5
-- sed 's/^/| /' conftest.$ac_ext >&5
-- 
-- fi
-- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-- else
--   cat >conftest.$ac_ext <<_ACEOF
-- /* confdefs.h.  */
-- _ACEOF
-- cat confdefs.h >>conftest.$ac_ext
-- cat >>conftest.$ac_ext <<_ACEOF
-- /* end confdefs.h.  */
-- int
-- main ()
-- {
--   /* Are we little or big endian?  From Harbison&Steele.  */
--   union
--   {
--     long l;
--     char c[sizeof (long)];
--   } u;
--   u.l = 1;
--   exit (u.c[sizeof (long) - 1] == 1);
-- }
-- _ACEOF
-- rm -f conftest$ac_exeext
-- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--   (eval $ac_link) 2>&5
--   ac_status=$?
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
--   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--   (eval $ac_try) 2>&5
--   ac_status=$?
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); }; }; then
--   ac_cv_c_bigendian=no
-- else
--   echo "$as_me: program exited with status $ac_status" >&5
-- echo "$as_me: failed program was:" >&5
-- sed 's/^/| /' conftest.$ac_ext >&5
-- 
-- ( exit $ac_status )
-- ac_cv_c_bigendian=yes
-- fi
-- rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-- fi
-- fi
-- rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-- fi
-- echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-- echo "${ECHO_T}$ac_cv_c_bigendian" >&6
-- case $ac_cv_c_bigendian in
--   yes)
-- 
-- cat >>confdefs.h <<\_ACEOF
-- #define WORDS_BIGENDIAN 1
-- _ACEOF
--  ;;
--   no)
--      ;;
--   *)
--     { { echo "$as_me:$LINENO: error: unknown endianness
-- presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-- echo "$as_me: error: unknown endianness
-- presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
--    { (exit 1); exit 1; }; } ;;
-- esac
-- 
-- 
-- 		echo "$as_me:$LINENO: checking whether float word ordering is big endian" >&5
-- echo $ECHO_N "checking whether float word ordering is big endian... $ECHO_C" >&6
-- if test "${ax_cv_c_float_word_order_big+set}" = set; then
--   echo $ECHO_N "(cached) $ECHO_C" >&6
-- else
-- 
-- 				if test "$cross_compiling" = yes; then
--   { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-- See \`config.log' for more details." >&5
-- echo "$as_me: error: cannot run test program while cross compiling
-- See \`config.log' for more details." >&2;}
--    { (exit 1); exit 1; }; }
-- else
--   cat >conftest.$ac_ext <<_ACEOF
-- 
-- 						/* This code returns 0 if the float word order is big endian and >= 1 if it is little endian. */
-- 						main(){
-- 							#ifdef WORDS_BIGENDIAN
-- 								return 0; /* If the system's encoding is big endian, so is the float word order. NOTE: If the encoding is big endian and WORDS_BIGENDIAN isn't defined, the code below will still return the correct float word order (big). */
-- 							#else
-- 								union
-- 								{
-- 									double d;
-- 									/* IEEE754 little endian encoded floating point number structure with little endian float word order. */
-- 									struct{
-- 										unsigned int mantissa1:32;
-- 										unsigned int mantissa0:20;
-- 										unsigned int exponent:11;
-- 										unsigned int negative:1;
-- 									} ieee;
-- 								} u;
-- 								u.d = -1;
-- 								return (u.ieee.negative == 1);
-- 							#endif
-- 						}
-- 
-- _ACEOF
-- rm -f conftest$ac_exeext
-- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
--   (eval $ac_link) 2>&5
--   ac_status=$?
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
--   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
--   (eval $ac_try) 2>&5
--   ac_status=$?
--   echo "$as_me:$LINENO: \$? = $ac_status" >&5
--   (exit $ac_status); }; }; then
--   ax_cv_c_float_word_order_big=yes
-- else
--   echo "$as_me: program exited with status $ac_status" >&5
-- echo "$as_me: failed program was:" >&5
-- sed 's/^/| /' conftest.$ac_ext >&5
-- 
-- ( exit $ac_status )
-- ax_cv_c_float_word_order_big=no
-- fi
-- rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-- fi
-- 
-- 
-- fi
-- echo "$as_me:$LINENO: result: $ax_cv_c_float_word_order_big" >&5
-- echo "${ECHO_T}$ax_cv_c_float_word_order_big" >&6
-- 
-- 		case $ax_cv_c_float_word_order_big in
-- 			yes)
-- 
-- 
-- cat >>confdefs.h <<\_ACEOF
-- #define FLOAT_WORD_ORDER_BIG 1
-- _ACEOF
-- 
-- 
-- 				 ;;
-- 			no)
-- 		    	 ;;
-- 		  	*)
-- 
-- 					{ { echo "$as_me:$LINENO: error: Unable to determain float word ordering. You need to manually preset ax_cv_c_float_word_order_big=(yes / no).
-- 		    		" >&5
-- echo "$as_me: error: Unable to determain float word ordering. You need to manually preset ax_cv_c_float_word_order_big=(yes / no).
-- 		    		" >&2;}
--    { (exit 1); exit 1; }; }
-- 
-- 		     ;;
-- 		esac
-- 
-- 
-  
-  
-  for ac_func in strdup
---- 19970,19975 ----
-diff -rc aterm-2.8/Makefile.in aterm-2.8-new/Makefile.in
-*** aterm-2.8/Makefile.in	2008-11-10 13:54:28.000000000 +0100
---- aterm-2.8-new/Makefile.in	2010-08-23 17:05:27.000000000 +0200
-***************
-*** 217,223 ****
-  
-  pkgconfig_DATA = ${PACKAGE}.pc
-  
-! SUBDIRS = aterm utils test  
-  
-  ACLOCAL_AMFLAGS = -I .
-  subdir = .
---- 217,223 ----
-  
-  pkgconfig_DATA = ${PACKAGE}.pc
-  
-! SUBDIRS = aterm utils 
-  
-  ACLOCAL_AMFLAGS = -I .
-  subdir = .
diff --git a/pkgs/development/libraries/audiofile/default.nix b/pkgs/development/libraries/audiofile/default.nix
index 1fe6d7b15a8..c76115000cb 100644
--- a/pkgs/development/libraries/audiofile/default.nix
+++ b/pkgs/development/libraries/audiofile/default.nix
@@ -1,10 +1,13 @@
-{ stdenv, fetchurl, alsaLib }:
+{ stdenv, fetchurl, alsaLib, AudioUnit, CoreServices }:
 
 stdenv.mkDerivation rec {
   name = "audiofile-0.3.6";
 
   nativeBuildInputs = stdenv.lib.optional stdenv.isLinux alsaLib;
 
+  buildInputs = (stdenv.lib.optional stdenv.isDarwin CoreServices) ++
+                (stdenv.lib.optional stdenv.isDarwin AudioUnit);
+
   src = fetchurl {
     url = "http://audiofile.68k.org/${name}.tar.gz";
     sha256 = "0rb927zknk9kmhprd8rdr4azql4gn2dp75a36iazx2xhkbqhvind";
@@ -14,7 +17,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Library for reading and writing audio files in various formats";
-    homepage    = http://www.68k.org/~michael/audiofile/; 
+    homepage    = http://www.68k.org/~michael/audiofile/;
     license     = licenses.lgpl21Plus;
     maintainers = with maintainers; [ lovek323 ];
     platforms   = platforms.unix;
diff --git a/pkgs/development/libraries/bobcat/default.nix b/pkgs/development/libraries/bobcat/default.nix
index 87eb1e324ce..b83fd0f7487 100644
--- a/pkgs/development/libraries/bobcat/default.nix
+++ b/pkgs/development/libraries/bobcat/default.nix
@@ -1,9 +1,9 @@
 { stdenv, fetchFromGitHub, icmake, libmilter, libX11, openssl, readline
 , utillinux, yodl }:
 
-let version = "4.00.00"; in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "bobcat-${version}";
+  version = "4.00.00";
 
   src = fetchFromGitHub {
     sha256 = "0wdb25sgw7i3jk3lbja6b4ipqfg1sncam6adg2bn8l5fcinrpwgs";
@@ -12,15 +12,6 @@ stdenv.mkDerivation {
     owner = "fbb-git";
   };
 
-  meta = with stdenv.lib; {
-    inherit version;
-    description = "Brokken's Own Base Classes And Templates";
-    homepage = https://fbb-git.github.io/bobcat/;
-    license = licenses.gpl3;
-    platforms = platforms.linux;
-    maintainers = with maintainers; [ nckx ];
-  };
-
   buildInputs = [ libmilter libX11 openssl readline utillinux ];
   nativeBuildInputs = [ icmake yodl ];
 
@@ -39,4 +30,12 @@ stdenv.mkDerivation {
   installPhase = ''
     ./build install
   '';
+
+  meta = with stdenv.lib; {
+    description = "Brokken's Own Base Classes And Templates";
+    homepage = https://fbb-git.github.io/bobcat/;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ nckx ];
+  };
 }
diff --git a/pkgs/development/libraries/boost/boost-155-clang.patch b/pkgs/development/libraries/boost/boost-155-clang.patch
deleted file mode 100644
index 9c4e3a74cd2..00000000000
--- a/pkgs/development/libraries/boost/boost-155-clang.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-diff --git a/boost/atomic/detail/cas128strong.hpp b/boost/atomic/detail/cas128strong.hpp
-index 906c13e..dcb4d7d 100644
---- a/boost/atomic/detail/cas128strong.hpp
-+++ b/boost/atomic/detail/cas128strong.hpp
-@@ -196,15 +196,17 @@ class base_atomic<T, void, 16, Sign>
- 
- public:
-     BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
--    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
-+    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT
-     {
-+        memset(&v_, 0, sizeof(v_));
-         memcpy(&v_, &v, sizeof(value_type));
-     }
- 
-     void
-     store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
-     {
--        storage_type value_s = 0;
-+        storage_type value_s;
-+        memset(&value_s, 0, sizeof(value_s));
-         memcpy(&value_s, &value, sizeof(value_type));
-         platform_fence_before_store(order);
-         platform_store128(value_s, &v_);
-@@ -247,7 +249,9 @@ class base_atomic<T, void, 16, Sign>
-         memory_order success_order,
-         memory_order failure_order) volatile BOOST_NOEXCEPT
-     {
--        storage_type expected_s = 0, desired_s = 0;
-+        storage_type expected_s, desired_s;
-+        memset(&expected_s, 0, sizeof(expected_s));
-+        memset(&desired_s, 0, sizeof(desired_s));
-         memcpy(&expected_s, &expected, sizeof(value_type));
-         memcpy(&desired_s, &desired, sizeof(value_type));
-
-diff --git a/boost/atomic/detail/gcc-atomic.hpp b/boost/atomic/detail/gcc-atomic.hpp
-index a130590..4af99a1 100644
---- a/boost/atomic/detail/gcc-atomic.hpp
-+++ b/boost/atomic/detail/gcc-atomic.hpp
-@@ -958,14 +958,16 @@ class base_atomic<T, void, 16, Sign>
- 
- public:
-     BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
--    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
-+    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT
-     {
-+        memset(&v_, 0, sizeof(v_));
-         memcpy(&v_, &v, sizeof(value_type));
-     }
- 
-     void store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
-     {
--        storage_type tmp = 0;
-+        storage_type tmp;
-+        memset(&tmp, 0, sizeof(tmp));
-         memcpy(&tmp, &v, sizeof(value_type));
-         __atomic_store_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order));
-     }
-@@ -980,7 +982,8 @@ class base_atomic<T, void, 16, Sign>
- 
-     value_type exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
-     {
--        storage_type tmp = 0;
-+        storage_type tmp;
-+        memset(&tmp, 0, sizeof(tmp));
-         memcpy(&tmp, &v, sizeof(value_type));
-         tmp = __atomic_exchange_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order));
-         value_type res;
-@@ -994,7 +997,9 @@ class base_atomic<T, void, 16, Sign>
-         memory_order success_order,
-         memory_order failure_order) volatile BOOST_NOEXCEPT
-     {
--        storage_type expected_s = 0, desired_s = 0;
-+        storage_type expected_s, desired_s;
-+        memset(&expected_s, 0, sizeof(expected_s));
-+        memset(&desired_s, 0, sizeof(desired_s));
-         memcpy(&expected_s, &expected, sizeof(value_type));
-         memcpy(&desired_s, &desired, sizeof(value_type));
-         const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, false,
-@@ -1010,7 +1015,9 @@ class base_atomic<T, void, 16, Sign>
-         memory_order success_order,
-         memory_order failure_order) volatile BOOST_NOEXCEPT
-     {
--        storage_type expected_s = 0, desired_s = 0;
-+        storage_type expected_s, desired_s;
-+        memset(&expected_s, 0, sizeof(expected_s));
-+        memset(&desired_s, 0, sizeof(desired_s));
-         memcpy(&expected_s, &expected, sizeof(value_type));
-         memcpy(&desired_s, &desired, sizeof(value_type));
-         const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, true,
diff --git a/pkgs/development/libraries/cpp-netlib/default.nix b/pkgs/development/libraries/cpp-netlib/default.nix
index 685d095a818..64b223d4ebb 100644
--- a/pkgs/development/libraries/cpp-netlib/default.nix
+++ b/pkgs/development/libraries/cpp-netlib/default.nix
@@ -1,11 +1,8 @@
 { stdenv, fetchurl, cmake, boost, openssl }:
 
-let
-  version = "0.11.2";
-in
-
 stdenv.mkDerivation rec {
   name = "cpp-netlib-${version}";
+  version = "0.11.2";
 
   src = fetchurl {
     url = "http://downloads.cpp-netlib.org/${version}/${name}-final.tar.bz2";
@@ -19,7 +16,6 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
-    inherit version;
     description = "A collection of open-source libraries for high level network programming";
     homepage    = http://cpp-netlib.org;
     license     = licenses.boost;
diff --git a/pkgs/development/libraries/fontconfig-ultimate/confd.nix b/pkgs/development/libraries/fontconfig-ultimate/confd.nix
index e522cead822..160fef5f07e 100644
--- a/pkgs/development/libraries/fontconfig-ultimate/confd.nix
+++ b/pkgs/development/libraries/fontconfig-ultimate/confd.nix
@@ -1,13 +1,18 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchFromGitHub }:
 
+let version = "2015-12-06"; in
 stdenv.mkDerivation {
-  name = "fontconfig-ultimate-20141123";
-  src = fetchurl {
-    url = "https://github.com/bohoomil/fontconfig-ultimate/archive/2014-11-23.tar.gz";
-    sha256 = "0czfm3hxc41x5mscwrba7p1vhm2w62j1qg7z8kfdrf21z8fvgznw";
+  name = "fontconfig-ultimate-${version}";
+
+  src = fetchFromGitHub {
+    sha256 = "02a811szxkq4q088nxfpdzp6rv0brvgkdhwigk09qffygxd776g6";
+    rev = version;
+    repo = "fontconfig-ultimate";
+    owner = "bohoomil";
   };
 
   phases = "$prePhases unpackPhase installPhase $postPhases";
+
   installPhase = ''
     mkdir -p $out/etc/fonts/conf.d
     cp conf.d.infinality/*.conf $out/etc/fonts/conf.d
@@ -22,8 +27,8 @@ stdenv.mkDerivation {
     rm $out/etc/fonts/conf.d/83-*.conf
 
     # Inclusion of local and user configs handled by global configuration
-    rm $out/etc/fonts/conf.d/97-local.conf
-    rm $out/etc/fonts/conf.d/98-user.conf
+    rm $out/etc/fonts/conf.d/29-local.conf
+    rm $out/etc/fonts/conf.d/28-user.conf
 
     cp fontconfig_patches/fonts-settings/*.conf $out/etc/fonts/conf.d
 
diff --git a/pkgs/development/libraries/fontconfig/make-fonts-cache.nix b/pkgs/development/libraries/fontconfig/make-fonts-cache.nix
new file mode 100644
index 00000000000..1321948c3c8
--- /dev/null
+++ b/pkgs/development/libraries/fontconfig/make-fonts-cache.nix
@@ -0,0 +1,27 @@
+{ runCommand, lib, writeText, fontconfig, fontbhttf, fontDirectories }:
+
+runCommand "fc-cache"
+  rec {
+    buildInputs = [ fontconfig ];
+    passAsFile = [ "fontDirs" ];
+    fontDirs = ''
+      <!-- Font directories -->
+      ${lib.concatStringsSep "\n" (map (font: "<dir>${font}</dir>") fontDirectories)}
+    '';
+  }
+  ''
+    export FONTCONFIG_FILE=$(pwd)/fonts.conf
+
+    cat > fonts.conf << EOF
+    <?xml version='1.0'?>
+    <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
+    <fontconfig>
+      <include>${fontconfig}/etc/fonts/fonts.conf</include>
+      <cachedir>$out</cachedir>
+    EOF
+    cat "$fontDirsPath" >> fonts.conf
+    echo "</fontconfig>" >> fonts.conf
+
+    mkdir -p $out
+    fc-cache -sv
+  ''
diff --git a/pkgs/development/libraries/fontconfig/make-fonts-conf.xsl b/pkgs/development/libraries/fontconfig/make-fonts-conf.xsl
index 1b79834c894..b59fcd0187b 100644
--- a/pkgs/development/libraries/fontconfig/make-fonts-conf.xsl
+++ b/pkgs/development/libraries/fontconfig/make-fonts-conf.xsl
@@ -23,16 +23,16 @@
     <fontconfig>
       <xsl:apply-templates select="child::node()[name() != 'dir' and name() != 'cachedir' and name() != 'include']" />
 
-      <!-- fontconfig distribution conf.d -->
-      <include><xsl:value-of select="$fontconfig" />/etc/fonts/conf.d</include>
-      <!-- versioned system-wide config -->
-      <include ignore_missing="yes">/etc/fonts/<xsl:value-of select="$fontconfigConfigVersion" />/conf.d</include>
-
       <!-- the first cachedir will be used to store the cache -->
       <cachedir prefix="xdg">fontconfig</cachedir>
       <!-- /var/cache/fontconfig is useful for non-nixos systems -->
       <cachedir>/var/cache/fontconfig</cachedir>
 
+      <!-- fontconfig distribution conf.d -->
+      <include><xsl:value-of select="$fontconfig" />/etc/fonts/conf.d</include>
+      <!-- versioned system-wide config -->
+      <include ignore_missing="yes">/etc/fonts/<xsl:value-of select="$fontconfigConfigVersion" />/conf.d</include>
+
       <dir prefix="xdg">fonts</dir>
       <xsl:for-each select="str:tokenize($fontDirectories)">
         <dir><xsl:value-of select="." /></dir>
diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix
index dccde33efcf..81e98056e90 100644
--- a/pkgs/development/libraries/freetype/default.nix
+++ b/pkgs/development/libraries/freetype/default.nix
@@ -1,16 +1,18 @@
 { stdenv, fetchurl, fetchpatch, pkgconfig, which, zlib, bzip2, libpng, gnumake
+, glib /* passthru only */
+
   # FreeType supports sub-pixel rendering.  This is patented by
   # Microsoft, so it is disabled by default.  This option allows it to
   # be enabled.  See http://www.freetype.org/patents.html.
-, glib/*passthru only*/
 , useEncumberedCode ? true
 }:
 
 let
-  version = "2.5.4";
+  version = "2.6.2";
 
-  fetch_bohoomil = name: sha256: fetchpatch {
-    url = https://raw.githubusercontent.com/bohoomil/fontconfig-ultimate/e4c99bcf5ac9595e2c64393c0661377685c0ad24/01_freetype2-iu/ + name;
+  # Don't use fetchpatch. It mangles them. That's an hour I'll never get back.
+  fetchbohoomil = name: sha256: fetchurl {
+    url = https://raw.githubusercontent.com/bohoomil/fontconfig-ultimate/254b688f96d4a37f78fb594303a43160fc15c7cd/freetype/ + name;
     inherit sha256;
   };
 in
@@ -20,15 +22,17 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://sourceforge/freetype/${name}.tar.bz2";
-    sha256 = "1fxsbk4lp6ymifldzrb86g3x6mz771jmrzphkz92mcrkddk2qkiv";
+    sha256 = "14mqrfgl18q2by1yzv6vcxi97zjy4kppcgsqf312mhfwgkpvvxms";
   };
 
-  patches = [ ./enable-validation.patch ] # from Gentoo, bohoomil has the same patch as well
-    ++ [ ./fix-pcf.patch ]
+  patches = []
     ++ optionals useEncumberedCode [
-      (fetch_bohoomil "02-ftsmooth-2.5.4.patch" "11w4wb7gwgpijc788mpkxj92d7rfdwrdv7jzrpxwv5w5cgpx9iw9")
-      (fetch_bohoomil "03-upstream-2014.12.07.patch" "0gq7y63mg3gc5z69nfkv2kl7xad0bjzsvnl6j1j9q79jjbvaqdq0")
-      (fetch_bohoomil "04-infinality-2.5.4-2014.12.07.patch" "1gph7z9s2221gy5dxn01v3lga0m9yib8yqsaqj5km74bqx1vlalh")
+      (fetchbohoomil "01-freetype-2.6.2-enable-valid.patch"
+        "1szq0zha7n41f4pq179wgfkam034mp2xn0xc36sdl5sjp9s9hv08")
+      (fetchbohoomil "02-upstream-2015.12.05.patch"
+        "0781r9n35kpn8db8nma0l47cpkzh0hbp84ziii5sald90dnrqdj4")
+      (fetchbohoomil "03-infinality-2.6.2-2015.12.05.patch"
+        "0wcjf9hiymplgqm3szla633i417pb57vpzzs2dyl1dnmcxgqa2y8")
     ];
 
   outputs = [ "dev" "out" ];
@@ -50,10 +54,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  # compat hacks
-  postFixup = glib.flattenInclude + ''
-    ln -s . "$dev"/include/freetype
-  '';
+  postInstall = glib.flattenInclude;
 
   crossAttrs = {
     # Somehow it calls the unwrapped gcc, "i686-pc-linux-gnu-gcc", instead
diff --git a/pkgs/development/libraries/freetype/enable-validation.patch b/pkgs/development/libraries/freetype/enable-validation.patch
deleted file mode 100644
index 44f3bf6e1c9..00000000000
--- a/pkgs/development/libraries/freetype/enable-validation.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Enables gxvalid and otvalid modules for use with ftvalid.
-
---- freetype-2.2.1/modules.cfg.orig	2006-07-07 21:01:09.000000000 -0400
-+++ freetype-2.2.1/modules.cfg	2006-07-07 21:01:54.000000000 -0400
-@@ -110,7 +110,7 @@
- AUX_MODULES += cache
- 
- # TrueType GX/AAT table validation.  Needs ftgxval.c below.
--# AUX_MODULES += gxvalid
-+AUX_MODULES += gxvalid
- 
- # Support for streams compressed with gzip (files with suffix .gz).
- #
-@@ -124,7 +124,7 @@
- 
- # OpenType table validation.  Needs ftotval.c below.
- #
--# AUX_MODULES += otvalid
-+AUX_MODULES += otvalid
- 
- # Auxiliary PostScript driver component to share common code.
- #
diff --git a/pkgs/development/libraries/freetype/fix-pcf.patch b/pkgs/development/libraries/freetype/fix-pcf.patch
deleted file mode 100644
index bb301bcd9ca..00000000000
--- a/pkgs/development/libraries/freetype/fix-pcf.patch
+++ /dev/null
@@ -1,132 +0,0 @@
-Upstream fixes for pcf fonts.
-
-http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=74af85c4b62b35e55b0ce9dec55ee10cbc4962a2
-http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=06842c7b49c21f13c0ab61201daab6ff5a358fcc
-
-diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
-index 998cbed..e3caf82 100644
---- a/src/pcf/pcfread.c
-+++ b/src/pcf/pcfread.c
-@@ -2,7 +2,7 @@
- 
-     FreeType font driver for pcf fonts
- 
--  Copyright 2000-2010, 2012, 2013 by
-+  Copyright 2000-2010, 2012-2014 by
-   Francesco Zappa Nardelli
- 
- Permission is hereby granted, free of charge, to any person obtaining a copy
-@@ -78,7 +78,7 @@ THE SOFTWARE.
-     FT_FRAME_START( 16  ),
-       FT_FRAME_ULONG_LE( type ),
-       FT_FRAME_ULONG_LE( format ),
--      FT_FRAME_ULONG_LE( size ),
-+      FT_FRAME_ULONG_LE( size ),   /* rounded up to a multiple of 4 */
-       FT_FRAME_ULONG_LE( offset ),
-     FT_FRAME_END
-   };
-@@ -95,9 +95,11 @@ THE SOFTWARE.
-     FT_Memory  memory = FT_FACE( face )->memory;
-     FT_UInt    n;
- 
-+    FT_ULong   size;
- 
--    if ( FT_STREAM_SEEK ( 0 )                          ||
--         FT_STREAM_READ_FIELDS ( pcf_toc_header, toc ) )
-+
-+    if ( FT_STREAM_SEEK( 0 )                          ||
-+         FT_STREAM_READ_FIELDS( pcf_toc_header, toc ) )
-       return FT_THROW( Cannot_Open_Resource );
- 
-     if ( toc->version != PCF_FILE_VERSION                 ||
-@@ -154,14 +156,35 @@ THE SOFTWARE.
-         break;
-     }
- 
--    /* we now check whether the `size' and `offset' values are reasonable: */
--    /* `offset' + `size' must not exceed the stream size                   */
-+    /*
-+     *  We now check whether the `size' and `offset' values are reasonable:
-+     *  `offset' + `size' must not exceed the stream size.
-+     *
-+     *  Note, however, that X11's `pcfWriteFont' routine (used by the
-+     *  `bdftopcf' program to create PDF font files) has two special
-+     *  features.
-+     *
-+     *  - It always assigns the accelerator table a size of 100 bytes in the
-+     *    TOC, regardless of its real size, which can vary between 34 and 72
-+     *    bytes.
-+     *
-+     *  - Due to the way the routine is designed, it ships out the last font
-+     *    table with its real size, ignoring the TOC's size value.  Since
-+     *    the TOC size values are always rounded up to a multiple of 4, the
-+     *    difference can be up to three bytes for all tables except the
-+     *    accelerator table, for which the difference can be as large as 66
-+     *    bytes.
-+     *
-+     */
-+
-     tables = face->toc.tables;
--    for ( n = 0; n < toc->count; n++ )
-+    size   = stream->size;
-+
-+    for ( n = 0; n < toc->count - 1; n++ )
-     {
-       /* we need two checks to avoid overflow */
--      if ( ( tables->size   > stream->size                ) ||
--           ( tables->offset > stream->size - tables->size ) )
-+      if ( ( tables->size   > size                ) ||
-+           ( tables->offset > size - tables->size ) )
-       {
-         error = FT_THROW( Invalid_Table );
-         goto Exit;
-@@ -169,6 +192,15 @@ THE SOFTWARE.
-       tables++;
-     }
- 
-+    /* no check of `tables->size' for last table element ... */
-+    if ( ( tables->offset > size ) )
-+    {
-+      error = FT_THROW( Invalid_Table );
-+      goto Exit;
-+    }
-+    /* ... instead, we adjust `tables->size' to the real value */
-+    tables->size = size - tables->offset;
-+
- #ifdef FT_DEBUG_LEVEL_TRACE
- 
-     {
-@@ -733,8 +765,8 @@ THE SOFTWARE.
- 
-     FT_TRACE4(( "  number of bitmaps: %d\n", nbitmaps ));
- 
--    /* XXX: PCF_Face->nmetrics is singed FT_Long, see pcf.h */
--    if ( face->nmetrics < 0 || nbitmaps != ( FT_ULong )face->nmetrics )
-+    /* XXX: PCF_Face->nmetrics is signed FT_Long, see pcf.h */
-+    if ( face->nmetrics < 0 || nbitmaps != (FT_ULong)face->nmetrics )
-       return FT_THROW( Invalid_File_Format );
- 
-     if ( FT_NEW_ARRAY( offsets, nbitmaps ) )
-diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
-index e3caf82..a29a9e3 100644
---- a/src/pcf/pcfread.c
-+++ b/src/pcf/pcfread.c
-@@ -192,14 +192,15 @@ THE SOFTWARE.
-       tables++;
-     }
- 
--    /* no check of `tables->size' for last table element ... */
-+    /* only check `tables->offset' for last table element ... */
-     if ( ( tables->offset > size ) )
-     {
-       error = FT_THROW( Invalid_Table );
-       goto Exit;
-     }
--    /* ... instead, we adjust `tables->size' to the real value */
--    tables->size = size - tables->offset;
-+    /* ... and adjust `tables->size' to the real value if necessary */
-+    if ( tables->size > size - tables->offset )
-+      tables->size = size - tables->offset;
- 
- #ifdef FT_DEBUG_LEVEL_TRACE
- 
diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix
index 869fdcc70a1..fc4707aedb7 100644
--- a/pkgs/development/libraries/glib-networking/default.nix
+++ b/pkgs/development/libraries/glib-networking/default.nix
@@ -2,15 +2,15 @@
 , gsettings_desktop_schemas }:
 
 let
-  ver_maj = "2.44";
-  ver_min = "0";
+  ver_maj = "2.46";
+  ver_min = "1";
 in
 stdenv.mkDerivation rec {
   name = "glib-networking-${ver_maj}.${ver_min}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/glib-networking/${ver_maj}/${name}.tar.xz";
-    sha256 = "8f8a340d3ba99bfdef38b653da929652ea6640e27969d29f7ac51fbbe11a4346";
+    sha256 = "1cchmi08jpjypgmm9i7xzh5qfg2q5k61kry9ns8mhw3z44a440ym";
   };
 
   outputs = [ "dev" "out" ]; # to deal with propagatedBuildInputs
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index 7feccdef9aa..db59befcb50 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -69,12 +69,17 @@ stdenv.mkDerivation rec {
   # internal pcre would only add <200kB, but it's relatively common
   configureFlags = [ "--with-pcre=system" ]
     ++ optional stdenv.isDarwin "--disable-compile-warnings"
-    ++ optional stdenv.isFreeBSD "--with-libiconv=gnu"
-    ++ optional stdenv.isSunOS ["--disable-modular-tests" "--with-libiconv"];
+    ++ optional (stdenv.isFreeBSD || stdenv.isSunOS) "--with-libiconv=gnu"
+    ++ optional stdenv.isSunOS "--disable-dtrace";
 
   NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin " -lintl"
     + optionalString stdenv.isSunOS " -DBSD_COMP";
 
+  preConfigure = if !stdenv.isSunOS then null else
+    ''
+      sed -i -e 's|inotify.h|foobar-inotify.h|g' configure
+    '';
+
   LIBELF_CFLAGS = optional stdenv.isFreeBSD "-I${libelf}";
   LIBELF_LIBS = optional stdenv.isFreeBSD "-L${libelf} -lelf";
 
diff --git a/pkgs/development/libraries/gmock/default.nix b/pkgs/development/libraries/gmock/default.nix
index 71ac281195b..926832dbada 100644
--- a/pkgs/development/libraries/gmock/default.nix
+++ b/pkgs/development/libraries/gmock/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, unzip, cmake}:
+{ stdenv, cmake, fetchzip }:
 
 stdenv.mkDerivation rec {
-  version = "1.7.0";
   name = "gmock-${version}";
+  version = "1.7.0";
 
-  src = fetchurl {
-    url = "https://googlemock.googlecode.com/files/${name}.zip";
-    sha256="26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b";
+  src = fetchzip {
+    url = "https://googlemock.googlecode.com/files/gmock-${version}.zip";
+    sha256 = "04n9p6pf3mrqsabrsncv32d3fqvd86zmcdq3gyni7liszgfk0paz";
   };
 
-  buildInputs = [ unzip cmake ];
+  buildInputs = [ cmake ];
 
   buildPhase = ''
     # avoid building gtest
@@ -29,4 +29,6 @@ stdenv.mkDerivation rec {
     license = stdenv.lib.licenses.bsd3;
     maintainers = [ stdenv.lib.maintainers.auntie ];
   };
+
+  passthru = { source = src; };
 }
diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix
index 8d8b9a91494..c6031142323 100644
--- a/pkgs/development/libraries/gpgme/default.nix
+++ b/pkgs/development/libraries/gpgme/default.nix
@@ -5,10 +5,8 @@ assert useGnupg1 -> gnupg1 != null;
 assert !useGnupg1 -> gnupg != null;
 
 let
-  gpgPath = if useGnupg1 then
-    "${gnupg1}/bin/gpg"
-  else
-    "${gnupg}/bin/gpg2";
+  gpgStorePath = if useGnupg1 then gnupg1 else gnupg;
+  gpgProgram = if useGnupg1 then "gpg" else "gpg2";
 in
 stdenv.mkDerivation rec {
   name = "gpgme-1.6.0";
@@ -25,7 +23,10 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig gnupg ];
 
-  configureFlags = "--with-gpg=${gpgPath}";
+  configureFlags = [
+    "--with-gpg=${gpgStorePath}/bin/${gpgProgram}"
+    "--enable-fixed-path=${gpgStorePath}/bin"
+  ];
 
   meta = with stdenv.lib; {
     homepage = "http://www.gnupg.org/related_software/gpgme";
diff --git a/pkgs/development/libraries/id3lib/default.nix b/pkgs/development/libraries/id3lib/default.nix
index 0ea1e96947e..9f880e3ea9f 100644
--- a/pkgs/development/libraries/id3lib/default.nix
+++ b/pkgs/development/libraries/id3lib/default.nix
@@ -3,7 +3,10 @@
 stdenv.mkDerivation {
   name = "id3lib-3.8.3";
 
-  patches = [ ./id3lib-3.8.3-gcc43-1.patch ];
+  patches = [
+    ./id3lib-3.8.3-gcc43-1.patch
+    ./patch_id3lib_3.8.3_UTF16_writing_bug.diff
+  ];
 
   buildInputs = [ zlib ];
   
diff --git a/pkgs/development/libraries/id3lib/patch_id3lib_3.8.3_UTF16_writing_bug.diff b/pkgs/development/libraries/id3lib/patch_id3lib_3.8.3_UTF16_writing_bug.diff
new file mode 100644
index 00000000000..b05d2cf298d
--- /dev/null
+++ b/pkgs/development/libraries/id3lib/patch_id3lib_3.8.3_UTF16_writing_bug.diff
@@ -0,0 +1,39 @@
+diff -ruN id3lib-3.8.3.orig/ChangeLog id3lib-3.8.3/ChangeLog
+--- id3lib-3.8.3.orig/ChangeLog	2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/ChangeLog	2006-02-22 00:33:59.946214472 +0100
+@@ -1,3 +1,8 @@
++2006-02-17  Jerome Couderc
++
++    * Patch from Spoon to fix UTF-16 writing bug
++      http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
++
+ 2003-03-02 Sunday 17:38   Thijmen Klok <thijmen@id3lib.org>
+ 
+ 	* THANKS (1.20): added more people 
+diff -ruN id3lib-3.8.3.orig/src/io_helpers.cpp id3lib-3.8.3/src/io_helpers.cpp
+--- id3lib-3.8.3.orig/src/io_helpers.cpp	2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/src/io_helpers.cpp	2006-02-22 00:35:02.926639992 +0100
+@@ -363,11 +363,22 @@
+     // Write the BOM: 0xFEFF
+     unicode_t BOM = 0xFEFF;
+     writer.writeChars((const unsigned char*) &BOM, 2);
++    // Patch from Spoon : 2004-08-25 14:17
++    //   http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
++    // Wrong code
++    //for (size_t i = 0; i < size; i += 2)
++    //{
++    //  unicode_t ch = (data[i] << 8) | data[i+1];
++    //  writer.writeChars((const unsigned char*) &ch, 2);
++    //}
++    // Right code
++    unsigned char *pdata = (unsigned char *) data.c_str();
+     for (size_t i = 0; i < size; i += 2)
+     {
+-      unicode_t ch = (data[i] << 8) | data[i+1];
++      unicode_t ch = (pdata[i] << 8) | pdata[i+1];
+       writer.writeChars((const unsigned char*) &ch, 2);
+     }
++    // End patch
+   }
+   return writer.getCur() - beg;
+ }
diff --git a/pkgs/development/libraries/ijs/default.nix b/pkgs/development/libraries/ijs/default.nix
index fbba11c10c9..0c7d412fee6 100644
--- a/pkgs/development/libraries/ijs/default.nix
+++ b/pkgs/development/libraries/ijs/default.nix
@@ -1,16 +1,25 @@
-{ stdenv, fetchurl, autoreconfHook }:
+{ stdenv, fetchurl, fetchpatch, autoreconfHook }:
 
-let version = "9.16";
+let version = "9.18";
 in
 stdenv.mkDerivation {
   name = "ijs-${version}";
 
   src = fetchurl {
     url = "http://downloads.ghostscript.com/public/ghostscript-${version}.tar.bz2";
-    sha256 = "0vdqbjkickb0109lk6397bb2zjmg1s46dac5p5j4gfxa4pwl8b9y";
+    sha256 = "18ad90za28dxybajqwf3y3dld87cgkx1ljllmcnc7ysspfxzbnl3";
   };
 
-  prePatch = "cd ijs";
+  patches = [
+    # http://bugs.ghostscript.com/show_bug.cgi?id=696246
+    (fetchpatch {
+      name = "devijs-account-for-device-subclassing.patch";
+      url = "http://git.ghostscript.com/?p=ghostpdl.git;a=patch;h=b68e05c3";
+      sha256 = "1c3fzfjzvf15z533vpw3l3da8wcxw98qi3p1lc6lf13940a57c7n";
+    })
+  ];
+
+  postPatch = "cd ijs";
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/ip2location-c/default.nix b/pkgs/development/libraries/ip2location-c/default.nix
index 7bf4e746db4..109510df79b 100644
--- a/pkgs/development/libraries/ip2location-c/default.nix
+++ b/pkgs/development/libraries/ip2location-c/default.nix
@@ -1,8 +1,8 @@
 { stdenv, fetchurl, autoreconfHook }:
 
-let version = "7.0.2"; in # meta.homepage might change after a major update
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "ip2location-c-${version}";
+  version = "7.0.2"; # meta.homepage might change after a major update
 
   src = fetchurl {
     sha256 = "1gs43qgcyfn83abrkhvvw1s67d1sbkbj3hab9m17ysn6swafiycx";
@@ -18,7 +18,6 @@ stdenv.mkDerivation {
   doCheck = false;
 
   meta = with stdenv.lib; {
-    inherit version;
     description = "Library to look up locations of host names and IP addresses";
     longDescription = ''
       A C library to find the country, region, city,coordinates,
diff --git a/pkgs/development/libraries/java/jflex/builder.sh b/pkgs/development/libraries/java/jflex/builder.sh
deleted file mode 100755
index d95feb5eeb4..00000000000
--- a/pkgs/development/libraries/java/jflex/builder.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-set -e
-source $stdenv/setup
-
-tar zxvf $src
-mkdir -p $out
-mv $name/* $out
diff --git a/pkgs/development/libraries/java/jflex/default.nix b/pkgs/development/libraries/java/jflex/default.nix
index 5e54e800f55..12f9995b56a 100644
--- a/pkgs/development/libraries/java/jflex/default.nix
+++ b/pkgs/development/libraries/java/jflex/default.nix
@@ -1,11 +1,26 @@
 {stdenv, fetchurl} :
 
-stdenv.mkDerivation {
-  name = "jflex-1.4.3";
-  builder = ./builder.sh;
+stdenv.mkDerivation rec {
+  name = "jflex-1.6.1";
 
   src = fetchurl {
-    url = http://jflex.de/jflex-1.4.3.tar.gz;
-    sha256 = "0sm74sgjvw01fsiqr5q9ipbm8rfyihf6yn00dqymhyc3wmbhr517";
+    url = "http://jflex.de/${name}.tar.gz";
+    sha256 = "1h7q2vhb4s42g4pqz5xxxliagprray7i9krr6hyaz1mjlx7gnycq";
+  };
+
+  sourceRoot = name;
+
+  phases = [ "unpackPhase" "installPhase" ];
+
+  installPhase = ''
+    mkdir -p $out
+    cp -a * $out
+    patchShebangs $out
+  '';
+
+  meta = {
+    homepage = http://www.jflex.de/;
+    description = "Lexical analyzer generator for Java, written in Java";
+    license = stdenv.lib.licenses.bsd3;
   };
 }
diff --git a/pkgs/development/libraries/libcli/default.nix b/pkgs/development/libraries/libcli/default.nix
index 7798eb5f8fc..1c247f6faa8 100644
--- a/pkgs/development/libraries/libcli/default.nix
+++ b/pkgs/development/libraries/libcli/default.nix
@@ -1,8 +1,8 @@
 { stdenv, fetchFromGitHub }:
 
-let version = "1.9.7"; in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "libcli-${version}";
+  version = "1.9.7";
 
   src = fetchFromGitHub {
     sha256 = "08pmjhqkwldhmcwjhi2l27slf1fk6nxxfaihnk2637pqkycy8z0c";
diff --git a/pkgs/development/libraries/libconfuse/default.nix b/pkgs/development/libraries/libconfuse/default.nix
new file mode 100644
index 00000000000..dbe818ba561
--- /dev/null
+++ b/pkgs/development/libraries/libconfuse/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, flex }:
+
+stdenv.mkDerivation rec {
+  name = "libconfuse-${version}";
+  version = "2.8";
+
+  src = fetchFromGitHub {
+    sha256 = "0s0asxnml4rlv17ijz5w57x949anag28wx7wdahqx6mgqz0w2j2k";
+    rev = "v${version}";
+    repo = "libconfuse";
+    owner = "martinh";
+  };
+
+  nativeBuildInputs = [ autoreconfHook flex ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    inherit (src.meta) homepage;
+    description = "Small configuration file parser library for C";
+    longDescription = ''
+      libConfuse (previously libcfg) is a configuration file parser library
+      written in C. It supports sections and (lists of) values, as well as
+      some other features. It makes it very easy to add configuration file
+      capability to a program using a simple API.
+
+      The goal of libConfuse is not to be the configuration file parser library
+      with a gazillion of features. Instead, it aims to be easy to use and
+      quick to integrate with your code.
+    '';
+    license = licenses.isc;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ nckx ];
+  };
+}
diff --git a/pkgs/development/libraries/libedit/freebsd_weak_ref.patch b/pkgs/development/libraries/libedit/freebsd_weak_ref.patch
deleted file mode 100644
index a4399593d63..00000000000
--- a/pkgs/development/libraries/libedit/freebsd_weak_ref.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- libedit-20110709-3.0/src/vi.c.old	2011-07-11 18:21:16.000000000 +0000
-+++ libedit-20110709-3.0/src/vi.c	2011-07-11 18:24:29.000000000 +0000
-@@ -918,7 +918,7 @@
-  * NB: posix implies that we should enter insert mode, however
-  * this is against historical precedent...
-  */
--#ifdef __weak_reference
-+#if defined(__weak_reference) && defined(__NetBSD__)
- __weakref_visible char *my_get_alias_text(const char *)
-     __weak_reference(get_alias_text);
- #endif
-@@ -926,7 +926,7 @@
- /*ARGSUSED*/
- vi_alias(EditLine *el, Int c)
- {
--#ifdef __weak_reference
-+#if defined(__weak_reference) && defined(__NetBSD__)
- 	char alias_name[3];
- 	char *alias_text;
- 
diff --git a/pkgs/development/libraries/libgdiplus/default.nix b/pkgs/development/libraries/libgdiplus/default.nix
index 56bc72acff0..60995046982 100644
--- a/pkgs/development/libraries/libgdiplus/default.nix
+++ b/pkgs/development/libraries/libgdiplus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, cairo, fontconfig
+{ stdenv, fetchurl, pkgconfig, glib, cairo, Carbon, fontconfig
 , libtiff, giflib, libungif, libjpeg, libpng, monoDLLFixer
 , libXrender, libexif }:
 
@@ -25,5 +25,6 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ pkgconfig glib cairo fontconfig libtiff giflib libungif
       libjpeg libpng libXrender libexif
-    ];
+    ]
+    ++ stdenv.lib.optional stdenv.isDarwin Carbon;
 }
diff --git a/pkgs/development/libraries/libkeyfinder/default.nix b/pkgs/development/libraries/libkeyfinder/default.nix
index bde5db77fda..9ea4748af4b 100644
--- a/pkgs/development/libraries/libkeyfinder/default.nix
+++ b/pkgs/development/libraries/libkeyfinder/default.nix
@@ -1,8 +1,8 @@
 { stdenv, fetchFromGitHub, fftw, qtbase }:
 
-let version = "2.1"; in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "libkeyfinder-${version}";
+  version = "2.1";
 
   src = fetchFromGitHub {
     sha256 = "07kc0cl6kirgmpdgkgmp6r3yvyf7b1w569z01g8rfl1cig80qdc7";
@@ -11,15 +11,6 @@ stdenv.mkDerivation {
     owner = "ibsh";
   };
 
-  meta = with stdenv.lib; {
-    inherit version;
-    description = "Musical key detection for digital audio (C++ library)";
-    homepage = http://www.ibrahimshaath.co.uk/keyfinder/;
-    license = licenses.gpl3Plus;
-    platforms = platforms.linux;
-    maintainers = with maintainers; [ nckx ];
-  };
-
   buildInputs = [ fftw qtbase ];
 
   postPatch = ''
@@ -40,4 +31,12 @@ stdenv.mkDerivation {
     mkdir -p $out/lib
     cp -a lib*.so* $out/lib
   '';
+
+  meta = with stdenv.lib; {
+    description = "Musical key detection for digital audio (C++ library)";
+    homepage = http://www.ibrahimshaath.co.uk/keyfinder/;
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ nckx ];
+  };
 }
diff --git a/pkgs/development/libraries/libnetfilter_conntrack/default.nix b/pkgs/development/libraries/libnetfilter_conntrack/default.nix
index 72aaa1593cc..75cca9a028e 100644
--- a/pkgs/development/libraries/libnetfilter_conntrack/default.nix
+++ b/pkgs/development/libraries/libnetfilter_conntrack/default.nix
@@ -1,8 +1,8 @@
 { stdenv, fetchurl, pkgconfig, libnfnetlink, libmnl }:
 
-let version = "1.0.5"; in
 stdenv.mkDerivation rec {
   name = "libnetfilter_conntrack-${version}";
+  version = "1.0.5";
 
   src = fetchurl {
     url = "http://netfilter.org/projects/libnetfilter_conntrack/files/${name}.tar.bz2";
@@ -14,7 +14,6 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
 
   meta = with stdenv.lib; {
-    inherit version;
     description = "Userspace library providing an API to the in-kernel connection tracking state table";
     longDescription = ''
       libnetfilter_conntrack is a userspace library providing a programming interface (API) to the
diff --git a/pkgs/development/libraries/libpsl/default.nix b/pkgs/development/libraries/libpsl/default.nix
index 7368729a881..1dc4c57e979 100644
--- a/pkgs/development/libraries/libpsl/default.nix
+++ b/pkgs/development/libraries/libpsl/default.nix
@@ -3,20 +3,19 @@
 
 let
 
-  version = "${libVersion}-list-${listVersion}";
-
-  listVersion = "2016-01-09";
+  listVersion = "2016-01-15";
   listSources = fetchFromGitHub {
-    sha256 = "1xsal9vyan954ahyn9pxvqpipmpcf6drp30xz7ag5xp3f2clcx8s";
-    rev = "0f7cc8b00498812ddaa983c56d67ef3713e48350";
+    sha256 = "1smn4fl0fhldy7gdn0k1diyghbxdxnr4cj921bjdl2i4wxas41g5";
+    rev = "77cb90dce70827bda40384e1ae8bff3c958daef3";
     repo = "list";
     owner = "publicsuffix";
   };
 
   libVersion = "0.12.0";
 
-in stdenv.mkDerivation {
+in stdenv.mkDerivation rec {
   name = "libpsl-${version}";
+  version = "${libVersion}-list-${listVersion}";
 
   src = fetchFromGitHub {
     sha256 = "13w3lc752az2swymg408f3w2lbqs0f2h5ri6d5jw1vv9z0ij9xlw";
@@ -54,7 +53,6 @@ in stdenv.mkDerivation {
   doCheck = true;
 
   meta = with stdenv.lib; {
-    inherit version;
     description = "C library for the Publix Suffix List";
     longDescription = ''
       libpsl is a C library for the Publix Suffix List (PSL). A "public suffix"
diff --git a/pkgs/development/libraries/libressl/2.2.nix b/pkgs/development/libraries/libressl/2.2.nix
index 89e7e6507e4..a3389a49fbc 100644
--- a/pkgs/development/libraries/libressl/2.2.nix
+++ b/pkgs/development/libraries/libressl/2.2.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libressl-${version}";
-  version = "2.2.5";
+  version = "2.2.6";
 
   src = fetchurl {
     url    = "mirror://openbsd/LibreSSL/${name}.tar.gz";
-    sha256 = "0jwidi7fafcdh5qml72dx0ad0kfsk94qxzm29i7wd3cx8v8dxjp3";
+    sha256 = "0kynb15l5gq1qgp3p4ncn20sc65sbl8lk89vyr07s17xrya9kq8y";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/libressl/2.3.nix b/pkgs/development/libraries/libressl/2.3.nix
index d9981f9b0c5..a87e599cbc0 100644
--- a/pkgs/development/libraries/libressl/2.3.nix
+++ b/pkgs/development/libraries/libressl/2.3.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libressl-${version}";
-  version = "2.3.1";
+  version = "2.3.2";
 
   src = fetchurl {
     url    = "mirror://openbsd/LibreSSL/${name}.tar.gz";
-    sha256 = "410b58db4ebbcab43c3357612e591094f64fb9339269caa2e68728e36f8d589e";
+    sha256 = "0sm9cjjqvj581sfd4sh0i467sh8p89nq9b8ck2qn3war92p5zx40";
   };
 
   enableParallelBuilding = true;
@@ -15,6 +15,6 @@ stdenv.mkDerivation rec {
     description = "Free TLS/SSL implementation";
     homepage    = "http://www.libressl.org";
     platforms   = platforms.all;
-    maintainers = with maintainers; [ thoughtpolice wkennington fpletz ];
+    maintainers = with maintainers; [ thoughtpolice wkennington fpletz globin ];
   };
 }
diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix
index b9a6c8341ef..aa84c507c97 100644
--- a/pkgs/development/libraries/libsoup/default.nix
+++ b/pkgs/development/libraries/libsoup/default.nix
@@ -3,15 +3,15 @@
 , libintlOrEmpty
 , intltool, python }:
 let
-  majorVersion = "2.50";
-  version = "${majorVersion}.0";
+  majorVersion = "2.52";
+  version = "${majorVersion}.2";
 in
 stdenv.mkDerivation {
   name = "libsoup-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/libsoup/${majorVersion}/libsoup-${version}.tar.xz";
-    sha256 = "1e01365ac4af3817187ea847f9d3588c27eee01fc519a5a7cb212bb78b0f667b";
+    sha256 = "1p4k40y2gikr6m8p3hm0vswdzj2pj133dckipd2jk5bxbj5n4mfv";
   };
 
   patchPhase = ''
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
   passthru.propagatedUserEnvPackages = [ glib_networking.out ];
 
   # glib_networking is a runtime dependency, not a compile-time dependency
-  configureFlags = "--disable-tls-check" + stdenv.lib.optionalString (!gnomeSupport) " --without-gnome";
+  configureFlags = "--disable-tls-check --enable-vala=no" + stdenv.lib.optionalString (!gnomeSupport) " --without-gnome";
 
   NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
 
diff --git a/pkgs/development/libraries/libspectre/default.nix b/pkgs/development/libraries/libspectre/default.nix
index 0e5f976c122..5c10fff50ad 100644
--- a/pkgs/development/libraries/libspectre/default.nix
+++ b/pkgs/development/libraries/libspectre/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "1v63lqc6bhhxwkpa43qmz8phqs8ci4dhzizyy16d3vkb20m846z8";
   };
 
+  patches = [ ./libspectre-0.2.7-gs918.patch ];
+
   buildInputs = [
     # Need `libgs.so'.
     pkgconfig ghostscript cairo /*for tests*/
diff --git a/pkgs/development/libraries/libspectre/libspectre-0.2.7-gs918.patch b/pkgs/development/libraries/libspectre/libspectre-0.2.7-gs918.patch
new file mode 100644
index 00000000000..e9a4eda192b
--- /dev/null
+++ b/pkgs/development/libraries/libspectre/libspectre-0.2.7-gs918.patch
@@ -0,0 +1,42 @@
+Fixed error namespace for >=ghostscript-gpl-9.18
+
+https://bugs.gentoo.org/563540
+
+--- libspectre-0.2.7/libspectre/spectre-gs.c
++++ libspectre-0.2.7/libspectre/spectre-gs.c
+@@ -43,12 +43,12 @@
+ 	
+ 	if (code <= -100) {
+ 		switch (code) {
+-			case e_Fatal:
++			case gs_error_Fatal:
+ 				fprintf (stderr, "fatal internal error %d", code);
+ 				return TRUE;
+ 				break;
+ 
+-			case e_ExecStackUnderflow:
++			case gs_error_ExecStackUnderflow:
+ 				fprintf (stderr, "stack overflow %d", code);
+ 				return TRUE;
+ 				break;
+@@ -109,9 +109,9 @@
+ 		set = _spectre_strdup_printf ("%d %d translate\n", -x, -y);
+ 		error = gsapi_run_string_continue (ghostscript_instance, set, strlen (set),
+ 						   0, &exit_code);
+-		error = error == e_NeedInput ? 0 : error;
++		error = error == gs_error_NeedInput ? 0 : error;
+ 		free (set);
+-		if (error != e_NeedInput && critic_error_code (error)) {
++		if (error != gs_error_NeedInput && critic_error_code (error)) {
+ 			fclose (fd);
+ 			return FALSE;
+ 		}
+@@ -126,7 +126,7 @@
+ 		read = fread (buf, sizeof (char), to_read, fd);
+ 		error = gsapi_run_string_continue (ghostscript_instance,
+ 						   buf, read, 0, &exit_code);
+-		error = error == e_NeedInput ? 0 : error;
++		error = error == gs_error_NeedInput ? 0 : error;
+ 		left -= read;
+ 	}
+ 	
diff --git a/pkgs/development/libraries/libutempter/default.nix b/pkgs/development/libraries/libutempter/default.nix
new file mode 100644
index 00000000000..8481f857b2c
--- /dev/null
+++ b/pkgs/development/libraries/libutempter/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, lib, glib }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  name = "libutempter-${version}";
+  version = "1.1.6";
+
+  src = fetchurl {
+    url = "http://archive.ubuntu.com/ubuntu/pool/main/libu/libutempter/libutempter_${version}.orig.tar.bz2";
+    sha256 = "15y3xbgznjxnfmix4xg3bwmqdvghdw7slbhazb0ybmyf65gmd65q";
+  };
+
+  buildInputs = [ glib ];
+
+  installFlags = [
+    "libdir=\${out}/lib"
+    "libexecdir=\${out}/lib"
+    "includedir=\${out}/include"
+    "mandir=\${out}/share/man"
+  ];
+
+  meta = {
+    description = "Interface for terminal emulators such as screen and xterm to record user sessions to utmp and wtmp files";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.msteen ];
+  };
+}
diff --git a/pkgs/development/libraries/libva/default.nix b/pkgs/development/libraries/libva/default.nix
index ff44b157eaf..e04c3b9828d 100644
--- a/pkgs/development/libraries/libva/default.nix
+++ b/pkgs/development/libraries/libva/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl, libX11, pkgconfig, libXext, libdrm, libXfixes, wayland, libffi
+{ stdenv, lib, fetchurl, libX11, pkgconfig, libXext, libdrm, libXfixes, wayland, libffi
 , mesa_noglu
 , minimal ? true, libva
 }:
 
 stdenv.mkDerivation rec {
-  name = "libva-1.6.1";
+  name = "libva-1.6.2";
 
   src = fetchurl {
     url = "http://www.freedesktop.org/software/vaapi/releases/libva/${name}.tar.bz2";
-    sha256 = "0bjfb5s8dk3lql843l91ffxzlq47isqks5sj19cxh7j3nhzw58kz";
+    sha256 = "1l4bij21shqbfllbxicmqgmay4v509v9hpxyyia9wm7gvsfg05y4";
   };
 
   outputs = [ "dev" "out" "bin" ];
@@ -16,10 +16,21 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [ libdrm ]
-    ++ stdenv.lib.optionals (!minimal) [ libva libX11 libXext libXfixes wayland libffi mesa_noglu ];
+    ++ lib.optionals (!minimal) [ libva libX11 libXext libXfixes wayland libffi mesa_noglu ];
   # TODO: share libs between minimal and !minimal - perhaps just symlink them
 
-  #configureFlags = stdenv.lib.optional (mesa != null) "--enable-glx";
+  configureFlags = lib.optionals (!minimal) [
+    "--with-drivers-path=${mesa_noglu.driverLink}/lib/dri"
+     "--enable-glx" 
+   ];
+
+   installFlags = lib.optional (!minimal) "DESTDIR=$(out)";
+
+  postInstall = lib.optionalString (!minimal) ''
+    cp -r $out/${mesa_noglu.driverLink}/* $out
+    cp -r $out/$out/* $out
+    rm -rf $out/run $out/$(echo "$out" | cut -d "/" -f2)
+  '';
 
   meta = with stdenv.lib; {
     homepage = http://www.freedesktop.org/wiki/Software/vaapi;
diff --git a/pkgs/development/libraries/libvdpau-va-gl/default.nix b/pkgs/development/libraries/libvdpau-va-gl/default.nix
new file mode 100644
index 00000000000..51fb858d8be
--- /dev/null
+++ b/pkgs/development/libraries/libvdpau-va-gl/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, libX11, libpthreadstubs, libvdpau, glib
+, libva, ffmpeg, mesa_glu }:
+
+let
+  version = "0.3.4";
+
+in stdenv.mkDerivation rec {
+  name = "libvdpau-va-gl-${version}";
+
+  src = fetchFromGitHub {
+    owner = "i-rinat";
+    repo = "libvdpau-va-gl";
+    rev = "v${version}";
+    sha256 = "1909f3srm2iy2hv4m6jxg1nxrh9xgsnjs07wfzw3ais1fww0i2nn";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+  buildInputs = [ libX11 libpthreadstubs libvdpau glib libva ffmpeg mesa_glu ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/i-rinat/libvdpau-va-gl;
+    description = "VDPAU driver with OpenGL/VAAPI backend";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/pkgs/development/libraries/libvdpau/default.nix b/pkgs/development/libraries/libvdpau/default.nix
index 04d06a149fc..c2ec587a52e 100644
--- a/pkgs/development/libraries/libvdpau/default.nix
+++ b/pkgs/development/libraries/libvdpau/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, xorg }:
+{ stdenv, fetchurl, pkgconfig, xorg, mesa_noglu }:
 
 stdenv.mkDerivation rec {
   name = "libvdpau-1.1.1";
@@ -14,6 +14,16 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ xorg.libX11 ];
 
+  configureFlags = [ "--with-module-dir=${mesa_noglu.driverLink}/lib/vdpau" ];
+
+  installFlags = [ "DESTDIR=$(out)" ];
+
+  postInstall = ''
+    cp -r $out/${mesa_noglu.driverLink}/* $out
+    cp -r $out/$out/* $out
+    rm -rf $out/run $out/$(echo "$out" | cut -d "/" -f2)
+  '';
+
   meta = with stdenv.lib; {
     homepage = http://people.freedesktop.org/~aplattner/vdpau/;
     description = "Library to use the Video Decode and Presentation API for Unix (VDPAU)";
diff --git a/pkgs/development/libraries/libxcomp/default.nix b/pkgs/development/libraries/libxcomp/default.nix
index 3a65277abe2..b19706c2c37 100644
--- a/pkgs/development/libraries/libxcomp/default.nix
+++ b/pkgs/development/libraries/libxcomp/default.nix
@@ -1,23 +1,14 @@
 { stdenv, fetchurl, autoreconfHook, libjpeg, libpng12, libX11, zlib }:
 
-let version = "3.5.0.32"; in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "libxcomp-${version}";
+  version = "3.5.0.32";
 
   src = fetchurl {
     sha256 = "02n5bdc1jsq999agb4w6dmdj5l2wlln2lka84qz6rpswwc59zaxm";
     url = "http://code.x2go.org/releases/source/nx-libs/nx-libs-${version}-lite.tar.gz";
   };
 
-  meta = with stdenv.lib; {
-    inherit version;
-    description = "NX compression library";
-    homepage = "http://wiki.x2go.org/doku.php/wiki:libs:nx-libs";
-    license = licenses.gpl2;
-    platforms = platforms.linux;
-    maintainers = with maintainers; [ nckx ];
-  };
-
   buildInputs = [ libjpeg libpng12 libX11 zlib ];
   nativeBuildInputs = [ autoreconfHook ];
 
@@ -26,4 +17,12 @@ stdenv.mkDerivation {
   '';
 
   enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "NX compression library";
+    homepage = "http://wiki.x2go.org/doku.php/wiki:libs:nx-libs";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ nckx ];
+  };
 }
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index 3596a994baf..00771f1f727 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -23,7 +23,7 @@ else
 with { inherit (stdenv.lib) optional optionalString; };
 
 let
-  version = "11.0.8";
+  version = "11.1.1";
   # this is the default search path for DRI drivers
   driverLink = "/run/opengl-driver" + optionalString stdenv.isi686 "-32";
 in
@@ -38,7 +38,7 @@ stdenv.mkDerivation {
         + head (splitString "." version) + ''.x/${version}/mesa-${version}.tar.xz'')
       "https://launchpad.net/mesa/trunk/${version}/+download/mesa-${version}.tar.xz"
     ];
-    sha256 = "5696e4730518b6805d2ed5def393c4293f425a2c2c01bd5ed4bdd7ad62f7ad75";
+    sha256 = "087xlxl8dzmhzjilpsdiy19dn106spq120c9ndgnn4qlqm7hgnv4";
   };
 
   prePatch = "patchShebangs .";
diff --git a/pkgs/development/libraries/openssl/1.0.2.x.nix b/pkgs/development/libraries/openssl/1.0.2.x.nix
index 0c9c62dfb92..c94033d0fef 100644
--- a/pkgs/development/libraries/openssl/1.0.2.x.nix
+++ b/pkgs/development/libraries/openssl/1.0.2.x.nix
@@ -8,14 +8,14 @@ let
     stdenv.cross;
 in
 stdenv.mkDerivation rec {
-  name = "openssl-1.0.2e";
+  name = "openssl-1.0.2f";
 
   src = fetchurl {
     urls = [
       "http://www.openssl.org/source/${name}.tar.gz"
       "http://openssl.linux-mirror.org/source/${name}.tar.gz"
     ];
-    sha256 = "1zqb1rff1wikc62a7vj5qxd1k191m8qif5d05mwdxz2wnzywlg72";
+    sha256 = "932b4ee4def2b434f85435d9e3e19ca8ba99ce9a065a61524b429a9d5e9b2e9c";
   };
 
   patches = optional stdenv.isCygwin ./1.0.1-cygwin64.patch;
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index 1d898df6e02..86d94b58d23 100644
--- a/pkgs/development/libraries/openssl/default.nix
+++ b/pkgs/development/libraries/openssl/default.nix
@@ -8,14 +8,14 @@ let
     stdenv.cross;
 in
 stdenv.mkDerivation rec {
-  name = "openssl-1.0.1q";
+  name = "openssl-1.0.1r";
 
   src = fetchurl {
     urls = [
       "http://www.openssl.org/source/${name}.tar.gz"
       "http://openssl.linux-mirror.org/source/${name}.tar.gz"
     ];
-    sha256 = "1dvz0hx7fjxag06b51pawy154y6d2xajm5rwxmfnlq7ax628nrdk";
+    sha256 = "0iik7a3b0mrfrxzngdf7ywfscg9inbw77y0jp2ccw0gdap9xhjvq";
   };
 
   patches = optional stdenv.isCygwin ./1.0.1-cygwin64.patch
diff --git a/pkgs/development/libraries/protobuf/3.0.nix b/pkgs/development/libraries/protobuf/3.0.nix
index 900c9dc5a51..a06d4cef968 100644
--- a/pkgs/development/libraries/protobuf/3.0.nix
+++ b/pkgs/development/libraries/protobuf/3.0.nix
@@ -1,12 +1,43 @@
-{ callPackage, fetchFromGitHub, ... } @ args:
+{ stdenv, fetchFromGitHub , autoreconfHook, zlib, gmock }:
 
-callPackage ./generic.nix (args // rec {
-  version = "3.0.0-alpha-3.1";
+stdenv.mkDerivation rec {
+  name = "protobuf-${version}";
+
+  version = "3.0.0-beta-2";
   # make sure you test also -A pythonPackages.protobuf
   src = fetchFromGitHub {
     owner = "google";
     repo = "protobuf";
     rev = "v${version}";
-    sha256 = "0vzw20ymjmjrrmg84f822qslclsb2q0wf0qdj2da198gmkkbrw45";
+    sha256 = "0cbr1glgma5vakabsjwcs41pcnn8yphhn037l0zd121zb9gdaqc1";
+  };
+
+  postPatch = ''
+    rm -rf gmock
+    cp -r ${gmock.source} gmock
+    chmod -R a+w gmock
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    substituteInPlace src/google/protobuf/testing/googletest.cc \
+      --replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
+  '';
+
+  buildInputs = [ autoreconfHook zlib ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = {
+    description = "Google's data interchange format";
+    longDescription =
+      ''Protocol Buffers are a way of encoding structured data in an efficient
+        yet extensible format. Google uses Protocol Buffers for almost all of
+        its internal RPC protocols and file formats.
+      '';
+    license = stdenv.lib.licenses.bsd3;
+    platforms = stdenv.lib.platforms.unix;
+    homepage = https://developers.google.com/protocol-buffers/;
   };
-})
+
+  passthru.version = version;
+}
diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix
index fc41187a931..51136c31aa1 100644
--- a/pkgs/development/libraries/protobuf/generic.nix
+++ b/pkgs/development/libraries/protobuf/generic.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
 
     license = "mBSD";
 
-    homepage = http://code.google.com/p/protobuf/;
+    homepage = https://developers.google.com/protocol-buffers/;
   };
 
   passthru.version = version;
diff --git a/pkgs/development/libraries/qpdf/default.nix b/pkgs/development/libraries/qpdf/default.nix
index 340f4558f81..8f886421d55 100644
--- a/pkgs/development/libraries/qpdf/default.nix
+++ b/pkgs/development/libraries/qpdf/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, pcre, zlib, perl }:
 
-let version = "5.1.3";
+let version = "6.0.0";
 in
 stdenv.mkDerivation rec {
   name = "qpdf-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/qpdf/qpdf/${version}/${name}.tar.gz";
-    sha256 = "1lq1v7xghvl6p4hgrwbps3a13ad6lh4ib3myimb83hxgsgd4n5nm";
+    sha256 = "0csj2p2gkxrc0rk8ykymlsdgfas96vzf1dip3y1x7z1q9plwgzd9";
   };
 
   nativeBuildInputs = [ perl ];
@@ -23,6 +23,7 @@ stdenv.mkDerivation rec {
   '';
 
   doCheck = true;
+  enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
     homepage = http://qpdf.sourceforge.net/; 
diff --git a/pkgs/development/libraries/rote/default.nix b/pkgs/development/libraries/rote/default.nix
index b87d4ed4ee4..524afd7cf4d 100644
--- a/pkgs/development/libraries/rote/default.nix
+++ b/pkgs/development/libraries/rote/default.nix
@@ -1,8 +1,8 @@
 { stdenv, fetchurl, ncurses }:
 
-let version = "0.2.8"; in
 stdenv.mkDerivation rec {
   name = "rote-${version}";
+  version = "0.2.8";
 
   src = fetchurl {
     sha256 = "05v1lw99jv4cwxl7spyi7by61j2scpdsvx809x5cga7dm5dhlmky";
@@ -14,7 +14,6 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
-    inherit version;
     description = "Our Own Terminal Emulation Library";
     longDescription = ''
       ROTE is a simple C library for VT102 terminal emulation. It allows the
diff --git a/pkgs/development/libraries/snack/default.nix b/pkgs/development/libraries/snack/default.nix
index ef2db5ae5a6..c2fdc8036c7 100644
--- a/pkgs/development/libraries/snack/default.nix
+++ b/pkgs/development/libraries/snack/default.nix
@@ -1,6 +1,6 @@
-# alsaLib vorbisTools python can be made optional
+# alsaLib vorbis-tools python can be made optional
 
-{ stdenv, fetchurl, python, tcl, tk, vorbisTools, pkgconfig, xlibsWrapper }:
+{ stdenv, fetchurl, python, tcl, tk, vorbis-tools, pkgconfig, xlibsWrapper }:
 
 stdenv.mkDerivation {
   name = "snack-2.2.10";
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   postUnpack = ''sourceRoot="$sourceRoot/unix"'';
 
-  buildInputs = [ python tcl tk vorbisTools pkgconfig xlibsWrapper ];
+  buildInputs = [ python tcl tk vorbis-tools pkgconfig xlibsWrapper ];
 
   postInstall = "aoeu";
 
diff --git a/pkgs/development/libraries/telepathy/qt/default.nix b/pkgs/development/libraries/telepathy/qt/default.nix
index 49745e23fca..441d9385f73 100644
--- a/pkgs/development/libraries/telepathy/qt/default.nix
+++ b/pkgs/development/libraries/telepathy/qt/default.nix
@@ -35,7 +35,8 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = "-DDESIRED_QT_VERSION=${builtins.substring 0 1 qtbase.version}";
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=cpp" ]; # remove after the next update
+  # should be removable after the next update
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=cpp" "-Wno-error=unused-but-set-variable" ];
 
   preBuild = ''
     NIX_CFLAGS_COMPILE+=" `pkg-config --cflags dbus-glib-1`"
diff --git a/pkgs/development/libraries/wcslib/default.nix b/pkgs/development/libraries/wcslib/default.nix
new file mode 100644
index 00000000000..12741379aaa
--- /dev/null
+++ b/pkgs/development/libraries/wcslib/default.nix
@@ -0,0 +1,27 @@
+{ fetchurl,  stdenv, flex }:
+
+stdenv.mkDerivation rec {
+  version = "5.13";
+  name = "wcslib-${version}";
+
+  buildInputs = [ flex ];
+
+  src = fetchurl {
+    url = "ftp://ftp.atnf.csiro.au/pub/software/wcslib/${name}.tar.bz2";
+    sha256 ="1rxlp7p1b84r9fnk7m9p2ivg2cajfj88afyccrg64zlrqn5kx66n";
+  };
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "World Coordinate System Library for Astronomy";
+    homepage = http://www.atnf.csiro.au/people/mcalabre/WCS/;
+
+    longDescription = ''Library for world coordinate systems for
+    spherical geometries and their conversion to image coordinate
+    systems. This is the standard library for this purpose in
+    astronomy.'';
+
+    license = stdenv.lib.licenses.lgpl3Plus;
+  };
+}