Compare commits

...

19 Commits

Author SHA1 Message Date
Adriaan de Groot
ba2ef08bfa Changes: pre-release housekeeping 2024-01-15 19:54:01 +01:00
Adriaan de Groot
881347b9c2 [locale,packagechooser] (Auto-)Tests should not require GUI 2024-01-15 00:14:56 +01:00
Adriaan de Groot
94cb026ad8 i18n: update English source texts 2024-01-14 21:35:17 +01:00
Adriaan de Groot
f8245ebb6e CMake: add missing includes
-extensions won't build unless the CMake modules are (somewhat) self-contained.
2024-01-12 23:15:01 +01:00
Adriaan de Groot
1b655c26ef [libcalamares] Remove TMP-related environment variables
When running a command in the chroot, don't set TMP (and similar)
variables because those directories might nog make sense in the
target (yet).

FIXES #2269
2024-01-12 23:04:26 +01:00
Adriaan de Groot
5583c15291 CI: ubuntu needs to explicitly install Ninja 2024-01-09 22:53:48 +01:00
Adriaan de Groot
437a30fdcf Merge pull request #2267 from udeved/headers-install-fix
libcalamares: add compat and packages headers to be installed;
2024-01-02 23:07:10 +01:00
78eeb963a3 libcalamares: add compat and packages headers to be installed;
Use case would be customization of default modules, eg packagechooser requires compat/Variant.h and packages/Globals.h to compile in the calamares-extension repo

Signed-off-by: artoo <artoo@artixlinux.org>
2024-01-02 22:57:08 +01:00
Adriaan de Groot
db4730107d Changes: document recent contributions 2024-01-02 22:40:10 +01:00
Adriaan de Groot
58117de3e3 CI: enable AppStream for those CIs that have it in their deps 2024-01-02 22:40:10 +01:00
Adriaan de Groot
d38a48e900 [packagechooser] Make AppData and AppStream optional default OFF
If set to *ON*, then the dependencies for these two are required
(e.g. QtXml and/or AppStreamQt).
2024-01-02 22:40:10 +01:00
Adriaan de Groot
2798dee036 Merge pull request #2266 from lubuntu-team/calamares
Add an Ubuntu devel CI
2024-01-02 21:02:15 +01:00
Simon Quigley
76a0b00550 Add an Ubuntu devel CI. 2024-01-02 11:52:22 -06:00
Adriaan de Groot
062171a2f0 [packagechooser] Use the found-directory for AppStream headers 2024-01-01 21:45:48 +01:00
Adriaan de Groot
94bc244965 CMake: also help find where the AppStream headers are 2024-01-01 21:45:34 +01:00
Adriaan de Groot
8a199aaaf9 [packagechooser] Split out helper for AppStreamQt
- add a CMake helper for finding variations of AppStreamQt
- adapt packagechooser and packagechooserq
- adopt a slightly more modern CMake style here
2023-12-31 01:07:08 +01:00
Adriaan de Groot
02aa49d442 CMake: drop "view" alias for module type
Allowing aliases and not using a canonical name for
them (e.g. mapping "view" to "viewmodule") is annoying
since the target name depends on which alias is passed
in to the function. Drop one of the two aliases.
2023-12-31 01:07:08 +01:00
Adriaan de Groot
f847f90842 Changes: document some recent updates and contributions 2023-12-30 20:55:16 +01:00
Adriaan de Groot
fa2b96e9cc [partition] Fix build 2023-12-30 20:55:04 +01:00
22 changed files with 771 additions and 449 deletions

View File

@@ -11,6 +11,8 @@ 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,6 +12,8 @@ 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,6 +13,8 @@ env:
-DCMAKE_BUILD_TYPE=Debug
-DBUILD_SCHEMA_TESTING=ON
-DBUILD_TESTING=ON
-DBUILD_APPSTREAM=ON
-DBUILD_APPDATA=ON
jobs:
build:

