Skip to content

feat(debian): install rofd-ffi.pc in librofd-ffi-dev - #12

Merged
lzwind merged 1 commit into
linuxdeepin:mainfrom
YangtseSu:feat/pkgconfig
Oct 19, 2026
Merged

lzwind merged 1 commit into
linuxdeepin:mainfrom
YangtseSu:feat/pkgconfig

Conversation

@YangtseSu

@YangtseSu YangtseSu commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Motivation. The released ABI ships no pkg-config metadata, so consumers
cannot discover the include directory, the library or the version. In practice
they hardcode paths (our papers-ofd backend has to carry
-Drofd_libdir=... -Drofd_includedir=...) and have no way to express "I need
the ABI as of 0.4.2 or newer".

Behaviour. librofd-ffi-dev now installs
/usr/lib/<multiarch>/pkgconfig/rofd-ffi.pc, generated from
debian/rofd-ffi.pc.in at build time:

  • Version: is the Debian version (dpkg-parsechangelog -SVersion), i.e. the
    release identifier — the Cargo crate version currently lags the release train
    (crates/rofd-ffi/Cargo.toml still says 0.4.0 while the package is 0.4.3), and
    consumers compare against the release;
  • Requires: cairo because rofd.h includes <cairo.h> — this matches the
    existing libcairo2-dev dependency of the -dev package;
  • Libs: -lrofd_ffi, the linker symlink the package already installs.

With it a Meson consumer can say
dependency('rofd-ffi', version: '>= 0.4.2') and both the paths and the version
check come from the metadata.

Verification (done on a non-Debian host, so dpkg-buildpackage itself was
not run here):

# substitution, as debian/rules performs it:
sed -e 's/@VERSION@/0.4.3/' -e 's/@MULTIARCH@/x86_64-linux-gnu/' \
    debian/rofd-ffi.pc.in > .../pkgconfig/rofd-ffi.pc
PKG_CONFIG_PATH=... pkg-config --modversion rofd-ffi   # 0.4.3
PKG_CONFIG_PATH=... pkg-config --libs rofd-ffi         # -L/usr/lib/x86_64-linux-gnu -lrofd_ffi -lcairo
PKG_CONFIG_PATH=... pkg-config --validate rofd-ffi     # no warnings for this file

Recipe lines were checked to start with a tab (cat -A). The same file is
already shipped by the AUR librofd-ffi package, so the two packaging paths
stay in sync.

Summary by Sourcery

Add Debian pkg-config metadata so consumers can discover and version-check the rofd-ffi ABI without hardcoded paths.

New Features:

  • Install pkg-config metadata for librofd-ffi-dev, exposing the library, include path, Cairo dependency, and Debian release version to consumers.

Build:

  • Generate and install rofd-ffi.pc in the multiarch pkg-config directory during the Debian package build.

Consumers currently have to hardcode the library directory and guess the
version: the released ABI has no pkg-config metadata, so e.g. Meson projects
carry -Drofd_libdir/-Drofd_includedir by hand and cannot check the version
they build against.

Ship a rofd-ffi.pc from librofd-ffi-dev. The template is filled in at build
time with the Debian version (the release identifier; the Cargo crate version
lags the release train) and DEB_HOST_MULTIARCH, and declares Requires: cairo
because rofd.h includes <cairo.h> (matching the existing libcairo2-dev
dependency) and -lrofd_ffi for the linker symlink the package already ships.

Verification (on a non-Debian host, so dpkg-buildpackage itself was not run):
- recipe indentation checked with cat -A (all recipe lines start with TAB)
- substitution and metadata checked by running the same sed with
  @Version@=0.4.3 and @multiarch@=x86_64-linux-gnu:
  Version: 0.4.3; Requires: cairo; Libs: -L/usr/lib/x86_64-linux-gnu -lrofd_ffi
  and `pkg-config --libs` yields -L/usr/lib/x86_64-linux-gnu -lrofd_ffi -lcairo
- `pkg-config --validate` reports nothing for the generated file
@sourcery-ai

sourcery-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The Debian packaging now generates and installs rofd-ffi.pc in librofd-ffi-dev, allowing consumers to discover the multiarch include/library paths, link against rofd_ffi and Cairo, and enforce a minimum release version via pkg-config.

File-Level Changes

Change Details Files
Add and install pkg-config metadata for the Debian development package.
  • Define the package name, Debian release version, multiarch library path, Cairo dependency, and linker flag in a template.
  • Generate the file during the Debian build using the changelog version and architecture substitution.
  • Install it under the multiarch pkg-config directory as part of the development package.
debian/rofd-ffi.pc.in
debian/rules

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot

Copy link
Copy Markdown

Hi @YangtseSu. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@YangtseSu

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA.

@lzwind
lzwind merged commit 2f5013d into linuxdeepin:main Oct 19, 2026
12 of 13 checks passed
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, YangtseSu

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants