ximion / appstream

Tools and libraries to work with AppStream metadata
http://www.freedesktop.org/wiki/Distributions/AppStream/
GNU Lesser General Public License v2.1
212 stars 115 forks source link

"Optional" dependency is required #26

Closed BenWiederhake closed 8 years ago

BenWiederhake commented 8 years ago

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:

ximion commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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:

Recapitulation from the above thread:

ximion commented 8 years ago

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 commented 8 years ago

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