36
.github/workflows/nightly-ubuntu.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
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,16 +8,33 @@ 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 (unreleased)
# 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.
This release contains contributions from (alphabetically by first name):
- Nobody yet!
- Adriaan de Groot
- Aleksey Samoilov
- Emir Sari
- Simon Quigley
## Core ##
- No changes of note.
- 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
## Modules ##
- No changes of note.
- The *displaymanager* module configuration for `greetd` has some more
options now. (thanks Aleksey)
# 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 OFF) # Set to ON during a release
set(CALAMARES_RELEASE_MODE ON) # Set to ON during a release
if(CMAKE_SCRIPT_MODE_FILE)
include(${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake)

View File

@@ -0,0 +1,86 @@
# === 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

@@ -19,7 +19,7 @@
#
# calamares_add_plugin(
# module-name
# TYPE <view|job>
# TYPE <viewmodule|job>
# EXPORT_MACRO macro-name
# SOURCES source-file...
# UI ui-file...
@@ -35,7 +35,7 @@
# [WEIGHT w]
# )
#
# Function parameters:
# Function optional 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,6 +65,9 @@
# 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 )
@@ -126,7 +129,7 @@ function( calamares_add_plugin )
set( target "calamares_${PLUGIN_TYPE}_${PLUGIN_NAME}" )
# automatic library linkage
if(PLUGIN_TYPE STREQUAL "view" OR PLUGIN_TYPE STREQUAL "viewmodule")
if(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,7 +10,8 @@
#
# This file has not yet been documented for use outside of Calamares itself.
include( CMakeParseArguments )
include(CMakeParseArguments)
include(FeatureSummary)
# The Gettext module is still old-fashioned, ALLCAPS variables
find_package( Gettext )

47
ci/deps-ubuntu.sh Executable file
View File

@@ -0,0 +1,47 @@
#! /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: 2023-12-27 20:44+0100\n"
"POT-Creation-Date: 2024-01-14 21:33+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:935
#: src/modules/displaymanager/main.py:938
msgid "No display managers selected for the displaymanager module."
msgstr ""
#: src/modules/displaymanager/main.py:936
#: src/modules/displaymanager/main.py:939
msgid ""
"The displaymanagers list is empty or undefined in both globalstorage and "
"displaymanager.conf."
msgstr ""
#: src/modules/displaymanager/main.py:1023
#: src/modules/displaymanager/main.py:1026
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)
foreach(subdir geoip locale modulesystem network partition utils compat packages)
file(GLOB subdir_headers "${subdir}/*.h")
install(FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir})
endforeach()

View File

@@ -128,6 +128,14 @@ 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_MAIN( LocaleTests )
QTEST_GUILESS_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)" ON)
option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" OFF)
if(BUILD_APPDATA)
find_package(${qtname} COMPONENTS Xml)
find_package(${qtname} REQUIRED COMPONENTS Xml)
if(TARGET ${qtname}::Xml)
add_definitions(-DHAVE_APPDATA)
list(APPEND _extra_libraries ${qtname}::Xml)
@@ -23,23 +23,7 @@ endif()
### OPTIONAL AppStream support in PackageModel
#
#
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()
include(AppStreamHelper)
calamares_add_plugin(packagechooser
TYPE viewmodule
@@ -59,6 +43,11 @@ 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,7 +16,6 @@
#ifdef HAVE_APPSTREAM_VERSION
#include "ItemAppStream.h"
#include <AppStreamQt/pool.h>
#include <memory>
#endif

View File

@@ -7,20 +7,16 @@
*
*/
/** @brief Loading items from AppData XML files.
/** @brief Loading items from AppStream database.
*
* Only used if QtXML is found, implements PackageItem::fromAppData().
* Only used if AppStreamQt is found, implements PackageItem::fromAppStream().
*/
#include "PackageModel.h"
#include "ItemAppStream.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,10 +12,28 @@
#include "PackageModel.h"
namespace AppStream
{
class Pool;
} // namespace AppStream
/*
* 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
/** @brief Loads an item from AppStream data.
*

View File

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

View File

@@ -10,9 +10,8 @@ if(NOT WITH_QML)
endif()
find_package(${qtname} ${QT_VERSION} CONFIG REQUIRED Core)
# Add optional libraries here
set(USER_EXTRA_LIB)
set(_extra_libraries "")
set(_extra_src "")
# include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser )
set(_packagechooser ${CMAKE_CURRENT_SOURCE_DIR}/../packagechooser)
@@ -21,9 +20,9 @@ include_directories(${_packagechooser})
### OPTIONAL AppData XML support in PackageModel
#
#
option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" ON)
option(BUILD_APPDATA "Support appdata: items in PackageChooser (requires QtXml)" OFF)
if(BUILD_APPDATA)
find_package(${qtname} COMPONENTS Xml)
find_package(${qtname} REQUIRED COMPONENTS Xml)
if(TARGET ${qtname}::Xml)
add_definitions(-DHAVE_APPDATA)
list(APPEND _extra_libraries ${qtname}::Xml)
@@ -34,23 +33,7 @@ endif()
### OPTIONAL AppStream support in PackageModel
#
#
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()
include(AppStreamHelper)
calamares_add_plugin(packagechooserq
TYPE viewmodule
@@ -67,3 +50,8 @@ 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
{