Skip to content
Snippets Groups Projects
Commit 170b6cad authored by Philip's avatar Philip
Browse files

adopt upstream changes vor v3.0

parent 368101a7
No related branches found
No related tags found
No related merge requests found
Showing
with 2385 additions and 1073 deletions
......@@ -35,8 +35,14 @@ Makefile*
qtcreator-build
CMakeLists.txt.user
# KDevelop
*.kdev4
# PyCharm
.idea
# Visual Studio Code
.vscode
# Backup files
*~
......@@ -7,3 +7,8 @@ source_file = lang/calamares_en.ts
source_lang = en
type = QT
[calamares.dummypythonqt]
file_filter = src/modules/dummypythonqt/lang/<lang>/LC_MESSAGES/dummypythonqt.po
source_file = src/modules/dummypythonqt/lang/dummypythonqt.pot
source_lang = en
......@@ -55,8 +55,10 @@ find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core Gui Widgets LinguistTools S
find_package( YAMLCPP 0.5.1 REQUIRED )
find_package( PolkitQt5-1 REQUIRED )
option( WITH_PYTHON "Enable Python modules support." ON )
option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON )
option( WITH_CRASHREPORTER "Build with CrashReporter" ON )
option( INSTALL_CONFIG "Install configuration files" ON)
option( WITH_PYTHONQT "Enable next generation Python modules API (experimental, requires PythonQt)." OFF )
if( CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libcrashreporter-qt/CMakeLists.txt" )
message( STATUS "Build of crashreporter disabled." )
......@@ -84,11 +86,23 @@ if ( PYTHONLIBS_FOUND )
FALSE "1.54.0"
"Boost.Python is used for interfacing with Calamares job modules written in Python 3."
)
macro_optional_find_package( PythonQt )
macro_log_feature( PYTHONQT_FOUND
"PythonQt"
"A Python embedding solution for Qt applications."
"http://pythonqt.sourceforge.net"
FALSE "3.1"
"PythonQt is used for the Python modules API."
)
endif()
if ( PYTHONLIBS_NOTFOUND OR NOT CALAMARES_BOOST_PYTHON3_FOUND )
set( WITH_PYTHON OFF )
endif()
if ( PYTHONLIBS_NOTFOUND OR NOT PYTHONQT_FOUND )
set( WITH_PYTHONQT OFF )
endif()
###
### Calamares application info
......@@ -100,9 +114,9 @@ set( CALAMARES_DESCRIPTION_SUMMARY "The distribution-independent installer frame
set( CALAMARES_TRANSLATION_LANGUAGES ar ast bg ca cs_CZ da de el en en_GB es_MX es eu fr hr hu id is it_IT ja lt nl pl pt_BR pt_PT ro ru sk sv th tr_TR zh_CN zh_TW )
### Bump version here
set( CALAMARES_VERSION_MAJOR 2 )
set( CALAMARES_VERSION_MINOR 4 )
set( CALAMARES_VERSION_PATCH 6 )
set( CALAMARES_VERSION_MAJOR 3 )
set( CALAMARES_VERSION_MINOR 0 )
set( CALAMARES_VERSION_PATCH 0 )
set( CALAMARES_VERSION_RC 0 )
set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )
......@@ -167,7 +181,15 @@ add_subdirectory( src )
macro_display_feature_log()
if ( NOT WITH_PYTHON )
message( "-- WARNING: Building Calamares without Python support. Python modules will not work.\n" )
message( "-- WARNING: Building Calamares without Python support. Legacy Python job modules will not work.\n" )
endif()
if ( NOT WITH_PYTHONQT )
message( "-- WARNING: Building Calamares without PythonQt support. Python modules will not work.\n" )
endif()
if ( NOT INSTALL_CONFIG )
message( "-- WARNING: Configuration files will not be installed.\n" )
endif()
# Add all targets to the build-tree export set
......@@ -211,12 +233,14 @@ install(
"${CMAKE_INSTALL_CMAKEDIR}"
)
if (INSTALL_CONFIG)
install(
FILES
settings.conf
DESTINATION
share/calamares
)
endif()
install(
FILES
......
# Find PythonQt
#
# Sets PYTHONQT_FOUND, PYTHONQT_INCLUDE_DIR, PYTHONQT_LIBRARY, PYTHONQT_LIBRARIES
#
# Python is required
find_package(PythonLibs)
if(NOT PYTHONLIBS_FOUND)
message(FATAL_ERROR "error: Python is required to build PythonQt")
endif()
if(NOT EXISTS "${PYTHONQT_INSTALL_DIR}")
find_path(PYTHONQT_INSTALL_DIR include/PythonQt/PythonQt.h DOC "Directory where PythonQt was installed.")
endif()
# XXX Since PythonQt 3.0 is not yet cmakeified, depending
# on how PythonQt is built, headers will not always be
# installed in "include/PythonQt". That is why "src"
# is added as an option. See [1] for more details.
# [1] https://github.com/commontk/CTK/pull/538#issuecomment-86106367
find_path(PYTHONQT_INCLUDE_DIR PythonQt.h
PATHS "${PYTHONQT_INSTALL_DIR}/include/PythonQt"
"${PYTHONQT_INSTALL_DIR}/src"
DOC "Path to the PythonQt include directory")
find_library(PYTHONQT_LIBRARY_RELEASE PythonQt PATHS "${PYTHONQT_INSTALL_DIR}/lib" DOC "The PythonQt library.")
find_library(PYTHONQT_LIBRARY_DEBUG NAMES PythonQt${CTK_CMAKE_DEBUG_POSTFIX} PythonQt${CMAKE_DEBUG_POSTFIX} PythonQt PATHS "${PYTHONQT_INSTALL_DIR}/lib" DOC "The PythonQt library.")
find_library(PYTHONQT_QTALL_LIBRARY_RELEASE PythonQt_QtAll PATHS "${PYTHONQT_INSTALL_DIR}/lib" DOC "Full Qt bindings for the PythonQt library.")
find_library(PYTHONQT_QTALL_LIBRARY_DEBUG NAMES PythonQt_QtAll${CTK_CMAKE_DEBUG_POSTFIX} PythonQt_QtAll${CMAKE_DEBUG_POSTFIX} PythonQt_QtAll PATHS "${PYTHONQT_INSTALL_DIR}/lib" DOC "Full Qt bindings for the PythonQt library.")
set(PYTHONQT_LIBRARY)
if(PYTHONQT_LIBRARY_RELEASE)
list(APPEND PYTHONQT_LIBRARY optimized ${PYTHONQT_LIBRARY_RELEASE})
endif()
if(PYTHONQT_LIBRARY_DEBUG)
list(APPEND PYTHONQT_LIBRARY debug ${PYTHONQT_LIBRARY_DEBUG})
endif()
set(PYTHONQT_QTALL_LIBRARY)
if(PYTHONQT_QTALL_LIBRARY_RELEASE)
list(APPEND PYTHONQT_QTALL_LIBRARY optimized ${PYTHONQT_QTALL_LIBRARY_RELEASE})
endif()
if(PYTHONQT_QTALL_LIBRARY_DEBUG)
list(APPEND PYTHONQT_QTALL_LIBRARY debug ${PYTHONQT_QTALL_LIBRARY_DEBUG})
endif()
mark_as_advanced(PYTHONQT_INSTALL_DIR)
mark_as_advanced(PYTHONQT_INCLUDE_DIR)
mark_as_advanced(PYTHONQT_LIBRARY_RELEASE)
mark_as_advanced(PYTHONQT_LIBRARY_DEBUG)
mark_as_advanced(PYTHONQT_QTALL_LIBRARY_RELEASE)
mark_as_advanced(PYTHONQT_QTALL_LIBRARY_DEBUG)
# On linux, also find libutil
if(UNIX AND NOT APPLE)
find_library(PYTHONQT_LIBUTIL util)
mark_as_advanced(PYTHONQT_LIBUTIL)
endif()
# All upper case _FOUND variable is maintained for backwards compatibility.
set(PYTHONQT_FOUND 0)
set(PythonQt_FOUND 0)
if(PYTHONQT_INCLUDE_DIR AND PYTHONQT_LIBRARY AND PYTHONQT_QTALL_LIBRARY)
# Currently CMake'ified PythonQt only supports building against a python Release build.
# This applies independently of CTK build type (Release, Debug, ...)
add_definitions(-DPYTHONQT_USE_RELEASE_PYTHON_FALLBACK)
set(PYTHONQT_FOUND 1)
set(PythonQt_FOUND ${PYTHONQT_FOUND})
set(PYTHONQT_LIBRARIES ${PYTHONQT_LIBRARY} ${PYTHONQT_LIBUTIL} ${PYTHONQT_QTALL_LIBRARY})
endif()
......@@ -21,7 +21,7 @@ function( calamares_add_module_subdirectory )
configure_file( ${SUBDIRECTORY}/${MODULE_FILE} ${SUBDIRECTORY}/${MODULE_FILE} COPYONLY )
get_filename_component( FLEXT ${MODULE_FILE} EXT )
if( "${FLEXT}" STREQUAL ".conf" )
if( "${FLEXT}" STREQUAL ".conf" AND INSTALL_CONFIG)
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${MODULE_FILE}
DESTINATION ${MODULE_DATA_DESTINATION} )
list( APPEND MODULE_CONFIG_FILES ${MODULE_FILE} )
......@@ -32,13 +32,25 @@ function( calamares_add_module_subdirectory )
endif()
endforeach()
# We copy over the lang directory, if any
if( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/lang" )
file( COPY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/lang"
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}" )
install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/lang"
DESTINATION ${MODULE_DESTINATION} )
endif()
message( "-- ${BoldYellow}Found ${CALAMARES_APPLICATION_NAME} module: ${BoldRed}${SUBDIRECTORY}${ColorReset}" )
if( NOT CMAKE_BUILD_TYPE STREQUAL "Release" )
message( " ${Green}TYPE:${ColorReset} jobmodule" )
# message( " ${Green}FILES:${ColorReset} ${MODULE_FILES}" )
message( " ${Green}MODULE_DESTINATION:${ColorReset} ${MODULE_DESTINATION}" )
if( MODULE_CONFIG_FILES )
if (INSTALL_CONFIG)
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => ${MODULE_DATA_DESTINATION}" )
else()
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => [Skipping installation]" )
endif()
endif()
message( "" )
endif()
......
......@@ -29,7 +29,11 @@ function( calamares_add_plugin )
# message( " ${Green}NO_INSTALL:${ColorReset} ${PLUGIN_NO_INSTALL}" )
message( " ${Green}PLUGIN_DESTINATION:${ColorReset} ${PLUGIN_DESTINATION}" )
if( PLUGIN_CONFIG_FILES )
if ( INSTALL_CONFIG )
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${PLUGIN_CONFIG_FILES} => ${PLUGIN_DATA_DESTINATION}" )
else()
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${PLUGIN_CONFIG_FILES} => [Skipping installation]" )
endif()
endif()
if( PLUGIN_RESOURCES )
message( " ${Green}RESOURCES:${ColorReset} ${PLUGIN_RESOURCES}" )
......@@ -83,9 +87,11 @@ function( calamares_add_plugin )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_DESC_FILE}
DESTINATION ${PLUGIN_DESTINATION} )
if ( INSTALL_CONFIG )
foreach( PLUGIN_CONFIG_FILE ${PLUGIN_CONFIG_FILES} )
configure_file( ${PLUGIN_CONFIG_FILE} ${PLUGIN_CONFIG_FILE} COPYONLY )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_CONFIG_FILE}
DESTINATION ${PLUGIN_DATA_DESTINATION} )
endforeach()
endif()
endfunction()
......@@ -20,11 +20,11 @@ make DESTDIR="$WORKSPACE/prefix" install
cd "$WORKSPACE"
wget https://scan.coverity.com/download/linux-64 --no-check-certificate \
wget https://scan.coverity.com/download/cxx/linux64 --no-check-certificate \
--post-data "token=ll90T04noQ4cORJx_zczKA&project=calamares%2Fcalamares" \
-O coverity_tool.tgz
-O coverity_tool.tar.gz
mkdir "$WORKSPACE/coveritytool"
tar xvf coverity_tool.tgz -C "$WORKSPACE/coveritytool" --strip-components 1
tar xvf coverity_tool.tar.gz -C "$WORKSPACE/coveritytool" --strip-components 2
export PATH="$WORKSPACE/coveritytool/bin:$PATH"
rm -Rf "$WORKSPACE/build"
......
......@@ -4,11 +4,11 @@
sudo cp ~/jenkins-master/kpluginfactory.h /usr/include/KF5/KCoreAddons
cd "$WORKSPACE"
wget https://scan.coverity.com/download/linux-64 --no-check-certificate \
wget https://scan.coverity.com/download/cxx/linux64 --no-check-certificate \
--post-data "token=cyOjQZx5EOFLdhfo7ZDa4Q&project=KDE+Partition+Manager+Core+Library+-+KPMcore" \
-O coverity_tool.tgz
-O coverity_tool.tar.gz
mkdir "$WORKSPACE/coveritytool"
tar xvf coverity_tool.tgz -C "$WORKSPACE/coveritytool" --strip-components 1
tar xvf coverity_tool.tar.gz -C "$WORKSPACE/coveritytool" --strip-components 2
export PATH="$WORKSPACE/coveritytool/bin:$PATH"
rm -Rf "$WORKSPACE/build"
......
......@@ -11,5 +11,21 @@ git config --global http.sslVerify false
export QT_SELECT=5
tx pull --force --source --all
git add --verbose lang/calamares*.ts
git commit --author='Calamares CI <teo@kde.org>' --message='Automatic merge of Transifex translations' | true
git commit --author='Calamares CI <teo@kde.org>' --message='[core] Automatic merge of Transifex translations' | true
for MODULE_DIR in `find src/modules -maxdepth 1 -mindepth 1 -type d`; do
FILES=(${MODULE_DIR}/*.py)
if [ ${#FILES[@]} -gt 0 ]; then
MODULE_NAME=$(basename ${MODULE_DIR})
if [ -d ${MODULE_DIR}/lang ]; then
# Convert PO files to MO files
for POFILE in `find . -name "*.po"` ; do
msgfmt -o ${POFILE/.po/.mo} $POFILE
done
git add --verbose ${MODULE_DIR}/lang/*
git commit --author='Calamares CI <teo@kde.org>' --message="[${MODULE_NAME}] Automatic merge of Transifex translations" | true
fi
fi
done
git push --set-upstream origin master
......@@ -10,4 +10,25 @@ git config --global http.sslVerify false
export QT_SELECT=5
lupdate src/ -ts -no-obsolete lang/calamares_en.ts
tx push --force --source --no-interactive
# Arch
# PYGETTEXT=/usr/lib/python3.5/Tools/i18n/pygettext.py
# Ubuntu
PYGETTEXT=pygettext3
for MODULE_DIR in `find src/modules -maxdepth 1 -mindepth 1 -type d`; do
FILES=(${MODULE_DIR}/*.py)
if [ ${#FILES[@]} -gt 0 ]; then
MODULE_NAME=$(basename ${MODULE_DIR})
if [ -d ${MODULE_DIR}/lang ]; then
${PYGETTEXT} -p ${MODULE_DIR}/lang -d ${MODULE_NAME} ${MODULE_DIR}/*.py
if [ -f ${MODULE_DIR}/lang/${MODULE_NAME}.pot ]; then
tx set -r calamares.${MODULE_NAME} --source -l en ${MODULE_DIR}/lang/${MODULE_NAME}.pot
tx push --force --source --no-interactive -r calamares.${MODULE_NAME}
fi
fi
fi
done
tx push --force --source --no-interactive -r calamares.calamares-master
[Desktop Entry]
Type=Application
Version=1.0
Name=Install Manjaro Linux (Calamares)
GenericName=Live Installer (Calamares)
Name=Install Manjaro Linux
GenericName=Live Installer
Comment=Install the operating system to disk
Comment[de]=Manjaro Linux installieren
Exec=/usr/bin/calamares_polkit %f
Icon=calamares
Terminal=false
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment