cannot cross compile application using maturin that uses gstreamer as dependency
Hi!
In the last couple of days I spent quite a lot of time in try to cross compile a rust project that uses maturin to create python bindings for a rust library that has gstreamer has dependency. Looks like may be related to #130 (closed).
After a couple of try and error I was able to figure out how to create whl package for x86_64-linux-gnu
:
maturin build --release --zig --strip --target x86_64-unknown-linux-gnu --features abi3 -- -C link-args="-L/usr/lib/x86_64-linux-gnu"
Afterwards I tried to build for aarch64, downloaded the cross compilation tools gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross
and then run:
maturin build --release --zig --strip --target aarch64-unknown-linux-gnu --features abi3 -- -C link-args="-L/usr/lib/aarch64-linux-gnu"
But this time did not work The following warnings were emitted during compilation:
warning: pkg-config has not been configured to support cross-compilation.
error: failed to run custom build command for
gstreamer-sys v0.20.0
Caused by: process didn't exit successfully:
/home/whatever/gst-reader/target/release/build/gstreamer-sys-682bafdcb98bc79f/build-script-build
(exit status: 1) --- stdout cargo:rerun-if-env-changed=GSTREAMER_1.0_NO_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64_unknown_linux_gnu cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS cargo:rerun-if-env-changed=PKG_CONFIG_aarch64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_aarch64_unknown_linux_gnu cargo:rerun-if-env-changed=TARGET_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64_unknown_linux_gnu cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR cargo:warning=pkg-config has not been configured to support cross-compilation.
The error is equal also for gobject-sys v0.17.4
, gio-sys v0.17.4
, gstreamer-app-sys v0.20.0
and glib-sys v0.17.4
.
Any idea about the error and the possible solution? I think is related to the fact that gstreamer is not installed for aarch64 but don't know how to solve it