Skip to content

pkg-config: to support or not? #12

Closed

Description

@springmeyer

pkg-config is useful when it works. Yet it has serious problems, including:

  • It is written in C so the binary is arch-dependent making its use in a cross-compiled environment painful at best or impossible without resorting to www.qemu.org tricks.
  • It appears to have bugs when built 32bit and run on a 64 bit OS X: No package 'freetype2' found mapnik/mapnik-packaging#134 (comment)
  • It generates hard-coded/absolute paths in the .pc files making tarballs of built artifacts hard to share in a portable way.

We need to care about pkg-config in two ways:

  • pkg-config may be a build dependency for Mason source compiles (e.g. harfbuzz needs pkg-config to find freetype)
  • apps that depend on mason packages may call out to pkg-config like mapbox-gl-native

So I think we have two options:

workarounds

Workaround all the limitations by:

  • Source compiles:
    • compiling and using only the host arch of pkg-config when cross-compiling (like this mess)
    • Require that the host machine have pkg-config already installed. (Note: this would be simple but I've avoided it because the HOST pkg-config is going to be looking by default in the wrong place for dependencies and even after setting PKG_CONFIG_PATH the wrong dependencies might get picked up).
  • Binary install:
    • overriding the hardcoded paths by using --define-variable=prefix, etc.
    • provide our own fake pkg-config shell script that provides the right things either by wrapping pkg-config or truly faking it

ban pkg-config

Or we could try to purge all dependence on pkg-config by:

  • patching or otherwise avoiding the need for pkg-config when building any deps that depend on it
  • having the mason itself be a build dependency of apps that use its tarballs and something like mason --libs libuv could replace pkg-config --libs libuv, or;
  • just ensure a very sane layout of lib and include folders that apps using mason packages could easily predict.

Refs:

Activity

  1. springmeyer commented on Oct 14, 2014

    @springmeyer
    ContributorAuthor

    the tl;dr of this issue is that I'd like to try to ban pkg-config because I don't want to go down yet another rabbit hole of trying to get it to work (mapnik/mapnik-packaging#134 (comment)).

  2. springmeyer commented on Nov 10, 2016

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions