From 5fae042ca5c42dd9f59a37fc323b998d56b1ffc8 Mon Sep 17 00:00:00 2001 From: Ian Liu Rodrigues Date: Wed, 20 Oct 2021 09:35:15 -0300 Subject: [PATCH 1/2] Fix install path of udev rules on linux The previous install method didn't obey the `DESTDIR` make variable, used to make packages in a different root tree; it was silently failing to install if no permissions were given. Also, the install destination was not standard, since packages should place their udev rules at `lib/udev/rules.d`, while the `/etc` prefix is reserved for custom system modifications. This patch fixes both issues. --- CMakeLists.txt | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed3167a3..f2d60efb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,17 +115,15 @@ install(TARGETS headsetcontrol DESTINATION bin) # install udev files on linux if(UNIX AND NOT APPLE) - set (program_cmd headsetcontrol) - set (program_arg "-u") - set (program_output "/etc/udev/rules.d/70-headsets.rules") - install( CODE - " - execute_process(COMMAND ${program_cmd} ${program_arg} - OUTPUT_FILE ${program_output}) - - message(STATUS \"Installed udev rules to ${program_output}\") - " - ) + set(rules_file 70-headsets.rules) + add_custom_command( + OUTPUT ${rules_file} + COMMAND headsetcontrol -u > ${rules_file} + DEPENDS headsetcontrol) + add_custom_target(udevrules ALL DEPENDS ${rules_file}) + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/${rules_file} + DESTINATION lib/udev/rules.d/) endif() From 6a8987c93ec61a88ce7f8a9b65d1758544564dec Mon Sep 17 00:00:00 2001 From: Denis Arnst Date: Sun, 24 Oct 2021 01:07:40 +0200 Subject: [PATCH 2/2] CI: Pin version of lukka/run-cmake to v3 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6180cb47..89ded00a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: run: find $RUNNER_WORKSPACE shell: bash - name: Run CMake with Ninja - uses: lukka/run-cmake@main + uses: lukka/run-cmake@v3 id: runcmake with: cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'