From 18125e6f50c77d56ba3f7486590db2bfb55a367b Mon Sep 17 00:00:00 2001 From: David McFarland Date: Tue, 23 May 2017 10:36:12 -0300 Subject: [PATCH] help2man: help wrapper find libintl on cygwin --- .../tools/misc/help2man/1.40.4-cygwin-nls.patch | 10 +++++----- pkgs/development/tools/misc/help2man/default.nix | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch b/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch index 20b99998154d..82f8cf1cb37b 100644 --- a/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch +++ b/pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch @@ -16,8 +16,8 @@ that we're trying to help2man). install_preload: install_dirs preload - $(INSTALL_PROGRAM) $(preload).so $(DESTDIR)$(pkglibdir) -+ $(INSTALL_PROGRAM) lib/cygintl-8.dll $(DESTDIR)$(pkglibdir) -+ ln -sf cygintl-8.dll $(DESTDIR)$(pkglibdir)/$(preload).so ++ $(INSTALL_PROGRAM) lib/cygintl-9.dll $(DESTDIR)$(pkglibdir) ++ ln -sf cygintl-9.dll $(DESTDIR)$(pkglibdir)/$(preload).so install_l10n: install_dirs msg_l10n man_l10n info_l10n set -e; \ @@ -27,8 +27,8 @@ that we're trying to help2man). $(preload).so: $(srcdir)/$(preload).c - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -fPIC -shared $? $(LIBS) + mkdir -p lib -+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o lib/cygintl-8.dll -shared $? $(LIBS) -+ ln -sf lib/cygintl-8.dll $@ ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o lib/cygintl-9.dll -shared $? $(LIBS) ++ ln -sf lib/cygintl-9.dll $@ man: $(target).1 $(target).1: $(srcdir)/$(target).PL $(srcdir)/$(target).h2m.PL @@ -62,7 +62,7 @@ that we're trying to help2man). return; +#ifdef __CYGWIN__ -+ if (!(RTLD_NEXT = dlopen("/usr/bin/cygintl-8.dll", RTLD_LAZY))) ++ if (!(RTLD_NEXT = dlopen("/usr/bin/cygintl-9.dll", RTLD_LAZY))) + die("libintl8 not found"); +#endif + diff --git a/pkgs/development/tools/misc/help2man/default.nix b/pkgs/development/tools/misc/help2man/default.nix index 8bf3db59147b..5e2edce56f0d 100644 --- a/pkgs/development/tools/misc/help2man/default.nix +++ b/pkgs/development/tools/misc/help2man/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, perl, gettext, LocaleGettext, makeWrapper }: +{ stdenv, hostPlatform, fetchurl, perl, gettext, LocaleGettext, makeWrapper }: stdenv.mkDerivation rec { name = "help2man-1.47.4"; @@ -12,11 +12,12 @@ stdenv.mkDerivation rec { doCheck = false; # target `check' is missing - patches = if stdenv.isCygwin then [ ./1.40.4-cygwin-nls.patch ] else null; + patches = if hostPlatform.isCygwin then [ ./1.40.4-cygwin-nls.patch ] else null; postInstall = '' wrapProgram "$out/bin/help2man" \ - --prefix PERL5LIB : "$(echo ${LocaleGettext}/lib/perl*/site_perl)" + --prefix PERL5LIB : "$(echo ${LocaleGettext}/lib/perl*/site_perl)" \ + ${stdenv.lib.optionalString hostPlatform.isCygwin "--prefix PATH : ${gettext}/bin"} '';