at 24.05-pre 111 lines 4.3 kB view raw
1{ stdenv, lib, fetchurl, fetchpatch, libiconv, xz, bash 2, gnulib 3}: 4 5# Note: this package is used for bootstrapping fetchurl, and thus 6# cannot use fetchpatch! All mutable patches (generated by GitHub or 7# cgit) that are needed here should be included directly in Nixpkgs as 8# files. 9 10stdenv.mkDerivation rec { 11 pname = "gettext"; 12 version = "0.21.1"; 13 14 src = fetchurl { 15 url = "mirror://gnu/gettext/${pname}-${version}.tar.gz"; 16 sha256 = "sha256-6MNlDh2M7odcTzVWQjgsHfgwWL1aEe6FVcDPJ21kbUU="; 17 }; 18 patches = [ 19 ./absolute-paths.diff 20 # fix reproducibile output, in particular in the grub2 build 21 # https://savannah.gnu.org/bugs/index.php?59658 22 ./0001-msginit-Do-not-use-POT-Creation-Date.patch 23 ] ++ lib.optional stdenv.hostPlatform.isWindows (fetchpatch { 24 url = "https://aur.archlinux.org/cgit/aur.git/plain/gettext_formatstring-ruby.patch?h=mingw-w64-gettext&id=e8b577ee3d399518d005e33613f23363a7df07ee"; 25 name = "gettext_formatstring-ruby.patch"; 26 sha256 = "sha256-6SxZObOMkQDxuKJuJY+mQ/VuJJxSeGbf97J8ZZddCV0="; 27 }); 28 29 outputs = [ "out" "man" "doc" "info" ]; 30 31 hardeningDisable = [ "format" ]; 32 33 LDFLAGS = lib.optionalString stdenv.isSunOS "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec"; 34 35 configureFlags = [ 36 "--disable-csharp" "--with-xz" 37 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 38 # On cross building, gettext supposes that the wchar.h from libc 39 # does not fulfill gettext needs, so it tries to work with its 40 # own wchar.h file, which does not cope well with the system's 41 # wchar.h and stddef.h (gcc-4.3 - glibc-2.9) 42 "gl_cv_func_wcwidth_works=yes" 43 ]; 44 45 postPatch = '' 46 substituteAllInPlace gettext-runtime/src/gettext.sh.in 47 substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd 48 substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd 49 substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd 50 '' + lib.optionalString stdenv.hostPlatform.isCygwin '' 51 sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in 52 sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in 53 ''; 54 55 strictDeps = true; 56 nativeBuildInputs = [ 57 xz 58 xz.bin 59 ]; 60 buildInputs = lib.optionals (!stdenv.hostPlatform.isMinGW) [ 61 bash 62 ] 63 ++ lib.optionals (!stdenv.isLinux && !stdenv.hostPlatform.isCygwin) [ 64 # HACK, see #10874 (and 14664) 65 libiconv 66 ]; 67 68 setupHooks = [ 69 ../../../build-support/setup-hooks/role.bash 70 ./gettext-setup-hook.sh 71 ]; 72 env = { 73 gettextNeedsLdflags = stdenv.hostPlatform.libc != "glibc" && !stdenv.hostPlatform.isMusl; 74 }; 75 76 enableParallelBuilding = true; 77 enableParallelChecking = false; # fails sometimes 78 79 meta = with lib; { 80 description = "Well integrated set of translation tools and documentation"; 81 82 longDescription = '' 83 Usually, programs are written and documented in English, and use 84 English at execution time for interacting with users. Using a common 85 language is quite handy for communication between developers, 86 maintainers and users from all countries. On the other hand, most 87 people are less comfortable with English than with their own native 88 language, and would rather be using their mother tongue for day to 89 day's work, as far as possible. Many would simply love seeing their 90 computer screen showing a lot less of English, and far more of their 91 own language. 92 93 GNU `gettext' is an important step for the GNU Translation Project, as 94 it is an asset on which we may build many other steps. This package 95 offers to programmers, translators, and even users, a well integrated 96 set of tools and documentation. Specifically, the GNU `gettext' 97 utilities are a set of tools that provides a framework to help other 98 GNU packages produce multi-lingual messages. 99 ''; 100 101 homepage = "https://www.gnu.org/software/gettext/"; 102 103 maintainers = with maintainers; [ zimbatm vrthra ]; 104 license = licenses.gpl2Plus; 105 platforms = platforms.all; 106 }; 107} 108 109// lib.optionalAttrs stdenv.isDarwin { 110 makeFlags = [ "CFLAGS=-D_FORTIFY_SOURCE=0" ]; 111}