Commit Graph

152 Commits

Author SHA1 Message Date
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
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
demmm
0e2fa42b60 [CMake] use KPMCore version to select Qt6
with 2588d1e796
KPMCore is Qt6 only, so any version from 24.01.75 on is Qt6, no need to check for Qt version this way
add missing NO_CONFIG to summaryq
2023-11-19 15:40:29 +01:00
Adriaan de Groot
5f06b321b2 CMake: correct copy-paste-o for destination of config files 2023-11-16 23:23:58 +01:00
Adriaan de Groot
2b0c41609d CMake: restore INSTALL_CONFIG 2023-11-09 21:52:12 +01:00
Adriaan de Groot
9bd600cab6 CMake: repair ca9006a1bc
Misplaced $, and looking for translation sources in the
wrong directory, led to a test-case failure before release.
2023-10-14 00:15:05 +02:00
Adriaan de Groot
364e940a9a CMake: don't default to SHARED libraries, require explicit 2023-09-28 20:56:09 +02:00
Adriaan de Groot
57746be66e kpmcore: factor out sometimes-needed dependencies 2023-09-07 23:45:57 +02:00
demmm
07e5a3a113 [partition] start Qt6 work
make kpmcorehelper usable for both kf5 & 6, though no section added yet dealing with set to NOT for Qt6
adjust CalamaresConfig to not be hardcoded to kf5
one more var needed in Variant.h, used in PartitionInfo.cpp
adjust QVariant & QtConcurrent use
2023-09-07 13:03:16 +02:00
Adriaan de Groot
3173a8ee3c i18n: expand helper function to handle more cases
- move template QRC file to the module that defines the function
- add parameters to accept more files (prefixes) per language
2023-09-04 23:26:43 +02:00
Adriaan de Groot
ca9006a1bc i18n: move translation helper-function to CMakeModules 2023-09-04 22:44:08 +02:00
Adriaan de Groot
8a8860e75c Qt6: resolve TODOs against missing KF6
- On FreeBSD, no KF6 was available
- On KDE Neon Unstable, there are somewhat wonky KF6 packages available
- Adjust CMake to find the KDE Neon versions, then fix the C++ code
2023-09-04 21:51:03 +02:00
Adriaan de Groot
49d449c211 i18n: enable Qt6 build of lang/ and libcalamares translations 2023-09-03 23:00:13 +02:00
Adriaan de Groot
2b40ab9a5b CMake: make tests independent of Qt5/6 2023-09-03 22:53:43 +02:00
Adriaan de Groot
8f72d2541f No more INSTALL_CONFIG 2022-11-05 15:46:39 +01:00
Adriaan de Groot
8a43ed99ed CMake: provide calamares::kpmcore only when kpmcore was found
This works around older CMakes that refuse to set arbitrary
properties on a target. Instead, use calamares::kpmcore
as the specific indicator that kpmcore was found.

Breaks build of libcalamares, since that needs **something**
regardless of whether KPMcore was found.
2022-07-23 23:45:32 +02:00
Adriaan de Groot
0688c7f4e7 CMake: target kpmcore doesn't exist elsewhere, so check was failing
Consumers of calapmcode couldn't tell if KPMcore was found.
Pass it around as a property of calapmcore, rather than
anything else.

FIXES #2026
2022-06-28 00:12:33 +02:00
Adriaan de Groot
f42f2514cb CMake: simplify the KPMcore helper 2022-07-21 13:19:19 +02:00
Adriaan de Groot
908928b41c CMake: repair broken logic around finding KPMcore
- the alias libraries calapmcore and calamares::kpmcore
  are always created; if there is no KPMcore, they handle
  definitions to signal that.
- upstream kpmcore target is the one we should be testing
  to see if KPMcore itself is there (or, use KPMcore_FOUND).
