Upgraded alpine images

This commit is contained in:
emeric
2024-04-27 15:16:03 +02:00
parent 2e24cf5fab
commit 1a9b392a71
16 changed files with 82 additions and 77 deletions
+1 -1
View File
@@ -1,3 +1,4 @@
pkg_check_modules(LIBAV IMPORTED_TARGET libavcodec libavutil libavformat)
add_library(lmsav SHARED
impl/AudioFile.cpp
@@ -27,4 +28,3 @@ target_link_libraries(lmsav PRIVATE
)
install(TARGETS lmsav DESTINATION ${CMAKE_INSTALL_LIBDIR})
+3
View File
@@ -1,3 +1,6 @@
pkg_check_modules(Config++ REQUIRED IMPORTED_TARGET libconfig++)
pkg_check_modules(Archive REQUIRED IMPORTED_TARGET libarchive)
add_library(lmscore SHARED
impl/http/Client.cpp
impl/http/SendQueue.cpp
+19 -9
View File
@@ -17,23 +17,33 @@ target_link_libraries(lmsimage PUBLIC
std::filesystem
)
if (IMAGE_LIBRARY STREQUAL STB)
set(LMS_IMAGE_BACKEND "stb" CACHE STRING "Image library")
set_property(CACHE LMS_IMAGE_BACKEND PROPERTY STRINGS "stb" "graphicsmagick")
if (${LMS_IMAGE_BACKEND} STREQUAL "stb")
find_package(StbImage REQUIRED)
message(STATUS "Using stb (resize version ${STB_IMAGE_RESIZE_VERSION})")
target_sources(lmsimage PRIVATE
impl/stb/JPEGImage.cpp
impl/stb/RawImage.cpp
)
target_compile_options(lmsimage PRIVATE "-DLMS_SUPPORT_IMAGE_STB")
target_include_directories(lmsimage PRIVATE ${STB_INCLUDE_DIR})
elseif (IMAGE_LIBRARY STREQUAL GraphicsMagick++)
)
target_compile_options(lmsimage PRIVATE "-DSTB_IMAGE_RESIZE_VERSION=${STB_IMAGE_RESIZE_VERSION}")
target_include_directories(lmsimage PRIVATE ${STB_IMAGE_INCLUDE_DIR})
elseif (${LMS_IMAGE_BACKEND} STREQUAL "graphicsmagick")
pkg_check_modules(GraphicsMagick++ REQUIRED IMPORTED_TARGET GraphicsMagick++)
message(STATUS "Using graphicsmagick")
target_sources(lmsimage PRIVATE
impl/graphicsmagick/JPEGImage.cpp
impl/graphicsmagick/RawImage.cpp
)
target_compile_options(lmsimage PRIVATE "-DLMS_SUPPORT_IMAGE_GM")
)
target_link_libraries(lmsimage PRIVATE PkgConfig::GraphicsMagick++)
else ()
message(FATAL_ERROR "Invalid IMAGE_LIBRARY provided")
endif()
message(FATAL_ERROR "Invalid image library")
endif ()
install(TARGETS lmsimage DESTINATION ${CMAKE_INSTALL_LIBDIR})
@@ -19,10 +19,6 @@
#pragma once
#ifndef LMS_SUPPORT_IMAGE_GM
#error "Bad configuration"
#endif
#include <Magick++.h>
#include "image/IEncodedImage.hpp"
@@ -19,10 +19,6 @@
#pragma once
#ifndef LMS_SUPPORT_IMAGE_GM
#error "Bad configuration"
#endif
#include <Magick++.h>
#include <cstddef>
+14
View File
@@ -28,7 +28,13 @@
#define STBI_FAILURE_USERMSG
#include <stb_image.h>
#if STB_IMAGE_RESIZE_VERSION == 1
#include <stb_image_resize.h>
#elif STB_IMAGE_RESIZE_VERSION == 2
#include <stb_image_resize2.h>
#else
#error "Unhandled STB image resize version"!
#endif
#include "core/ITraceLogger.hpp"
#include "image/Exception.hpp"
@@ -94,9 +100,17 @@ namespace lms::image::STB
if (!resizedData)
throw Exception{ "Cannot allocate memory for resized image!" };
#if STB_IMAGE_RESIZE_VERSION == 1
if (::stbir_resize_uint8_srgb(reinterpret_cast<const unsigned char*>(_data.get()), _width, _height, 0,
reinterpret_cast<unsigned char*>(resizedData.get()), width, height, 0,
3, STBIR_ALPHA_CHANNEL_NONE, 0) == 0)
#elif STB_IMAGE_RESIZE_VERSION == 2
if (::stbir_resize_uint8_srgb(reinterpret_cast<const unsigned char*>(_data.get()), _width, _height, 0,
reinterpret_cast<unsigned char*>(resizedData.get()), width, height, 0,
STBIR_RGB) == 0)
#else
#error "Unhandled STB image resize version"!
#endif
{
throw Exception{ "Failed to resize image:" + std::string{ ::stbi_failure_reason() } };
}
-4
View File
@@ -19,10 +19,6 @@
#pragma once
#ifndef LMS_SUPPORT_IMAGE_STB
#error "Bad configuration"
#endif
#include <cstddef>
#include <filesystem>
+1
View File
@@ -1,3 +1,4 @@
pkg_check_modules(Taglib REQUIRED IMPORTED_TARGET taglib)
if(BUILD_TESTING)
add_subdirectory(test)
+16
View File
@@ -27,6 +27,22 @@ target_link_libraries(lmsauth PUBLIC
Boost::system
Wt::Wt
)
# PAM
option(USE_PAM "Use the PAM backend authentication API" ON)
if (USE_PAM)
find_package(PAM QUIET)
if (USE_PAM AND NOT PAM_FOUND)
message(WARNING "PAM library not found: disabling")
set(USE_PAM OFF)
endif ()
endif ()
if (USE_PAM)
message(STATUS "Using PAM authentication backend")
else ()
message(STATUS "NOT using PAM authentication backend")
endif ()
if (USE_PAM)
target_compile_options(lmsauth PRIVATE "-DLMS_SUPPORT_PAM")