Stazed / rakarrack-plus

Rakarrack plus LV2s
GNU General Public License v2.0
36 stars 8 forks source link

More standardized CMake build script #20

Closed fpesari closed 3 years ago

fpesari commented 3 years ago

Hello,

I am building rakarrack-plus in a virtualized environment (Open Build System) and the current build is a bit uncomfortable, because it requires that an environment variable is set and that the lv2 directory already exists, which is not necessarily true in virtualized environments (which are built from scratch for every build, basically).

I did not submit a PR because my change was pretty substantial and you might want to think about an alternative. Here is my solution, which uses a CMAKE variable so that it can be passed via cmake -DLV2_PATH=...

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8efa0d56..7b9fa94d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -210,8 +210,8 @@ endif (BuildRakarrackPlus)
 if (BuildLV2Plugins)
     pkg_check_modules(LV2 REQUIRED lv2>=1.0.0)
     if (LV2_FOUND)
-        if (EXISTS $ENV{LV2_PATH})
-            set(LV2_INSTALL_DIR $ENV{LV2_PATH} CACHE PATH
+        if (DEFINED LV2_PATH)
+            set(LV2_INSTALL_DIR "${LV2_PATH}/RakarrackPlus.lv2" CACHE PATH
             "Specifies where the LV2 libraries should be installed")
         else()
             set(LV2_INSTALL_DIR lib/lv2/RakarrackPlus.lv2 CACHE PATH

Also, I think there was a typo in the first branch of the if because the LV2_PATH should not include the RakarrackPlus.lv2 child directory but should be the generic LV2 path, such as /usr/lib/lv2 or /usr/lib64/lv2

Stazed commented 3 years ago

Yep, it seems that ENV LV2_PATH is not used much. I checked ubuntu-studio, Manjaro(arch) as well. This explains why the missing sub-directory was not noticed by me or perhaps anyone else. Your solution makes sense to me, so I will make the change in the wip branch. Thanks!

fpesari commented 3 years ago

No probs! You can tag me if you need to know anything packaging-specific, I am no wizard but I've done some packages in my life :smile_cat: I've already published the openSUSE package for rakarrack-plus, by the way!

Stazed commented 3 years ago

Fixed In 1.1.0.