Skip to content
Extraits de code Groupes Projets

Comparer les révisions

Les modifications sont affichées comme si la révision source était fusionnée avec la révision cible. En savoir plus sur la comparaison des révisions.

Source

Sélectionner le projet cible
No results found
Sélectionner une révision Git
Loading items

Cible

Sélectionner le projet cible
  • martin2018/lektor
1 résultat
Sélectionner une révision Git
Loading items
Afficher les modifications
Validations sur la source (17)
......@@ -33,4 +33,5 @@ autom4te.cache
*\~
*.AppImage
*.pro.user
*.lock
target/
.breaking_tests: &breaking_tests
allow_failure: true
.bin_generation: &bin_generation
stage: package
only:
- master
.main_tests: &main_tests
tags:
- kurisu
.common_build:
only:
- master
- merge_requests
except:
variables:
- $CI_MERGE_REQUEST_TITLE =~ /^WIP:/
- $CI_MERGE_REQUEST_TITLE =~ /^Draft:/
- $CI_MERGE_REQUEST_TITLE =~ /^WIP:.*/
- $CI_MERGE_REQUEST_TITLE =~ /^Draft:.*/
- $CI_COMMIT_TITLE =~ /.*\[skip-ci\].*/
- $CI_COMMIT_TITLE =~ /.*\[SKIP-CI\].*/
- $CI_COMMIT_TITLE =~ /.*\[WIP\].*/
- $CI_COMMIT_TITLE =~ /.*\[wip\].*/
- $CI_COMMIT_TITLE =~ /.*\[no-build\].*/
- $CI_COMMIT_TITLE =~ /.*\[NO-BUILD\].*/
.common_build:
before_script:
- apt update && apt -y install make libmpv-dev cmake clang clang-format gcc g++ libomp-dev libsdl2-dev libsdl2-image-dev xxd mkvtoolnix libcurl4-openssl-dev libsqlite3-dev manpages man-db fontconfig libfontconfig-dev
- lsb_release -a
- echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list
- apt update && apt -y install make libmpv-dev cmake clang clang-format gcc g++ xxd mkvtoolnix
libcurl4-openssl-dev libsqlite3-dev manpages man-db libfontconfig-dev
qt6-base-dev qt6-declarative-dev qt6-multimedia-dev
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh
- chmod +x ./rustup.sh
- ./rustup.sh -y --default-toolchain beta
......@@ -54,18 +47,3 @@ build-gcc:
variables:
c_compiler: gcc
cxx_compiler: g++
#################################################
### Packages ####################################
#################################################
# package-kagari:
# <<: *bin_generation
# <<: *main_tests
# script: utils/scripts/validate.bash --step=kagari
# package-appimage:
# <<: *bin_generation
# <<: *main_tests
# needs: ["build-clang"]
# script: utils/scripts/validate.bash --build=gcc --static-modules --appimage --step=configure,build,copy-all
......@@ -4,7 +4,7 @@
- Add: add rust code to lektord -> common lib + new repo rs module
- Add: merge the amadeus-rs prokect into the lektor one
- Add: add file logging to lektord, the rotate operations are done by lektord to avoid running out of space if someone try to dos lektord...
- Add: Qt5 module for the player, it's the new default (will replace sdl2!)
- Add: Qt6 module for the player, it's the new default (will replace sdl2!)
- Add: hook to automatically upgrade the database scheme if needed
- Add: multi-add IDs, create a list with stb_ds and add its content in the queue, the adds are batched 10 per 10. When adding multiple times the same kara ID, it is only added once
- Add: dry-update command to only refresh the available kara in Kurisu and don't download them
......@@ -36,6 +36,7 @@
- Change: autotools to cmake toolchain
- Change: cmake minimal version to 3.17 because of policy CMP0100
- Change: the CI check if lektor compiles, no binary deployment for now
- Change: minimal version of Qt is now 6!
- Remove: delete `KLKT` as it is no longer maintained
- Remove: get ride of the SDL2 module
......
......@@ -13,7 +13,6 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
set(CMAKE_COLOR_MAKEFILE ON)
include(TestBigEndian) # Needed for endianness tests
include(FindOpenMP) # Test OpenMP support
include(GNUInstallDirs) # Needed for installation things
include(ExternalProject) # Enable ExternalProject CMake module
......@@ -41,27 +40,28 @@ else()
set(RUST_BUILD_CMD "${CARGO}" build)
endif()
### ###
# TEST OPENMP #
### ###
if(OpenMP_FOUND)
message(STATUS "OpenMP found by CMake for C (version ${OpenMP_C_VERSION}) and C++ (version ${OpenMP_CXX_VERSION})")
else()
message(FATAL_ERROR "OpenMP not found by CMake for C and C++")
endif()
### ###
# SET COMMON VARIABLES #
### ###
set(${CMAKE_C_COMPILER_ID}_C_FLAGS)
set(${CMAKE_BUILD_TYPE}_C_FLAGS)
set(RelWithDebInfo_C_FLAGS
-Wno-switch # For the CI
)
set(${CMAKE_BUILD_TYPE}_${CMAKE_C_COMPILER_ID}_C_FLAGS)
# For the CI...
set(RelWithDebInfo_GNU_C_FLAGS -Wno-switch)
set(Release_GNU_C_FLAGS -Wno-switch)
set(RelWithDebInfo_Clang_C_FLAGS -Wno-switch-enum)
set(Release_Clang_C_FLAGS -Wno-switch-enum)
set(RelWithDebInfo_GNU_CXX_FLAGS $<$<COMPILE_LANGUAGE:CXX>:-Wno-switch)
set(Release_GNU_CXX_FLAGS $<$<COMPILE_LANGUAGE:CXX>:-Wno-switch)
set(RelWithDebInfo_Clang_CXX_FLAGS $<$<COMPILE_LANGUAGE:CXX>:-Wno-switch-enum)
set(Release_Clang_CXX_FLAGS $<$<COMPILE_LANGUAGE:CXX>:-Wno-switch-enum)
set(Debug_GNU_C_FLAGS -Werror)
set(Debug_Clang_C_FLAGS -Werror)
# Common flags, also per compiler
set(COMMON_C_FLAGS
-Wall -Wextra -Werror
-Wall -Wextra
-Wshadow
-Wcast-align
-Wconversion
......@@ -72,7 +72,6 @@ set(COMMON_C_FLAGS
-Wdouble-promotion
-Wformat=2
-Wignored-qualifiers
${OpenMP_C_FLAGS}
)
set(Clang_C_FLAGS
-Weverything
......@@ -92,10 +91,12 @@ set(Clang_C_FLAGS
-Wno-missing-variable-declarations
-Wno-unknown-warning-option
-Wno-declaration-after-statement
-fcolor-diagnostics
-Wno-covered-switch-default # We migh want to have a default even if everything is covered
-fcolor-diagnostics # Colors!
)
set(Clang_CXX_FLAGS
$<$<COMPILE_LANGUAGE:CXX>:-Wno-c++98-compat-pedantic>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-c++20-compat>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-redundant-parens>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-inconsistent-missing-override>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-suggest-override>
......@@ -114,9 +115,8 @@ set(GNU_C_FLAGS
find_library(MPV_LIBRARY mpv REQUIRED) # tested with 0.32.0
find_library(SQLITE3_LIBRARY sqlite3 REQUIRED version>=3.31.0) # tested with 3.34.1
find_package(CURL REQUIRED HTTP HTTPS) # tested with 7.74.0
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
find_package(CURL COMPONENTS HTTP HTTPS REQUIRED) # tested with 7.74.0
find_package(Qt6 COMPONENTS Widgets OpenGL OpenGLWidgets REQUIRED) # tested with 6.4.0-1
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
......@@ -276,20 +276,15 @@ add_custom_command(OUTPUT ${SQL_GENERATED_FILE}
COMMENT "Generating SQL included files to embed them"
)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(lektord
MANUAL_FINALIZATION
${lektord_SOURCES}
${SQL_GENERATED_FILE}
)
else()
add_executable(lektord
${lektord_SOURCES}
${SQL_GENERATED_FILE}
)
endif()
add_executable(lkt ${lkt_SOURCES})
set_property(TARGET lektord PROPERTY CXX_STANDARD 20)
set(MANPAGES_COMMANDS)
if(GENERATE_MANPAGES)
message(STATUS "Generating manpages")
......@@ -307,38 +302,34 @@ if(GENERATE_MANPAGES)
endforeach()
endif()
target_link_libraries(lektord PRIVATE
${OpenMP_C_LIBRARIES}
${MPV_LIBRARY}
${CMAKE_DL_LIBS}
${SQLITE3_LIBRARY}
${CURL_LIBRARIES}
Qt${QT_VERSION_MAJOR}::Widgets
)
target_link_libraries(lkt PRIVATE
${OpenMP_C_LIBRARIES}
)
target_include_directories(lkt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/inc)
target_include_directories(lektord PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/inc
${CURL_INCLUDE_DIRS}
)
target_compile_definitions(lektord PRIVATE ${common_DEFINITIONS})
target_compile_definitions(lkt PRIVATE ${common_DEFINITIONS})
target_compile_options(lektord PRIVATE ${COMMON_C_FLAGS} ${${CMAKE_C_COMPILER_ID}_C_FLAGS} ${${CMAKE_CXX_COMPILER_ID}_CXX_FLAGS})
target_compile_definitions(lektord PRIVATE
target_compile_definitions(lektord PRIVATE ${common_DEFINITIONS}
QT_DISABLE_DEPRECATED_BEFORE=0x050F00
QT_NO_CAST_TO_ASCII
QT_RESTRICTED_CAST_FROM_ASCII
QTCREATOR_UTILS_STATIC_LIB
)
target_compile_options(lkt PRIVATE ${COMMON_C_FLAGS} ${${CMAKE_C_COMPILER_ID}_C_FLAGS} ${${CMAKE_CXX_COMPILER_ID}_CXX_FLAGS})
set_property(TARGET lektord PROPERTY CXX_STANDARD 20)
target_compile_options(lektord PRIVATE
${COMMON_C_FLAGS}
${${CMAKE_C_COMPILER_ID}_C_FLAGS}
${${CMAKE_CXX_COMPILER_ID}_CXX_FLAGS}
${${CMAKE_BUILD_TYPE}_${CMAKE_C_COMPILER_ID}_C_FLAGS}
${${CMAKE_BUILD_TYPE}_${CMAKE_CXX_COMPILER_ID}_C_FLAGS}
)
target_compile_options(lkt PRIVATE
${COMMON_C_FLAGS}
${${CMAKE_C_COMPILER_ID}_C_FLAGS}
${${CMAKE_CXX_COMPILER_ID}_CXX_FLAGS}
${${CMAKE_BUILD_TYPE}_${CMAKE_C_COMPILER_ID}_C_FLAGS}
${${CMAKE_BUILD_TYPE}_${CMAKE_CXX_COMPILER_ID}_C_FLAGS}
)
set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/Rust)
......@@ -371,7 +362,13 @@ add_dependencies(lektord liblektor_rs)
target_link_libraries(lektord
PRIVATE
"${CMAKE_SOURCE_DIR}/src/rust/target/${RUST_BUILD_TYPE}/liblektor_rs.a"
Qt${QT_VERSION_MAJOR}::Widgets
${MPV_LIBRARY}
${CMAKE_DL_LIBS}
${SQLITE3_LIBRARY}
${CURL_LIBRARIES}
Qt::Widgets
Qt::OpenGL
Qt::OpenGLWidgets
)
### ###
......@@ -401,6 +398,5 @@ foreach(CMD IN LISTS MANPAGE_COMMANDS)
)
endforeach()
if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(lektord)
endif()
......@@ -29,23 +29,16 @@ A Karaoke player made to replace the old bash scripts on Sakura.
- [cmake](https://cmake.org/) with at least the version 3.17
- a C compiler with C11 support
- a C++ compiler with C++20 support (for the Qt5 module)
- The C and C++ compilers must have OpenMP support (see the
[OpenMP C test program](utils/cmake/TestOpenMp.c))
- a C++ compiler with C++20 support (for the Qt6 module)
- the [sqlite3](https://www.sqlite.org/) development library, version
3.31.0 or newer for [generated columns](https://www.sqlite.org/gencol.html) support
- a POSIX.1-2008 compatible system (for MS Windows, use something like WSL2)
For the module sdl2, you will need the following prerequisites:
- the [mpv](https://mpv.io/) development library
- the [sdl2](https://www.libsdl.org/) development library
- the [sdl2-image](https://www.libsdl.org/projects/SDL_image/) development library
For the Qt module, you will need the following prerequisites:
- the [Qt](https://www.qt.io/) develipment library, QtCore, QtWidgets in at
least version 5.15 (Qt6 should be supported)
- the [mpv](https://mpv.io/) development library
- the [Qt](https://www.qt.io/) develipment library, QtCore, QtWidgets, QtOpenGL,
QtOpenGLWidgets in at least version 6
For the module repo, you will need the folowing prerequisites:
......
......@@ -74,12 +74,12 @@ enum {
typedef void (*function_ptr)(void);
/* Attributes */
#define noreturn __attribute__((noreturn))
// #define noreturn __attribute__((noreturn))
#define UNUSED __attribute__((unused))
#define UNUSED_FUNCTION UNUSED
#define CONSTRUCTOR_FUNCTION __attribute__((constructor)) static void
#define DESTRUCTOR_FUNCTION __attribute__((destructor)) static void
#define EXIT_FUNCTION noreturn void
#define EXIT_FUNCTION __attribute__((noreturn)) void
#define PRIVATE_FUNCTION UNUSED_FUNCTION static inline
#define FALLTHROUGH __attribute__((fallthrough))
......
......@@ -347,8 +347,13 @@ retry_config:
config_default_file(conf_file, conf_len);
___mkdir(conf_file); /* Create the folder for the file. */
errno = 0;
FILE *file_desc = fopen(conf_file, "w+");
RETURN_UNLESS(file_desc, "Failed to open default config file to initialize it", 1);
if (file_desc != NULL) {
LOG_ERROR("INIT", "Failed to open default config file and initialize it");
LOG_ERROR("INTI", "Conf file is %s, errno is %d: %s", conf_file, errno, strerror(errno));
return 1;
}
config_default(file_desc);
fclose(file_desc);
......
......@@ -14,7 +14,8 @@ struct module_repo_rs_internal;
********************/
PRIVATE_FUNCTION int
mod_new(va_list *va) {
mod_new(va_list *va)
{
va_list copy;
struct module_repo_rs_internal **UNUSED repo;
va_copy(copy, *va);
......@@ -25,7 +26,8 @@ mod_new(va_list *va) {
}
PRIVATE_FUNCTION int
mod_free(va_list *va) {
mod_free(va_list *va)
{
va_list copy;
struct module_repo_rs_internal **UNUSED repo;
va_copy(copy, *va);
......@@ -36,7 +38,8 @@ mod_free(va_list *va) {
}
PRIVATE_FUNCTION int
mod_close(va_list *va) {
mod_close(va_list *va)
{
va_list copy;
struct module_repo_rs_internal **UNUSED repo;
va_copy(copy, *va);
......@@ -47,7 +50,8 @@ mod_close(va_list *va) {
}
PRIVATE_FUNCTION int
mod_update(va_list *va) {
mod_update(va_list *va)
{
va_list copy;
struct module_repo_rs_internal **UNUSED repo;
va_copy(copy, *va);
......@@ -58,7 +62,8 @@ mod_update(va_list *va) {
}
PRIVATE_FUNCTION int
mod_dry_update(va_list *va) {
mod_dry_update(va_list *va)
{
va_list copy;
struct module_repo_rs_internal **UNUSED repo;
va_copy(copy, *va);
......@@ -69,7 +74,8 @@ mod_dry_update(va_list *va) {
}
PRIVATE_FUNCTION int
mod_rescan(va_list *va) {
mod_rescan(va_list *va)
{
va_list copy;
struct module_repo_rs_internal **UNUSED repo;
va_copy(copy, *va);
......@@ -80,7 +86,8 @@ mod_rescan(va_list *va) {
}
PRIVATE_FUNCTION int
mod_import(va_list *va) {
mod_import(va_list *va)
{
va_list copy;
struct module_repo_rs_internal **UNUSED repo;
va_copy(copy, *va);
......
#include "mpvwidget.hh"
#include "mpvwidget.hh"
#include <stdexcept>
#include <QtGui/QOpenGLContext>
......@@ -210,6 +210,11 @@ apply_unpause:
case MPV_EVENT_PLAYBACK_RESTART:
case MPV_EVENT_QUEUE_OVERFLOW:
case MPV_EVENT_HOOK: break;
default:
LOG_ERROR("WINDOW", "Should not get event %s (id is %d)", mpv_event_name(event->event_id),
event->event_id);
break;
}
}
......
#pragma once
#include <QtWidgets/QOpenGLWidget>
#include <QtOpenGLWidgets/QOpenGLWidget>
#include <mpv/client.h>
#include <mpv/render_gl.h>
#include <QtGui>
......
......@@ -90,7 +90,7 @@ private:
Q_DISABLE_COPY(node_builder)
mpv_node node_;
mpv_node_list *create_list(mpv_node *dst, bool is_map, int num)
mpv_node_list *create_list(mpv_node *dst, bool is_map, qsizetype num)
{
dst->format = is_map ? MPV_FORMAT_NODE_MAP : MPV_FORMAT_NODE_ARRAY;
mpv_node_list *list = new mpv_node_list();
......@@ -151,7 +151,10 @@ private:
mpv_node_list *list = create_list(dst, false, qlist.size());
if (!list)
goto fail;
list->num = qlist.size();
const qsizetype qlist_size = qlist.size();
if (qlist_size >= std::numeric_limits<int>::max())
goto fail;
list->num = static_cast<int>(qlist_size);
for (int n = 0; n < qlist.size(); n++)
set(&list->values[n], qlist[n]);
} else if (src.canConvert<QVariantMap>()) {
......@@ -159,7 +162,10 @@ private:
mpv_node_list *list = create_list(dst, true, qmap.size());
if (!list)
goto fail;
list->num = qmap.size();
const qsizetype qmap_size = qmap.size();
if (qmap_size >= std::numeric_limits<int>::max())
goto fail;
list->num = static_cast<int>(qmap_size);
for (int n = 0; n < qmap.size(); n++) {
list->keys[n] = dup_qstring(qmap.keys()[n]);
if (!list->keys[n]) {
......
/target
!*.lock
*.lock
Ce diff est replié.