Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "localizations" sane again #37012

Merged
merged 15 commits into from
Mar 23, 2018
Merged
2 changes: 0 additions & 2 deletions pkgs/applications/audio/ncmpc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ stdenv.mkDerivation rec {
buildInputs = [ glib ncurses mpd_clientlib ];
nativeBuildInputs = [ meson ninja pkgconfig gettext ];

NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";

meta = with stdenv.lib; {
description = "Curses-based interface for MPD (music player daemon)";
homepage = https://www.musicpd.org/clients/ncmpc/;
Expand Down
6 changes: 2 additions & 4 deletions pkgs/applications/editors/geany/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, gtk2, which, pkgconfig, intltool, file }:
{ stdenv, fetchurl, gtk2, which, pkgconfig, intltool, file, libintl }:

with stdenv.lib;

Expand All @@ -14,9 +14,7 @@ stdenv.mkDerivation rec {
sha256 = "66baaff43f12caebcf0efec9a5533044dc52837f799c73a1fd7312caa86099c2";
};

NIX_LDFLAGS = if stdenv.isDarwin then "-lintl" else null;

nativeBuildInputs = [ pkgconfig intltool ];
nativeBuildInputs = [ pkgconfig intltool libintl ];
buildInputs = [ gtk2 which file ];

doCheck = true;
Expand Down
3 changes: 1 addition & 2 deletions pkgs/applications/graphics/gimp/2.8.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ in stdenv.mkDerivation rec {
enableParallelBuilding = true;

# "screenshot" needs this.
NIX_LDFLAGS = "-rpath ${xorg.libX11.out}/lib"
+ stdenv.lib.optionalString stdenv.isDarwin " -lintl";
NIX_LDFLAGS = "-rpath ${xorg.libX11.out}/lib";

meta = {
description = "The GNU Image Manipulation Program";
Expand Down
6 changes: 2 additions & 4 deletions pkgs/applications/misc/djvulibre/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, libjpeg, libtiff, librsvg, libintlOrEmpty }:
{ stdenv, fetchurl, libjpeg, libtiff, librsvg, libiconv }:

stdenv.mkDerivation rec {
name = "djvulibre-3.5.27";
Expand All @@ -10,9 +10,7 @@ stdenv.mkDerivation rec {

outputs = [ "bin" "dev" "out" ];

buildInputs = [ libjpeg libtiff librsvg ] ++ libintlOrEmpty;

NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
buildInputs = [ libjpeg libtiff librsvg libiconv ];

meta = with stdenv.lib; {
description = "A library and viewer for the DJVU file format for scanned images";
Expand Down
7 changes: 2 additions & 5 deletions pkgs/applications/misc/girara/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, gtk, gettext, ncurses, libiconv, libintlOrEmpty
{ stdenv, fetchurl, pkgconfig, gtk, gettext, ncurses, libiconv, libintl
, withBuildColors ? true
}:

Expand All @@ -19,10 +19,7 @@ stdenv.mkDerivation rec {
'';

nativeBuildInputs = [ pkgconfig ];
buildInputs = [ gtk gettext libintlOrEmpty ]
++ stdenv.lib.optional stdenv.isDarwin libiconv;

NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
buildInputs = [ gtk gettext libintl libiconv ];

makeFlags = [
"PREFIX=$(out)"
Expand Down
3 changes: 1 addition & 2 deletions pkgs/applications/misc/sdcv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ stdenv.mkDerivation rec {
mkdir locale
'';

NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__"
+ stdenv.lib.optionalString stdenv.isDarwin " -lintl";
NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__";

meta = with stdenv.lib; {
homepage = https://dushistov.github.io/sdcv/;
Expand Down
7 changes: 3 additions & 4 deletions pkgs/applications/misc/zathura/core/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv, fetchurl, makeWrapper, pkgconfig
, gtk, girara, ncurses, gettext, docutils
, file, sqlite, glib, texlive, libintlOrEmpty
, file, sqlite, glib, texlive, libintl
, gtk-mac-integration, synctexSupport ? true
}:

Expand All @@ -20,16 +20,15 @@ stdenv.mkDerivation rec {
icon = ./icon.xpm;

nativeBuildInputs = [
pkgconfig
] ++ optional stdenv.isDarwin [ libintlOrEmpty ];
pkgconfig libintl
];

buildInputs = [
file gtk girara
gettext makeWrapper sqlite glib
] ++ optional synctexSupport texlive.bin.core
++ optional stdenv.isDarwin [ gtk-mac-integration ];

NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";

makeFlags = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/irc/irssi/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, ncurses, glib, openssl, perl, libintlOrEmpty }:
{ stdenv, fetchurl, pkgconfig, ncurses, glib, openssl, perl, libintl }:

stdenv.mkDerivation rec {
version = "1.1.1";
Expand All @@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
};

nativeBuildInputs = [ pkgconfig ];
buildInputs = [ ncurses glib openssl perl libintlOrEmpty ];
buildInputs = [ ncurses glib openssl perl libintl ];

configureFlags = [
"--with-proxy"
Expand Down
6 changes: 3 additions & 3 deletions pkgs/desktops/gnome-2/platform/ORBit2/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, glib, libIDL, libintlOrEmpty }:
{ stdenv, fetchurl, pkgconfig, glib, libIDL, libintl }:

stdenv.mkDerivation rec {
name = "ORBit2-${minVer}.19";
Expand All @@ -9,8 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "0l3mhpyym9m5iz09fz0rgiqxl2ym6kpkwpsp1xrr4aa80nlh1jam";
};

nativeBuildInputs = [ pkgconfig ];
propagatedBuildInputs = [ glib libIDL ] ++ libintlOrEmpty;
nativeBuildInputs = [ pkgconfig libintl ];
propagatedBuildInputs = [ glib libIDL ];

outputs = [ "out" "dev" ];

Expand Down
2 changes: 0 additions & 2 deletions pkgs/desktops/gnome-2/platform/libglade/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ stdenv.mkDerivation {
buildInputs = [ gtk python gettext ];

propagatedBuildInputs = [ libxml2 ];

NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
}
4 changes: 2 additions & 2 deletions pkgs/development/compilers/vala/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, flex, bison, libxslt, autoconf, graphviz
, glib, libiconv, libintlOrEmpty, libtool, expat
, glib, libiconv, libintl, libtool, expat
}:

let
Expand All @@ -16,7 +16,7 @@ let

nativeBuildInputs = [ pkgconfig flex bison libxslt ] ++ extraNativeBuildInputs;

buildInputs = [ glib libiconv ] ++ libintlOrEmpty ++ extraBuildInputs;
buildInputs = [ glib libiconv libintl ] ++ extraBuildInputs;

meta = with stdenv.lib; {
description = "Compiler for GObject type system";
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/libraries/at-spi2-core/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ stdenv.mkDerivation rec {
# ToDo: on non-NixOS we create a symlink from there?
configureFlags = "--with-dbus-daemondir=/run/current-system/sw/bin/";

NIX_LDFLAGS = with stdenv; lib.optionalString isDarwin "-lintl";

meta = with stdenv.lib; {
platforms = platforms.unix;
};
}

4 changes: 1 addition & 3 deletions pkgs/development/libraries/atk/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, meson, ninja, gettext, pkgconfig, glib, libintlOrEmpty, gobjectIntrospection, gnome3 }:
{ stdenv, fetchurl, meson, ninja, gettext, pkgconfig, glib, gobjectIntrospection, gnome3 }:

let
pname = "atk";
Expand All @@ -22,8 +22,6 @@ stdenv.mkDerivation rec {

outputs = [ "out" "dev" ];

buildInputs = libintlOrEmpty;

nativeBuildInputs = [ meson ninja pkgconfig gettext gobjectIntrospection ];

propagatedBuildInputs = [
Expand Down
5 changes: 3 additions & 2 deletions pkgs/development/libraries/cairo/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, fetchurl, fetchFromGitHub, fetchpatch, pkgconfig, libiconv
, libintlOrEmpty, expat, zlib, libpng, pixman, fontconfig, freetype, xorg
, libintl, expat, zlib, libpng, pixman, fontconfig, freetype, xorg
, gobjectSupport ? true, glib
, xcbSupport ? true # no longer experimental since 1.12
, glSupport ? true, libGL ? null # libGLU_combined is no longer a big dependency
Expand Down Expand Up @@ -34,7 +34,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
pkgconfig
libiconv
] ++ libintlOrEmpty ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
libintl
] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
CoreGraphics
CoreText
ApplicationServices
Expand Down
7 changes: 2 additions & 5 deletions pkgs/development/libraries/cogl/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, libGL, glib, gdk_pixbuf, xorg, libintlOrEmpty
{ stdenv, fetchurl, pkgconfig, libGL, glib, gdk_pixbuf, xorg, libintl
, pangoSupport ? true, pango, cairo, gobjectIntrospection, wayland, gnome3
, gstreamerSupport ? true, gst_all_1 }:

Expand All @@ -13,7 +13,7 @@ in stdenv.mkDerivation rec {
sha256 = "03f0ha3qk7ca0nnkkcr1garrm1n1vvfqhkz9lwjm592fnv6ii9rr";
};

nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [ pkgconfig libintl ];

configureFlags = [
"--enable-introspection"
Expand All @@ -27,7 +27,6 @@ in stdenv.mkDerivation rec {
glib gdk_pixbuf gobjectIntrospection wayland
libGL libXrandr libXfixes libXcomposite libXdamage
]
++ libintlOrEmpty
++ stdenv.lib.optionals gstreamerSupport [ gst_all_1.gstreamer
gst_all_1.gst-plugins-base ];

Expand All @@ -37,8 +36,6 @@ in stdenv.mkDerivation rec {
= stdenv.lib.optionalString (stdenv.isDarwin && pangoSupport)
"-I${pango.dev}/include/pango-1.0 -I${cairo.dev}/include/cairo";

NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";

#doCheck = true; # all tests fail (no idea why)

passthru = {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/cracklib/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, libintlOrEmpty, zlib, gettext }:
{ stdenv, fetchurl, zlib, gettext }:

stdenv.mkDerivation rec {
name = "cracklib-2.9.6";
Expand All @@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
sha256 = "0hrkb0prf7n92w6rxgq0ilzkk6rkhpys2cfqkrbzswp27na7dkqp";
};

buildInputs = [ libintlOrEmpty zlib gettext ];
buildInputs = [ zlib gettext ];

meta = with stdenv.lib; {
homepage = https://github.com/cracklib/cracklib;
Expand Down
5 changes: 2 additions & 3 deletions pkgs/development/libraries/gdk-pixbuf/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv, fetchurl, meson, ninja, pkgconfig, gettext, python3, libxml2, libxslt, docbook_xsl
, docbook_xml_dtd_43, gtk-doc, glib, libtiff, libjpeg, libpng, libX11, gnome3
, jasper, shared-mime-info, libintlOrEmpty, gobjectIntrospection, doCheck ? false, makeWrapper }:
, jasper, shared-mime-info, libintl, gobjectIntrospection, doCheck ? false, makeWrapper }:

let
pname = "gdk-pixbuf";
Expand All @@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;

# !!! We might want to factor out the gdk-pixbuf-xlib subpackage.
buildInputs = [ libX11 ] ++ stdenv.lib.optional (!stdenv.isDarwin) shared-mime-info ++ libintlOrEmpty;
buildInputs = [ libX11 libintl ] ++ stdenv.lib.optional (!stdenv.isDarwin) shared-mime-info;

nativeBuildInputs = [
meson ninja pkgconfig gettext python3 libxml2 libxslt docbook_xsl docbook_xml_dtd_43
Expand Down Expand Up @@ -78,4 +78,3 @@ stdenv.mkDerivation rec {
platforms = platforms.unix;
};
}

6 changes: 2 additions & 4 deletions pkgs/development/libraries/gegl/3.0.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv, fetchurl, pkgconfig, glib, babl, libpng, cairo, libjpeg, which
, librsvg, pango, gtk, bzip2, json-glib, intltool, autoreconfHook, libraw
, libwebp, gnome3 }:
, libwebp, gnome3, libintl }:

stdenv.mkDerivation rec {
name = "gegl-0.3.28";
Expand All @@ -10,8 +10,6 @@ stdenv.mkDerivation rec {
sha256 = "1zr3gmmzjhp2d3d3h51x80r5q7gs9rv67ywx69sif6as99h8fbqm";
};

NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";

hardeningDisable = [ "format" ];

# needs fonts otherwise don't know how to pass them
Expand All @@ -28,7 +26,7 @@ stdenv.mkDerivation rec {

propagatedBuildInputs = [ glib json-glib babl ]; # for gegl-3.0.pc

nativeBuildInputs = [ pkgconfig intltool which autoreconfHook ];
nativeBuildInputs = [ pkgconfig intltool which autoreconfHook libintl ];

meta = with stdenv.lib; {
description = "Graph-based image processing framework";
Expand Down
8 changes: 3 additions & 5 deletions pkgs/development/libraries/gegl/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, glib, babl, libpng, cairo, libjpeg
, librsvg, pango, gtk2, bzip2, intltool
, librsvg, pango, gtk2, bzip2, intltool, libintl
, OpenGL ? null }:

stdenv.mkDerivation rec {
Expand All @@ -20,14 +20,12 @@ stdenv.mkDerivation rec {
# needs fonts otherwise don't know how to pass them
configureFlags = "--disable-docs";

NIX_LDFLAGS = if stdenv.isDarwin then "-lintl" else null;

buildInputs = [ babl libpng cairo libjpeg librsvg pango gtk2 bzip2 intltool ]
buildInputs = [ babl libpng cairo libjpeg librsvg pango gtk2 bzip2 intltool libintl ]
++ stdenv.lib.optional stdenv.isDarwin OpenGL;

nativeBuildInputs = [ pkgconfig ];

meta = {
meta = {
description = "Graph-based image processing framework";
homepage = http://www.gegl.org;
license = stdenv.lib.licenses.gpl3;
Expand Down
7 changes: 2 additions & 5 deletions pkgs/development/libraries/geoclue/2.0.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ fetchurl, stdenv, intltool, libintlOrEmpty, pkgconfig, glib, json-glib, libsoup, geoip
{ fetchurl, stdenv, intltool, pkgconfig, glib, json-glib, libsoup, geoip
, dbus, dbus-glib, modemmanager, avahi, glib-networking, wrapGAppsHook, gobjectIntrospection
}:

Expand All @@ -18,8 +18,7 @@ stdenv.mkDerivation rec {
pkgconfig intltool wrapGAppsHook gobjectIntrospection
];

buildInputs = libintlOrEmpty ++
[ glib json-glib libsoup geoip
buildInputs = [ glib json-glib libsoup geoip
dbus dbus-glib avahi
] ++ optionals (!stdenv.isDarwin) [ modemmanager ];

Expand All @@ -37,8 +36,6 @@ stdenv.mkDerivation rec {
"--disable-modem-gps-source"
"--disable-nmea-source" ];

NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin " -lintl";

postInstall = ''
sed -i $dev/lib/pkgconfig/libgeoclue-2.0.pc -e "s|includedir=.*|includedir=$dev/include|"
'';
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/libraries/gettext/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ stdenv.mkDerivation rec {
buildInputs = stdenv.lib.optional (!stdenv.isLinux && !hostPlatform.isCygwin) libiconv;

setupHook = ./gettext-setup-hook.sh;
gettextNeedsLdflags = hostPlatform.libc != "glibc";

enableParallelBuilding = true;

Expand Down
10 changes: 10 additions & 0 deletions pkgs/development/libraries/gettext/gettext-setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,13 @@ gettextDataDirsHook() {
}

addEnvHooks "$hostOffset" gettextDataDirsHook

# libintl must be listed in load flags on non-Glibc
# it doesn't hurt to have it in Glibc either though
gettextLdflags() {
export NIX_LDFLAGS="$NIX_LDFLAGS -lintl"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to case on $hostOffset to use the correct one of NIX_{BUILD_,_,TARGET_}LDFLAGS. See cc-wrapper for details.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would that be something like "NIX_@infixSalt@_LDFLAGS"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still need to be changed? @Ericson2314

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or at least does merging as is break anything?

Copy link
Member

@Ericson2314 Ericson2314 Mar 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh bummer I totally forgot about this. Yes this should be fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll go do this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

if [ ! -z "@gettextNeedsLdflags@" ]; then
addEnvHooks "$hostOffset" gettextLdflags
fi
1 change: 0 additions & 1 deletion pkgs/development/libraries/glib-networking/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@ stdenv.mkDerivation rec {
platforms = platforms.unix;
};
}

Loading