3
0
Fork 0
forked from mirrors/nixpkgs

libidn2: fix darwin build

cc 
This commit is contained in:
Franz Pletz 2017-02-12 02:31:21 +01:00
parent 123cbd40c2
commit 5e599035f4
No known key found for this signature in database
GPG key ID: 846FDED7792617B4
2 changed files with 37 additions and 2 deletions
pkgs/development/libraries/libidn2

View file

@ -1,4 +1,6 @@
{ fetchurl, stdenv, libiconv, libunistring }:
{ fetchurl, stdenv, libiconv, libunistring, help2man }:
with stdenv.lib;
stdenv.mkDerivation rec {
name = "libidn2-0.16";
@ -10,8 +12,10 @@ stdenv.mkDerivation rec {
outputs = [ "bin" "dev" "out" "info" "devdoc" ];
patches = optional stdenv.isDarwin ./fix-error-darwin.patch;
buildInputs = [ libunistring ]
++ stdenv.lib.optional stdenv.isDarwin libiconv;
++ optionals stdenv.isDarwin [ libiconv help2man ];
meta = {
homepage = "https://www.gnu.org/software/libidn/#libidn2";

View file

@ -0,0 +1,31 @@
diff --git a/src/idn2.c b/src/idn2.c
index 6abbc72..804f0f2 100644
--- a/src/idn2.c
+++ b/src/idn2.c
@@ -31,7 +31,6 @@
#include <unistr.h>
/* Gnulib headers. */
-#include "error.h"
#include "gettext.h"
#define _(String) dgettext (PACKAGE, String)
#include "progname.h"
@@ -161,9 +160,7 @@ process_input (char *readbuf, int flags)
free (output);
}
else
- error (EXIT_FAILURE, 0, "%s: %s",
- args_info.register_given ? "register" : "lookup",
- idn2_strerror (rc));
+ perror (idn2_strerror (rc));
}
int
@@ -222,7 +219,7 @@ main (int argc, char *argv[])
}
if (ferror (stdin))
- error (EXIT_FAILURE, errno, "%s", _("input error"));
+ perror (_("input error"));
cmdline_parser_free (&args_info);