AyatanaIndicators / libayatana-common

Shared Library for common functions required by the Ayatana System Indicators
GNU General Public License v3.0
0 stars 2 forks source link

Fails to install gir file #53

Closed z3ntu closed 2 years ago

z3ntu commented 2 years ago

I get this when building with gobject-introspection-1.0 available in the make install phase. Grepping through the build directory I cannot find traces of the add_custom_command stuff from https://github.com/AyatanaIndicators/libayatana-common/blob/main/src/CMakeLists.txt#L34

cmake version 3.21.3 if that matters

CMake Error at build/src/cmake_install.cmake:139 (file):
  file INSTALL cannot find
  "/home/pmos/build/src/libayatana-common-0.9.5/build/src/AyatanaCommon-0.0.gir":
  No such file or directory.
Call Stack (most recent call first):
  build/cmake_install.cmake:47 (include)
z3ntu commented 2 years ago

This patch helps (vala bindings probably also need this but I'm not building them (yet))

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3e4d529..5763d91 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -50,6 +50,8 @@ if (INTROSPECTION_FOUND)
         --output "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.0.gir"
     )

+    add_custom_target(AyatanaCommon-0.0.gir ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.0.gir")
+
     install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.0.gir" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/gir-1.0")

 # AyatanaCommon.typelib
@@ -65,6 +67,8 @@ if (INTROSPECTION_FOUND)
         -o "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.0.typelib"
     )

+    add_custom_target(AyatanaCommon-0.0.typelib ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.0.typelib")
+
     install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaCommon-0.0.typelib" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/girepository-1.0")

 # AyatanaCommon.vapi

From what I could piece together online, add_custom_command itself doesn't really do anything and you have to use it with something else, e.g. add_custom_target which actually puts it into the Makefile.

No clue how this works for you on other distros.

edit: vala bindings are actually fine, they get added to a target here https://github.com/AyatanaIndicators/libayatana-common/blob/main/src/CMakeLists.txt#L85

tari01 commented 2 years ago

Yes, I originally made gobject-introspection and vala hard dependencies. As thinks changed over time, we got a situation where the gir + typelib stuff does not get built if there is no vala to depend on those targets.

Can I ask you to check out https://github.com/AyatanaIndicators/libayatana-common/pull/54 and tell me if this fixes the issue?

Thanks.

sunweaver commented 2 years ago

@z3ntu: any feedback on #54?

tari01 commented 2 years ago

@z3ntu: any feedback on #54?

There is feedback in https://github.com/AyatanaIndicators/libayatana-common/pull/54 itself.