Merge pull request #84415 from matthewbauer/mb-cross-fixes-april2020

Cross compilation fixes [april 2020]
This commit is contained in:
Matthew Bauer 2020-04-13 16:48:38 -04:00 committed by GitHub
commit e520d6af29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 187 additions and 83 deletions

View File

@ -45,6 +45,9 @@ let
# generate the font cache setting file for a fontconfig version # generate the font cache setting file for a fontconfig version
# use latest when no version is passed # use latest when no version is passed
# When cross-compiling, we cant generate the cache, so we skip the
# <cachedir> part. fontconfig still works but is a little slower in
# looking things up.
makeCacheConf = { version ? null }: makeCacheConf = { version ? null }:
let let
fcPackage = if version == null fcPackage = if version == null
@ -60,11 +63,13 @@ let
<fontconfig> <fontconfig>
<!-- Font directories --> <!-- Font directories -->
${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)} ${concatStringsSep "\n" (map (font: "<dir>${font}</dir>") config.fonts.fonts)}
${optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) ''
<!-- Pre-generated font caches --> <!-- Pre-generated font caches -->
<cachedir>${cache}</cachedir> <cachedir>${cache}</cachedir>
${optionalString (pkgs.stdenv.isx86_64 && cfg.cache32Bit) '' ${optionalString (pkgs.stdenv.isx86_64 && cfg.cache32Bit) ''
<cachedir>${cache32}</cachedir> <cachedir>${cache32}</cachedir>
''} ''}
''}
</fontconfig> </fontconfig>
''; '';

View File

@ -197,7 +197,7 @@ in
} // optionalAttrs (pkgs.stdenv.hostPlatform.libc == "glibc") { } // optionalAttrs (pkgs.stdenv.hostPlatform.libc == "glibc") {
# /etc/rpc: RPC program numbers. # /etc/rpc: RPC program numbers.
rpc.source = pkgs.glibc.out + "/etc/rpc"; rpc.source = pkgs.stdenv.cc.libc.out + "/etc/rpc";
}; };
networking.proxy.envVars = networking.proxy.envVars =

View File

@ -7,6 +7,10 @@ let
nssModulesPath = config.system.nssModules.path; nssModulesPath = config.system.nssModules.path;
cfg = config.services.nscd; cfg = config.services.nscd;
nscd = if pkgs.stdenv.hostPlatform.libc == "glibc"
then pkgs.stdenv.cc.libc.bin
else pkgs.glibc.bin;
in in
{ {
@ -59,16 +63,16 @@ in
# files. So prefix the ExecStart command with "!" to prevent systemd # files. So prefix the ExecStart command with "!" to prevent systemd
# from dropping privileges early. See ExecStart in systemd.service(5). # from dropping privileges early. See ExecStart in systemd.service(5).
serviceConfig = serviceConfig =
{ ExecStart = "!@${pkgs.glibc.bin}/sbin/nscd nscd"; { ExecStart = "!@${nscd}/sbin/nscd nscd";
Type = "forking"; Type = "forking";
DynamicUser = true; DynamicUser = true;
RuntimeDirectory = "nscd"; RuntimeDirectory = "nscd";
PIDFile = "/run/nscd/nscd.pid"; PIDFile = "/run/nscd/nscd.pid";
Restart = "always"; Restart = "always";
ExecReload = ExecReload =
[ "${pkgs.glibc.bin}/sbin/nscd --invalidate passwd" [ "${nscd}/sbin/nscd --invalidate passwd"
"${pkgs.glibc.bin}/sbin/nscd --invalidate group" "${nscd}/sbin/nscd --invalidate group"
"${pkgs.glibc.bin}/sbin/nscd --invalidate hosts" "${nscd}/sbin/nscd --invalidate hosts"
]; ];
}; };
}; };

View File

