charlesfleche/lpd8editor

Packaging for openSUSE (RPM format)

Closed this issue · 2 comments

Tried your project as an example to learn packaging for openSUSE, but I got really mad, because the application that the build process created was always relying on liblpd8editor-lib.so which was build but not packaged.

After a long journey, I noticed that there was just an install part for the app, but not for the lib.

So I applied this patch:

 cat lpd8editor.diff 
--- src/CMakeLists.txt.orig	2023-02-09 15:17:10.909817886 +0100
+++ src/CMakeLists.txt	2023-02-09 15:18:47.723100658 +0100
@@ -74,6 +74,13 @@
     ${ALSA_LIBRARIES}
 )
 
+install(
+  TARGETS
+    ${_lib}
+  DESTINATION
+    "${CMAKE_INSTALL_LIBDIR}"
+)
+
 add_executable(${_exe}
     main.cpp
     app_info.h.in

After that the package works using the shared ibrary that got installed now. Was never able to build a complete statically linked app.

Hi @rakoenig , and thank you for trying to make an openSUSE packet. The library was never intended to be shipped as-is: it's just a convenience for testing. As all tests are independent programs with their own main function, I split the real executable from a lib, so the lib can statically linked in each test. It is also statically linked in the main main executable.

If you look at the .tar.gz release, you'll notice that there is no lib, just an executable and a bunch of translation files. The DEB package is the same.

I'm using CPack to build releases as .deb and .tar.gz. The .deb is built on ubuntu-18.04 in the CI. If you manage to build an RPM with the current setup I'd be interested in a PR.

Looks like your Ubuntu-18.04 is building static libraries by default somehow.
After declaring the lib as STATIC in src/CMakeLists.txt I managed to create a statically linked binary.