Compare commits

...

2 Commits

Author SHA1 Message Date
Colin b0b57ad3c7 ffado: support cross compilation 2024-04-27 19:23:49 +00:00
Colin f59a0e42ec dbus-cplusplus: support cross compilation
building examples requires executing a `dbusxx-xml2cpp` helper which is
built earlier in the build process (for the host architecture), with no
easy way to patch it for the correct architecture, so disable examples.
2024-04-27 17:41:24 +00:00
3 changed files with 34 additions and 14 deletions

View File

@ -52,7 +52,12 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config ];
buildInputs = [ dbus glib expat ];
configureFlags = [ "--disable-ecore" "--disable-tests" ];
configureFlags = [
"--disable-ecore"
"--disable-tests"
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
"--disable-examples"
];
meta = with lib; {
homepage = "https://dbus-cplusplus.sourceforge.net";

View File

@ -1,6 +1,5 @@
{ lib
, stdenv
, mkDerivation
, argp-standalone
, dbus
, dbus_cplusplus
@ -16,16 +15,18 @@
, libxmlxx3
, pkg-config
, python3
, qt5
, scons
, which
, wrapQtAppsHook
# only build the mixer for environments supported by qt5
, withMixer ? stdenv.buildPlatform == stdenv.targetPlatform
}:
let
inherit (python3.pkgs) pyqt5 dbus-python;
python = python3.withPackages (pkgs: with pkgs; [ pyqt5 dbus-python ]);
inherit (python3.pkgs) pyqt5;
python = python3.withPackages (pkgs: with pkgs; [ dbus-python ] ++ lib.optionals withMixer [ pyqt5 ]);
in
mkDerivation rec {
stdenv.mkDerivation rec {
pname = "ffado";
version = "2.4.8";
@ -53,6 +54,19 @@ mkDerivation rec {
})
];
postPatch = ''
# prevent build tools from leaking into closure
substituteInPlace support/tools/SConscript --replace-fail \
'support/tools/ffado-diag --static' \
"echo 'See `nix-store --query --tree ${placeholder "out"}`.'"
'' + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
substituteInPlace SConstruct \
--replace-fail 'conf.CompilerCheck()' 'True' \
--replace-fail "pkg-config" "$PKG_CONFIG"
substituteInPlace admin/pkgconfig.py \
--replace-fail "pkg-config" "$PKG_CONFIG"
'';
outputs = [ "out" "bin" "dev" ];
nativeBuildInputs = [
@ -61,22 +75,26 @@ mkDerivation rec {
pkg-config
which
python
] ++ lib.optionals withMixer [
pyqt5
wrapQtAppsHook
qt5.wrapQtAppsHook
];
prefixKey = "PREFIX=";
sconsFlags = [
"CUSTOM_ENV=True" # tell SConstruct to use nixpkgs' CC/CXX/CFLAGS
"DETECT_USERSPACE_ENV=False"
"DEBUG=False"
"ENABLE_ALL=True"
"BUILD_TESTS=True"
"WILL_DEAL_WITH_XDG_MYSELF=True"
"BUILD_MIXER=True"
"UDEVDIR=${placeholder "out"}/lib/udev/rules.d"
"PYPKGDIR=${placeholder "out"}/${python3.sitePackages}"
"BINDIR=${placeholder "bin"}/bin"
"INCLUDEDIR=${placeholder "dev"}/include"
"PYTHON_INTERPRETER=${python.interpreter}"
] ++ lib.optionals withMixer [
"BUILD_MIXER=True"
];
buildInputs = [
@ -98,19 +116,16 @@ mkDerivation rec {
enableParallelBuilding = true;
dontWrapQtApps = true;
postInstall = ''
postInstall = lib.optionalString withMixer ''
desktop="$bin/share/applications/ffado-mixer.desktop"
install -DT -m 444 support/xdg/ffado.org-ffadomixer.desktop $desktop
substituteInPlace "$desktop" \
--replace Exec=ffado-mixer "Exec=$bin/bin/ffado-mixer" \
--replace hi64-apps-ffado ffado-mixer
install -DT -m 444 support/xdg/hi64-apps-ffado.png "$bin/share/icons/hicolor/64x64/apps/ffado-mixer.png"
# prevent build tools from leaking into closure
echo 'See `nix-store --query --tree ${placeholder "out"}`.' > $out/lib/libffado/static_info.txt
'';
preFixup = ''
preFixup = lib.optionalString withMixer ''
wrapQtApp $bin/bin/ffado-mixer
'';

View File

@ -27199,7 +27199,7 @@ with pkgs;
fatrace = callPackage ../os-specific/linux/fatrace { };
ffado = libsForQt5.callPackage ../os-specific/linux/ffado {
ffado = callPackage ../os-specific/linux/ffado {
inherit (linuxPackages) kernel;
};
libffado = ffado;