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

"Optional" dependency is required #26

Closed
BenWiederhake opened this issue Feb 18, 2016 · 6 comments
Closed

"Optional" dependency is required #26

BenWiederhake opened this issue Feb 18, 2016 · 6 comments

Comments

@BenWiederhake
Copy link

In README.md, it says:

#### Optional
 * Vala Compiler (vapigen) (for Vala VAPI file)
 * libyaml (for DEP-11 support)

However, cd build && cmake .. doesn't work without yaml-dev in place:

-- Checking for module 'yaml-0.1'
--   Package 'yaml-0.1' not found
CMake Error at /usr/share/cmake-3.4/Modules/FindPkgConfig.cmake:360 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.4/Modules/FindPkgConfig.cmake:522 (_pkg_check_modules_internal)
  src/CMakeLists.txt:86 (pkg_check_modules)

I can see two ways to resolve this:

  • Make it a required dependency
  • Let it stay an optional dependency, and extend the line by something like Run cmake --no-yaml to build without this.
@ximion
Copy link
Owner

ximion commented Feb 18, 2016

libyaml is optional, but highly recommended, which is why it's enabled by default.
Do you also get this error if you pass -DDEP11=OFF to cmake (if so, then it's a bug, otherwise it is working as intended)?

@BenWiederhake
Copy link
Author

Can't test this anymore; I just installed yaml after seeing the error, and wrote this issue while waiting on the installation.

Next note: the list of requirements doesn't list xmlto (has nothing to do with libxml2), but it seems to be required.

@ximion
Copy link
Owner

ximion commented Feb 18, 2016

That I can add - it's technically just required for the manual pages, but since we always build them...
I will test if the DEP11 flag still works, but I am pretty sure it does :)

@BenWiederhake
Copy link
Author

Thanks for your patience btw :)

And another issue with the dependencies. (Do you consider these to be different "issues", or can I just continue and keep the discussion somewhat linear here?)

I have gobject-introspection installed. When running cd build && rm -rf * && cmake .., I get this output:

[SNIP]
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
-- Found GLIB2: /usr/lib/x86_64-linux-gnu/libglib-2.0.so (Required is at least version "2.46") 
-- Checking for module 'gio-2.0'
--   Found gio-2.0, version 2.46.2
-- Checking for module 'gobject-introspection-1.0'
--   Package 'gobject-introspection-1.0' not found
[SNIP]
-- Configuring done
-- Generating done
-- Build files have been written to: /home/eispin/workspace/appstream/build

It appears to be somewhat successful. Exit code is 0, "successful".
However, when running make it fails:

[SNIP]
[ 21%] Built target appstream
Scanning dependencies of target gir-girs
[ 22%] Generating AppStream-1.0.gir
/bin/sh: 1: --identifier-prefix=As: not found
src/CMakeFiles/gir-girs.dir/build.make:95: recipe for target 'src/AppStream-1.0.gir' failed
make[2]: *** [src/AppStream-1.0.gir] Error 127
CMakeFiles/Makefile2:158: recipe for target 'src/CMakeFiles/gir-girs.dir/all' failed
make[1]: *** [src/CMakeFiles/gir-girs.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

I guess that some variable that was supposed to contain a gobject-introspection command is empty, and sh attempts to call the first argument as an executable.

Anyway. The problem is: The package is actually called libgirepository1.0-dev.

Now I can finally say what I propose to change:

  • Force cmake to throw an error when girepository is missing (no idea how and where to detect that).
  • Add a note in the README like (including girepository. Note: on your OS this might be a separate package.)

Recapitulation from the above thread:

  • list xmlto in the required dependencies
  • do something with libyaml (although of course it was my fault for missing the later parts of the README, which clearly say that libyaml is required.)

@ximion
Copy link
Owner

ximion commented Feb 18, 2016

Eww... Right, cmake should fail if the GIR stuff is missing, I will fix that.
As for adding a warning that things might be in different packages: I would rather not want to clutter the README with that info, as it's pretty much obvious and won't provide any useful information - distros package things in all kind of random ways, there might even be three packages for a dependency.
What does make sense though is e.g. including an example RPM specfile and the like.
Looks like you're on some Debian-based distro btw, in that case simply run sudo apt build-dep appstream to get all the build dependencies ;-)

@BenWiederhake
Copy link
Author

Argh! How could I forget apt build-dep! Yeah, you're right.

@ximion ximion closed this as completed in 392182f Feb 27, 2016
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

No branches or pull requests

2 participants