diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c64939..9a79efa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,15 +5,33 @@ project(pipedal HOMEPAGE_URL "https://rerdavies.github.io/pipedal" ) -execute_process( COMMAND dpkg --print-architecture COMMAND tr -d '\n' OUTPUT_VARIABLE DEBIAN_ARCHITECTURE ) - set (DISPLAY_VERSION "PiPedal v2.0.105-Release") -set (PACKAGE_ARCHITECTURE ${DEBIAN_ARCHITECTURE}) -set (CMAKE_INSTALL_PREFIX "/usr/") + +option(PIPEDAL_DISABLE_COPYRIGHT_BUILD "Skip generation of copyright notices (use on non-Debian distros)" OFF) +option(PIPEDAL_EXCLUDE_TESTS "Exclude test targets from default build" OFF) set(PIPEDAL_T3K_PUBLISHABLE_KEY "t3k_pub_bHrH8btdwXXTtxz5ryEU8sNLF-2TGRT9") +# Determine Debian-compatible architecture name (portable across distros) +if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + set(DEBIAN_ARCHITECTURE "amd64") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + set(DEBIAN_ARCHITECTURE "arm64") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7l") + set(DEBIAN_ARCHITECTURE "armhf") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i686") + set(DEBIAN_ARCHITECTURE "i386") +else() + execute_process(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE UNAME_M) + message(FATAL_ERROR "Cannot determine Debian architecture from CMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR} (uname -m: ${UNAME_M})") +endif() +message(STATUS "DEBIAN_ARCHITECTURE=${DEBIAN_ARCHITECTURE}") + +set (PACKAGE_ARCHITECTURE ${DEBIAN_ARCHITECTURE}) +set (CMAKE_INSTALL_PREFIX "/usr/") + + set (LIBZIP_DO_INSTALL OFF CACHE BOOL "Disable libzip install" FORCE) set (SQLITECPP_INSTALL OFF CACHE BOOL "Disable SQLiteCpp install" FORCE) @@ -24,8 +42,6 @@ set(CPACK_SOURCE_IGNORE_FILES "*.a;sqlite3.h;$(CPACK_SOURCE_IGNORE_FILES)" ) - -set (PIPEDAL_EXCLUDE_TESTS false) include(CTest) enable_testing() diff --git a/PiPedalCommon/src/CMakeLists.txt b/PiPedalCommon/src/CMakeLists.txt index 6829869..40a58c8 100644 --- a/PiPedalCommon/src/CMakeLists.txt +++ b/PiPedalCommon/src/CMakeLists.txt @@ -97,7 +97,7 @@ add_library(PiPedalCommon STATIC ss.hpp ) target_include_directories(PiPedalCommon PUBLIC "include" ${LIBNL3_INCLUDE_DIRS}) -target_link_libraries(PiPedalCommon PUBLIC ${LIBNL3_LIBRARIES} sdbus-c++-objlib +target_link_libraries(PiPedalCommon PUBLIC ${LIBNL3_LIBRARIES} sdbus-c++-objlib asound ) diff --git a/PiPedalCommon/src/DBusDispatcher.cpp b/PiPedalCommon/src/DBusDispatcher.cpp index e440552..d80dfec 100644 --- a/PiPedalCommon/src/DBusDispatcher.cpp +++ b/PiPedalCommon/src/DBusDispatcher.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "ss.hpp" #include #include diff --git a/docs/BuildPrerequisites.md b/docs/BuildPrerequisites.md index 1b6257f..7f95978 100644 --- a/docs/BuildPrerequisites.md +++ b/docs/BuildPrerequisites.md @@ -17,7 +17,8 @@ If your distribution doesn't provide a suitable version of nodejs, please refer to the `node.js` website for instructions on [how to install the latest version of `node.js`](https://nodejs.org/en/download) directly. Run the following commands to install dependent libraries required by the PiPedal build. - + +Ubuntu: sudo apt update sudo apt upgrade @@ -27,6 +28,27 @@ Run the following commands to install dependent libraries required by the PiPeda libsdbus-c++-dev libzip-dev google-perftools \ libgoogle-perftools-dev \ libpipewire-0.3-dev libbz2-dev libssl-dev librsvg2-dev + +Arch: + + sudo pacman -S --needed lilv boost systemd catch2 alsa-lib \ + util-linux avahi networkmanager icu libzip gperftools \ + pipewire bzip2 openssl librsvg sdbus-cpp + + There is one AUR package: + sudo paru -S authbind + +Note: in Arch, tests and copyright notices won't work, so they need to be disabled with cmake arguments. Add this to your .vscode/settings.json file: + +```json +{ + "cmake.configureSettings": { + "PIPEDAL_EXCLUDE_TESTS": "ON", + "DISABLE_COPYRIGHT_BUILD": "ON" + }, + ... +} +``` ### Installing Sources diff --git a/lv2/x86_64/unpackArtifact.sh b/lv2/x86_64/unpackArtifact.sh index a01412f..68f101d 100755 --- a/lv2/x86_64/unpackArtifact.sh +++ b/lv2/x86_64/unpackArtifact.sh @@ -1,7 +1,20 @@ #!/usr/bin/bash rm -rf build/lv2_x64 -mkdir build/lv2_x64 +mkdir -p build/lv2_x64/pkg -mkdir build/lv2_x64/pkg -dpkg-deb -x lv2/x86_64/toobamp_*_amd64.deb build/lv2_x64/pkg \ No newline at end of file +# Extract .deb using ar + tar (portable, no dpkg-deb needed) +cd build/lv2_x64 +ar x ../../lv2/x86_64/toobamp_*_amd64.deb +if [ -f data.tar.zst ]; then + tar --zstd -xf data.tar.zst -C pkg +elif [ -f data.tar.xz ]; then + tar -xJf data.tar.xz -C pkg +elif [ -f data.tar.gz ]; then + tar -xzf data.tar.gz -C pkg +else + echo "Error: cannot find data.tar.* in the .deb package" + exit 1 +fi +rm -f control.tar.* data.tar.* debian-binary +cd "$OLDPWD" \ No newline at end of file diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 69fcf98..bf4c571 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -25,5 +25,7 @@ option(BUILD_REGRESS "Build regression tests" OFF) option(BUILD_OSSFUZZ "Build fuzzers for ossfuzz" OFF) option(BUILD_EXAMPLES "Build examples" OFF) option(BUILD_DOC "Build documentation" OFF) +# Ensure BUILD_SHARED_LIBS is ON for libzip (SQLiteCpp may have set it OFF) +set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries (.so) instead of static ones (.a)" FORCE) add_subdirectory("libzip") diff --git a/modules/websocketpp b/modules/websocketpp index 508c9b5..e6df114 160000 --- a/modules/websocketpp +++ b/modules/websocketpp @@ -1 +1 @@ -Subproject commit 508c9b5e404df2249e6f0590bc12bd9912889ba4 +Subproject commit e6df114a1a1ba83038a0c5a71985c0e294190fb2 diff --git a/src/AuxInTest.cpp b/src/AuxInTest.cpp index 3fbfd76..a729ac8 100644 --- a/src/AuxInTest.cpp +++ b/src/AuxInTest.cpp @@ -19,6 +19,7 @@ #include "AuxIn.hpp" +#include using namespace pipedal; int main(int argc, char**argv) { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f9f02d6..f8a8f36 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -155,8 +155,20 @@ else() set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -Wno-psabi") endif() -execute_process( COMMAND dpkg --print-architecture COMMAND tr -d '\n' OUTPUT_VARIABLE DEBIAN_ARCHITECTURE ) -message(STATUS DEBIAN_ARCHITECTURE="${DEBIAN_ARCHITECTURE}") +# Determine Debian-compatible architecture name (portable across distros) +if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + set(DEBIAN_ARCHITECTURE "amd64") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + set(DEBIAN_ARCHITECTURE "arm64") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7l") + set(DEBIAN_ARCHITECTURE "armhf") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i686") + set(DEBIAN_ARCHITECTURE "i386") +else() + execute_process(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE UNAME_M) + message(FATAL_ERROR "Cannot determine Debian architecture from CMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR} (uname -m: ${UNAME_M})") +endif() +message(STATUS "DEBIAN_ARCHITECTURE=${DEBIAN_ARCHITECTURE}") add_compile_definitions(DEBIAN_ARCHITECTURE="${DEBIAN_ARCHITECTURE}") @@ -856,8 +868,8 @@ elseif(EXISTS "/usr/share/doc/libboost1.71-dev") set (BOOST_COPYRIGHT_DIR "libboost1.71-dev") elseif(EXISTS "/usr/share/doc/libboost1.67-dev") set (BOOST_COPYRIGHT_DIR "libboost1.67-dev") -else() - message(FATAL_ERROR "Boost libary version has changed. Please update me.") +# else() +# message(FATAL_ERROR "Boost libary version has changed. Please update me.") endif() @@ -871,10 +883,12 @@ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Updating copyright notices." ) -add_custom_target ( - CopyrightBuild ALL - DEPENDS ${REACT_NOTICES_FILE} -) +if(NOT PIPEDAL_DISABLE_COPYRIGHT_BUILD) + add_custom_target ( + CopyrightBuild ALL + DEPENDS ${REACT_NOTICES_FILE} + ) +endif() if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.31) cmake_policy(SET CMP0177 NEW) diff --git a/src/ModFileTypes.cpp b/src/ModFileTypes.cpp index 500a9e9..6c48823 100644 --- a/src/ModFileTypes.cpp +++ b/src/ModFileTypes.cpp @@ -21,6 +21,7 @@ #include "util.hpp" #include #include +#include #include "ss.hpp" #include "MimeTypes.hpp" diff --git a/src/kconfigMain.cpp b/src/kconfigMain.cpp index f8d1b5a..1365a9e 100644 --- a/src/kconfigMain.cpp +++ b/src/kconfigMain.cpp @@ -55,6 +55,7 @@ #include #include "BootConfig.hpp" #include +#include #include "CommandLineParser.hpp" #include "PrettyPrinter.hpp" #include "SysExec.hpp"