Possible to override pango-sys version for gtk4?

Trying to install gtk4 crate on RHEL 9.4, which itself depends on the pango-sys crate, which is asking for >= 1.49 of pango when I cargo run. Unfortunately, RHEL 9.4 (the latest) only has 1.48 available.

New to Rust, so this might be a silly question. Is it possible to make my gtk4 dependency, which requires pango-sys as a dependecy, require version 1.48 of system pango?

Line of interest:

PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags pango pango >= 1.49.2

Full output:

[joshuasmartin@customer books]$ cargo build
   Compiling gobject-sys v0.18.0
   Compiling pango-sys v0.18.0
   Compiling cairo-sys-rs v0.18.2
   Compiling graphene-sys v0.18.1
   Compiling proc-macro-crate v1.3.1
The following warnings were emitted during compilation:

warning: pango-sys@0.18.0: 

error: failed to run custom build command for `pango-sys v0.18.0`

Caused by:
  process didn't exit successfully: `/home/joshuasmartin/Projects/books/target/debug/build/pango-sys-c6314bfa0a98a9ef/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=PANGO_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=
  pkg-config exited with status code 1
  > PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags pango pango >= 1.49.2

  The system library `pango` required by crate `pango-sys` was not found.
  The file `pango.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  PKG_CONFIG_PATH contains the following:
      - /usr/lib64/pkgconfig
      - /usr/share/pkgconfig

  HINT: you may need to install a package such as pango, pango-dev or pango-devel.

warning: build failed, waiting for other jobs to finish...

Resolved my issue by disabling pkg-config lookup of system-deps in the Cargo.toml and specifying the shared object name of pango according the instructions here:

Added the following lines to .bashrc and now the cargo run is successful:

export SYSTEM_DEPS_PANGO_NO_PKG_CONFIG="true"
export SYSTEM_DEPS_PANGO_LIB="pango-1.0"

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.