diff --git a/nixos/modules/config/fonts/fontconfig.nix b/nixos/modules/config/fonts/fontconfig.nix index 3bfa1893a8ba..6ac64b0ec9c6 100644 --- a/nixos/modules/config/fonts/fontconfig.nix +++ b/nixos/modules/config/fonts/fontconfig.nix @@ -45,6 +45,9 @@ let # generate the font cache setting file for a fontconfig version # use latest when no version is passed + # When cross-compiling, we can’t generate the cache, so we skip the + # part. fontconfig still works but is a little slower in + # looking things up. makeCacheConf = { version ? null }: let fcPackage = if version == null @@ -60,11 +63,13 @@ let ${concatStringsSep "\n" (map (font: "${font}") config.fonts.fonts)} + ${optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) '' ${cache} ${optionalString (pkgs.stdenv.isx86_64 && cfg.cache32Bit) '' ${cache32} ''} + ''} ''; diff --git a/nixos/modules/config/networking.nix b/nixos/modules/config/networking.nix index dd36696b94d2..03944de82497 100644 --- a/nixos/modules/config/networking.nix +++ b/nixos/modules/config/networking.nix @@ -197,7 +197,7 @@ in } // optionalAttrs (pkgs.stdenv.hostPlatform.libc == "glibc") { # /etc/rpc: RPC program numbers. - rpc.source = pkgs.glibc.out + "/etc/rpc"; + rpc.source = pkgs.stdenv.cc.libc.out + "/etc/rpc"; }; networking.proxy.envVars = diff --git a/nixos/modules/services/system/nscd.nix b/nixos/modules/services/system/nscd.nix index e11f7e049d8f..af26dd847073 100644 --- a/nixos/modules/services/system/nscd.nix +++ b/nixos/modules/services/system/nscd.nix @@ -7,6 +7,10 @@ let nssModulesPath = config.system.nssModules.path; cfg = config.services.nscd; + nscd = if pkgs.stdenv.hostPlatform.libc == "glibc" + then pkgs.stdenv.cc.libc.bin + else pkgs.glibc.bin; + in { @@ -59,16 +63,16 @@ in # files. So prefix the ExecStart command with "!" to prevent systemd # from dropping privileges early. See ExecStart in systemd.service(5). serviceConfig = - { ExecStart = "!@${pkgs.glibc.bin}/sbin/nscd nscd"; + { ExecStart = "!@${nscd}/sbin/nscd nscd"; Type = "forking"; DynamicUser = true; RuntimeDirectory = "nscd"; PIDFile = "/run/nscd/nscd.pid"; Restart = "always"; ExecReload = - [ "${pkgs.glibc.bin}/sbin/nscd --invalidate passwd" - "${pkgs.glibc.bin}/sbin/nscd --invalidate group" - "${pkgs.glibc.bin}/sbin/nscd --invalidate hosts" + [ "${nscd}/sbin/nscd --invalidate passwd" + "${nscd}/sbin/nscd --invalidate group" + "${nscd}/sbin/nscd --invalidate hosts" ]; }; }; diff --git a/nixos/modules/services/x11/gdk-pixbuf.nix b/nixos/modules/services/x11/gdk-pixbuf.nix index 9ad926369ec7..e6a24a2f1a30 100644 --- a/nixos/modules/services/x11/gdk-pixbuf.nix +++ b/nixos/modules/services/x11/gdk-pixbuf.nix @@ -19,7 +19,7 @@ let continue fi GDK_PIXBUF_MODULEDIR="$module_dir" \ - ${pkgs.gdk-pixbuf.dev}/bin/gdk-pixbuf-query-loaders + ${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} ${pkgs.gdk-pixbuf.dev}/bin/gdk-pixbuf-query-loaders done ) > "$out" ''; @@ -37,7 +37,7 @@ in # If there is any package configured in modulePackages, we generate the # loaders.cache based on that and set the environment variable # GDK_PIXBUF_MODULE_FILE to point to it. - config = mkIf (cfg.modulePackages != []) { + config = mkIf (cfg.modulePackages != [] || pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform) { environment.variables = { GDK_PIXBUF_MODULE_FILE = "${loadersCache}"; }; diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix index 6169c2d0296b..ca3bf667b4a1 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -80,6 +80,8 @@ stdenv.mkDerivation { configureFlags = stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "ac_cv_fread_reads_directories=yes" "ac_cv_snprintf_returns_bogus=no" + "ac_cv_iconv_omits_bom=no" + "ac_cv_prog_CURL_CONFIG=${curl.dev}/bin/curl-config" ]; preBuild = '' diff --git a/pkgs/applications/video/kodi/default.nix b/pkgs/applications/video/kodi/default.nix index d13dd3201a32..6d02bcefb084 100644 --- a/pkgs/applications/video/kodi/default.nix +++ b/pkgs/applications/video/kodi/default.nix @@ -4,22 +4,20 @@ , boost, avahi, lame, autoreconfHook , gettext, pcre-cpp, yajl, fribidi, which , openssl, gperf, tinyxml2, taglib, libssh, swig, jre -, libX11, xorgproto, libxml2 -, libXt, libXmu, libXext -, libXinerama, libXrandr -, libXtst, libXfixes, systemd +, libxml2, systemd , alsaLib, libGLU, libGL, glew, fontconfig, freetype, ftgl , libjpeg, libpng, libtiff , libmpeg2, libsamplerate, libmad , libogg, libvorbis, flac, libxslt , lzo, libcdio, libmodplug, libass, libbluray , sqlite, libmysqlclient, nasm, gnutls, libva, libdrm -, curl, bzip2, zip, unzip, glxinfo, xdpyinfo +, curl, bzip2, zip, unzip, glxinfo , libcec, libcec_platform, dcadec, libuuid , libcrossguid, libmicrohttpd -, bluez, doxygen, giflib, glib, harfbuzz, lcms2, libidn, libpthreadstubs, libtasn1, libXdmcp +, bluez, doxygen, giflib, glib, harfbuzz, lcms2, libidn, libpthreadstubs, libtasn1 , libplist, p11-kit, zlib, flatbuffers, fmt, fstrcmp, rapidjson , lirc +, x11Support ? true, libX11, xorgproto, libXt, libXmu, libXext, libXinerama, libXrandr, libXtst, libXfixes, xdpyinfo, libXdmcp , dbusSupport ? true, dbus ? null , joystickSupport ? true, cwiid ? null , nfsSupport ? true, libnfs ? null @@ -32,6 +30,7 @@ , useWayland ? false, wayland ? null, wayland-protocols ? null , waylandpp ? null, libxkbcommon ? null , useGbm ? false, mesa ? null, libinput ? null +, buildPackages }: assert dbusSupport -> dbus != null; @@ -94,10 +93,18 @@ let sha256 = "1krsjlr949iy5l6ljxancza1yi6w1annxc5s6k283i9mb15qy8cy"; preConfigure = '' cp ${kodi_src}/tools/depends/target/ffmpeg/{CMakeLists.txt,*.cmake} . + sed -i 's/ --cpu=''${CPU}//' CMakeLists.txt + sed -i 's/--strip=''${CMAKE_STRIP}/--strip=''${CMAKE_STRIP} --ranlib=''${CMAKE_RANLIB}/' CMakeLists.txt ''; - buildInputs = [ gnutls libidn libtasn1 p11-kit zlib libva ] + cmakeFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DCROSSCOMPILING=ON" + "-DCPU=${stdenv.hostPlatform.parsed.cpu.name}" + "-DOS=${stdenv.hostPlatform.parsed.kernel.name}" + "-DPKG_CONFIG_EXECUTABLE=pkgconfig" + ]; + buildInputs = [ libidn libtasn1 p11-kit zlib libva ] ++ lib.optional vdpauSupport libvdpau; - nativeBuildInputs = [ cmake nasm pkgconfig ]; + nativeBuildInputs = [ cmake nasm pkgconfig gnutls ]; }; # We can build these externally but FindLibDvd.cmake forces us to build it @@ -152,29 +159,31 @@ in stdenv.mkDerivation { buildInputs = [ gnutls libidn libtasn1 nasm p11-kit - libxml2 yasm python2Packages.python + libxml2 python2Packages.python boost libmicrohttpd gettext pcre-cpp yajl fribidi libva libdrm - openssl gperf tinyxml2 taglib libssh swig jre - libX11 xorgproto libXt libXmu libXext - libXinerama libXrandr libXtst libXfixes - alsaLib libGL libGLU glew fontconfig freetype ftgl + openssl gperf tinyxml2 taglib libssh + alsaLib libGL libGLU fontconfig freetype ftgl libjpeg libpng libtiff libmpeg2 libsamplerate libmad libogg libvorbis flac libxslt systemd lzo libcdio libmodplug libass libbluray sqlite libmysqlclient avahi lame - curl bzip2 zip unzip glxinfo xdpyinfo + curl bzip2 zip unzip glxinfo libcec libcec_platform dcadec libuuid libgcrypt libgpgerror libunistring - libcrossguid cwiid libplist - bluez giflib glib harfbuzz lcms2 libpthreadstubs libXdmcp + libcrossguid libplist + bluez giflib glib harfbuzz lcms2 libpthreadstubs ffmpeg flatbuffers fmt fstrcmp rapidjson lirc # libdvdcss libdvdnav libdvdread ] + ++ lib.optional x11Support [ + libX11 xorgproto libXt libXmu libXext libXdmcp + libXinerama libXrandr libXtst libXfixes + ] ++ lib.optional dbusSupport dbus - ++ lib.optionals joystickSupport [ cwiid ] + ++ lib.optional joystickSupport cwiid ++ lib.optional nfsSupport libnfs ++ lib.optional pulseSupport libpulseaudio ++ lib.optional rtmpSupport rtmpdump @@ -183,7 +192,7 @@ in stdenv.mkDerivation { ++ lib.optional usbSupport libusb ++ lib.optional vdpauSupport libvdpau ++ lib.optionals useWayland [ - wayland waylandpp + wayland waylandpp wayland-protocols # Not sure why ".dev" is needed here, but CMake doesn't find libxkbcommon otherwise libxkbcommon.dev ] @@ -200,8 +209,16 @@ in stdenv.mkDerivation { which pkgconfig gnumake autoconf automake libtool # still needed for some components. Check if that is the case with 19.0 + jre yasm gettext python2Packages.python flatbuffers + + # for TexturePacker + giflib zlib libpng libjpeg lzo ] ++ lib.optionals useWayland [ wayland-protocols ]; + depsBuildBuild = [ + buildPackages.stdenv.cc + ]; + cmakeFlags = [ "-Dlibdvdcss_URL=${libdvdcss.src}" "-Dlibdvdnav_URL=${libdvdnav.src}" @@ -210,9 +227,14 @@ in stdenv.mkDerivation { "-DENABLE_EVENTCLIENTS=ON" "-DENABLE_INTERNAL_CROSSGUID=OFF" "-DENABLE_OPTICAL=ON" + "-DLIRC_DEVICE=/run/lirc/lircd" + "-DSWIG_EXECUTABLE=${buildPackages.swig}/bin/swig" + "-DFLATBUFFERS_FLATC_EXECUTABLE=${buildPackages.flatbuffers}/bin/flatc" + "-DPYTHON_EXECUTABLE=${buildPackages.python2Packages.python}/bin/python" ] ++ lib.optional useWayland [ "-DCORE_PLATFORM_NAME=wayland" "-DWAYLAND_RENDER_SYSTEM=gl" + "-DWAYLANDPP_SCANNER=${buildPackages.waylandpp}/bin/wayland-scanner++" ] ++ lib.optional useGbm [ "-DCORE_PLATFORM_NAME=gbm" "-DGBM_RENDER_SYSTEM=gles" @@ -224,6 +246,16 @@ in stdenv.mkDerivation { # I'm guessing there is a thing waiting to time out doCheck = false; + # Need these tools on the build system when cross compiling, + # hacky, but have found no other way. + preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + CXX=c++ LD=ld make -C tools/depends/native/JsonSchemaBuilder + cmakeFlags+=" -DWITH_JSONSCHEMABUILDER=$PWD/tools/depends/native/JsonSchemaBuilder/bin" + + CXX=c++ LD=ld make EXTRA_CONFIGURE= -C tools/depends/native/TexturePacker + cmakeFlags+=" -DWITH_TEXTUREPACKER=$PWD/tools/depends/native/TexturePacker/bin" + ''; + postPatch = '' substituteInPlace xbmc/platform/linux/LinuxTimezone.cpp \ --replace 'usr/share/zoneinfo' 'etc/zoneinfo' @@ -232,9 +264,11 @@ in stdenv.mkDerivation { postInstall = '' for p in $(ls $out/bin/) ; do wrapProgram $out/bin/$p \ - --prefix PATH ":" "${lib.makeBinPath [ python2Packages.python glxinfo xdpyinfo ]}" \ + --prefix PATH ":" "${lib.makeBinPath ([ python2Packages.python glxinfo ] ++ lib.optional x11Support xdpyinfo)}" \ --prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath - ([ curl systemd libmad libvdpau libcec libcec_platform rtmpdump libass ] ++ lib.optional nfsSupport libnfs)}" + ([ curl systemd libmad libvdpau libcec libcec_platform libass ] + ++ lib.optional nfsSupport libnfs + ++ lib.optional rtmpSupport rtmpdump)}" done substituteInPlace $out/share/xsessions/kodi.desktop \ diff --git a/pkgs/build-support/setup-hooks/auto-patchelf.sh b/pkgs/build-support/setup-hooks/auto-patchelf.sh index 52c50091d08c..72970623ed79 100644 --- a/pkgs/build-support/setup-hooks/auto-patchelf.sh +++ b/pkgs/build-support/setup-hooks/auto-patchelf.sh @@ -15,7 +15,7 @@ isExecutable() { # *or* there is an INTERP section. This also catches position-independent # executables, as they typically have an INTERP section but their ELF type # is DYN. - isExeResult="$(LANG=C readelf -h -l "$1" 2> /dev/null \ + isExeResult="$(LANG=C $READELF -h -l "$1" 2> /dev/null \ | grep '^ *Type: *EXEC\>\|^ *INTERP\>')" # not using grep -q, because it can cause Broken pipe [ -n "$isExeResult" ] @@ -207,7 +207,7 @@ autoPatchelf() { # outside of this function. while IFS= read -r -d $'\0' file; do isELF "$file" || continue - segmentHeaders="$(LANG=C readelf -l "$file")" + segmentHeaders="$(LANG=C $READELF -l "$file")" # Skip if the ELF file doesn't have segment headers (eg. object files). # not using grep -q, because it can cause Broken pipe [ -n "$(echo "$segmentHeaders" | grep '^Program Headers:')" ] || continue diff --git a/pkgs/data/icons/hicolor-icon-theme/setup-hook.sh b/pkgs/data/icons/hicolor-icon-theme/setup-hook.sh index f07bab4b269f..f7c99418144b 100644 --- a/pkgs/data/icons/hicolor-icon-theme/setup-hook.sh +++ b/pkgs/data/icons/hicolor-icon-theme/setup-hook.sh @@ -10,4 +10,4 @@ hicolorIconThemeHook() { } # I think this is meant to be a runtime dep -addEnvHooks "${hostOffset:?}" hicolorIconThemeHook +addEnvHooks "${targetOffset:?}" hicolorIconThemeHook diff --git a/pkgs/desktops/gnome-3/core/epiphany/default.nix b/pkgs/desktops/gnome-3/core/epiphany/default.nix index 5ede0184d219..c41f5d79eb71 100644 --- a/pkgs/desktops/gnome-3/core/epiphany/default.nix +++ b/pkgs/desktops/gnome-3/core/epiphany/default.nix @@ -58,6 +58,7 @@ stdenv.mkDerivation rec { python3 wrapGAppsHook buildPackages.glib + buildPackages.gtk3 ]; buildInputs = [ diff --git a/pkgs/development/libraries/cracklib/default.nix b/pkgs/development/libraries/cracklib/default.nix index 4f3270d677a7..c10a69d72f94 100644 --- a/pkgs/development/libraries/cracklib/default.nix +++ b/pkgs/development/libraries/cracklib/default.nix @@ -18,10 +18,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) buildPackages.cracklib; buildInputs = [ zlib gettext ]; - postPatch = '' + postPatch = stdenv.lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' chmod +x util/cracklib-format patchShebangs util + '' + '' ln -vs ${toString wordlists} dicts/ ''; diff --git a/pkgs/development/libraries/flatbuffers/default.nix b/pkgs/development/libraries/flatbuffers/default.nix index fecd54e0ef5c..825e052ad873 100644 --- a/pkgs/development/libraries/flatbuffers/default.nix +++ b/pkgs/development/libraries/flatbuffers/default.nix @@ -18,7 +18,9 @@ stdenv.mkDerivation (rec { nativeBuildInputs = [ cmake ]; enableParallelBuilding = true; - doCheck = true; + cmakeFlags = [ "-DFLATBUFFERS_BUILD_TESTS=${if doCheck then "ON" else "OFF"}" ]; + + doCheck = stdenv.hostPlatform == stdenv.buildPlatform; checkTarget = "test"; meta = { diff --git a/pkgs/development/libraries/fstrcmp/cross.patch b/pkgs/development/libraries/fstrcmp/cross.patch new file mode 100644 index 000000000000..f794e3b91da6 --- /dev/null +++ b/pkgs/development/libraries/fstrcmp/cross.patch @@ -0,0 +1,24 @@ +diff '--color=auto' -ur fstrcmp-0.7-D001-old/configure.ac fstrcmp-0.7.D001/configure.ac +--- fstrcmp-0.7-D001-old/configure.ac 2014-03-04 19:13:45.000000000 -0500 ++++ fstrcmp-0.7.D001/configure.ac 2020-04-02 13:57:52.805154634 -0400 +@@ -32,6 +32,8 @@ + AC_OBJEXT + AC_EXEEXT + ++LT_INIT ++ + dnl @synopsis AC_ADD_CFLAGS + dnl + dnl Add the given option to CFLAGS, if it doesn't break the compiler +diff '--color=auto' -ur fstrcmp-0.7-D001-old/Makefile.in fstrcmp-0.7.D001/Makefile.in +--- fstrcmp-0.7-D001-old/Makefile.in 2014-03-04 19:13:45.000000000 -0500 ++++ fstrcmp-0.7.D001/Makefile.in 2020-04-02 13:57:12.355269595 -0400 +@@ -37,6 +37,8 @@ + srcdir = @srcdir@ + VPATH = @srcdir@ + ++top_builddir = $(srcdir) ++ + # + # the name of the install program to use + # diff --git a/pkgs/development/libraries/fstrcmp/default.nix b/pkgs/development/libraries/fstrcmp/default.nix index 732cd68551b8..46b579d4abd8 100644 --- a/pkgs/development/libraries/fstrcmp/default.nix +++ b/pkgs/development/libraries/fstrcmp/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchzip, libtool, ghostscript, groff }: +{ stdenv, fetchzip, libtool, ghostscript, groff, autoreconfHook }: stdenv.mkDerivation rec { pname = "fstrcmp"; @@ -9,9 +9,11 @@ stdenv.mkDerivation rec { sha256 = "0yg3y3k0wz50gmhgigfi2dx725w1gc8snb95ih7vpcnj6kabgz9a"; }; + patches = [ ./cross.patch ]; + outputs = [ "out" "dev" "doc" "man" "devman" ]; - nativeBuildInputs = [ libtool ghostscript groff ]; + nativeBuildInputs = [ libtool ghostscript groff autoreconfHook ]; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/ftgl/default.nix b/pkgs/development/libraries/ftgl/default.nix index 21be623314fb..a0ce9db815bc 100644 --- a/pkgs/development/libraries/ftgl/default.nix +++ b/pkgs/development/libraries/ftgl/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation { [ libGL libGLU ]) ; + configureFlags = [ "--with-ft-prefix=${stdenv.lib.getDev freetype}" ]; + enableParallelBuilding = true; meta = { diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix index b45b578eac0e..82fbbc967efc 100644 --- a/pkgs/development/libraries/gdk-pixbuf/default.nix +++ b/pkgs/development/libraries/gdk-pixbuf/default.nix @@ -35,7 +35,7 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkgconfig gettext python3 libxml2 libxslt docbook_xsl docbook_xml_dtd_43 - gtk-doc gobject-introspection makeWrapper + gtk-doc gobject-introspection makeWrapper glib ] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; @@ -68,7 +68,7 @@ in stdenv.mkDerivation rec { + '' moveToOutput "bin" "$dev" moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out" - + '' + stdenv.lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' # We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/ $dev/bin/gdk-pixbuf-query-loaders --update-cache ''; diff --git a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh index 06958be32131..bdfd00009dc5 100644 --- a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh +++ b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh @@ -14,4 +14,4 @@ findGdkPixbufLoaders() { } -addEnvHooks "$hostOffset" findGdkPixbufLoaders +addEnvHooks "$targetOffset" findGdkPixbufLoaders diff --git a/pkgs/development/libraries/glib/setup-hook.sh b/pkgs/development/libraries/glib/setup-hook.sh index 5d9c330b62eb..8ead5510ec4f 100644 --- a/pkgs/development/libraries/glib/setup-hook.sh +++ b/pkgs/development/libraries/glib/setup-hook.sh @@ -1,4 +1,3 @@ - make_glib_find_gsettings_schemas() { # For packages that need gschemas of other packages (e.g. empathy) for maybe_dir in "$1"/share/gsettings-schemas/*; do @@ -7,7 +6,7 @@ make_glib_find_gsettings_schemas() { fi done } -addEnvHooks "$hostOffset" make_glib_find_gsettings_schemas +addEnvHooks "$targetOffset" make_glib_find_gsettings_schemas # Install gschemas, if any, in a package-specific directory glibPreInstallPhase() { diff --git a/pkgs/development/libraries/libasyncns/default.nix b/pkgs/development/libraries/libasyncns/default.nix index d8b4f1d7df25..9a91551c3a43 100644 --- a/pkgs/development/libraries/libasyncns/default.nix +++ b/pkgs/development/libraries/libasyncns/default.nix @@ -8,6 +8,11 @@ stdenv.mkDerivation rec { sha256 = "0x5b6lcic4cd7q0bx00x93kvpyzl7n2abbgvqbrlzrfb8vknc6jg"; }; + configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; + meta = with stdenv.lib; { homepage = "http://0pointer.de/lennart/projects/libasyncns/"; description = "A C library for Linux/Unix for executing name service queries asynchronously"; diff --git a/pkgs/development/libraries/libcddb/default.nix b/pkgs/development/libraries/libcddb/default.nix index 26a69fe9fc76..2b837ff1ce1a 100644 --- a/pkgs/development/libraries/libcddb/default.nix +++ b/pkgs/development/libraries/libcddb/default.nix @@ -10,6 +10,11 @@ stdenv.mkDerivation rec { buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv; + configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; + doCheck = false; # fails 3 of 5 tests with locale errors meta = with stdenv.lib; { diff --git a/pkgs/development/libraries/libcdio/default.nix b/pkgs/development/libraries/libcdio/default.nix index e4522bf00be8..b0b7b55a19db 100644 --- a/pkgs/development/libraries/libcdio/default.nix +++ b/pkgs/development/libraries/libcdio/default.nix @@ -12,8 +12,8 @@ stdenv.mkDerivation rec { patchShebangs . ''; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ libcddb ncurses help2man ] + nativeBuildInputs = [ pkgconfig help2man ]; + buildInputs = [ libcddb ncurses ] ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv Carbon IOKit ]; doCheck = !stdenv.isDarwin; diff --git a/pkgs/development/libraries/libcec/default.nix b/pkgs/development/libraries/libcec/default.nix index 2ea55db22477..09ebac93869b 100644 --- a/pkgs/development/libraries/libcec/default.nix +++ b/pkgs/development/libraries/libcec/default.nix @@ -11,8 +11,8 @@ stdenv.mkDerivation { sha256 = "02j09y06csaic4m0fyb4dr9l3hl15nxbbniwq0i1qlccpxjak0j3"; }; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ cmake udev libcec_platform ] ++ + nativeBuildInputs = [ pkgconfig cmake ]; + buildInputs = [ udev libcec_platform ] ++ stdenv.lib.optional (libraspberrypi != null) libraspberrypi; cmakeFlags = [ "-DBUILD_SHARED_LIBS=1" ]; diff --git a/pkgs/development/libraries/libcrossguid/default.nix b/pkgs/development/libraries/libcrossguid/default.nix index 0d0f06aac37b..8e2be72987cf 100644 --- a/pkgs/development/libraries/libcrossguid/default.nix +++ b/pkgs/development/libraries/libcrossguid/default.nix @@ -15,8 +15,8 @@ stdenv.mkDerivation rec { buildInputs = [ libuuid ]; buildPhase = '' - g++ -c guid.cpp -o guid.o $CXXFLAGS -std=c++11 -DGUID_LIBUUID - ar rvs libcrossguid.a guid.o + $CXX -c guid.cpp -o guid.o $CXXFLAGS -std=c++11 -DGUID_LIBUUID + $AR rvs libcrossguid.a guid.o ''; installPhase = '' mkdir -p $out/{lib,include} diff --git a/pkgs/development/libraries/libva/default.nix b/pkgs/development/libraries/libva/default.nix index 1c8e78a3a372..be374eaf8957 100644 --- a/pkgs/development/libraries/libva/default.nix +++ b/pkgs/development/libraries/libva/default.nix @@ -2,6 +2,7 @@ , libXext, libdrm, libXfixes, wayland, libffi, libX11 , libGL, mesa , minimal ? false, libva-minimal +, buildPackages }: stdenv.mkDerivation rec { @@ -18,7 +19,7 @@ stdenv.mkDerivation rec { outputs = [ "dev" "out" ]; - nativeBuildInputs = [ autoreconfHook pkgconfig ]; + nativeBuildInputs = [ autoreconfHook pkgconfig wayland ]; buildInputs = [ libdrm ] ++ lib.optionals (!minimal) [ libva-minimal libX11 libXext libXfixes wayland libffi libGL ]; @@ -29,6 +30,7 @@ stdenv.mkDerivation rec { configureFlags = [ # Add FHS paths for non-NixOS applications. "--with-drivers-path=${mesa.drivers.driverLink}/lib/dri:/usr/lib/dri:/usr/lib32/dri" + "ac_cv_path_WAYLAND_SCANNER=${buildPackages.wayland}/bin/wayland-scanner" ] ++ lib.optionals (!minimal) [ "--enable-glx" ]; installFlags = [ diff --git a/pkgs/development/libraries/libvisual/default.nix b/pkgs/development/libraries/libvisual/default.nix index 8880daed88ea..8fe53acc2456 100644 --- a/pkgs/development/libraries/libvisual/default.nix +++ b/pkgs/development/libraries/libvisual/default.nix @@ -13,6 +13,11 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; + configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; + meta = { description = "An abstraction library for audio visualisations"; homepage = "https://sourceforge.net/projects/libvisual/"; diff --git a/pkgs/development/libraries/libvpx/default.nix b/pkgs/development/libraries/libvpx/default.nix index ca3ec9856c2c..007df403ff73 100644 --- a/pkgs/development/libraries/libvpx/default.nix +++ b/pkgs/development/libraries/libvpx/default.nix @@ -135,16 +135,10 @@ stdenv.mkDerivation rec { experimentalFpMbStatsSupport || experimentalEmulateHardwareSupport) "experimental") ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - #"--extra-cflags=" - #"--extra-cxxflags=" - #"--prefix=" - #"--libc=" - #"--libdir=" - "--enable-external-build" # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version) # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14 - "--force-target=${stdenv.hostPlatform.config}${ + "--force-target=${stdenv.hostPlatform.parsed.cpu.name}-${stdenv.hostPlatform.parsed.kernel.name}${ if stdenv.hostPlatform.isDarwin then if stdenv.hostPlatform.osxMinVersion == "10.10" then "14" else if stdenv.hostPlatform.osxMinVersion == "10.9" then "13" diff --git a/pkgs/development/libraries/tinyxml/2.6.2.nix b/pkgs/development/libraries/tinyxml/2.6.2.nix index 664030bc1bcc..9c909d5e14d6 100644 --- a/pkgs/development/libraries/tinyxml/2.6.2.nix +++ b/pkgs/development/libraries/tinyxml/2.6.2.nix @@ -23,14 +23,14 @@ in stdenv.mkDerivation { ./2.6.2-cxx.patch ]; - preConfigure = "export LD=${if stdenv.isDarwin then "clang++" else "g++"}"; + preConfigure = "export LD=${stdenv.cc.targetPrefix}c++"; hardeningDisable = [ "format" ]; NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9"; - buildInputs = [ unzip ]; + nativeBuildInputs = [ unzip ]; buildPhase = '' # use STL (xbmc requires it) sed '1i#define TIXML_USE_STL 1' -i tinyxml.h diff --git a/pkgs/development/libraries/vulkan-loader/default.nix b/pkgs/development/libraries/vulkan-loader/default.nix index 53f492bf8b04..e650a28c61e5 100644 --- a/pkgs/development/libraries/vulkan-loader/default.nix +++ b/pkgs/development/libraries/vulkan-loader/default.nix @@ -12,8 +12,8 @@ stdenv.mkDerivation rec { sha256 = "12n4mxc6db89258k8i47ql1zna7k94lkwv7lpxg39nm8ypa1ywrv"; }; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ cmake python3 xlibsWrapper libxcb libXrandr libXext wayland ]; + nativeBuildInputs = [ pkgconfig cmake ]; + buildInputs = [ python3 xlibsWrapper libxcb libXrandr libXext wayland ]; enableParallelBuilding = true; preConfigure = '' diff --git a/pkgs/development/libraries/waylandpp/default.nix b/pkgs/development/libraries/waylandpp/default.nix index 06faec558c01..59fac7bfe4a1 100644 --- a/pkgs/development/libraries/waylandpp/default.nix +++ b/pkgs/development/libraries/waylandpp/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, cmake, pkgconfig, pugixml, wayland, libGL }: +{ stdenv, fetchFromGitHub, cmake, pkgconfig, pugixml, wayland, libGL, libffi, buildPackages }: stdenv.mkDerivation rec { pname = "waylandpp"; @@ -11,8 +11,10 @@ stdenv.mkDerivation rec { sha256 = "16h57hzd688664qcyznzhjp3hxipdkzgv46x82yhkww24av8b55n"; }; + cmakeFlags = stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DWAYLAND_SCANNERPP=${buildPackages.waylandpp}/bin/wayland-scanner++"; + nativeBuildInputs = [ cmake pkgconfig ]; - buildInputs = [ pugixml wayland libGL ]; + buildInputs = [ pugixml wayland libGL libffi ]; meta = with stdenv.lib; { description = "Wayland C++ binding"; diff --git a/pkgs/development/python-modules/python-dbusmock/default.nix b/pkgs/development/python-modules/python-dbusmock/default.nix index 3d6a4a7aee03..d643603a0679 100644 --- a/pkgs/development/python-modules/python-dbusmock/default.nix +++ b/pkgs/development/python-modules/python-dbusmock/default.nix @@ -44,12 +44,12 @@ buildPythonPackage rec { checkInputs = [ nose dbus dbus-python which pycodestyle pyflakes - pygobject3 bluez bluez.test networkmanager + pygobject3 bluez (lib.getOutput "test" bluez) networkmanager ]; checkPhase = '' runHook preCheck - export PATH="$PATH:${bluez.test}/test"; + export PATH="$PATH:${lib.getOutput "test" bluez}/test"; nosetests -v runHook postCheck ''; diff --git a/pkgs/misc/emulators/retroarch/default.nix b/pkgs/misc/emulators/retroarch/default.nix index a91e2de85934..28a641ec9701 100644 --- a/pkgs/misc/emulators/retroarch/default.nix +++ b/pkgs/misc/emulators/retroarch/default.nix @@ -15,6 +15,8 @@ , enableNvidiaCgToolkit ? false, nvidia_cg_toolkit ? null , withVulkan ? stdenv.isLinux, vulkan-loader ? null , fetchurl +, wayland +, libxkbcommon }: with stdenv.lib; @@ -30,7 +32,7 @@ stdenv.mkDerivation rec { rev = "v${version}"; }; - nativeBuildInputs = [ pkgconfig ] + nativeBuildInputs = [ pkgconfig wayland ] ++ optional withVulkan makeWrapper; buildInputs = [ ffmpeg freetype libxml2 libGLU libGL python3 SDL2 which ] @@ -38,7 +40,11 @@ stdenv.mkDerivation rec { ++ optional withVulkan vulkan-loader ++ optionals stdenv.isDarwin [ libobjc AppKit Foundation ] ++ optionals stdenv.isLinux [ alsaLib libdrm libpulseaudio libv4l libX11 - libXdmcp libXext libXxf86vm mesa udev ]; + libXdmcp libXext libXxf86vm mesa udev + wayland libxkbcommon ]; + + # we use prefix-less pkg-config + PKG_CONF_PATH = "pkg-config"; enableParallelBuilding = true; diff --git a/pkgs/os-specific/linux/alsa-plugins/default.nix b/pkgs/os-specific/linux/alsa-plugins/default.nix index b524d7906da4..a69d86c5c4d6 100644 --- a/pkgs/os-specific/linux/alsa-plugins/default.nix +++ b/pkgs/os-specific/linux/alsa-plugins/default.nix @@ -9,9 +9,11 @@ stdenv.mkDerivation rec { sha256 = "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"; }; + nativeBuildInputs = [ pkgconfig ]; + # ToDo: a52, etc.? buildInputs = - [ pkgconfig alsaLib libogg ] + [ alsaLib libogg ] ++ lib.optional (libpulseaudio != null) libpulseaudio ++ lib.optional (libjack2 != null) libjack2; diff --git a/pkgs/os-specific/linux/bluez/default.nix b/pkgs/os-specific/linux/bluez/default.nix index 78d88d941e87..401ab39bca36 100644 --- a/pkgs/os-specific/linux/bluez/default.nix +++ b/pkgs/os-specific/linux/bluez/default.nix @@ -11,9 +11,13 @@ , readline , systemd , udev -}: - -stdenv.mkDerivation rec { +}: let + pythonPath = with python3.pkgs; [ + dbus-python + pygobject3 + recursivePthLoader + ]; +in stdenv.mkDerivation rec { pname = "bluez"; version = "5.54"; @@ -22,12 +26,6 @@ stdenv.mkDerivation rec { sha256 = "1p2ncvjz6alr9n3l5wvq2arqgc7xjs6dqyar1l9jp0z8cfgapkb8"; }; - pythonPath = with python3.pkgs; [ - dbus-python - pygobject3 - recursivePthLoader - ]; - buildInputs = [ alsaLib dbus @@ -44,7 +42,7 @@ stdenv.mkDerivation rec { python3.pkgs.wrapPython ]; - outputs = [ "out" "dev" "test" ]; + outputs = [ "out" "dev" ] ++ lib.optional doCheck "test"; postPatch = '' substituteInPlace tools/hid2hci.rules \ @@ -79,7 +77,7 @@ stdenv.mkDerivation rec { doCheck = stdenv.hostPlatform.isx86_64; - postInstall = '' + postInstall = lib.optionalString doCheck '' mkdir -p $test/{bin,test} cp -a test $test pushd $test/test @@ -94,8 +92,8 @@ stdenv.mkDerivation rec { ln -s ../test/$a $test/bin/bluez-$a done popd - wrapPythonProgramsIn $test/test "$test/test $pythonPath" - + wrapPythonProgramsIn $test/test "$test/test ${toString pythonPath}" + '' + '' # for bluez4 compatibility for NixOS mkdir $out/sbin ln -s ../libexec/bluetooth/bluetoothd $out/sbin/bluetoothd diff --git a/pkgs/os-specific/linux/plymouth/default.nix b/pkgs/os-specific/linux/plymouth/default.nix index b4c4909cac50..7a6c227f401f 100644 --- a/pkgs/os-specific/linux/plymouth/default.nix +++ b/pkgs/os-specific/linux/plymouth/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, autoreconfHook, pkgconfig, libxslt, docbook_xsl -, gtk3, udev, systemd +, gtk3, udev, systemd, lib }: stdenv.mkDerivation rec { @@ -44,6 +44,7 @@ stdenv.mkDerivation rec { "--enable-pango" "--enable-gdm-transition" "--enable-gtk" + "ac_cv_path_SYSTEMD_ASK_PASSWORD_AGENT=${lib.getBin systemd}/bin/systemd-tty-ask-password-agent" ]; configurePlatforms = [ "host" ]; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index e398b9b5d652..c6fe55ad9f75 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -256,6 +256,15 @@ self: super: libXres = super.libXres.overrideAttrs (attrs: { outputs = [ "out" "dev" "devdoc" ]; + buildInputs = with self; attrs.buildInputs ++ [ utilmacros ]; + configureFlags = attrs.configureFlags or [] + ++ malloc0ReturnsNullCrossFlag; + }); + + libXScrnSaver = super.libXScrnSaver.overrideAttrs (attrs: { + buildInputs = with self; attrs.buildInputs ++ [ utilmacros ]; + configureFlags = attrs.configureFlags or [] + ++ malloc0ReturnsNullCrossFlag; }); libXv = super.libXv.overrideAttrs (attrs: { diff --git a/pkgs/tools/misc/dvtm/dvtm.nix b/pkgs/tools/misc/dvtm/dvtm.nix index 61af9fac1778..5bb8efb5540c 100644 --- a/pkgs/tools/misc/dvtm/dvtm.nix +++ b/pkgs/tools/misc/dvtm/dvtm.nix @@ -9,6 +9,7 @@ stdenv.mkDerivation { cp ${builtins.toFile "config.h" customConfig} ./config.h ''; + nativeBuildInputs = [ ncurses ]; buildInputs = [ ncurses ]; prePatch = '' @@ -16,9 +17,7 @@ stdenv.mkDerivation { --replace /usr/share/terminfo $out/share/terminfo ''; - installPhase = '' - make PREFIX=$out install - ''; + makeFlags = [ "PREFIX=$(out)" ]; meta = with stdenv.lib; { description = "Dynamic virtual terminal manager"; diff --git a/pkgs/top-level/unix-tools.nix b/pkgs/top-level/unix-tools.nix index 56bab2fe4116..cdad9de61f41 100644 --- a/pkgs/top-level/unix-tools.nix +++ b/pkgs/top-level/unix-tools.nix @@ -66,12 +66,12 @@ let linux = pkgs.utillinux; }; getconf = { - linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.glibc + linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.stdenv.cc.libc else pkgs.netbsd.getconf; darwin = pkgs.darwin.system_cmds; }; getent = { - linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.glibc + linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.stdenv.cc.libc else pkgs.netbsd.getent; darwin = pkgs.netbsd.getent; };