Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve pkg config #128

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Apteryks
Copy link

I think this is an improvement on the current state of things.

I haven't successfully built Inkscape with it yet, but it seems the issue may be more with my packaging of Inkscape or its build system.

* configure.ac: Record the computed Requires.private values in the
REQUIRES_PRIVATE configure variable.
* autotrace.pc.in: Use it as the value for a new Requires.private
field.  Remove Libs.private and extraneous flags from Cflags.

Fixes: autotrace#124
@Apteryks
Copy link
Author

I'm investigating why CMake prints the following as part of the Inkscape build, following this change:

-- Checking for module 'autotrace'
--   Found autotrace, version 0.40.0
Package pstoedit was not found in the pkg-config search path.
Perhaps you should add the directory containing `pstoedit.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pstoedit', required by 'autotrace', not found
Package pstoedit was not found in the pkg-config search path.
Perhaps you should add the directory containing `pstoedit.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pstoedit', required by 'autotrace', not found
Package pstoedit was not found in the pkg-config search path.
Perhaps you should add the directory containing `pstoedit.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pstoedit', required by 'autotrace', not found
Package pstoedit was not found in the pkg-config search path.
Perhaps you should add the directory containing `pstoedit.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pstoedit', required by 'autotrace', not found
Package pstoedit was not found in the pkg-config search path.
Perhaps you should add the directory containing `pstoedit.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pstoedit', required by 'autotrace', not found
Package pstoedit was not found in the pkg-config search path.
Perhaps you should add the directory containing `pstoedit.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pstoedit', required by 'autotrace', not found
Package pstoedit was not found in the pkg-config search path.
Perhaps you should add the directory containing `pstoedit.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pstoedit', required by 'autotrace', not found
Package pstoedit was not found in the pkg-config search path.
Perhaps you should add the directory containing `pstoedit.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pstoedit', required by 'autotrace', not found
Package pstoedit was not found in the pkg-config search path.
Perhaps you should add the directory containing `pstoedit.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pstoedit', required by 'autotrace', not found
Package pstoedit was not found in the pkg-config search path.
Perhaps you should add the directory containing `pstoedit.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pstoedit', required by 'autotrace', not found

This is emitted when pkg_check_modules(INKSCAPE_DEP REQUIRED autotrace) is used in its CMakeScripts/DefineDependsandFlags.cmake file.

@Apteryks
Copy link
Author

That's probably expected and non-fatal; CMake invokes both pkg-config with and without --static, to gather its data.

@Apteryks
Copy link
Author

Funny, the freedesktop pkg-config when called with --static fails:

-- Checking for modules 'autotrace;2geom;harfbuzz;pangocairo>=1.44;pangoft2;fontconfig;gsl;gmodule-2.0;libsoup-2.4>=2.42;bdw-gc;lcms2'
--   Package 'pstoedit', required by 'autotrace', not found
CMake Error at /gnu/store/1fzd3ak386lgv7zl28j7zqkviv8wkz8d-cmake-minimal-3.24.2/share/cmake-3.24/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found
Call Stack (most recent call first):
  /gnu/store/1fzd3ak386lgv7zl28j7zqkviv8wkz8d-cmake-minimal-3.24.2/share/cmake-3.24/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)
  CMakeScripts/DefineDependsandFlags.cmake:122 (pkg_check_modules)
  CMakeLists.txt:146 (include)


-- Configuring incomplete, errors occurred!
See also "/tmp/guix-build-inkscape-1.3.2.drv-0/build/CMakeFiles/CMakeOutput.log".

pkgconf doesn't fail, perhaps for this use case. I'll raise the issue with CMake.

@Apteryks
Copy link
Author

Apteryks commented Feb 21, 2024

Here's the report I've sent to CMake: https://gitlab.kitware.com/cmake/cmake/-/issues/25692

@lemenkov
Copy link
Member

@Apteryks doesn't pass the tests. Could you please take a look?

Otherwise, libraries linking to libautotrace.so would not find the
symbols needed (in a situation where the .la file is not used and it
is expected that a RUNPATH was written to the ELF object of the
library).

* Makefile.am (autotrace_LDADD): Move library link directives to...
(libautotrace_la_LDFLAGS): ... here.
(autotrace_LDFLAGS): New variable.

Relates-to: autotrace#124
@Apteryks
Copy link
Author

Apteryks commented Feb 22, 2024

@Apteryks doesn't pass the tests. Could you please take a look?

Hi! Weird, since it works on my Guix system. Perhaps the ld wrapper used in Guix that adds -rpath arguments for each library directory corresponding to each linked library is the reason.

I've added this line to the Makefile.am:

autotrace_LDFLAGS = $(GLIB2_LIBS)

noting that src/main.c uses glib too. I hope it resolves it!

@lemenkov lemenkov added this to the 0.31.11 milestone Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants