Compare commits

..

1 Commits

Author SHA1 Message Date
e7d8f6fbb0 fix extensions build 2023-12-30 23:52:02 +01:00
23 changed files with 443 additions and 763 deletions

View File

@@ -11,8 +11,6 @@ env:
CMAKE_ARGS: |
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
-DCMAKE_BUILD_TYPE=Debug
-DBUILD_APPSTREAM=ON
-DBUILD_APPDATA=ON
jobs:
build:

View File

@@ -12,8 +12,6 @@ env:
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
-DCMAKE_BUILD_TYPE=Debug
-DWITH_QT6=ON
-DBUILD_APPSTREAM=ON
-DBUILD_APPDATA=ON
jobs:
build:

View File

@@ -13,8 +13,6 @@ env:
-DCMAKE_BUILD_TYPE=Debug
-DBUILD_SCHEMA_TESTING=ON
-DBUILD_TESTING=ON
-DBUILD_APPSTREAM=ON
-DBUILD_APPDATA=ON
jobs:
build:

View File

@@ -1,36 +0,0 @@
name: nightly-ubuntu
on:
schedule:
- cron: "12 23 * * *"
workflow_dispatch:
env:
BUILDDIR: /build
SRCDIR: ${{ github.workspace }}
CMAKE_ARGS: |
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
-DCMAKE_BUILD_TYPE=Debug
-DBUILD_APPSTREAM=ON
-DBUILD_APPDATA=ON
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker://ubuntu:devel
options: --tmpfs /build:rw --user 0:0
steps:
- name: "prepare git"
shell: bash
run: |
apt-get update
apt-get -y install git-core jq curl ninja-build
- name: "prepare source"
uses: calamares/actions/generic-checkout@v5
- name: "install dependencies"
shell: bash
run: ./ci/deps-ubuntu.sh
- name: "build"
shell: bash
run: ./ci/build.sh

View File

@@ -8,33 +8,16 @@ changelog -- this log starts with version 3.3.0. See CHANGES-3.2 for
the history of the 3.2 series (2018-05 - 2022-08).
# 3.3.1 (2024-01-15)
This release sets `BUILD_APPDATA` and `BUILD_APSTREAM` to default to **OFF**,
where previously they defaulted to **ON**. When enabled, the dependencies for
both features are required -- previously they would silently switch off if
the dependencies were not found. Distributions are strongly advised to check
their package-building instructions.
# 3.3.1 (unreleased)
This release contains contributions from (alphabetically by first name):
- Adriaan de Groot
- Aleksey Samoilov
- Emir Sari
- Simon Quigley
- Nobody yet!
## Core ##
- There has been internal code re-organization (e.g. not using functions
named `tr()`) to help translation tools.
- Strings everywhere have been given more context. (thanks Emir)
- In CMake, "view" is no longer accepted as an alias of the module
type "viewmodule" in function `calamares_add_plugin()`.
- Plain Ubuntu builds have been added to the CI roster. (thanks Simon)
- Commands that run in the target system (in the chroot) no longer
use the TMP-related environment variables from the host. #2269
- No changes of note.
## Modules ##
- The *displaymanager* module configuration for `greetd` has some more
options now. (thanks Aleksey)
- No changes of note.
# 3.3.0 (2023-12-12)

View File

@@ -48,7 +48,7 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(CALAMARES_VERSION 3.3.1)
set(CALAMARES_RELEASE_MODE ON) # Set to ON during a release
set(CALAMARES_RELEASE_MODE OFF) # Set to ON during a release
if(CMAKE_SCRIPT_MODE_FILE)
include(${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake)

View File

@@ -1,86 +0,0 @@
# === This file is part of Calamares - <https://calamares.io> ===
#
# SPDX-FileCopyrightText: 2023 Adriaan de Groot <groot@kde.org>
# SPDX-License-Identifier: BSD-2-Clause
#
###
#
# Finds AppStream-Qt suitable for the Qt version that is in use.
# Creates target calamares::appstreamqt to alias whatever is found.
# Sets AppStreamQt_FOUND appropriately, regardless of the underlying
# variables (e.g. might be AppStreamQt6_FOUND).
#
option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" OFF)
if(TARGET calaappstream)
if(TARGET calamares::appstreamqt)
message(STATUS "AppStreamQt has already been found")
set(AppStreamQt_FOUND TRUE)
else()
message(STATUS "AppStreamQt has been searched-for and not found")
set(AppStreamQt_FOUND FALSE)
endif()
return()
endif()
if(NOT BUILD_APPSTREAM)
return()
endif()
### FIND APPSTREAM
#
# First, look for a Qt-versioned variety of the package.
# If that is not found, look for an unversioned one.
set(HAVE_APPSTREAM OFF)
find_package(AppStream${qtname})
# Not everyone renames the variables consistently
if(AppStream${qtname}_FOUND OR AppStreamQt_FOUND)
set(_appstream_name AppStream${qtname})
set(HAVE_APPSTREAM ON)
else()
find_package(AppStreamQt)
if(AppStreamQt_FOUND)
set(_appstream_name AppStreamQt)
# TODO: how to check underlying Qt version?
set(HAVE_APPSTREAM ON)
endif()
endif()
if(HAVE_APPSTREAM)
# Look for the directory name containing the headers
find_file(_appstream_header NAMES ${_appstream_name}/pool.h AppStreamQt/pool.h)
if(NOT _appstream_header)
set(HAVE_APPSTREAM OFF)
else()
if(_appstream_header MATCHES /${_appstream_name}/)
set(_appstream_header_directory ${_appstream_name})
else()
set(_appstream_header_directory AppStreamQt)
endif()
endif()
else()
# Placeholder name
set(_appstream_name AppStreamQt)
endif()
set(_appstream_dependency_type OPTIONAL)
if(BUILD_APPSTREAM)
set(_appstream_dependency_type REQUIRED)
endif()
set_package_properties(
${_appstream_name}
PROPERTIES
DESCRIPTION "Support for AppStream (cache) data"
URL "https://github.com/ximion/appstream"
PURPOSE "AppStream provides package data"
TYPE ${_appstream_dependency_type}
)
add_library(calaappstream INTERFACE) # Always, but might not be populated
if(HAVE_APPSTREAM)
target_compile_definitions(calaappstream INTERFACE HAVE_APPSTREAM_VERSION=${${_appstream_name}_VERSION_MAJOR} HAVE_APPSTREAM_HEADERS=${_appstream_header_directory})
target_link_libraries(calaappstream INTERFACE ${_appstream_name})
add_library(calamares::appstreamqt ALIAS calaappstream)
endif()
set(AppStreamQt_FOUND ${HAVE_APPSTREAM})

View File

@@ -39,6 +39,7 @@
include( CalamaresAddTranslations )
include( CalamaresCheckModuleSelection )
include( FeatureSummary )
set( MODULE_DATA_DESTINATION share/calamares/modules )

View File

@@ -19,7 +19,7 @@
#
# calamares_add_plugin(
# module-name
# TYPE <viewmodule|job>
# TYPE <view|job>
# EXPORT_MACRO macro-name
# SOURCES source-file...
# UI ui-file...
@@ -35,7 +35,7 @@
# [WEIGHT w]
# )
#
# Function optional parameters:
# Function parameters:
# - COMPILE_DEFINITIONS
# Definitions are set on the resulting module with a suitable
# flag (i.e. `-D`) so only state the name (optionally, also the value)
@@ -65,9 +65,6 @@
# SKIPPED_MODULES is set in the parent (i.e. caller's) scope with the
# reason why. This should rarely be a concern as AddModuleSubdirectory
# already handles skip-reasons and collects them for reporting.
#
# The target defined this way is called "calamares_<TYPE>_<module-name>",
# e.g. "calamares_viewmodule_packagechooserq".
include( CMakeParseArguments )
@@ -129,7 +126,7 @@ function( calamares_add_plugin )
set( target "calamares_${PLUGIN_TYPE}_${PLUGIN_NAME}" )
# automatic library linkage
if(PLUGIN_TYPE STREQUAL "viewmodule")
if(PLUGIN_TYPE STREQUAL "view" OR PLUGIN_TYPE STREQUAL "viewmodule")
list(APPEND PLUGIN_LINK_PRIVATE_LIBRARIES Calamares::calamaresui)
elseif(PLUGIN_TYPE STREQUAL "job")
list(APPEND PLUGIN_LINK_PRIVATE_LIBRARIES Calamares::calamares)

View File

@@ -10,8 +10,8 @@
#
# This file has not yet been documented for use outside of Calamares itself.
include(CMakeParseArguments)
include(FeatureSummary)
include( CMakeParseArguments )
include( FeatureSummary )
# The Gettext module is still old-fashioned, ALLCAPS variables
find_package( Gettext )

View File

@@ -1,47 +0,0 @@
#! /bin/sh
#
# Install dependencies for the nightly-ubuntu (devel) build
# These build dependencies are grabbed directly from the Debian package
#
apt-get update
apt-get -y install git-core jq curl ninja
apt-get -y install \
build-essential \
cmake \
extra-cmake-modules \
gettext \
libappstreamqt5-dev \
libkf5config-dev \
libkf5coreaddons-dev \
libkf5crash-dev \
libkf5i18n-dev \
libkf5iconthemes-dev \
libkf5kio-dev \
libkf5parts-dev \
libkf5plasma-dev \
libkf5service-dev \
libkf5solid-dev \
libkpmcore-dev \
libparted-dev \
libpolkit-qt5-1-dev \
libpwquality-dev \
libqt5svg5-dev \
libqt5webkit5-dev \
libyaml-cpp-dev \
os-prober \
pkg-config \
pkg-kde-tools \
polkitd \
python3-dev \
python3-jsonschema \
python3-yaml \
qml-module-qtquick-layouts \
qml-module-qtquick-privatewidgets \
qml-module-qtquick-window2 \
qml-module-qtquick2 \
qtbase5-dev \
qtdeclarative5-dev \
qtlocation5-dev \
qttools5-dev \
qttools5-dev-tools
true

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-14 21:33+0100\n"
"POT-Creation-Date: 2023-12-27 20:44+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -68,17 +68,17 @@ msgstr ""
msgid "SLIM config file {!s} does not exist"
msgstr ""
#: src/modules/displaymanager/main.py:938
#: src/modules/displaymanager/main.py:935
msgid "No display managers selected for the displaymanager module."
msgstr ""
#: src/modules/displaymanager/main.py:939
#: src/modules/displaymanager/main.py:936
msgid ""
"The displaymanagers list is empty or undefined in both globalstorage and "
"displaymanager.conf."
msgstr ""
#: src/modules/displaymanager/main.py:1026
#: src/modules/displaymanager/main.py:1023
msgid "Display manager configuration was incomplete"
msgstr ""

View File

@@ -190,7 +190,7 @@ install(
DESTINATION include/libcalamares
)
# Install each subdir-worth of header files
foreach(subdir geoip locale modulesystem network partition utils compat packages)
foreach(subdir geoip locale modulesystem network partition utils)
file(GLOB subdir_headers "${subdir}/*.h")
install(FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir})
endforeach()