@ -19,7 +19,7 @@ let
continue continue
fi fi
GDK_PIXBUF_MODULEDIR="$module_dir" \ 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 done
) > "$out" ) > "$out"
''; '';
@ -37,7 +37,7 @@ in
# If there is any package configured in modulePackages, we generate the # If there is any package configured in modulePackages, we generate the
# loaders.cache based on that and set the environment variable # loaders.cache based on that and set the environment variable
# GDK_PIXBUF_MODULE_FILE to point to it. # GDK_PIXBUF_MODULE_FILE to point to it.
config = mkIf (cfg.modulePackages != []) { config = mkIf (cfg.modulePackages != [] || pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform) {
environment.variables = { environment.variables = {
GDK_PIXBUF_MODULE_FILE = "${loadersCache}"; GDK_PIXBUF_MODULE_FILE = "${loadersCache}";
}; };

View File

@ -80,6 +80,8 @@ stdenv.mkDerivation {
configureFlags = stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ configureFlags = stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"ac_cv_fread_reads_directories=yes" "ac_cv_fread_reads_directories=yes"
"ac_cv_snprintf_returns_bogus=no" "ac_cv_snprintf_returns_bogus=no"
"ac_cv_iconv_omits_bom=no"
"ac_cv_prog_CURL_CONFIG=${curl.dev}/bin/curl-config"
]; ];
preBuild = '' preBuild = ''

View File

@ -4,22 +4,20 @@
, boost, avahi, lame, autoreconfHook , boost, avahi, lame, autoreconfHook
, gettext, pcre-cpp, yajl, fribidi, which , gettext, pcre-cpp, yajl, fribidi, which
, openssl, gperf, tinyxml2, taglib, libssh, swig, jre , openssl, gperf, tinyxml2, taglib, libssh, swig, jre
, libX11, xorgproto, libxml2 , libxml2, systemd
, libXt, libXmu, libXext
, libXinerama, libXrandr
, libXtst, libXfixes, systemd
, alsaLib, libGLU, libGL, glew, fontconfig, freetype, ftgl , alsaLib, libGLU, libGL, glew, fontconfig, freetype, ftgl
, libjpeg, libpng, libtiff , libjpeg, libpng, libtiff
, libmpeg2, libsamplerate, libmad , libmpeg2, libsamplerate, libmad
, libogg, libvorbis, flac, libxslt , libogg, libvorbis, flac, libxslt
, lzo, libcdio, libmodplug, libass, libbluray , lzo, libcdio, libmodplug, libass, libbluray
, sqlite, libmysqlclient, nasm, gnutls, libva, libdrm , sqlite, libmysqlclient, nasm, gnutls, libva, libdrm
, curl, bzip2, zip, unzip, glxinfo, xdpyinfo , curl, bzip2, zip, unzip, glxinfo
, libcec, libcec_platform, dcadec, libuuid , libcec, libcec_platform, dcadec, libuuid
, libcrossguid, libmicrohttpd , 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 , libplist, p11-kit, zlib, flatbuffers, fmt, fstrcmp, rapidjson
, lirc , lirc
, x11Support ? true, libX11, xorgproto, libXt, libXmu, libXext, libXinerama, libXrandr, libXtst, libXfixes, xdpyinfo, libXdmcp
, dbusSupport ? true, dbus ? null , dbusSupport ? true, dbus ? null
, joystickSupport ? true, cwiid ? null , joystickSupport ? true, cwiid ? null
, nfsSupport ? true, libnfs ? null , nfsSupport ? true, libnfs ? null
@ -32,6 +30,7 @@
, useWayland ? false, wayland ? null, wayland-protocols ? null , useWayland ? false, wayland ? null, wayland-protocols ? null
, waylandpp ? null, libxkbcommon ? null , waylandpp ? null, libxkbcommon ? null
, useGbm ? false, mesa ? null, libinput ? null , useGbm ? false, mesa ? null, libinput ? null
, buildPackages
}: }:
assert dbusSupport -> dbus != null; assert dbusSupport -> dbus != null;
@ -94,10 +93,18 @@ let
sha256 = "1krsjlr949iy5l6ljxancza1yi6w1annxc5s6k283i9mb15qy8cy"; sha256 = "1krsjlr949iy5l6ljxancza1yi6w1annxc5s6k283i9mb15qy8cy";
preConfigure = '' preConfigure = ''
cp ${kodi_src}/tools/depends/target/ffmpeg/{CMakeLists.txt,*.cmake} . 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; ++ 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 # We can build these externally but FindLibDvd.cmake forces us to build it
@ -152,29 +159,31 @@ in stdenv.mkDerivation {
buildInputs = [ buildInputs = [
gnutls libidn libtasn1 nasm p11-kit gnutls libidn libtasn1 nasm p11-kit
libxml2 yasm python2Packages.python libxml2 python2Packages.python
boost libmicrohttpd boost libmicrohttpd
gettext pcre-cpp yajl fribidi libva libdrm gettext pcre-cpp yajl fribidi libva libdrm
openssl gperf tinyxml2 taglib libssh swig jre openssl gperf tinyxml2 taglib libssh
libX11 xorgproto libXt libXmu libXext alsaLib libGL libGLU fontconfig freetype ftgl
libXinerama libXrandr libXtst libXfixes
alsaLib libGL libGLU glew fontconfig freetype ftgl
libjpeg libpng libtiff libjpeg libpng libtiff
libmpeg2 libsamplerate libmad libmpeg2 libsamplerate libmad
libogg libvorbis flac libxslt systemd libogg libvorbis flac libxslt systemd
lzo libcdio libmodplug libass libbluray lzo libcdio libmodplug libass libbluray
sqlite libmysqlclient avahi lame sqlite libmysqlclient avahi lame
curl bzip2 zip unzip glxinfo xdpyinfo curl bzip2 zip unzip glxinfo
libcec libcec_platform dcadec libuuid libcec libcec_platform dcadec libuuid
libgcrypt libgpgerror libunistring libgcrypt libgpgerror libunistring
libcrossguid cwiid libplist libcrossguid libplist
bluez giflib glib harfbuzz lcms2 libpthreadstubs libXdmcp bluez giflib glib harfbuzz lcms2 libpthreadstubs
ffmpeg flatbuffers fmt fstrcmp rapidjson ffmpeg flatbuffers fmt fstrcmp rapidjson
lirc lirc
# libdvdcss libdvdnav libdvdread # libdvdcss libdvdnav libdvdread
] ]
++ lib.optional x11Support [
libX11 xorgproto libXt libXmu libXext libXdmcp
libXinerama libXrandr libXtst libXfixes
]
++ lib.optional dbusSupport dbus ++ lib.optional dbusSupport dbus
++ lib.optionals joystickSupport [ cwiid ] ++ lib.optional joystickSupport cwiid
++ lib.optional nfsSupport libnfs ++ lib.optional nfsSupport libnfs
++ lib.optional pulseSupport libpulseaudio ++ lib.optional pulseSupport libpulseaudio
++ lib.optional rtmpSupport rtmpdump ++ lib.optional rtmpSupport rtmpdump
@ -183,7 +192,7 @@ in stdenv.mkDerivation {
++ lib.optional usbSupport libusb ++ lib.optional usbSupport libusb
++ lib.optional vdpauSupport libvdpau ++ lib.optional vdpauSupport libvdpau
++ lib.optionals useWayland [ ++ lib.optionals useWayland [
wayland waylandpp wayland waylandpp wayland-protocols
# Not sure why ".dev" is needed here, but CMake doesn't find libxkbcommon otherwise # Not sure why ".dev" is needed here, but CMake doesn't find libxkbcommon otherwise
libxkbcommon.dev libxkbcommon.dev
] ]
@ -200,8 +209,16 @@ in stdenv.mkDerivation {
which which
pkgconfig gnumake pkgconfig gnumake
autoconf automake libtool # still needed for some components. Check if that is the case with 19.0 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 ]; ] ++ lib.optionals useWayland [ wayland-protocols ];
depsBuildBuild = [
buildPackages.stdenv.cc
];
cmakeFlags = [ cmakeFlags = [
"-Dlibdvdcss_URL=${libdvdcss.src}" "-Dlibdvdcss_URL=${libdvdcss.src}"
"-Dlibdvdnav_URL=${libdvdnav.src}" "-Dlibdvdnav_URL=${libdvdnav.src}"
@ -210,9 +227,14 @@ in stdenv.mkDerivation {
"-DENABLE_EVENTCLIENTS=ON" "-DENABLE_EVENTCLIENTS=ON"
"-DENABLE_INTERNAL_CROSSGUID=OFF" "-DENABLE_INTERNAL_CROSSGUID=OFF"
"-DENABLE_OPTICAL=ON" "-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 [ ] ++ lib.optional useWayland [
"-DCORE_PLATFORM_NAME=wayland" "-DCORE_PLATFORM_NAME=wayland"
"-DWAYLAND_RENDER_SYSTEM=gl" "-DWAYLAND_RENDER_SYSTEM=gl"
"-DWAYLANDPP_SCANNER=${buildPackages.waylandpp}/bin/wayland-scanner++"
] ++ lib.optional useGbm [ ] ++ lib.optional useGbm [
"-DCORE_PLATFORM_NAME=gbm" "-DCORE_PLATFORM_NAME=gbm"
"-DGBM_RENDER_SYSTEM=gles" "-DGBM_RENDER_SYSTEM=gles"
@ -224,6 +246,16 @@ in stdenv.mkDerivation {
# I'm guessing there is a thing waiting to time out # I'm guessing there is a thing waiting to time out
doCheck = false; 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 = '' postPatch = ''
substituteInPlace xbmc/platform/linux/LinuxTimezone.cpp \ substituteInPlace xbmc/platform/linux/LinuxTimezone.cpp \
--replace 'usr/share/zoneinfo' 'etc/zoneinfo' --replace 'usr/share/zoneinfo' 'etc/zoneinfo'
@ -232,9 +264,11 @@ in stdenv.mkDerivation {
postInstall = '' postInstall = ''
for p in $(ls $out/bin/) ; do for p in $(ls $out/bin/) ; do
wrapProgram $out/bin/$p \ 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 --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 done
substituteInPlace $out/share/xsessions/kodi.desktop \ substituteInPlace $out/share/xsessions/kodi.desktop \

View File

@ -15,7 +15,7 @@ isExecutable() {
# *or* there is an INTERP section. This also catches position-independent # *or* there is an INTERP section. This also catches position-independent
# executables, as they typically have an INTERP section but their ELF type # executables, as they typically have an INTERP section but their ELF type
# is DYN. # 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\>')" | grep '^ *Type: *EXEC\>\|^ *INTERP\>')"
# not using grep -q, because it can cause Broken pipe # not using grep -q, because it can cause Broken pipe
[ -n "$isExeResult" ] [ -n "$isExeResult" ]
@ -207,7 +207,7 @@ autoPatchelf() {
# outside of this function. # outside of this function.
while IFS= read -r -d $'\0' file; do while IFS= read -r -d $'\0' file; do
isELF "$file" || continue 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). # Skip if the ELF file doesn't have segment headers (eg. object files).
# not using grep -q, because it can cause Broken pipe # not using grep -q, because it can cause Broken pipe
[ -n "$(echo "$segmentHeaders" | grep '^Program Headers:')" ] || continue [ -n "$(echo "$segmentHeaders" | grep '^Program Headers:')" ] || continue

View File

@ -10,4 +10,4 @@ hicolorIconThemeHook() {
} }
# I think this is meant to be a runtime dep # I think this is meant to be a runtime dep
addEnvHooks "${hostOffset:?}" hicolorIconThemeHook addEnvHooks "${targetOffset:?}" hicolorIconThemeHook

View File

@ -58,6 +58,7 @@ stdenv.mkDerivation rec {
python3 python3
wrapGAppsHook wrapGAppsHook
buildPackages.glib buildPackages.glib
buildPackages.gtk3
]; ];
buildInputs = [ buildInputs = [

View File

@ -18,10 +18,11 @@ stdenv.mkDerivation rec {
nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) buildPackages.cracklib; nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) buildPackages.cracklib;
buildInputs = [ zlib gettext ]; buildInputs = [ zlib gettext ];
postPatch = '' postPatch = stdenv.lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
chmod +x util/cracklib-format chmod +x util/cracklib-format
patchShebangs util patchShebangs util
'' + ''
ln -vs ${toString wordlists} dicts/ ln -vs ${toString wordlists} dicts/
''; '';

View File

@ -18,7 +18,9 @@ stdenv.mkDerivation (rec {
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
enableParallelBuilding = true; enableParallelBuilding = true;
doCheck = true; cmakeFlags = [ "-DFLATBUFFERS_BUILD_TESTS=${if doCheck then "ON" else "OFF"}" ];
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
checkTarget = "test"; checkTarget = "test";
meta = { meta = {

View File

@ -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
#

View File

@ -1,4 +1,4 @@
{ stdenv, fetchzip, libtool, ghostscript, groff }: { stdenv, fetchzip, libtool, ghostscript, groff, autoreconfHook }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "fstrcmp"; pname = "fstrcmp";
@ -9,9 +9,11 @@ stdenv.mkDerivation rec {
sha256 = "0yg3y3k0wz50gmhgigfi2dx725w1gc8snb95ih7vpcnj6kabgz9a"; sha256 = "0yg3y3k0wz50gmhgigfi2dx725w1gc8snb95ih7vpcnj6kabgz9a";
}; };
patches = [ ./cross.patch ];
outputs = [ "out" "dev" "doc" "man" "devman" ]; outputs = [ "out" "dev" "doc" "man" "devman" ];
nativeBuildInputs = [ libtool ghostscript groff ]; nativeBuildInputs = [ libtool ghostscript groff autoreconfHook ];
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -18,6 +18,8 @@ stdenv.mkDerivation {
[ libGL libGLU ]) [ libGL libGLU ])
; ;
configureFlags = [ "--with-ft-prefix=${stdenv.lib.getDev freetype}" ];
enableParallelBuilding = true; enableParallelBuilding = true;
meta = { meta = {

View File

@ -35,7 +35,7 @@ in stdenv.mkDerivation rec {
nativeBuildInputs = [ nativeBuildInputs = [
meson ninja pkgconfig gettext python3 libxml2 libxslt docbook_xsl docbook_xml_dtd_43 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; ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
@ -68,7 +68,7 @@ in stdenv.mkDerivation rec {
+ '' + ''
moveToOutput "bin" "$dev" moveToOutput "bin" "$dev"
moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out" 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/ # We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/
$dev/bin/gdk-pixbuf-query-loaders --update-cache $dev/bin/gdk-pixbuf-query-loaders --update-cache
''; '';

View File

@ -14,4 +14,4 @@ findGdkPixbufLoaders() {
} }
addEnvHooks "$hostOffset" findGdkPixbufLoaders addEnvHooks "$targetOffset" findGdkPixbufLoaders

View File

@ -1,4 +1,3 @@
make_glib_find_gsettings_schemas() { make_glib_find_gsettings_schemas() {
# For packages that need gschemas of other packages (e.g. empathy) # For packages that need gschemas of other packages (e.g. empathy)
for maybe_dir in "$1"/share/gsettings-schemas/*; do for maybe_dir in "$1"/share/gsettings-schemas/*; do
@ -7,7 +6,7 @@ make_glib_find_gsettings_schemas() {
fi fi
done done
} }
addEnvHooks "$hostOffset" make_glib_find_gsettings_schemas addEnvHooks "$targetOffset" make_glib_find_gsettings_schemas
# Install gschemas, if any, in a package-specific directory # Install gschemas, if any, in a package-specific directory
glibPreInstallPhase() { glibPreInstallPhase() {

View File

@ -8,6 +8,11 @@ stdenv.mkDerivation rec {
sha256 = "0x5b6lcic4cd7q0bx00x93kvpyzl7n2abbgvqbrlzrfb8vknc6jg"; 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; { meta = with stdenv.lib; {
homepage = "http://0pointer.de/lennart/projects/libasyncns/"; homepage = "http://0pointer.de/lennart/projects/libasyncns/";
description = "A C library for Linux/Unix for executing name service queries asynchronously"; description = "A C library for Linux/Unix for executing name service queries asynchronously";

View File

@ -10,6 +10,11 @@ stdenv.mkDerivation rec {
buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv; 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 doCheck = false; # fails 3 of 5 tests with locale errors
meta = with stdenv.lib; { meta = with stdenv.lib; {

View File

@ -12,8 +12,8 @@ stdenv.mkDerivation rec {
patchShebangs . patchShebangs .
''; '';
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig help2man ];
buildInputs = [ libcddb ncurses help2man ] buildInputs = [ libcddb ncurses ]
++ stdenv.lib.optionals stdenv.isDarwin [ libiconv Carbon IOKit ]; ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv Carbon IOKit ];
doCheck = !stdenv.isDarwin; doCheck = !stdenv.isDarwin;

View File

@ -11,8 +11,8 @@ stdenv.mkDerivation {
sha256 = "02j09y06csaic4m0fyb4dr9l3hl15nxbbniwq0i1qlccpxjak0j3"; sha256 = "02j09y06csaic4m0fyb4dr9l3hl15nxbbniwq0i1qlccpxjak0j3";
}; };
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig cmake ];
buildInputs = [ cmake udev libcec_platform ] ++ buildInputs = [ udev libcec_platform ] ++
stdenv.lib.optional (libraspberrypi != null) libraspberrypi; stdenv.lib.optional (libraspberrypi != null) libraspberrypi;
cmakeFlags = [ "-DBUILD_SHARED_LIBS=1" ]; cmakeFlags = [ "-DBUILD_SHARED_LIBS=1" ];

View File

@ -15,8 +15,8 @@ stdenv.mkDerivation rec {
buildInputs = [ libuuid ]; buildInputs = [ libuuid ];
buildPhase = '' buildPhase = ''
g++ -c guid.cpp -o guid.o $CXXFLAGS -std=c++11 -DGUID_LIBUUID $CXX -c guid.cpp -o guid.o $CXXFLAGS -std=c++11 -DGUID_LIBUUID
ar rvs libcrossguid.a guid.o $AR rvs libcrossguid.a guid.o
''; '';
installPhase = '' installPhase = ''
mkdir -p $out/{lib,include} mkdir -p $out/{lib,include}

View File

@ -2,6 +2,7 @@
, libXext, libdrm, libXfixes, wayland, libffi, libX11 , libXext, libdrm, libXfixes, wayland, libffi, libX11
, libGL, mesa , libGL, mesa
, minimal ? false, libva-minimal , minimal ? false, libva-minimal
, buildPackages
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -18,7 +19,7 @@ stdenv.mkDerivation rec {
outputs = [ "dev" "out" ]; outputs = [ "dev" "out" ];
nativeBuildInputs = [ autoreconfHook pkgconfig ]; nativeBuildInputs = [ autoreconfHook pkgconfig wayland ];
buildInputs = [ libdrm ] buildInputs = [ libdrm ]
++ lib.optionals (!minimal) [ libva-minimal libX11 libXext libXfixes wayland libffi libGL ]; ++ lib.optionals (!minimal) [ libva-minimal libX11 libXext libXfixes wayland libffi libGL ];
@ -29,6 +30,7 @@ stdenv.mkDerivation rec {
configureFlags = [ configureFlags = [
# Add FHS paths for non-NixOS applications. # Add FHS paths for non-NixOS applications.
"--with-drivers-path=${mesa.drivers.driverLink}/lib/dri:/usr/lib/dri:/usr/lib32/dri" "--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" ]; ] ++ lib.optionals (!minimal) [ "--enable-glx" ];
installFlags = [ installFlags = [

View File

@ -13,6 +13,11 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "format" ]; 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 = { meta = {
description = "An abstraction library for audio visualisations"; description = "An abstraction library for audio visualisations";
homepage = "https://sourceforge.net/projects/libvisual/"; homepage = "https://sourceforge.net/projects/libvisual/";

View File

@ -135,16 +135,10 @@ stdenv.mkDerivation rec {
experimentalFpMbStatsSupport || experimentalFpMbStatsSupport ||
experimentalEmulateHardwareSupport) "experimental") experimentalEmulateHardwareSupport) "experimental")
] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ ] ++ 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) # 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 # 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 # 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.isDarwin then
if stdenv.hostPlatform.osxMinVersion == "10.10" then "14" if stdenv.hostPlatform.osxMinVersion == "10.10" then "14"
else if stdenv.hostPlatform.osxMinVersion == "10.9" then "13" else if stdenv.hostPlatform.osxMinVersion == "10.9" then "13"

View File

@ -23,14 +23,14 @@ in stdenv.mkDerivation {
./2.6.2-cxx.patch ./2.6.2-cxx.patch
]; ];
preConfigure = "export LD=${if stdenv.isDarwin then "clang++" else "g++"}"; preConfigure = "export LD=${stdenv.cc.targetPrefix}c++";
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
NIX_CFLAGS_COMPILE = NIX_CFLAGS_COMPILE =
stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9"; stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9";
buildInputs = [ unzip ]; nativeBuildInputs = [ unzip ];
buildPhase = '' buildPhase = ''
# use STL (xbmc requires it) # use STL (xbmc requires it)
sed '1i#define TIXML_USE_STL 1' -i tinyxml.h sed '1i#define TIXML_USE_STL 1' -i tinyxml.h

View File

@ -12,8 +12,8 @@ stdenv.mkDerivation rec {
sha256 = "12n4mxc6db89258k8i47ql1zna7k94lkwv7lpxg39nm8ypa1ywrv"; sha256 = "12n4mxc6db89258k8i47ql1zna7k94lkwv7lpxg39nm8ypa1ywrv";
}; };
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig cmake ];
buildInputs = [ cmake python3 xlibsWrapper libxcb libXrandr libXext wayland ]; buildInputs = [ python3 xlibsWrapper libxcb libXrandr libXext wayland ];
enableParallelBuilding = true; enableParallelBuilding = true;
preConfigure = '' preConfigure = ''

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, cmake, pkgconfig, pugixml, wayland, libGL }: { stdenv, fetchFromGitHub, cmake, pkgconfig, pugixml, wayland, libGL, libffi, buildPackages }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "waylandpp"; pname = "waylandpp";
@ -11,8 +11,10 @@ stdenv.mkDerivation rec {
sha256 = "16h57hzd688664qcyznzhjp3hxipdkzgv46x82yhkww24av8b55n"; sha256 = "16h57hzd688664qcyznzhjp3hxipdkzgv46x82yhkww24av8b55n";
}; };
cmakeFlags = stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DWAYLAND_SCANNERPP=${buildPackages.waylandpp}/bin/wayland-scanner++";
nativeBuildInputs = [ cmake pkgconfig ]; nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [ pugixml wayland libGL ]; buildInputs = [ pugixml wayland libGL libffi ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Wayland C++ binding"; description = "Wayland C++ binding";

View File

@ -44,12 +44,12 @@ buildPythonPackage rec {
checkInputs = [ checkInputs = [
nose dbus dbus-python which pycodestyle pyflakes nose dbus dbus-python which pycodestyle pyflakes
pygobject3 bluez bluez.test networkmanager pygobject3 bluez (lib.getOutput "test" bluez) networkmanager
]; ];
checkPhase = '' checkPhase = ''
runHook preCheck runHook preCheck
export PATH="$PATH:${bluez.test}/test"; export PATH="$PATH:${lib.getOutput "test" bluez}/test";
nosetests -v nosetests -v
runHook postCheck runHook postCheck
''; '';

View File

@ -15,6 +15,8 @@
, enableNvidiaCgToolkit ? false, nvidia_cg_toolkit ? null , enableNvidiaCgToolkit ? false, nvidia_cg_toolkit ? null
, withVulkan ? stdenv.isLinux, vulkan-loader ? null , withVulkan ? stdenv.isLinux, vulkan-loader ? null
, fetchurl , fetchurl
, wayland
, libxkbcommon
}: }:
with stdenv.lib; with stdenv.lib;
@ -30,7 +32,7 @@ stdenv.mkDerivation rec {
rev = "v${version}"; rev = "v${version}";
}; };
nativeBuildInputs = [ pkgconfig ] nativeBuildInputs = [ pkgconfig wayland ]
++ optional withVulkan makeWrapper; ++ optional withVulkan makeWrapper;
buildInputs = [ ffmpeg freetype libxml2 libGLU libGL python3 SDL2 which ] buildInputs = [ ffmpeg freetype libxml2 libGLU libGL python3 SDL2 which ]
@ -38,7 +40,11 @@ stdenv.mkDerivation rec {
++ optional withVulkan vulkan-loader ++ optional withVulkan vulkan-loader
++ optionals stdenv.isDarwin [ libobjc AppKit Foundation ] ++ optionals stdenv.isDarwin [ libobjc AppKit Foundation ]
++ optionals stdenv.isLinux [ alsaLib libdrm libpulseaudio libv4l libX11 ++ 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; enableParallelBuilding = true;

View File

@ -9,9 +9,11 @@ stdenv.mkDerivation rec {
sha256 = "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"; sha256 = "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw";
}; };
nativeBuildInputs = [ pkgconfig ];
# ToDo: a52, etc.? # ToDo: a52, etc.?
buildInputs = buildInputs =
[ pkgconfig alsaLib libogg ] [ alsaLib libogg ]
++ lib.optional (libpulseaudio != null) libpulseaudio ++ lib.optional (libpulseaudio != null) libpulseaudio
++ lib.optional (libjack2 != null) libjack2; ++ lib.optional (libjack2 != null) libjack2;

View File

@ -11,9 +11,13 @@
, readline , readline
, systemd , systemd
, udev , udev
}: }: let
pythonPath = with python3.pkgs; [
stdenv.mkDerivation rec { dbus-python
pygobject3
recursivePthLoader
];
in stdenv.mkDerivation rec {
pname = "bluez"; pname = "bluez";
version = "5.54"; version = "5.54";
@ -22,12 +26,6 @@ stdenv.mkDerivation rec {
sha256 = "1p2ncvjz6alr9n3l5wvq2arqgc7xjs6dqyar1l9jp0z8cfgapkb8"; sha256 = "1p2ncvjz6alr9n3l5wvq2arqgc7xjs6dqyar1l9jp0z8cfgapkb8";
}; };
pythonPath = with python3.pkgs; [
dbus-python
pygobject3
recursivePthLoader
];
buildInputs = [ buildInputs = [
alsaLib alsaLib
dbus dbus
@ -44,7 +42,7 @@ stdenv.mkDerivation rec {
python3.pkgs.wrapPython python3.pkgs.wrapPython
]; ];
outputs = [ "out" "dev" "test" ]; outputs = [ "out" "dev" ] ++ lib.optional doCheck "test";
postPatch = '' postPatch = ''
substituteInPlace tools/hid2hci.rules \ substituteInPlace tools/hid2hci.rules \
@ -79,7 +77,7 @@ stdenv.mkDerivation rec {
doCheck = stdenv.hostPlatform.isx86_64; doCheck = stdenv.hostPlatform.isx86_64;
postInstall = '' postInstall = lib.optionalString doCheck ''
mkdir -p $test/{bin,test} mkdir -p $test/{bin,test}
cp -a test $test cp -a test $test
pushd $test/test pushd $test/test
@ -94,8 +92,8 @@ stdenv.mkDerivation rec {
ln -s ../test/$a $test/bin/bluez-$a ln -s ../test/$a $test/bin/bluez-$a
done done
popd popd
wrapPythonProgramsIn $test/test "$test/test $pythonPath" wrapPythonProgramsIn $test/test "$test/test ${toString pythonPath}"
'' + ''
# for bluez4 compatibility for NixOS # for bluez4 compatibility for NixOS
mkdir $out/sbin mkdir $out/sbin
ln -s ../libexec/bluetooth/bluetoothd $out/sbin/bluetoothd ln -s ../libexec/bluetooth/bluetoothd $out/sbin/bluetoothd

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, autoreconfHook, pkgconfig, libxslt, docbook_xsl { stdenv, fetchurl, autoreconfHook, pkgconfig, libxslt, docbook_xsl
, gtk3, udev, systemd , gtk3, udev, systemd, lib
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -44,6 +44,7 @@ stdenv.mkDerivation rec {
"--enable-pango" "--enable-pango"
"--enable-gdm-transition" "--enable-gdm-transition"
"--enable-gtk" "--enable-gtk"
"ac_cv_path_SYSTEMD_ASK_PASSWORD_AGENT=${lib.getBin systemd}/bin/systemd-tty-ask-password-agent"
]; ];
configurePlatforms = [ "host" ]; configurePlatforms = [ "host" ];

View File

@ -256,6 +256,15 @@ self: super:
libXres = super.libXres.overrideAttrs (attrs: { libXres = super.libXres.overrideAttrs (attrs: {
outputs = [ "out" "dev" "devdoc" ]; 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: { libXv = super.libXv.overrideAttrs (attrs: {

View File

@ -9,6 +9,7 @@ stdenv.mkDerivation {
cp ${builtins.toFile "config.h" customConfig} ./config.h cp ${builtins.toFile "config.h" customConfig} ./config.h
''; '';
nativeBuildInputs = [ ncurses ];
buildInputs = [ ncurses ]; buildInputs = [ ncurses ];
prePatch = '' prePatch = ''
@ -16,9 +17,7 @@ stdenv.mkDerivation {
--replace /usr/share/terminfo $out/share/terminfo --replace /usr/share/terminfo $out/share/terminfo
''; '';
installPhase = '' makeFlags = [ "PREFIX=$(out)" ];
make PREFIX=$out install
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Dynamic virtual terminal manager"; description = "Dynamic virtual terminal manager";

View File

@ -66,12 +66,12 @@ let
linux = pkgs.utillinux; linux = pkgs.utillinux;
}; };
getconf = { 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; else pkgs.netbsd.getconf;
darwin = pkgs.darwin.system_cmds; darwin = pkgs.darwin.system_cmds;
}; };
getent = { 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; else pkgs.netbsd.getent;
darwin = pkgs.netbsd.getent; darwin = pkgs.netbsd.getent;
}; };