2022-07-19 11:54:26 +02:00
Adriaan de Groot
eef3bb19d3
Merge pull request #2011 from calamares/improve-kpmcore
Fix kpmcore detection and compilation on Debian-11
2022-07-18 23:23:32 +02:00
Adriaan de Groot
fb620464d7 CMake: create an alias for KPMcore that fixes its interface
- kpmcore (when used as target "kpmcore") has an interface
  include directory that does not contain the "kpmcore/"
  subdirectory. But the headers it has installed, assume it
  is there (e.g. kpmcore internals use #include <fs/filesystem.h>).
- add an alias at Calamares level that sticks in some more
  includes, adds the relevant WITHOUT_kpmcore when it's
  not there, etc.
2022-07-10 13:38:48 +02:00
Adriaan de Groot
ab813b607f CMake: move kpmcore support into the helper-CMake-module
- find the dependencies just once
- fix the interface for kpmcore so it can find its own
  includes (this is mostly relevant for Debian)
2022-07-10 13:38:48 +02:00
Adriaan de Groot
42f4cdd40c CMake: remove redundant comments (they're at top-level too) 2022-07-02 22:37:52 +02:00
Adriaan de Groot
62de4eb8bf CMake: use modern FindPython and FindBoost 2022-04-25 14:36:16 +02:00
Adriaan de Groot
aedb55ea36 [partition] Require modern KPMCore 2022-03-21 23:44:20 +01:00
Adriaan de Groot
ca4dbabf70 Remove PythonQt support
Nothing beyond the example module was ever built with the
PythonQt bindings, as far as I can tell. They have been
deprecated, defaulting OFF for over two years now.

QML modules fill the gap with customizable, run-time
interpreted UI and stronger support from the C++ side
of Calamares.
2021-09-28 23:49:08 +02:00
Adriaan de Groot
c1e1e6c3a4 Merge branch 'calamares' into work-3.3 2021-09-28 23:37:38 +02:00
Adriaan de Groot
719548213f CMake: if pylint is available, run it as part of the test-suite
This introduces a stub-implementation (fake) that mimics the
API offered by libcalamares (the library is actually exposed
to Python via Boost::Python, so it doesn't act like a C-extension).
Using that stub-implementation, we can check Python modules for
validity as part of the test-suite.

The stub-implementation is needed, because otherwise every
Python module already fails at `import libcalamares`.

- stub-implement the API that is actually used by the Python modules
- in globalstorage, be slightly smart about what keys are being
  requested (so that e.g. all the modules that handle partitions
  information get an empty list and can manipulate that, instead of
  erroring out when they get a string)
2021-09-27 21:02:18 +02:00
Adriaan de Groot
5975ff9e42 CMake: drop NAME option from add_test
- drop the unused "NAME" option for calamares_add_test
- while here reformat the module with the CMake style tool
2021-09-16 11:52:01 +02:00
Adriaan de Groot
ce67712009 CMake: rename imported yamlcpp library
- call it yamlcpp::yamlcpp

This is source-incompatible if targets link explicitly to yamlcpp
2021-07-26 15:04:46 +02:00
Adriaan de Groot
4d1630bf8b CMake: tidy up automatic linking of Calamares libraries
- Modules and plugins don't need to mention libcalamares themselves
  for linking -- we can do that automatically. Use the IMPORTED names
  so that it works in Calamares main repo and external repositories.
- Complain about unknown module types.
2021-07-26 14:27:52 +02:00
Adriaan de Groot
38ec357bd5 CMake: simplify development-version string
- merge the (not-installed) date-stamp and git-version
  files into ExtendedVersion, turn things into functions
- drop support for CVS (wut?)
- don't mention the branch, in git-versioning, because the
  hash is enough to find whatever
- don't need external program to find date, use `string(TIMESTAMP...)`
2021-03-26 18:25:51 +01:00
Adriaan de Groot
2ebf9124d1 CMake: move check for skipped-modules to all subdirs
The check for skipping a subdirectory was applied to Python subdirs,
not to C++ subdirs. This meant that a skipped module would notice
only in calamares_add_plugin() that it should be skipped. The **rest**
of the CMakeLists.txt in the to-be-skipped modules' subdirectory
was not skipped, and so a test might be added for a module that
was skipped. Depending on how the test consumes the code/module
under test, that might fail to link.

Example module is *initramfs*. Reported by yonggan.
2021-03-26 13:37:02 +01:00
Adriaan de Groot
88aa1755ce CMake: split out skip-module-checking to its own cmake module
The skip-checking is now in the functions for adding plugins and
subdirectories, so that third-party building should get it
as well, for free. Since AddModuleSubdirectory and AddPlugin
use the newly split-out module, handling SKIP_MODULES and USE_*
consistently across module repositories is now easier.

While here, make accumulating-the-skipped-modules explicit.
2021-03-23 01:47:10 +01:00
Adriaan de Groot
a64a54ff04 CMake: split out global skip-modules checking
There are two ways to skip building a module:
 - SKIP_MODULES (individually listed)
 - USE_* (pick one from a collection)

Move the handling for those ways to a separate function, so that it
can be re-used in the calamares-extensions module too, or other
external module repositories.
2021-03-23 01:45:03 +01:00
Adriaan de Groot
0bf1df72cd CMake: report Python module name without subdirectory
FIXES ##1641
2021-03-22 13:49:04 +01:00
Adriaan de Groot
e66f81f6ee CMake: comment on BUILD_AS_TEST 2020-11-02 12:01:02 +01:00
Adriaan de Groot
40aa0fcaba CMake: add a helper module for finding KPMcore
I think we had this (kind of) module a long time ago and it was
removed for over-complicating things; re-introduce one now that
KPMcore is used in 3 different places and all would benefit
from consistent API handling / defines.
2020-10-07 00:11:18 +02:00
Adriaan de Groot
aeffbac9cd CMake: add resources to tests
Some tests -- notably the keyboard module -- need to have the
QRC for the module loaded as well (e.g. because of data in the
QRC). Add a RESOURCES parameter to calamares_add_test()
like calamares_add_plugin() already has, to build the
resources into the test.

Keyboard test now passes, since it was missing the data for
lookups before.
2020-09-09 11:58:56 +02:00
Adriaan de Groot
6b6267e3a4 i18n: check for gettext rather than just calling msgfmt
- *secretly* this is already done in the KF5 i18n modules,
  so the resizefs was already requiring FindGettext.
- we don't actually use the gettext modules' CMake macros,
  so explain why in the module.
2020-08-28 01:10:21 +02:00
Adriaan de Groot
392b4d33a0 i18n: create the lang/<lang>/ directories in the build as-needed 2020-08-27 16:39:44 +02:00
Adriaan de Groot
49e925ef47 i18n: untangle translations in the executable
- there's no need for a macro that is going to be used once,
  especially if there's only one place it can be called.
- expand it in place and remove it from the installed CMake
  module
2020-08-27 15:34:17 +02:00
Adriaan de Groot
3529659629 i18n: compile the gettext translations at build time
- need gettext to build translations (TODO: find_program)
- compile the .mo files from .po as part of the build, writing
  to the build-directory only
2020-08-27 15:21:23 +02:00
Adriaan de Groot
242d5c6499 i18n: install Python translations from a sensible place
- put the installation code in lang/ rather than among the modules
- remove useless indirection through CMake macro
2020-08-27 13:59:23 +02:00
Adriaan de Groot
1cd9b93a22 REUSE: Giant boilerplate cleanup
- point to main Calamares site in the 'part of' headers instead
  of to github (this is the "this file is part of Calamares"
  opening line for most files).
- remove boilerplate from all source files, CMake modules and completions,
  this is the 3-paragraph summary of the GPL-3.0-or-later, which has
  a meaning entirely covered by the SPDX tag.
2020-08-26 02:28:38 +02:00
Adriaan de Groot
31d0b5b194 REUSE: (BSD-2-Clause) CMakeModules/
The intended license for the CMake modules is BSD-2-Clause;
there's no desire to restrict what can be done with these,
and CMake modules are generally 2-clause licensed.
2020-08-26 02:01:48 +02:00
Adriaan de Groot
2609e05898 CMake: remove unused module 2020-08-26 00:31:16 +02:00
Adriaan de Groot
c19866f887 [libcalamares] Add a module-weight to the module descriptor 2020-08-12 16:00:27 +02:00