View File

@@ -128,14 +128,6 @@ Calamares::Utils::Runner::run()
{
auto env = QProcessEnvironment::systemEnvironment();
env.insert( "LC_ALL", "C" );
// No guarantees that host settings for /tmp/ make sense in target
if ( m_location == RunLocation::RunInTarget )
{
env.remove( "TEMP" );
env.remove( "TEMPDIR" );
env.remove( "TMP" );
env.remove( "TMPDIR" );
}
process.setProcessEnvironment( env );
}
process.setProcessChannelMode( QProcess::MergedChannels );

View File

@@ -66,7 +66,7 @@ private:
QStringList m_FreeBSDLocales;
};
QTEST_GUILESS_MAIN( LocaleTests )
QTEST_MAIN( LocaleTests )
LocaleTests::LocaleTests() {}

View File

@@ -10,9 +10,9 @@ set(_extra_src "")
### OPTIONAL AppData XML support in PackageModel
#
#
option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" OFF)
option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON)
if(BUILD_APPDATA)
find_package(${qtname} REQUIRED COMPONENTS Xml)
find_package(${qtname} COMPONENTS Xml)
if(TARGET ${qtname}::Xml)
add_definitions(-DHAVE_APPDATA)
list(APPEND _extra_libraries ${qtname}::Xml)
@@ -23,7 +23,23 @@ endif()
### OPTIONAL AppStream support in PackageModel
#
#
include(AppStreamHelper)
option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON)
if(BUILD_APPSTREAM)
find_package(AppStreamQt)
set_package_properties(
AppStreamQt
PROPERTIES
DESCRIPTION "Support for AppStream (cache) data"
URL "https://github.com/ximion/appstream"
PURPOSE "AppStream provides package data"
TYPE OPTIONAL
)
if(AppStreamQt_FOUND)
add_definitions(-DHAVE_APPSTREAM_VERSION=${AppStreamQt_VERSION_MAJOR})
list(APPEND _extra_libraries AppStreamQt)
list(APPEND _extra_src ItemAppStream.cpp)
endif()
endif()
calamares_add_plugin(packagechooser
TYPE viewmodule
@@ -43,11 +59,6 @@ calamares_add_plugin(packagechooser
SHARED_LIB
)
if(AppStreamQt_FOUND)
target_link_libraries(calamares_viewmodule_packagechooser PRIVATE calamares::appstreamqt)
target_sources(calamares_viewmodule_packagechooser PRIVATE ItemAppStream.cpp)
endif()
calamares_add_test(
packagechoosertest
GUI

View File

@@ -16,6 +16,7 @@
#ifdef HAVE_APPSTREAM_VERSION
#include "ItemAppStream.h"
#include <AppStreamQt/pool.h>
#include <memory>
#endif

View File

@@ -7,16 +7,20 @@
*
*/
/** @brief Loading items from AppStream database.
/** @brief Loading items from AppData XML files.
*
* Only used if AppStreamQt is found, implements PackageItem::fromAppStream().
* Only used if QtXML is found, implements PackageItem::fromAppData().
*/
#include "ItemAppStream.h"
#include "PackageModel.h"
#include "locale/TranslationsModel.h"
#include "utils/Logger.h"
#include "utils/Variant.h"
#include <AppStreamQt/image.h>
#include <AppStreamQt/pool.h>
#include <AppStreamQt/screenshot.h>
/// @brief Return number of pixels in a size, for < ordering purposes
static inline quint64
sizeOrder( const QSize& size )

View File

@@ -12,28 +12,10 @@
#include "PackageModel.h"
/*
* This weird include mechanism is because an #include line is allowed
* to consist of preprocessor-tokens, which are expanded, and then
* the #include is *re*processed. But if it starts with < or ", then
* preprocessor tokens are not expanded. So we build up a #include <>
* style line with a suitable path -- if we are given a value for
* HAVE_APPSTREAM_HEADERS, that is the directory that the AppStreamQt
* headers live in.
*/
#define CALAMARES_LT <
#define CALAMARES_GT >
#ifndef HAVE_APPSTREAM_HEADERS
#define HAVE_APPSTREAM_HEADERS AppStreamQt
#endif
#include CALAMARES_LT HAVE_APPSTREAM_HEADERS/pool.h CALAMARES_GT
#include CALAMARES_LT HAVE_APPSTREAM_HEADERS/image.h CALAMARES_GT
#include CALAMARES_LT HAVE_APPSTREAM_HEADERS/screenshot.h CALAMARES_GT
#undef CALAMARES_LT
#undef CALAMARES_GT
namespace AppStream
{
class Pool;
} // namespace AppStream
/** @brief Loads an item from AppStream data.
*

View File

@@ -21,7 +21,7 @@
#include <QtTest/QtTest>
QTEST_GUILESS_MAIN( PackageChooserTests )
QTEST_MAIN( PackageChooserTests )
PackageChooserTests::PackageChooserTests() {}

View File

@@ -10,8 +10,9 @@ if(NOT WITH_QML)
endif()
find_package(${qtname} ${QT_VERSION} CONFIG REQUIRED Core)
set(_extra_libraries "")
set(_extra_src "")
# Add optional libraries here
set(USER_EXTRA_LIB)
# include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser )
set(_packagechooser ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser)
@@ -20,9 +21,9 @@ include_directories(${_packagechooser})
### OPTIONAL AppData XML support in PackageModel
#
#
option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" OFF)
option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON)
if(BUILD_APPDATA)
find_package(${qtname} REQUIRED COMPONENTS Xml)
find_package(${qtname} COMPONENTS Xml)
if(TARGET ${qtname}::Xml)
add_definitions(-DHAVE_APPDATA)
list(APPEND _extra_libraries ${qtname}::Xml)
@@ -33,7 +34,23 @@ endif()
### OPTIONAL AppStream support in PackageModel
#
#
include(AppStreamHelper)
option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON)
if(BUILD_APPSTREAM)
find_package(AppStreamQt)
set_package_properties(
AppStreamQt
PROPERTIES
DESCRIPTION "Support for AppStream (cache) data"
URL "https://github.com/ximion/appstream"
PURPOSE "AppStream provides package data"
TYPE OPTIONAL
)
if(AppStreamQt_FOUND)
add_definitions(-DHAVE_APPSTREAM_VERSION=${AppStreamQt_VERSION_MAJOR})
list(APPEND _extra_libraries AppStreamQt)
list(APPEND _extra_src ${_packagechooser}/ItemAppStream.cpp)
endif()
endif()
calamares_add_plugin(packagechooserq
TYPE viewmodule
@@ -50,8 +67,3 @@ calamares_add_plugin(packagechooserq
${_extra_libraries}
SHARED_LIB
)
if(AppStreamQt_FOUND)
target_link_libraries(calamares_viewmodule_packagechooserq PRIVATE calamares::appstreamqt)
target_sources(calamares_viewmodule_packagechooserq PRIVATE ${_packagechooser}/ItemAppStream.cpp)
endif()

View File

@@ -198,7 +198,7 @@ PartitionModel::data( const QModelIndex& index, int role ) const
{
if ( isPartitionFreeSpace( partition ) )
{
name = tr( "Free Space", "@title" );
name = tr( "Free Space", "@title );
}
else
{