[merge] with upstream
This commit is contained in:
commit
4342b244ba
10
.gersemirc
Normal file
10
.gersemirc
Normal file
@ -0,0 +1,10 @@
|
||||
# SPDX-FileCopyrightText: no
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
# Gersemi configuration
|
||||
color: false
|
||||
definitions: [ CMakeModules/CalamaresAddTest.cmake ]
|
||||
line_length: 120
|
||||
quiet: false
|
||||
unsafe: false
|
||||
|
2
.github/workflows/nightly-debian.yml
vendored
2
.github/workflows/nightly-debian.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker://debian:10
|
||||
image: docker://debian:11
|
||||
options: --tmpfs /build:rw --user 0:0
|
||||
steps:
|
||||
- name: "prepare env"
|
||||
|
2
.github/workflows/nightly-opensuse.yml
vendored
2
.github/workflows/nightly-opensuse.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker://opensuse/leap
|
||||
image: docker://opensuse/tumbleweed
|
||||
options: --tmpfs /build:rw --user 0:0
|
||||
steps:
|
||||
- name: "prepare env"
|
||||
|
4
.github/workflows/push.yml
vendored
4
.github/workflows/push.yml
vendored
@ -4,7 +4,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- calamares
|
||||
- work-3.3
|
||||
- 3.2.x-stable
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
@ -31,7 +31,7 @@ jobs:
|
||||
- name: "prepare env"
|
||||
uses: calamares/actions/prepare-neon@v4
|
||||
- name: "prepare source"
|
||||
uses: calamares/actions/generic-checkout@v4
|
||||
uses: calamares/actions/generic-checkout@330c45ae1eb6efad4ad75a6dd887c3c5d5fe1590
|
||||
- name: "build"
|
||||
id: build
|
||||
uses: calamares/actions/generic-build@v4
|
||||
|
488
3rdparty/kdsingleapplicationguard/LICENSE.LGPL.txt
vendored
488
3rdparty/kdsingleapplicationguard/LICENSE.LGPL.txt
vendored
@ -1,488 +0,0 @@
|
||||
|
||||
The KD Tools Library is Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
|
||||
You may use, distribute and copy the KD Tools Library under the terms of
|
||||
GNU Library General Public License version 2, which is displayed below.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, so that any problems introduced by others will not reflect on
|
||||
the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the source code distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
@ -1,481 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
* SPDX-License-Identifier: LGPL-2.0-only
|
||||
*
|
||||
* The KD Tools Library is Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
*/
|
||||
#include "kdlockedsharedmemorypointer.h"
|
||||
|
||||
#if QT_VERSION >= 0x040400 || defined( DOXYGEN_RUN )
|
||||
#ifndef QT_NO_SHAREDMEMORY
|
||||
|
||||
namespace kdtools
|
||||
{
|
||||
}
|
||||
using namespace kdtools;
|
||||
|
||||
KDLockedSharedMemoryPointerBase::KDLockedSharedMemoryPointerBase( QSharedMemory * m )
|
||||
: locker( m ),
|
||||
mem( m )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
KDLockedSharedMemoryPointerBase::KDLockedSharedMemoryPointerBase( QSharedMemory & m )
|
||||
: locker( &m ),
|
||||
mem( &m )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
KDLockedSharedMemoryPointerBase::~KDLockedSharedMemoryPointerBase() {}
|
||||
|
||||
void * KDLockedSharedMemoryPointerBase::get() {
|
||||
return mem ? mem->data() : 0 ;
|
||||
}
|
||||
|
||||
const void * KDLockedSharedMemoryPointerBase::get() const {
|
||||
return mem ? mem->data() : 0 ;
|
||||
}
|
||||
|
||||
size_t KDLockedSharedMemoryPointerBase::byteSize() const {
|
||||
return mem ? mem->size() : 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
\class KDLockedSharedMemoryPointer
|
||||
\ingroup core raii smartptr
|
||||
\brief Locking pointer for Qt shared memory segments
|
||||
\since_c 2.1
|
||||
|
||||
(The exception safety of this class has not been evaluated yet.)
|
||||
|
||||
KDLockedSharedMemoryPointer is a smart immutable pointer, which gives convenient and safe access to a QSharedMemory data segment.
|
||||
The content of a KDLockedSharedMemoryPointer cannot be changed during it's lifetime.
|
||||
|
||||
You can use this class like a normal pointer to the shared memory segment and be sure it's locked while accessing it.
|
||||
\note You can only put simple types/structs/classes into it. structs and classes shall not contain any other pointers. See the
|
||||
documentation of QSharedMemory for details.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryPointer::KDLockedSharedMemoryPointer( QSharedMemory * mem )
|
||||
|
||||
Constructor. Constructs a KDLockedSharedMemory pointer which points to the data segment of \a mem.
|
||||
The constructor locks \a mem. If the memory segment is already locked by another process, this constructor
|
||||
blocks until the lock is released.
|
||||
|
||||
\post data() == mem->data() and the memory segment has been locked
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryPointer::KDLockedSharedMemoryPointer( QSharedMemory & mem )
|
||||
|
||||
\overload
|
||||
|
||||
\post data() == mem.data() and the memory segment has been locked
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryPointer::~KDLockedSharedMemoryPointer()
|
||||
|
||||
Destructor. Unlocks the shared memory segment.
|
||||
|
||||
\post The shared memory segment has been unlocked
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn T * KDLockedSharedMemoryPointer::get()
|
||||
|
||||
\returns a pointer to the contained object.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const T * KDLockedSharedMemoryPointer::get() const
|
||||
|
||||
\returns a const pointer to the contained object
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn T * KDLockedSharedMemoryPointer::data()
|
||||
|
||||
Equivalent to get(), provided for consistency with Qt naming conventions.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const T * KDLockedSharedMemoryPointer::data() const
|
||||
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn T & KDLockedSharedMemoryPointer::operator*()
|
||||
|
||||
Dereference operator. Returns \link get() *get()\endlink.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const T & KDLockedSharedMemoryPointer::operator*() const
|
||||
|
||||
Dereference operator. Returns \link get() *get()\endlink.
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn T * KDLockedSharedMemoryPointer::operator->()
|
||||
|
||||
Member-by-pointer operator. Returns get().
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const T * KDLockedSharedMemoryPointer::operator->() const
|
||||
|
||||
Member-by-pointer operator. Returns get().
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class KDLockedSharedMemoryArray
|
||||
\ingroup core raii smartptr
|
||||
\brief Locking array pointer to Qt shared memory segments
|
||||
\since_c 2.1
|
||||
|
||||
(The exception safety of this class has not been evaluated yet.)
|
||||
|
||||
KDLockedSharedMemoryArray is a smart immutable pointer, which gives convenient and safe access to array data stored in a QSharedMemory
|
||||
data segment.
|
||||
The content of a KDLockedSharedMemoryArray cannot be changed during it's lifetime.
|
||||
|
||||
You can use this class like a normal pointer to the shared memory segment and be sure it's locked while accessing it.
|
||||
\note You can only put arrays of simple types/structs/classes into it. structs and classes shall not contain any other pointers. See the
|
||||
documentation of QSharedMemory for details.
|
||||
|
||||
\sa KDLockedSharedMemoryPointer
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryArray::KDLockedSharedMemoryArray( QSharedMemory* mem )
|
||||
Constructor. Constructs a KDLockedSharedMemoryArray which points to the data segment of \a mem. The constructor locks \a mem. If the memory
|
||||
segment is already locked by another process, this constructor blocks until the lock is release.
|
||||
|
||||
\post get() == mem->data() and the memory segment has been locked
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryArray::KDLockedSharedMemoryArray( QSharedMemory& mem )
|
||||
\overload
|
||||
|
||||
\post get() == mem->data() and the memory segment has been locked
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\typedef KDLockedSharedMemoryArray::size_type
|
||||
Typedef for std::size_t. Provided for STL compatibility.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\typedef KDLockedSharedMemoryArray::difference_type
|
||||
Typedef for std::ptrdiff_t. Provided for STL compatibility.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\typedef KDLockedSharedMemoryArray::iterator
|
||||
Typedef for T*. Provided for STL compatibility.
|
||||
\since_t 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\typedef KDLockedSharedMemoryArray::const_iterator
|
||||
Typedef for const T*. Provided for STL compatibility.
|
||||
\since_t 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\typedef KDLockedSharedMemoryArray::reverse_iterator
|
||||
Typedef for std::reverse_iterator< \link KDLockedSharedMemoryArray::iterator iterator\endlink >. Provided for STL compatibility.
|
||||
\since_t 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\typedef KDLockedSharedMemoryArray::const_reverse_iterator
|
||||
Typedef for std::reverse_iterator< \link KDLockedSharedMemoryArray::const_iterator const_iterator\endlink >. Provided for STL compatibility.
|
||||
\since_t 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryArray::iterator KDLockedSharedMemoryArray::begin()
|
||||
Returns an \link KDLockedSharedMemoryArray::iterator iterator\endlink pointing to the first item of the array.
|
||||
\since_f 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryArray::const_iterator KDLockedSharedMemoryArray::begin() const
|
||||
\overload
|
||||
\since_f 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryArray::iterator KDLockedSharedMemoryArray::end()
|
||||
Returns an \link KDLockedSharedMemoryArray::iterator iterator\endlink pointing to the item after the last item of the array.
|
||||
\since_f 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryArray::const_iterator KDLockedSharedMemoryArray::end() const
|
||||
\overload
|
||||
\since_f 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryArray::reverse_iterator KDLockedSharedMemoryArray::rbegin()
|
||||
Returns an \link KDLockedSharedMemoryArray::reverse_iterator reverse_iterator\endlink pointing to the item after the last item of the array.
|
||||
\since_f 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryArray::const_reverse_iterator KDLockedSharedMemoryArray::rbegin() const
|
||||
\overload
|
||||
\since_f 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryArray::reverse_iterator KDLockedSharedMemoryArray::rend()
|
||||
Returns an \link KDLockedSharedMemoryArray::reverse_iterator reverse_iterator\endlink pointing to the first item of the array.
|
||||
\since_f 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryArray::const_reverse_iterator KDLockedSharedMemoryArray::rend() const
|
||||
\overload
|
||||
\since_f 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn KDLockedSharedMemoryArray::size_type KDLockedSharedMemoryArray::size() const
|
||||
Returns the size of this array. The size is calculated from the storage size of T and
|
||||
the size of the shared memory segment.
|
||||
\since_f 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn T& KDLockedSharedMemoryArray::operator[]( difference_type n )
|
||||
Array access operator. Returns a reference to the item at index position \a n.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const T& KDLockedSharedMemoryArray::operator[]( difference_type n ) const
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn T& KDLockedSharedMemoryArray::front()
|
||||
Returns a reference to the first item in the array. This is the same as operator[](0).
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const T& KDLockedSharedMemoryArray::front() const
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn T& KDLockedSharedMemoryArray::back()
|
||||
Returns a reference to the last item in the array. This is the same as operator[](size()-1).
|
||||
\since_f 2.2
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const T& KDLockedSharedMemoryArray::back() const
|
||||
\overload
|
||||
\since_f 2.2
|
||||
*/
|
||||
|
||||
|
||||
#ifdef eKDTOOLSCORE_UNITTESTS
|
||||
|
||||
#include <KDUnitTest/Test>
|
||||
|
||||
#include <QThread>
|
||||
#include <QUuid>
|
||||
|
||||
namespace
|
||||
{
|
||||
struct TestStruct
|
||||
{
|
||||
TestStruct( uint nn = 0 )
|
||||
: n( nn ),
|
||||
f( 0.0 ),
|
||||
c( '\0' ),
|
||||
b( false )
|
||||
{
|
||||
}
|
||||
uint n;
|
||||
double f;
|
||||
char c;
|
||||
bool b;
|
||||
};
|
||||
|
||||
bool operator==( const TestStruct& lhs, const TestStruct& rhs )
|
||||
{
|
||||
return lhs.n == rhs.n && lhs.f == rhs.f && lhs.c == rhs.c && lhs.b == rhs.b;
|
||||
}
|
||||
|
||||
class TestThread : public QThread
|
||||
{
|
||||
public:
|
||||
TestThread( const QString& key )
|
||||
: mem( key )
|
||||
{
|
||||
mem.attach();
|
||||
}
|
||||
|
||||
void run()
|
||||
{
|
||||
while( true )
|
||||
{
|
||||
msleep( 100 );
|
||||
kdtools::KDLockedSharedMemoryPointer< TestStruct > p( &mem );
|
||||
if( !p->b )
|
||||
continue;
|
||||
|
||||
p->n = 5;
|
||||
p->f = 3.14;
|
||||
p->c = 'A';
|
||||
p->b = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QSharedMemory mem;
|
||||
};
|
||||
|
||||
bool isConst( TestStruct* )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isConst( const TestStruct* )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
KDAB_UNITTEST_SIMPLE( KDLockedSharedMemoryPointer, "kdcoretools" ) {
|
||||
|
||||
const QString key = QUuid::createUuid();
|
||||
QSharedMemory mem( key );
|
||||
const bool created = mem.create( sizeof( TestStruct ) );
|
||||
assertTrue( created );
|
||||
if ( !created )
|
||||
return; // don't execute tests if shm coulnd't be created
|
||||
|
||||
// On Windows, shared mem is only available in increments of page
|
||||
// size (4k), so don't fail if the segment is larger:
|
||||
const unsigned long mem_size = mem.size();
|
||||
assertGreaterOrEqual( mem_size, sizeof( TestStruct ) );
|
||||
|
||||
{
|
||||
kdtools::KDLockedSharedMemoryPointer< TestStruct > p( &mem );
|
||||
assertTrue( p );
|
||||
*p = TestStruct();
|
||||
assertEqual( p->n, 0u );
|
||||
assertEqual( p->f, 0.0 );
|
||||
assertEqual( p->c, '\0' );
|
||||
assertFalse( p->b );
|
||||
}
|
||||
|
||||
{
|
||||
TestThread thread( key );
|
||||
assertEqual( thread.mem.key().toStdString(), key.toStdString() );
|
||||
assertEqual( static_cast< unsigned long >( thread.mem.size() ), mem_size );
|
||||
thread.start();
|
||||
|
||||
assertTrue( thread.isRunning() );
|
||||
thread.wait( 2000 );
|
||||
assertTrue( thread.isRunning() );
|
||||
|
||||
{
|
||||
kdtools::KDLockedSharedMemoryPointer< TestStruct > p( &mem );
|
||||
p->b = true;
|
||||
}
|
||||
|
||||
thread.wait( 2000 );
|
||||
assertFalse( thread.isRunning() );
|
||||
}
|
||||
|
||||
{
|
||||
kdtools::KDLockedSharedMemoryPointer< TestStruct > p( &mem );
|
||||
assertEqual( p->n, 5u );
|
||||
assertEqual( p->f, 3.14 );
|
||||
assertEqual( p->c, 'A' );
|
||||
assertFalse( p->b );
|
||||
}
|
||||
|
||||
{
|
||||
kdtools::KDLockedSharedMemoryPointer< TestStruct > p( mem );
|
||||
assertEqual( mem.data(), p.get() );
|
||||
assertEqual( p.get(), p.operator->() );
|
||||
assertEqual( p.get(), &(*p) );
|
||||
assertEqual( p.get(), p.data() );
|
||||
assertFalse( isConst( p.get() ) );
|
||||
}
|
||||
|
||||
{
|
||||
const kdtools::KDLockedSharedMemoryPointer< TestStruct > p( &mem );
|
||||
assertEqual( mem.data(), p.get() );
|
||||
assertEqual( p.get(), p.operator->() );
|
||||
assertEqual( p.get(), &(*p) );
|
||||
assertEqual( p.get(), p.data() );
|
||||
assertTrue( isConst( p.get() ) );
|
||||
}
|
||||
|
||||
{
|
||||
QSharedMemory mem2( key + key );
|
||||
const bool created2 = mem2.create( 16 * sizeof( TestStruct ) );
|
||||
assertTrue( created2 );
|
||||
if ( !created2 )
|
||||
return; // don't execute tests if shm coulnd't be created
|
||||
|
||||
kdtools::KDLockedSharedMemoryArray<TestStruct> a( mem2 );
|
||||
assertTrue( a );
|
||||
assertEqual( a.get(), mem2.data() );
|
||||
assertEqual( &a[0], a.get() );
|
||||
|
||||
a[1] = a[0];
|
||||
assertTrue( a[0] == a[1] );
|
||||
|
||||
TestStruct ts;
|
||||
ts.n = 5;
|
||||
ts.f = 3.14;
|
||||
a[0] = ts;
|
||||
assertFalse( a[0] == a[1] );
|
||||
assertEqual( a.front().n, ts.n );
|
||||
assertEqual( a[0].f, ts.f );
|
||||
a[0].n = 10;
|
||||
assertEqual( a.front().n, 10u );
|
||||
ts = a[0];
|
||||
assertEqual( ts.n, 10u );
|
||||
|
||||
std::vector< TestStruct > v;
|
||||
for( uint i = 0; i < a.size(); ++i )
|
||||
v.push_back( TestStruct( i ) );
|
||||
|
||||
std::copy( v.begin(), v.end(), a.begin() );
|
||||
for( uint i = 0; i < a.size(); ++i )
|
||||
assertEqual( a[ i ].n, i );
|
||||
assertEqual( a.front().n, 0u );
|
||||
assertEqual( a.back().n, a.size() - 1 );
|
||||
|
||||
std::copy( v.begin(), v.end(), a.rbegin() );
|
||||
for( uint i = 0; i < a.size(); ++i )
|
||||
assertEqual( a[ i ].n, a.size() - 1 - i );
|
||||
assertEqual( a.front().n, a.size() - 1 );
|
||||
assertEqual( a.back().n, 0u );
|
||||
}
|
||||
|
||||
}
|
||||
#endif // KDTOOLSCORE_UNITTESTS
|
||||
#endif // QT_NO_SHAREDMEMORY
|
||||
#endif // QT_VERSION >= 0x040400 || defined( DOXYGEN_RUN )
|
@ -1,121 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
* SPDX-License-Identifier: LGPL-2.0-only
|
||||
*
|
||||
* The KD Tools Library is Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
*/
|
||||
#ifndef __KDTOOLS__CORE__KDLOCKEDSHAREDMEMORYPOINTER_H__
|
||||
#define __KDTOOLS__CORE__KDLOCKEDSHAREDMEMORYPOINTER_H__
|
||||
|
||||
#include <QtCore/QtGlobal>
|
||||
|
||||
#if QT_VERSION >= 0x040400 || defined( DOXYGEN_RUN )
|
||||
#ifndef QT_NO_SHAREDMEMORY
|
||||
|
||||
#include "kdsharedmemorylocker.h"
|
||||
#include <QtCore/QSharedMemory>
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#ifndef DOXYGEN_RUN
|
||||
namespace kdtools {
|
||||
#endif
|
||||
|
||||
class KDLockedSharedMemoryPointerBase {
|
||||
protected:
|
||||
explicit KDLockedSharedMemoryPointerBase( QSharedMemory * mem );
|
||||
explicit KDLockedSharedMemoryPointerBase( QSharedMemory & mem );
|
||||
~KDLockedSharedMemoryPointerBase();
|
||||
|
||||
// PENDING(marc) do we really want const propagation here? I
|
||||
// usually declare all my RAII objects const...
|
||||
void * get();
|
||||
const void * get() const;
|
||||
|
||||
KDAB_IMPLEMENT_SAFE_BOOL_OPERATOR( get() )
|
||||
|
||||
size_t byteSize() const;
|
||||
|
||||
private:
|
||||
KDSharedMemoryLocker locker;
|
||||
QSharedMemory * const mem;
|
||||
};
|
||||
|
||||
template< typename T>
|
||||
class MAKEINCLUDES_EXPORT KDLockedSharedMemoryPointer : KDLockedSharedMemoryPointerBase {
|
||||
KDAB_DISABLE_COPY( KDLockedSharedMemoryPointer );
|
||||
public:
|
||||
explicit KDLockedSharedMemoryPointer( QSharedMemory * m )
|
||||
: KDLockedSharedMemoryPointerBase( m ) {}
|
||||
explicit KDLockedSharedMemoryPointer( QSharedMemory & m )
|
||||
: KDLockedSharedMemoryPointerBase( m ) {}
|
||||
|
||||
T * get() { return static_cast<T*>( KDLockedSharedMemoryPointerBase::get() ); }
|
||||
const T * get() const { return static_cast<const T*>( KDLockedSharedMemoryPointerBase::get() ); }
|
||||
|
||||
T * data() { return static_cast<T*>( get() ); }
|
||||
const T * data() const { return static_cast<const T*>( get() ); }
|
||||
|
||||
T & operator*() { assert( get() ); return *get(); }
|
||||
const T & operator*() const { assert( get() ); return *get(); }
|
||||
|
||||
T * operator->() { return get(); }
|
||||
const T * operator->() const { return get(); }
|
||||
|
||||
KDAB_USING_SAFE_BOOL_OPERATOR( KDLockedSharedMemoryPointerBase )
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class MAKEINCLUDES_EXPORT KDLockedSharedMemoryArray : KDLockedSharedMemoryPointerBase {
|
||||
KDAB_DISABLE_COPY( KDLockedSharedMemoryArray );
|
||||
public:
|
||||
explicit KDLockedSharedMemoryArray( QSharedMemory * m )
|
||||
: KDLockedSharedMemoryPointerBase( m ) {}
|
||||
explicit KDLockedSharedMemoryArray( QSharedMemory & m )
|
||||
: KDLockedSharedMemoryPointerBase( m ) {}
|
||||
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef T* iterator;
|
||||
typedef const T* const_iterator;
|
||||
typedef std::reverse_iterator< const_iterator > const_reverse_iterator;
|
||||
typedef std::reverse_iterator< iterator > reverse_iterator;
|
||||
|
||||
iterator begin() { return get(); }
|
||||
const_iterator begin() const { return get(); }
|
||||
|
||||
iterator end() { return begin() + size(); }
|
||||
const_iterator end() const { return begin() + size(); }
|
||||
|
||||
reverse_iterator rbegin() { return reverse_iterator( end() ); }
|
||||
const_reverse_iterator rbegin() const { return reverse_iterator( end() ); }
|
||||
|
||||
reverse_iterator rend() { return reverse_iterator( begin() ); }
|
||||
const_reverse_iterator rend() const { return const_reverse_iterator( begin() ); }
|
||||
|
||||
size_type size() const { return byteSize() / sizeof( T ); }
|
||||
|
||||
T * get() { return static_cast<T*>( KDLockedSharedMemoryPointerBase::get() ); }
|
||||
const T * get() const { return static_cast<const T*>( KDLockedSharedMemoryPointerBase::get() ); }
|
||||
|
||||
T & operator[]( difference_type n ) { assert( get() ); return *(get()+n); }
|
||||
const T & operator[]( difference_type n ) const { assert( get() ); return *(get()+n); }
|
||||
|
||||
T & front() { assert( get() ); return *get(); }
|
||||
const T & front() const { assert( get() ); return *get(); }
|
||||
|
||||
T & back() { assert( get() ); return *( get() + size() - 1 ); }
|
||||
const T & back() const { assert( get() ); return *( get() + size() - 1 ); }
|
||||
|
||||
KDAB_USING_SAFE_BOOL_OPERATOR( KDLockedSharedMemoryPointerBase )
|
||||
};
|
||||
|
||||
#ifndef DOXYGEN_RUN
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* QT_NO_SHAREDMEMORY */
|
||||
|
||||
#endif /* QT_VERSION >= 0x040400 || defined( DOXYGEN_RUN ) */
|
||||
|
||||
#endif /* __KDTOOLS__CORE__KDLOCKEDSHAREDMEMORYPOINTER_H__ */
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
* SPDX-License-Identifier: LGPL-2.0-only
|
||||
*
|
||||
* The KD Tools Library is Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
*/
|
||||
#include "kdsharedmemorylocker.h"
|
||||
|
||||
#if QT_VERSION >= 0x040400 || defined( DOXYGEN_RUN )
|
||||
|
||||
#include <QSharedMemory>
|
||||
|
||||
using namespace kdtools;
|
||||
|
||||
/*!
|
||||
\class KDSharedMemoryLocker
|
||||
\ingroup raii core
|
||||
\brief Exception-safe and convenient wrapper around QSharedMemory::lock()
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructor. Locks the shared memory segment \a mem.
|
||||
* If another process has locking the segment, this constructor blocks
|
||||
* until the lock is released. The memory segments needs to be properly created or attached.
|
||||
*/
|
||||
KDSharedMemoryLocker::KDSharedMemoryLocker( QSharedMemory* mem )
|
||||
: mem( mem )
|
||||
{
|
||||
mem->lock();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor. Unlocks the shared memory segment associated with this
|
||||
* KDSharedMemoryLocker.
|
||||
*/
|
||||
KDSharedMemoryLocker::~KDSharedMemoryLocker()
|
||||
{
|
||||
mem->unlock();
|
||||
}
|
||||
|
||||
#ifdef KDAB_EVAL
|
||||
#include KDAB_EVAL
|
||||
static const EvalDialogChecker evalChecker( "KD Tools", false );
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
* SPDX-License-Identifier: LGPL-2.0-only
|
||||
*
|
||||
* The KD Tools Library is Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
*/
|
||||
#ifndef __KDTOOLS__CORE__KDSHAREDMEMORYLOCKER_H
|
||||
#define __KDTOOLS__CORE__KDSHAREDMEMORYLOCKER_H
|
||||
|
||||
#include "kdtoolsglobal.h"
|
||||
|
||||
#if QT_VERSION < 0x040400 && !defined( DOXYGEN_RUN )
|
||||
#ifdef Q_CC_GNU
|
||||
#warning "Can't use KDTools KDSharedMemoryLocker with Qt versions prior to 4.4"
|
||||
#endif
|
||||
#else
|
||||
|
||||
class QSharedMemory;
|
||||
|
||||
#ifndef DOXYGEN_RUN
|
||||
namespace kdtools
|
||||
{
|
||||
#endif
|
||||
|
||||
class KDTOOLSCORE_EXPORT KDSharedMemoryLocker
|
||||
{
|
||||
Q_DISABLE_COPY( KDSharedMemoryLocker )
|
||||
public:
|
||||
KDSharedMemoryLocker( QSharedMemory* mem );
|
||||
~KDSharedMemoryLocker();
|
||||
|
||||
private:
|
||||
QSharedMemory* const mem;
|
||||
};
|
||||
|
||||
#ifndef DOXYGEN_RUN
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -1,147 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
* SPDX-License-Identifier: LGPL-2.0-only
|
||||
*
|
||||
* The KD Tools Library is Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
*/
|
||||
#ifndef KDTOOLSCORE_KDSINGLEAPPLICATIONGUARD_H
|
||||
#define KDTOOLSCORE_KDSINGLEAPPLICATIONGUARD_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
#ifndef QT_NO_SHAREDMEMORY
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QMetaType>
|
||||
|
||||
#include "pimpl_ptr.h"
|
||||
#include "DllMacro.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
template <typename T> class QVector;
|
||||
class QCoreApplication;
|
||||
|
||||
class DLLEXPORT KDSingleApplicationGuard : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_ENUMS( Policy )
|
||||
Q_PROPERTY( bool operational READ isOperational )
|
||||
Q_PROPERTY( bool exitRequested READ isExitRequested )
|
||||
Q_PROPERTY( bool primaryInstance READ isPrimaryInstance NOTIFY becamePrimaryInstance )
|
||||
Q_PROPERTY( Policy policy READ policy WRITE setPolicy NOTIFY policyChanged )
|
||||
public:
|
||||
enum Policy
|
||||
{
|
||||
NoPolicy = 0,
|
||||
AutoKillOtherInstances = 1
|
||||
};
|
||||
|
||||
explicit KDSingleApplicationGuard( QObject * parent=nullptr );
|
||||
explicit KDSingleApplicationGuard( Policy policy, QObject * parent=nullptr );
|
||||
explicit KDSingleApplicationGuard( const QStringList & arguments, QObject * parent=nullptr );
|
||||
explicit KDSingleApplicationGuard( const QStringList & arguments, Policy policy, QObject * parent=nullptr );
|
||||
~KDSingleApplicationGuard() override;
|
||||
|
||||
bool isOperational() const;
|
||||
|
||||
bool isExitRequested() const;
|
||||
|
||||
bool isPrimaryInstance() const;
|
||||
|
||||
Policy policy() const;
|
||||
void setPolicy( Policy policy );
|
||||
|
||||
class Instance;
|
||||
|
||||
QVector<Instance> instances() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void instanceStarted( const KDSingleApplicationGuard::Instance & instance );
|
||||
void instanceExited( const KDSingleApplicationGuard::Instance & instance );
|
||||
void exitRequested();
|
||||
void raiseRequested();
|
||||
void becamePrimaryInstance();
|
||||
void becameSecondaryInstance();
|
||||
void policyChanged( KDSingleApplicationGuard::Policy policy );
|
||||
|
||||
public Q_SLOTS:
|
||||
void shutdownOtherInstances();
|
||||
void killOtherInstances();
|
||||
|
||||
protected:
|
||||
/*! \reimp */ bool event( QEvent * event ) override;
|
||||
|
||||
private:
|
||||
#ifndef Q_WS_WIN
|
||||
static void SIGINT_handler( int );
|
||||
#endif
|
||||
|
||||
private:
|
||||
friend struct ProcessInfo;
|
||||
|
||||
class Private;
|
||||
kdtools::pimpl_ptr< Private > d;
|
||||
};
|
||||
|
||||
class DLLEXPORT KDSingleApplicationGuard::Instance {
|
||||
friend class ::KDSingleApplicationGuard;
|
||||
friend class ::KDSingleApplicationGuard::Private;
|
||||
Instance( const QStringList &, bool, qint64 );
|
||||
public:
|
||||
Instance();
|
||||
Instance( const Instance & other );
|
||||
~Instance();
|
||||
|
||||
void swap( Instance & other ) {
|
||||
std::swap( d, other.d );
|
||||
}
|
||||
|
||||
Instance & operator=( Instance other ) {
|
||||
swap( other );
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool isNull() const { return !d; }
|
||||
bool isValid() const;
|
||||
|
||||
bool areArgumentsTruncated() const;
|
||||
|
||||
const QStringList & arguments() const;
|
||||
qint64 pid() const;
|
||||
|
||||
void shutdown();
|
||||
void kill();
|
||||
void raise();
|
||||
|
||||
private:
|
||||
class Private;
|
||||
Private * d;
|
||||
};
|
||||
|
||||
namespace std {
|
||||
template <>
|
||||
inline void swap( KDSingleApplicationGuard::Instance & lhs,
|
||||
KDSingleApplicationGuard::Instance & rhs )
|
||||
{
|
||||
lhs.swap( rhs );
|
||||
}
|
||||
} // namespace std
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
template <>
|
||||
inline void qSwap( KDSingleApplicationGuard::Instance & lhs,
|
||||
KDSingleApplicationGuard::Instance & rhs )
|
||||
{
|
||||
lhs.swap( rhs );
|
||||
}
|
||||
Q_DECLARE_METATYPE( KDSingleApplicationGuard::Instance )
|
||||
Q_DECLARE_TYPEINFO( KDSingleApplicationGuard::Instance, Q_MOVABLE_TYPE );
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
||||
#endif // QT_NO_SHAREDMEMORY
|
||||
|
||||
#endif /* KDTOOLSCORE_KDSINGLEAPPLICATIONGUARD_H */
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
* SPDX-License-Identifier: LGPL-2.0-only
|
||||
*
|
||||
* The KD Tools Library is Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
*/
|
||||
#include "kdtoolsglobal.h"
|
||||
|
||||
#include <QByteArray>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace {
|
||||
struct Version {
|
||||
unsigned char v[3];
|
||||
};
|
||||
|
||||
static inline bool operator<( const Version & lhs, const Version & rhs ) {
|
||||
return std::lexicographical_compare( lhs.v, lhs.v + 3, rhs.v, rhs.v + 3 );
|
||||
}
|
||||
static inline bool operator==( const Version & lhs, const Version & rhs ) {
|
||||
return std::equal( lhs.v, lhs.v + 3, rhs.v );
|
||||
}
|
||||
KDTOOLS_MAKE_RELATION_OPERATORS( Version, static inline )
|
||||
}
|
||||
|
||||
static Version kdParseQtVersion( const char * const version ) {
|
||||
if ( !version || qstrlen( version ) < 5 || version[1] != '.' || version[3] != '.' || ( version[5] != 0 && version[5] != '.' && version[5] != '-' ) )
|
||||
return Version(); // parse error
|
||||
const Version result = { { static_cast< unsigned char >( version[0] - '0' ),
|
||||
static_cast< unsigned char >( version[2] - '0' ),
|
||||
static_cast< unsigned char >( version[4] - '0' ) } };
|
||||
return result;
|
||||
}
|
||||
|
||||
bool _kdCheckQtVersion_impl( unsigned int major, unsigned int minor, unsigned int patchlevel ) {
|
||||
static const Version actual = kdParseQtVersion( qVersion() ); // do this only once each run...
|
||||
const Version requested = { { static_cast< unsigned char >( major ),
|
||||
static_cast< unsigned char >( minor ),
|
||||
static_cast< unsigned char >( patchlevel ) } };
|
||||
return actual >= requested;
|
||||
}
|
120
3rdparty/kdsingleapplicationguard/kdtoolsglobal.h
vendored
120
3rdparty/kdsingleapplicationguard/kdtoolsglobal.h
vendored
@ -1,120 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
* SPDX-License-Identifier: LGPL-2.0-only
|
||||
*
|
||||
* The KD Tools Library is Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
*/
|
||||
#ifndef KDTOOLS_KDTOOLSGLOBAL_H
|
||||
#define KDTOOLS_KDTOOLSGLOBAL_H
|
||||
|
||||
#include <QtCore/QtGlobal>
|
||||
|
||||
#define KDAB_DISABLE_COPY( x ) private: x( const x & ); x & operator=( const x & )
|
||||
|
||||
#ifdef KDTOOLS_SHARED
|
||||
# ifdef BUILD_SHARED_KDTOOLSCORE
|
||||
# define KDTOOLSCORE_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define KDTOOLSCORE_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
# ifdef BUILD_SHARED_KDTOOLSGUI
|
||||
# define KDTOOLSGUI_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define KDTOOLSGUI_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
# ifdef BUILD_SHARED_KDTOOLSXML
|
||||
# define KDTOOLSXML_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define KDTOOLSXML_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
# ifdef BUILD_SHARED_KDUPDATER
|
||||
# define KDTOOLS_UPDATER_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define KDTOOLS_UPDATER_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
#else // KDTOOLS_SHARED
|
||||
# define KDTOOLSCORE_EXPORT
|
||||
# define KDTOOLSGUI_EXPORT
|
||||
# define KDTOOLSXML_EXPORT
|
||||
# define KDTOOLS_UPDATER_EXPORT
|
||||
#endif // KDTOOLS_SHARED
|
||||
|
||||
#define MAKEINCLUDES_EXPORT
|
||||
|
||||
#define DOXYGEN_PROPERTY( x )
|
||||
#ifdef DOXYGEN_RUN
|
||||
# define KDAB_IMPLEMENT_SAFE_BOOL_OPERATOR( func ) operator unspecified_bool_type() const { return func; }
|
||||
# define KDAB_USING_SAFE_BOOL_OPERATOR( Class ) operator unspecified_bool_type() const;
|
||||
#else
|
||||
# define KDAB_IMPLEMENT_SAFE_BOOL_OPERATOR( func ) \
|
||||
private: \
|
||||
struct __safe_bool_dummy__ { void nonnull() {} }; \
|
||||
public: \
|
||||
typedef void ( __safe_bool_dummy__::*unspecified_bool_type )(); \
|
||||
operator unspecified_bool_type() const { \
|
||||
return ( func ) ? &__safe_bool_dummy__::nonnull : 0 ; \
|
||||
}
|
||||
#define KDAB_USING_SAFE_BOOL_OPERATOR( Class ) \
|
||||
using Class::operator Class::unspecified_bool_type;
|
||||
#endif
|
||||
|
||||
#define KDTOOLS_MAKE_RELATION_OPERATORS( Class, linkage ) \
|
||||
linkage bool operator>( const Class & lhs, const Class & rhs ) { \
|
||||
return operator<( rhs, lhs ); \
|
||||
} \
|
||||
linkage bool operator!=( const Class & lhs, const Class & rhs ) { \
|
||||
return !operator==( lhs, rhs ); \
|
||||
} \
|
||||
linkage bool operator<=( const Class & lhs, const Class & rhs ) { \
|
||||
return !operator>( lhs, rhs ); \
|
||||
} \
|
||||
linkage bool operator>=( const Class & lhs, const Class & rhs ) { \
|
||||
return !operator<( lhs, rhs ); \
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T & __kdtools__dereference_for_methodcall( T & o ) {
|
||||
return o;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T & __kdtools__dereference_for_methodcall( T * o ) {
|
||||
return *o;
|
||||
}
|
||||
|
||||
#define KDAB_SET_OBJECT_NAME( x ) __kdtools__dereference_for_methodcall( x ).setObjectName( QLatin1String( #x ) )
|
||||
|
||||
KDTOOLSCORE_EXPORT bool _kdCheckQtVersion_impl( unsigned int major, unsigned int minor=0, unsigned int patchlevel=0 );
|
||||
static inline bool kdCheckQtVersion( unsigned int major, unsigned int minor=0, unsigned int patchlevel=0 ) {
|
||||
return (major<<16|minor<<8|patchlevel) <= static_cast<unsigned int>(QT_VERSION)
|
||||
|| _kdCheckQtVersion_impl( major, minor, patchlevel );
|
||||
}
|
||||
|
||||
#define KDTOOLS_DECLARE_PRIVATE_BASE( Class ) \
|
||||
protected: \
|
||||
class Private; \
|
||||
Private * d_func() { return _d; } \
|
||||
const Private * d_func() const { return _d; } \
|
||||
Class( Private * _d_, bool b ) : _d( _d_ ) { init(b); } \
|
||||
private: \
|
||||
void init(bool); \
|
||||
private: \
|
||||
Private * _d
|
||||
|
||||
#define KDTOOLS_DECLARE_PRIVATE_DERIVED( Class, Base ) \
|
||||
protected: \
|
||||
class Private; \
|
||||
Private * d_func() { \
|
||||
return reinterpret_cast<Private*>( Base::d_func() ); \
|
||||
} \
|
||||
const Private * d_func() const { \
|
||||
return reinterpret_cast<const Private*>( Base::d_func() ); \
|
||||
} \
|
||||
Class( Private * _d_, bool b ) \
|
||||
: Base( reinterpret_cast<Base::Private*>(_d_), b ) { init(b); } \
|
||||
private: \
|
||||
void init(bool)
|
||||
|
||||
|
||||
#endif /* KDTOOLS_KDTOOLSGLOBAL_H */
|
||||
|
209
3rdparty/kdsingleapplicationguard/pimpl_ptr.cpp
vendored
209
3rdparty/kdsingleapplicationguard/pimpl_ptr.cpp
vendored
@ -1,209 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
* SPDX-License-Identifier: LGPL-2.0-only
|
||||
*
|
||||
* The KD Tools Library is Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
*/
|
||||
#include "pimpl_ptr.h"
|
||||
|
||||
/*!
|
||||
\class pimpl_ptr:
|
||||
\ingroup core smartptr
|
||||
\brief Owning pointer for private implementations
|
||||
\since_c 2.1
|
||||
|
||||
(The exception safety of this class has not been evaluated yet.)
|
||||
|
||||
pimpl_ptr is a smart immutable pointer, which owns the contained object. Unlike other smart pointers,
|
||||
it creates a standard constructed object when instanciated via the
|
||||
\link pimpl_ptr() standard constructor\endlink.
|
||||
Additionally, pimpl_ptr respects constness of the pointer object and returns \c const \c T* for
|
||||
a const pimpl_ptr object.
|
||||
|
||||
The content of a pimpl_ptr cannot be changed during it's lifetime.
|
||||
|
||||
\section general-use General Use
|
||||
|
||||
The general use case of pimpl_ptr is the "Pimpl Idiom", i.e. hiding the private implementation of a class
|
||||
from the user's compiler which see \c MyClass as
|
||||
|
||||
\code
|
||||
class MyClass
|
||||
{
|
||||
public:
|
||||
MyClass();
|
||||
~MyClass();
|
||||
|
||||
// public class API
|
||||
int value() const;
|
||||
|
||||
private:
|
||||
class Private; // defined later
|
||||
kdtools::pimpl_ptr< Private > d;
|
||||
};
|
||||
\endcode
|
||||
|
||||
but not the private parts of it. These can only be seen (and accessed) by the code knowing \c MyClass::Private:
|
||||
|
||||
\code
|
||||
class MyClass::Private
|
||||
{
|
||||
public:
|
||||
int value;
|
||||
};
|
||||
|
||||
MyClass::MyClass()
|
||||
{
|
||||
// d was automatically filled with new Private
|
||||
d->value = 42;
|
||||
}
|
||||
|
||||
MyClass::~MyClass()
|
||||
{
|
||||
// the content of d gets deleted automatically
|
||||
}
|
||||
|
||||
int MyClass::value() const
|
||||
{
|
||||
// access the private part:
|
||||
// since MyClass::value() is const, the returned pointee is const, too
|
||||
return d->value;
|
||||
}
|
||||
\endcode
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn pimpl_ptr::pimpl_ptr()
|
||||
|
||||
Default constructor. Constructs a pimpl_tr that contains (owns) a standard constructed
|
||||
instance of \c T.
|
||||
|
||||
\post \c *this owns a new object.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn pimpl_ptr::pimpl_ptr( T * t )
|
||||
|
||||
Constructor. Constructs a pimpl_ptr that contains (owns) \a t.
|
||||
|
||||
\post get() == obj
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn pimpl_ptr::~pimpl_ptr()
|
||||
|
||||
Destructor.
|
||||
|
||||
\post The object previously owned by \c *this has been deleted.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const T * pimpl_ptr::get() const
|
||||
|
||||
\returns a const pointer to the contained (owned) object.
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn T * pimpl_ptr::get()
|
||||
|
||||
\returns a pointer to the contained (owned) object.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const T & pimpl_ptr::operator*() const
|
||||
|
||||
Dereference operator. Returns \link get() *get()\endlink.
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn T & pimpl_ptr::operator*()
|
||||
|
||||
Dereference operator. Returns \link get() *get()\endlink.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const T * pimpl_ptr::operator->() const
|
||||
|
||||
Member-by-pointer operator. Returns get().
|
||||
\overload
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn T * pimpl_ptr::operator->()
|
||||
|
||||
Member-by-pointer operator. Returns get().
|
||||
*/
|
||||
|
||||
#ifdef KDTOOLSCORE_UNITTESTS
|
||||
|
||||
#include <kdunittest/test.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
|
||||
namespace
|
||||
{
|
||||
struct ConstTester
|
||||
{
|
||||
bool isConst()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isConst() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
KDAB_UNITTEST_SIMPLE( pimpl_ptr, "kdcoretools" ) {
|
||||
|
||||
{
|
||||
kdtools::pimpl_ptr< QObject > p;
|
||||
assertNotNull( p.get() );
|
||||
assertNull( p->parent() );
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
QPointer< QObject > o;
|
||||
{
|
||||
kdtools::pimpl_ptr< QObject > qobject( new QObject );
|
||||
o = qobject.get();
|
||||
assertEqual( o, qobject.operator->() );
|
||||
assertEqual( o, &(qobject.operator*()) );
|
||||
}
|
||||
assertNull( o );
|
||||
}
|
||||
|
||||
{
|
||||
const kdtools::pimpl_ptr< QObject > qobject( new QObject );
|
||||
const QObject* o = qobject.get();
|
||||
assertEqual( o, qobject.operator->() );
|
||||
assertEqual( o, &(qobject.operator*()) );
|
||||
}
|
||||
|
||||
{
|
||||
kdtools::pimpl_ptr< QObject > o1;
|
||||
assertTrue( o1 );
|
||||
kdtools::pimpl_ptr< QObject > o2( 0 );
|
||||
assertFalse( o2 );
|
||||
}
|
||||
|
||||
{
|
||||
const kdtools::pimpl_ptr< ConstTester > o1;
|
||||
kdtools::pimpl_ptr< ConstTester > o2;
|
||||
assertTrue( o1->isConst() );
|
||||
assertFalse( o2->isConst() );
|
||||
assertTrue( (*o1).isConst() );
|
||||
assertFalse( (*o2).isConst() );
|
||||
assertTrue( o1.get()->isConst() );
|
||||
assertFalse( o2.get()->isConst() );
|
||||
}
|
||||
}
|
||||
|
||||
#endif // KDTOOLSCORE_UNITTESTS
|
50
3rdparty/kdsingleapplicationguard/pimpl_ptr.h
vendored
50
3rdparty/kdsingleapplicationguard/pimpl_ptr.h
vendored
@ -1,50 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
* SPDX-License-Identifier: LGPL-2.0-only
|
||||
*
|
||||
* The KD Tools Library is Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
*/
|
||||
#ifndef KDTOOLSCORE_PIMPL_PTR_H
|
||||
#define KDTOOLSCORE_PIMPL_PTR_H
|
||||
|
||||
#include "kdtoolsglobal.h"
|
||||
|
||||
#ifndef DOXYGEN_RUN
|
||||
namespace kdtools {
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
class pimpl_ptr {
|
||||
KDAB_DISABLE_COPY( pimpl_ptr );
|
||||
T * d;
|
||||
public:
|
||||
pimpl_ptr() : d( new T ) {}
|
||||
explicit pimpl_ptr( T * t ) : d( t ) {}
|
||||
~pimpl_ptr() { delete d; d = nullptr; }
|
||||
|
||||
T * get() { return d; }
|
||||
const T * get() const { return d; }
|
||||
|
||||
T * operator->() { return get(); }
|
||||
const T * operator->() const { return get(); }
|
||||
|
||||
T & operator*() { return *get(); }
|
||||
const T & operator*() const { return *get(); }
|
||||
|
||||
KDAB_IMPLEMENT_SAFE_BOOL_OPERATOR( get() )
|
||||
};
|
||||
|
||||
// these are not implemented, so's we can catch their use at
|
||||
// link-time. Leaving them undeclared would open up a comparison
|
||||
// via operator unspecified-bool-type().
|
||||
template <typename T, typename S>
|
||||
void operator==( const pimpl_ptr<T> &, const pimpl_ptr<S> & );
|
||||
template <typename T, typename S>
|
||||
void operator!=( const pimpl_ptr<T> &, const pimpl_ptr<S> & );
|
||||
|
||||
#ifndef DOXYGEN_RUN
|
||||
} // namespace kdtools
|
||||
#endif
|
||||
|
||||
#endif /* KDTOOLSCORE_PIMPL_PTR_H */
|
||||
|
284
3rdparty/waitingspinnerwidget.cpp
vendored
284
3rdparty/waitingspinnerwidget.cpp
vendored
@ -1,284 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2012-2014 Alexander Turkin
|
||||
* SPDX-FileCopyrightText: 2014 William Hallatt
|
||||
* SPDX-FileCopyrightText: 2015 Jacob Dawid
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/* Original Work Copyright (c) 2012-2014 Alexander Turkin
|
||||
Modified 2014 by William Hallatt
|
||||
Modified 2015 by Jacob Dawid
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// Own includes
|
||||
#include "waitingspinnerwidget.h"
|
||||
|
||||
// Standard includes
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
|
||||
// Qt includes
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
|
||||
WaitingSpinnerWidget::WaitingSpinnerWidget(QWidget *parent,
|
||||
bool centerOnParent,
|
||||
bool disableParentWhenSpinning)
|
||||
: QWidget(parent),
|
||||
_centerOnParent(centerOnParent),
|
||||
_disableParentWhenSpinning(disableParentWhenSpinning) {
|
||||
initialize();
|
||||
}
|
||||
|
||||
WaitingSpinnerWidget::WaitingSpinnerWidget(Qt::WindowModality modality,
|
||||
QWidget *parent,
|
||||
bool centerOnParent,
|
||||
bool disableParentWhenSpinning)
|
||||
: QWidget(parent, Qt::Dialog | Qt::FramelessWindowHint),
|
||||
_centerOnParent(centerOnParent),
|
||||
_disableParentWhenSpinning(disableParentWhenSpinning){
|
||||
initialize();
|
||||
|
||||
// We need to set the window modality AFTER we've hidden the
|
||||
// widget for the first time since changing this property while
|
||||
// the widget is visible has no effect.
|
||||
setWindowModality(modality);
|
||||
setAttribute(Qt::WA_TranslucentBackground);
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::initialize() {
|
||||
_color = Qt::black;
|
||||
_roundness = 100.0;
|
||||
_minimumTrailOpacity = 3.14159265358979323846;
|
||||
_trailFadePercentage = 80.0;
|
||||
_revolutionsPerSecond = 1.57079632679489661923;
|
||||
_numberOfLines = 20;
|
||||
_lineLength = 10;
|
||||
_lineWidth = 2;
|
||||
_innerRadius = 10;
|
||||
_currentCounter = 0;
|
||||
_isSpinning = false;
|
||||
|
||||
_timer = new QTimer(this);
|
||||
connect(_timer, SIGNAL(timeout()), this, SLOT(rotate()));
|
||||
updateSize();
|
||||
updateTimer();
|
||||
hide();
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::paintEvent(QPaintEvent *) {
|
||||
updatePosition();
|
||||
QPainter painter(this);
|
||||
painter.fillRect(this->rect(), Qt::transparent);
|
||||
painter.setRenderHint(QPainter::Antialiasing, true);
|
||||
|
||||
if (_currentCounter >= _numberOfLines) {
|
||||
_currentCounter = 0;
|
||||
}
|
||||
|
||||
painter.setPen(Qt::NoPen);
|
||||
for (int i = 0; i < _numberOfLines; ++i) {
|
||||
painter.save();
|
||||
painter.translate(_innerRadius + _lineLength,
|
||||
_innerRadius + _lineLength);
|
||||
qreal rotateAngle =
|
||||
static_cast<qreal>(360 * i) / static_cast<qreal>(_numberOfLines);
|
||||
painter.rotate(rotateAngle);
|
||||
painter.translate(_innerRadius, 0);
|
||||
int distance =
|
||||
lineCountDistanceFromPrimary(i, _currentCounter, _numberOfLines);
|
||||
QColor color =
|
||||
currentLineColor(distance, _numberOfLines, _trailFadePercentage,
|
||||
_minimumTrailOpacity, _color);
|
||||
painter.setBrush(color);
|
||||
// TODO improve the way rounded rect is painted
|
||||
painter.drawRoundedRect(
|
||||
QRect(0, -_lineWidth / 2, _lineLength, _lineWidth), _roundness,
|
||||
_roundness, Qt::RelativeSize);
|
||||
painter.restore();
|
||||
}
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::start() {
|
||||
updatePosition();
|
||||
_isSpinning = true;
|
||||
show();
|
||||
|
||||
if(parentWidget() && _disableParentWhenSpinning) {
|
||||
parentWidget()->setEnabled(false);
|
||||
}
|
||||
|
||||
if (!_timer->isActive()) {
|
||||
_timer->start();
|
||||
_currentCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::stop() {
|
||||
_isSpinning = false;
|
||||
hide();
|
||||
|
||||
if(parentWidget() && _disableParentWhenSpinning) {
|
||||
parentWidget()->setEnabled(true);
|
||||
}
|
||||
|
||||
if (_timer->isActive()) {
|
||||
_timer->stop();
|
||||
_currentCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::setNumberOfLines(int lines) {
|
||||
_numberOfLines = lines;
|
||||
_currentCounter = 0;
|
||||
updateTimer();
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::setLineLength(int length) {
|
||||
_lineLength = length;
|
||||
updateSize();
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::setLineWidth(int width) {
|
||||
_lineWidth = width;
|
||||
updateSize();
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::setInnerRadius(int radius) {
|
||||
_innerRadius = radius;
|
||||
updateSize();
|
||||
}
|
||||
|
||||
QColor WaitingSpinnerWidget::color() {
|
||||
return _color;
|
||||
}
|
||||
|
||||
qreal WaitingSpinnerWidget::roundness() {
|
||||
return _roundness;
|
||||
}
|
||||
|
||||
qreal WaitingSpinnerWidget::minimumTrailOpacity() {
|
||||
return _minimumTrailOpacity;
|
||||
}
|
||||
|
||||
qreal WaitingSpinnerWidget::trailFadePercentage() {
|
||||
return _trailFadePercentage;
|
||||
}
|
||||
|
||||
qreal WaitingSpinnerWidget::revolutionsPersSecond() {
|
||||
return _revolutionsPerSecond;
|
||||
}
|
||||
|
||||
int WaitingSpinnerWidget::numberOfLines() {
|
||||
return _numberOfLines;
|
||||
}
|
||||
|
||||
int WaitingSpinnerWidget::lineLength() {
|
||||
return _lineLength;
|
||||
}
|
||||
|
||||
int WaitingSpinnerWidget::lineWidth() {
|
||||
return _lineWidth;
|
||||
}
|
||||
|
||||
int WaitingSpinnerWidget::innerRadius() {
|
||||
return _innerRadius;
|
||||
}
|
||||
|
||||
bool WaitingSpinnerWidget::isSpinning() const {
|
||||
return _isSpinning;
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::setRoundness(qreal roundness) {
|
||||
_roundness = std::max(0.0, std::min(100.0, roundness));
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::setColor(QColor color) {
|
||||
_color = color;
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::setRevolutionsPerSecond(qreal revolutionsPerSecond) {
|
||||
_revolutionsPerSecond = revolutionsPerSecond;
|
||||
updateTimer();
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::setTrailFadePercentage(qreal trail) {
|
||||
_trailFadePercentage = trail;
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::setMinimumTrailOpacity(qreal minimumTrailOpacity) {
|
||||
_minimumTrailOpacity = minimumTrailOpacity;
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::rotate() {
|
||||
++_currentCounter;
|
||||
if (_currentCounter >= _numberOfLines) {
|
||||
_currentCounter = 0;
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::updateSize() {
|
||||
int size = (_innerRadius + _lineLength) * 2;
|
||||
setFixedSize(size, size);
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::updateTimer() {
|
||||
_timer->setInterval(1000 / (_numberOfLines * _revolutionsPerSecond));
|
||||
}
|
||||
|
||||
void WaitingSpinnerWidget::updatePosition() {
|
||||
if (parentWidget() && _centerOnParent) {
|
||||
move(parentWidget()->width() / 2 - width() / 2,
|
||||
parentWidget()->height() / 2 - height() / 2);
|
||||
}
|
||||
}
|
||||
|
||||
int WaitingSpinnerWidget::lineCountDistanceFromPrimary(int current, int primary,
|
||||
int totalNrOfLines) {
|
||||
int distance = primary - current;
|
||||
if (distance < 0) {
|
||||
distance += totalNrOfLines;
|
||||
}
|
||||
return distance;
|
||||
}
|
||||
|
||||
QColor WaitingSpinnerWidget::currentLineColor(int countDistance, int totalNrOfLines,
|
||||
qreal trailFadePerc, qreal minOpacity,
|
||||
QColor color) {
|
||||
if (countDistance == 0) {
|
||||
return color;
|
||||
}
|
||||
const qreal minAlphaF = minOpacity / 100.0;
|
||||
int distanceThreshold =
|
||||
static_cast<int>(ceil((totalNrOfLines - 1) * trailFadePerc / 100.0));
|
||||
if (countDistance > distanceThreshold) {
|
||||
color.setAlphaF(minAlphaF);
|
||||
} else {
|
||||
qreal alphaDiff = color.alphaF() - minAlphaF;
|
||||
qreal gradient = alphaDiff / static_cast<qreal>(distanceThreshold + 1);
|
||||
qreal resultAlpha = color.alphaF() - gradient * countDistance;
|
||||
|
||||
// If alpha is out of bounds, clip it.
|
||||
resultAlpha = std::min(1.0, std::max(0.0, resultAlpha));
|
||||
color.setAlphaF(resultAlpha);
|
||||
}
|
||||
return color;
|
||||
}
|
122
3rdparty/waitingspinnerwidget.h
vendored
122
3rdparty/waitingspinnerwidget.h
vendored
@ -1,122 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2012-2014 Alexander Turkin
|
||||
* SPDX-FileCopyrightText: 2014 William Hallatt
|
||||
* SPDX-FileCopyrightText: 2015 Jacob Dawid
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/* Original Work Copyright (c) 2012-2014 Alexander Turkin
|
||||
Modified 2014 by William Hallatt
|
||||
Modified 2015 by Jacob Dawid
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Qt includes
|
||||
#include <QWidget>
|
||||
#include <QTimer>
|
||||
#include <QColor>
|
||||
|
||||
class WaitingSpinnerWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
/*! Constructor for "standard" widget behaviour - use this
|
||||
* constructor if you wish to, e.g. embed your widget in another. */
|
||||
WaitingSpinnerWidget(QWidget *parent = nullptr,
|
||||
bool centerOnParent = true,
|
||||
bool disableParentWhenSpinning = true);
|
||||
|
||||
/*! Constructor - use this constructor to automatically create a modal
|
||||
* ("blocking") spinner on top of the calling widget/window. If a valid
|
||||
* parent widget is provided, "centreOnParent" will ensure that
|
||||
* QtWaitingSpinner automatically centres itself on it, if not,
|
||||
* "centreOnParent" is ignored. */
|
||||
WaitingSpinnerWidget(Qt::WindowModality modality,
|
||||
QWidget *parent = nullptr,
|
||||
bool centerOnParent = true,
|
||||
bool disableParentWhenSpinning = true);
|
||||
|
||||
public slots:
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
public:
|
||||
void setColor(QColor color);
|
||||
void setRoundness(qreal roundness);
|
||||
void setMinimumTrailOpacity(qreal minimumTrailOpacity);
|
||||
void setTrailFadePercentage(qreal trail);
|
||||
void setRevolutionsPerSecond(qreal revolutionsPerSecond);
|
||||
void setNumberOfLines(int lines);
|
||||
void setLineLength(int length);
|
||||
void setLineWidth(int width);
|
||||
void setInnerRadius(int radius);
|
||||
void setText(QString text);
|
||||
|
||||
QColor color();
|
||||
qreal roundness();
|
||||
qreal minimumTrailOpacity();
|
||||
qreal trailFadePercentage();
|
||||
qreal revolutionsPersSecond();
|
||||
int numberOfLines();
|
||||
int lineLength();
|
||||
int lineWidth();
|
||||
int innerRadius();
|
||||
|
||||
bool isSpinning() const;
|
||||
|
||||
private slots:
|
||||
void rotate();
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *paintEvent) override;
|
||||
|
||||
private:
|
||||
static int lineCountDistanceFromPrimary(int current, int primary,
|
||||
int totalNrOfLines);
|
||||
static QColor currentLineColor(int distance, int totalNrOfLines,
|
||||
qreal trailFadePerc, qreal minOpacity,
|
||||
QColor color);
|
||||
|
||||
void initialize();
|
||||
void updateSize();
|
||||
void updateTimer();
|
||||
void updatePosition();
|
||||
|
||||
private:
|
||||
QColor _color;
|
||||
qreal _roundness; // 0..100
|
||||
qreal _minimumTrailOpacity;
|
||||
qreal _trailFadePercentage;
|
||||
qreal _revolutionsPerSecond;
|
||||
int _numberOfLines;
|
||||
int _lineLength;
|
||||
int _lineWidth;
|
||||
int _innerRadius;
|
||||
|
||||
private:
|
||||
WaitingSpinnerWidget(const WaitingSpinnerWidget&);
|
||||
WaitingSpinnerWidget& operator=(const WaitingSpinnerWidget&);
|
||||
|
||||
QTimer *_timer;
|
||||
bool _centerOnParent;
|
||||
bool _disableParentWhenSpinning;
|
||||
int _currentCounter;
|
||||
bool _isSpinning;
|
||||
};
|
30
AUTHORS
30
AUTHORS
@ -20,30 +20,58 @@ and moral support from (alphabetically by first name or nickname):
|
||||
- Allen Welkie
|
||||
- AlmAck
|
||||
- Andrius Štikonas
|
||||
- Anke Boersma
|
||||
- Anubhav Choudhary
|
||||
- Arjen Balfoort
|
||||
- Arnaud Ferraris
|
||||
- Artem Grinev
|
||||
- artoo@cromnix.org
|
||||
- benne-dee
|
||||
- Bernhard Landauer
|
||||
- Bezzy1999
|
||||
- Bill Auger
|
||||
- Bob van der Linden
|
||||
- Caio Jordão Carvalho
|
||||
- Camilo Higuita
|
||||
- Collabora LTD
|
||||
- Corey Lang
|
||||
- crispg72
|
||||
- Dan Simmons
|
||||
- demmm
|
||||
- Emmanuel Arias
|
||||
- Enrique Medina Gremaldos
|
||||
- Erik Dubois
|
||||
- Dominic Hayes
|
||||
- El-Wumbus
|
||||
- Evan James
|
||||
- Frede H
|
||||
- Gabriel Craciunescu
|
||||
- Harald Sitter
|
||||
- Huang Jia Wen
|
||||
- Jerrod Frost
|
||||
- Jia Chao
|
||||
- Joe Kamprad
|
||||
- Jonas Strassel
|
||||
- Kai Dohmen
|
||||
- Kevin Kofler
|
||||
- Kyle Robertze
|
||||
- Lisa Vitolo
|
||||
- Neal Gompa
|
||||
- Matti Hyttinen
|
||||
- n3rdopolis
|
||||
- Neal Gompa
|
||||
- Nico 'dr460nf1r3'
|
||||
- Omer I.S.
|
||||
- Philip Müller
|
||||
- Ramon Buldó
|
||||
- Raul Rodrigo Segura
|
||||
- Rohan Garg
|
||||
- Santosh Mahto
|
||||
- Scott Harvey
|
||||
- Simon Quigley
|
||||
- Taejun Park
|
||||
- Victor Fuentes
|
||||
- vtriolet
|
||||
- Walter Lapchynski
|
||||
- Waneon Kim
|
||||
|
||||
> This list was updated to revision 6e8d820737dea0f3e08f12b10768facef19be684 on May 28th 2022.
|
||||
|
23
CHANGES-3.2
23
CHANGES-3.2
@ -1,4 +1,3 @@
|
||||
|
||||
<!-- SPDX-FileCopyrightText: no
|
||||
SPDX-License-Identifier: CC0-1.0
|
||||
-->
|
||||
@ -8,13 +7,27 @@ contributors are listed. Note that Calamares does not have a historical
|
||||
changelog -- this log starts with version 3.2.0. The release notes on the
|
||||
website will have to do for older versions.
|
||||
|
||||
# 3.2.59 (unreleased) #
|
||||
# 3.2.59 (2022-05-29) #
|
||||
|
||||
This release contains contributions from (alphabetically by first name):
|
||||
- Arjen Balfoort
|
||||
|
||||
This is the final release of Calamares 3.2 where the release is from
|
||||
the *calamares* branch -- that is, where the primary development
|
||||
branch is also the branch being released regularly. Future releases
|
||||
of the 3.2 series are bugfix-only, and no new feature development
|
||||
or translations are expected. This is also the final release done
|
||||
*as work-work* by the current maintainer.
|
||||
|
||||
## Core ##
|
||||
- No core changes yet
|
||||
- Prep-work for moving the *About Calamares* button to the panels,
|
||||
rather than keeping it in the Welcome module. The about information
|
||||
is somewhat more flexible now, so that a new maintainer can be added
|
||||
easily without frustrating translators.
|
||||
- The progress panels (both Widgets and QML) now have an About button
|
||||
on them, showing the traditional *About Calamares* dialog.
|
||||
- Translations for the (QML) slideshow were not being loaded correctly.
|
||||
The log is now somewhat more informative when that fails.
|
||||
|
||||
## Modules ##
|
||||
- *fstab* can now be configured to put `/tmp` on a *tmpfs*, and this can
|
||||
@ -24,6 +37,10 @@ This release contains contributions from (alphabetically by first name):
|
||||
(Thanks Arjen)
|
||||
- *partition* will cycle out a LUKS key if all the key slots are in use
|
||||
and a new key is added, rather than crashing the installer. (Thanks Arjen)
|
||||
- *welcome* and *welcomeq* have no *About* button anymore; this is now
|
||||
available from the progress panel, since it's also not-really about the
|
||||
distro itself.
|
||||
|
||||
|
||||
# 3.2.58.2 (2022-05-24)
|
||||
|
||||
|
55
CHANGES-3.3
Normal file
55
CHANGES-3.3
Normal file
@ -0,0 +1,55 @@
|
||||
<!-- SPDX-FileCopyrightText: no
|
||||
SPDX-License-Identifier: CC0-1.0
|
||||
-->
|
||||
|
||||
This is the changelog for Calamares. For each release, the major changes and
|
||||
contributors are listed. Note that Calamares does not have a historical
|
||||
changelog -- this log starts with version 3.3.0. See CHANGES-3.2 for
|
||||
the history of the 3.2 series (2018-05 - 2021-12).
|
||||
|
||||
# 3.3.0 (unreleased) #
|
||||
|
||||
This release contains contributions from (alphabetically by first name):
|
||||
- Anubhav Choudhary
|
||||
- Evan James
|
||||
- Vitor Lopes
|
||||
|
||||
This is a "minor" version change, but the size of the changes is very
|
||||
large. Configuration files from previous versions of Calamares will
|
||||
**certainly** need to be re-validated. Take heed of the many changes
|
||||
in the *Modules* heading, below.
|
||||
|
||||
## Project ##
|
||||
- The C++ code in the project is now formatted with clang-format 12 or 13,
|
||||
with the coding-style as found in `.clang-format`; there are minor
|
||||
differences from the tool, compared to the clang-format 9 usually applied
|
||||
to Calamares 3.2.
|
||||
- The CMake code in the project is now formatted with gersemi 0.7.5.
|
||||
|
||||
## Core ##
|
||||
- CMake 3.16, Qt 5.15 are now required; the newer CMake is to support
|
||||
new features (also for KDE Frameworks), Qt is the current LTS version.
|
||||
- KDE Framework "DBusAddons" is now required, and is used to "activate"
|
||||
Calamares; the KDAB Single Application Guard is no longer used.
|
||||
KDSAG needed patching to chase Qt 5.15 deprecations, and the DBus
|
||||
activation code is tried and tested in Frameworks (tier 1).
|
||||
Running `calamares -d` no longer enforces a single-application
|
||||
(it is for debugging purposes, after all).
|
||||
- Python 3.6 or later is now required, to allow for F-strings in
|
||||
Python code and allow other tidy-ups in the Python modules.
|
||||
Boost::Python now requires 1.67 or later (for CMake support).
|
||||
- The log file now **always** contains a debug-log, and the `-D` flag
|
||||
primarily controls what is printed to stdout. By default, stdout
|
||||
only gets errors; use `-D6` to match stdout with the file. Use `-D8`
|
||||
to get a verbose log file **and** verbose stdout.
|
||||
|
||||
## Modules ##
|
||||
- *bootloader* now supports more options when building the kernel
|
||||
command-line. (Thanks Evan)
|
||||
- *displaymanager* no longer supports the discontinued *kdm* display manager.
|
||||
- *grubcfg* changed the key *keepDistributor* to *keep_distributor*.
|
||||
Please update configurations.
|
||||
- *partition* requires KPMCore 21.12 (e.g. KPMCore 4.2 API, or later).
|
||||
- *partition* can now skip installing the bootloader in more scenarios.
|
||||
#1632 (Thanks Anubhav)
|
||||
|
258
CMakeLists.txt
258
CMakeLists.txt
@ -25,10 +25,13 @@
|
||||
# CMake once. These affect the ABI offered by Calamares.
|
||||
# - PYTHON (enable Python Job modules)
|
||||
# - QML (enable QML UI View modules)
|
||||
# - PYTHONQT # TODO:3.3: remove
|
||||
# The WITH_* options affect the ABI of Calamares: you must
|
||||
# build (C++) modules for Calamares with the same WITH_*
|
||||
# settings, or they may not load at all.
|
||||
# BUILD_<foo> : choose additional things to build
|
||||
# - TESTING (standard CMake option)
|
||||
# - SCHEMA_TESTING (requires Python, see ci/configvalidator.py)
|
||||
# - KF5Crash (uses KCrash, rather than Calamares internal, for crash reporting)
|
||||
# DEBUG_<foo> : special developer flags for debugging
|
||||
#
|
||||
# Example usage:
|
||||
@ -38,15 +41,22 @@
|
||||
# One special target is "show-version", which can be built
|
||||
# to obtain the version number from here.
|
||||
|
||||
# TODO:3.3: Require CMake 3.12
|
||||
cmake_minimum_required( VERSION 3.3 FATAL_ERROR )
|
||||
project( CALAMARES
|
||||
VERSION 3.2.59
|
||||
LANGUAGES C CXX
|
||||
)
|
||||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
|
||||
set( CALAMARES_VERSION_RC 1 ) # Set to 0 during release cycle, 1 during development
|
||||
if( CALAMARES_VERSION_RC EQUAL 1 AND CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
|
||||
set(CALAMARES_VERSION 3.3.0)
|
||||
set(CALAMARES_RELEASE_MODE OFF) # Set to ON during a release
|
||||
|
||||
if(CMAKE_SCRIPT_MODE_FILE)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake)
|
||||
set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
extend_version( ${CALAMARES_VERSION} OFF _vshort _vlong )
|
||||
message("${_vlong}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
project(CALAMARES VERSION ${CALAMARES_VERSION} LANGUAGES C CXX HOMEPAGE_URL "https://calamares.io/")
|
||||
|
||||
if(NOT CALAMARES_RELEASE_MODE AND CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
||||
message(FATAL_ERROR "Do not build development versions in the source-directory.")
|
||||
endif()
|
||||
|
||||
@ -55,18 +65,15 @@ endif()
|
||||
option(INSTALL_CONFIG "Install configuration files" OFF)
|
||||
option(INSTALL_POLKIT "Install Polkit configuration" ON)
|
||||
option(INSTALL_COMPLETION "Install shell completions" OFF)
|
||||
# Options for the calamares executable
|
||||
option( WITH_KF5Crash "Enable crash reporting with KCrash." ON ) # TODO:3.3: WITH->BUILD (this isn't an ABI thing)
|
||||
option( WITH_KF5DBus "Use DBus service for unique-application." OFF ) # TODO:3.3: WITH->BUILD
|
||||
# When adding WITH_* that affects the ABI offered by libcalamares,
|
||||
# also update libcalamares/CalamaresConfig.h.in
|
||||
option(WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON)
|
||||
option( WITH_PYTHONQT "Enable Python view modules API (deprecated, requires PythonQt)." OFF ) # TODO:3.3: remove
|
||||
option(WITH_QML "Enable QML UI options." ON)
|
||||
#
|
||||
# Additional parts to build
|
||||
# Additional parts to build that do not affect ABI
|
||||
option(BUILD_SCHEMA_TESTING "Enable schema-validation-tests" ON)
|
||||
|
||||
# Options for the calamares executable
|
||||
option(BUILD_KF5Crash "Enable crash reporting with KCrash." ON)
|
||||
|
||||
# Possible debugging flags are:
|
||||
# - DEBUG_TIMEZONES draws latitude and longitude lines on the timezone
|
||||
@ -77,7 +84,6 @@ option( BUILD_SCHEMA_TESTING "Enable schema-validation-tests" ON )
|
||||
# - DEBUG_PARTITION_UNSAFE (see partition/CMakeLists.txt)
|
||||
# - DEBUG_PARTITION_BAIL_OUT (see partition/CMakeLists.txt)
|
||||
|
||||
|
||||
### USE_*
|
||||
#
|
||||
# By convention, when there are multiple modules that implement similar
|
||||
@ -108,8 +114,7 @@ set( USE_services "" CACHE STRING "Select the services module to use" )
|
||||
set(CALAMARES_ORGANIZATION_NAME "Calamares")
|
||||
set(CALAMARES_ORGANIZATION_DOMAIN "github.com/calamares")
|
||||
set(CALAMARES_APPLICATION_NAME "Calamares")
|
||||
set( CALAMARES_DESCRIPTION_SUMMARY
|
||||
"The distribution-independent installer framework" )
|
||||
set(CALAMARES_DESCRIPTION_SUMMARY "The distribution-independent installer framework")
|
||||
|
||||
### Transifex (languages) info
|
||||
#
|
||||
@ -135,24 +140,24 @@ set( CALAMARES_DESCRIPTION_SUMMARY
|
||||
# `txstats.py -e`. See also
|
||||
#
|
||||
# Total 74 languages
|
||||
set( _tx_complete az az_AZ ca es fi_FI he hi hr ja lt pt_BR pt_PT
|
||||
sq sv uk zh_TW )
|
||||
set( _tx_good as be ca@valencia cs_CZ da de fa fr fur it_IT ko ml
|
||||
nl ru si sk tg tr_TR vi zh_CN )
|
||||
set( _tx_complete az az_AZ ca es fi_FI he hi hr ja ko lt pt_BR
|
||||
pt_PT sq sv tr_TR uk zh_TW )
|
||||
set( _tx_good as be ca@valencia cs_CZ da de fa fr fur it_IT ml nl
|
||||
ru si sk tg vi zh_CN )
|
||||
set( _tx_ok ar ast bg bn el en_GB es_MX et eu gl hu id is mr nb oc
|
||||
pl ro sl sr sr@latin th )
|
||||
set( _tx_incomplete eo es_PR gu ie ja-Hira kk kn lo lv mk ne_NP
|
||||
ta_IN te ur zh zh_HK )
|
||||
# Total 74 languages
|
||||
|
||||
### Required versions
|
||||
#
|
||||
# See DEPENDENCIES section below.
|
||||
set( QT_VERSION 5.9.0 )
|
||||
set(QT_VERSION 5.15.0)
|
||||
set(YAMLCPP_VERSION 0.5.1)
|
||||
set(ECM_VERSION 5.18)
|
||||
set( PYTHONLIBS_VERSION 3.3 )
|
||||
set( BOOSTPYTHON_VERSION 1.55.0 )
|
||||
|
||||
set(PYTHONLIBS_VERSION 3.6)
|
||||
set(BOOSTPYTHON_VERSION 1.72.0)
|
||||
|
||||
### CMAKE SETUP
|
||||
#
|
||||
@ -168,7 +173,9 @@ if( POLICY CMP0071 )
|
||||
endif()
|
||||
# Recognize more macros to trigger automoc
|
||||
if(NOT CMAKE_VERSION VERSION_LESS "3.10.0")
|
||||
list(APPEND CMAKE_AUTOMOC_MACRO_NAMES
|
||||
list(
|
||||
APPEND
|
||||
CMAKE_AUTOMOC_MACRO_NAMES
|
||||
"K_PLUGIN_FACTORY_WITH_JSON"
|
||||
"K_EXPORT_PLASMA_DATAENGINE_WITH_JSON"
|
||||
"K_EXPORT_PLASMA_RUNNER"
|
||||
@ -203,13 +210,23 @@ set( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g" )
|
||||
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -Wl,--fatal-warnings")
|
||||
|
||||
# If no build type is set, pick a reasonable one
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
if(CALAMARES_RELEASE_MODE)
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
||||
else()
|
||||
set(CMAKE_BUILD_TYPE "Debug")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
message(STATUS "Found Clang ${CMAKE_CXX_COMPILER_VERSION}, setting up Clang-specific compiler flags.")
|
||||
|
||||
# Clang warnings: doing *everything* is counter-productive, since it warns
|
||||
# about things which we can't fix (e.g. C++98 incompatibilities, but
|
||||
# Calamares is C++17).
|
||||
foreach( CLANG_WARNINGS
|
||||
foreach(
|
||||
CLANG_WARNINGS
|
||||
-Weverything
|
||||
-Wno-c++98-compat
|
||||
-Wno-c++98-compat-pedantic
|
||||
@ -249,21 +266,21 @@ endif()
|
||||
# Use mark_thirdparty_code() to reduce warnings from the compiler
|
||||
# on code that we're not going to fix. Call this with a list of files.
|
||||
macro(mark_thirdparty_code)
|
||||
set_source_files_properties( ${ARGV}
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS "${SUPPRESS_3RDPARTY_WARNINGS}"
|
||||
COMPILE_DEFINITIONS "THIRDPARTY"
|
||||
set_source_files_properties(
|
||||
${ARGV}
|
||||
PROPERTIES COMPILE_FLAGS "${SUPPRESS_3RDPARTY_WARNINGS}" COMPILE_DEFINITIONS "THIRDPARTY"
|
||||
)
|
||||
endmacro()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9 OR
|
||||
CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.9 )
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.9)
|
||||
message(STATUS "Found GNU g++ ${CMAKE_CXX_COMPILER_VERSION}, enabling colorized error messages.")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=auto")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# API that was deprecated before Qt 5.15 causes a compile error
|
||||
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050f00)
|
||||
|
||||
### DEPENDENCIES
|
||||
#
|
||||
@ -282,7 +299,8 @@ else()
|
||||
find_package(PolkitQt5-1)
|
||||
endif()
|
||||
set_package_properties(
|
||||
PolkitQt5-1 PROPERTIES
|
||||
PolkitQt5-1
|
||||
PROPERTIES
|
||||
DESCRIPTION "Qt5 support for Polkit"
|
||||
URL "https://cgit.kde.org/polkit-qt-1.git"
|
||||
PURPOSE "PolkitQt5-1 helps with installing Polkit configuration"
|
||||
@ -305,36 +323,39 @@ endif()
|
||||
|
||||
find_package(KF5 QUIET COMPONENTS CoreAddons Crash DBusAddons)
|
||||
set_package_properties(
|
||||
KF5::CoreAddons PROPERTIES
|
||||
KF5::CoreAddons
|
||||
PROPERTIES
|
||||
TYPE REQUIRED
|
||||
DESCRIPTION "Classes built on QtCore for About Data"
|
||||
URL "https://api.kde.org/frameworks/kcoreaddons/"
|
||||
PURPOSE "About Calamares"
|
||||
)
|
||||
set_package_properties(
|
||||
KF5::DBusAddons
|
||||
PROPERTIES
|
||||
TYPE REQUIRED
|
||||
DESCRIPTION "Classes for DBus activation"
|
||||
URL "https://api.kde.org/frameworks/dbusaddons/"
|
||||
PURPOSE "Unique instance of Calamares"
|
||||
)
|
||||
if(NOT KF5Crash_FOUND)
|
||||
if( WITH_KF5Crash )
|
||||
message(WARNING "WITH_KF5Crash is set, but KF5::Crash is not available.")
|
||||
if(BUILD_KF5Crash)
|
||||
message(WARNING "BUILD_KF5Crash is set, but KF5::Crash is not available.")
|
||||
endif()
|
||||
set( WITH_KF5Crash OFF )
|
||||
endif()
|
||||
if( NOT KF5DBusAddons_FOUND )
|
||||
if( WITH_KF5DBus )
|
||||
message(WARNING "WITH_KF5DBus is set, but KF5::DBusAddons is not available.")
|
||||
endif()
|
||||
set( WITH_KF5DBus OFF )
|
||||
set(BUILD_KF5Crash OFF)
|
||||
endif()
|
||||
|
||||
# TODO:3.3: Use FindPython3 instead
|
||||
find_package( PythonInterp ${PYTHONLIBS_VERSION} )
|
||||
find_package(Python ${PYTHONLIBS_VERSION} COMPONENTS Interpreter Development)
|
||||
set_package_properties(
|
||||
PythonInterp PROPERTIES
|
||||
Python
|
||||
PROPERTIES
|
||||
DESCRIPTION "Python3 interpreter."
|
||||
URL "https://python.org"
|
||||
PURPOSE "Python3 interpreter for certain tests."
|
||||
)
|
||||
|
||||
set(_schema_explanation "")
|
||||
if ( PYTHONINTERP_FOUND )
|
||||
if(Python_Interpreter_FOUND)
|
||||
if(BUILD_SCHEMA_TESTING)
|
||||
# The configuration validator script has some dependencies,
|
||||
# and if they are not installed, don't run. If errors out
|
||||
@ -342,9 +363,18 @@ if ( PYTHONINTERP_FOUND )
|
||||
if(CALAMARES_CONFIGVALIDATOR_CHECKED)
|
||||
set(_validator_deps ${CALAMARES_CONFIGVALIDATOR_RESULT})
|
||||
else()
|
||||
exec_program( ${PYTHON_EXECUTABLE} ARGS "${CMAKE_SOURCE_DIR}/ci/configvalidator.py" -x RETURN_VALUE _validator_deps )
|
||||
exec_program(
|
||||
${Python_EXECUTABLE}
|
||||
ARGS
|
||||
"${CMAKE_SOURCE_DIR}/ci/configvalidator.py"
|
||||
-x
|
||||
RETURN_VALUE
|
||||
_validator_deps
|
||||
)
|
||||
set(CALAMARES_CONFIGVALIDATOR_CHECKED TRUE CACHE INTERNAL "Dependencies for configvalidator checked")
|
||||
set( CALAMARES_CONFIGVALIDATOR_RESULT ${_validator_deps} CACHE INTERNAL "Result of configvalidator dependency check" )
|
||||
set(CALAMARES_CONFIGVALIDATOR_RESULT ${_validator_deps}
|
||||
CACHE INTERNAL "Result of configvalidator dependency check"
|
||||
)
|
||||
endif()
|
||||
# It should never succeed, but only returns 1 when the imports fail
|
||||
if(_validator_deps EQUAL 1)
|
||||
@ -359,49 +389,26 @@ else()
|
||||
endif()
|
||||
add_feature_info(yaml-schema BUILD_SCHEMA_TESTING "Validate YAML (config files) with schema.${_schema_explanation}")
|
||||
|
||||
find_package( PythonLibs ${PYTHONLIBS_VERSION} )
|
||||
set_package_properties(
|
||||
PythonLibs PROPERTIES
|
||||
DESCRIPTION "C interface libraries for the Python 3 interpreter."
|
||||
URL "https://python.org"
|
||||
PURPOSE "Python 3 is used for Python job modules."
|
||||
)
|
||||
|
||||
if ( PYTHONLIBS_FOUND )
|
||||
# TODO:3.3: Require Boost + CMake; sort out Boost::Python
|
||||
# Since Boost provides CMake config files (starting with Boost 1.70.
|
||||
# or so) the mess that is the Calamares find code picks the wrong
|
||||
# bits. Suppress those CMake config files, as suggested by @jmrcpn
|
||||
set(Boost_NO_BOOST_CMAKE ON)
|
||||
include( BoostPython3 )
|
||||
find_boost_python3( ${BOOSTPYTHON_VERSION} ${PYTHONLIBS_VERSION_STRING} CALAMARES_BOOST_PYTHON3_FOUND )
|
||||
set_package_properties(
|
||||
Boost PROPERTIES
|
||||
PURPOSE "Boost.Python is used for Python job modules."
|
||||
)
|
||||
# TODO:3.3: Remove PythonQt support
|
||||
find_package( PythonQt )
|
||||
set_package_properties( PythonQt PROPERTIES
|
||||
DESCRIPTION "A Python embedding solution for Qt applications."
|
||||
URL "http://pythonqt.sourceforge.net"
|
||||
PURPOSE "PythonQt is used for Python view modules."
|
||||
)
|
||||
if(Python_Development_FOUND)
|
||||
find_package(boost_python)
|
||||
if(NOT TARGET Boost::python)
|
||||
find_package(Boost ${BOOSTPYTHON_VERSION} COMPONENTS python)
|
||||
set_package_properties(Boost PROPERTIES PURPOSE "Boost.Python is used for Python job modules.")
|
||||
else()
|
||||
message(STATUS "Found boost_python with target Boost::python")
|
||||
set(Boost_FOUND ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( NOT PYTHONLIBS_FOUND OR NOT CALAMARES_BOOST_PYTHON3_FOUND )
|
||||
if(NOT Python_Development_FOUND OR NOT Boost_FOUND)
|
||||
message(STATUS "Disabling Boost::Python modules")
|
||||
set(WITH_PYTHON OFF)
|
||||
endif()
|
||||
if( NOT PYTHONLIBS_FOUND OR NOT PYTHONQT_FOUND )
|
||||
message(STATUS "Disabling PythonQt modules")
|
||||
set( WITH_PYTHONQT OFF )
|
||||
endif()
|
||||
|
||||
# Now we know the state of the ABI-options, copy them into "Calamares_"
|
||||
# prefixed variables, to match how the variables would-be-named
|
||||
# when building out-of-tree.
|
||||
set(Calamares_WITH_PYTHON ${WITH_PYTHON})
|
||||
set(Calamares_WITH_PYTHONQT ${WITH_PYTHONQT})
|
||||
set(Calamares_WITH_QML ${WITH_QML})
|
||||
|
||||
### Transifex Translation status
|
||||
@ -496,7 +503,6 @@ endif()
|
||||
# "http://tldp.org/HOWTO/SquashFS-HOWTO/creatingandusing.html"
|
||||
add_feature_info(ExampleDistro ${mksquashfs_FOUND} "Create example-distro target.")
|
||||
|
||||
|
||||
### CALAMARES PROPER
|
||||
#
|
||||
set(CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH})
|
||||
@ -516,21 +522,14 @@ if( NOT BUILD_RELEASE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/" )
|
||||
extend_version( "${CALAMARES_VERSION}" OFF CALAMARES_VERSION_SHORT CALAMARES_VERSION )
|
||||
endif()
|
||||
|
||||
# Special target for not-RC (e.g. might-be-release) builds.
|
||||
# This is used by the release script to get the version.
|
||||
if ( CALAMARES_VERSION_RC EQUAL 0 )
|
||||
add_custom_target(show-version
|
||||
${CMAKE_COMMAND} -E echo CALAMARES_VERSION=${CALAMARES_VERSION_SHORT}
|
||||
USES_TERMINAL
|
||||
)
|
||||
# Special define for RC (e.g. not-a-release) builds.
|
||||
# This is consumed via the CalamaresConfig.h header.
|
||||
if(NOT CALAMARES_RELEASE_MODE)
|
||||
set(CALAMARES_VERSION_RC 1)
|
||||
endif()
|
||||
|
||||
# enforce using constBegin, constEnd for const-iterators
|
||||
add_definitions(
|
||||
-DQT_STRICT_ITERATORS
|
||||
-DQT_SHARED
|
||||
-DQT_SHAREDPOINTER_TRACK_POINTERS
|
||||
)
|
||||
add_definitions(-DQT_STRICT_ITERATORS -DQT_SHARED -DQT_SHAREDPOINTER_TRACK_POINTERS)
|
||||
|
||||
# set paths
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||
@ -555,10 +554,10 @@ set( Calamares_LIBRARIES calamares )
|
||||
add_subdirectory(src)
|
||||
|
||||
add_feature_info(Python ${WITH_PYTHON} "Python job modules")
|
||||
add_feature_info(PythonQt ${WITH_PYTHONQT} "Python view modules")
|
||||
add_feature_info(Qml ${WITH_QML} "QML UI support")
|
||||
add_feature_info(Config ${INSTALL_CONFIG} "Install Calamares configuration")
|
||||
add_feature_info(KCrash ${WITH_KF5Crash} "Crash dumps via KCrash")
|
||||
add_feature_info(KDBusAddons ${WITH_KF5DBus} "Unique-application via DBus")
|
||||
add_feature_info(Polkit ${INSTALL_POLKIT} "Install Polkit files")
|
||||
add_feature_info(KCrash ${BUILD_KF5Crash} "Crash dumps via KCrash")
|
||||
|
||||
### CMake infrastructure installation
|
||||
#
|
||||
@ -571,22 +570,14 @@ configure_package_config_file(
|
||||
"CalamaresConfig.cmake.in"
|
||||
"${PROJECT_BINARY_DIR}/CalamaresConfig.cmake"
|
||||
INSTALL_DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
|
||||
PATH_VARS
|
||||
CMAKE_INSTALL_INCLUDEDIR
|
||||
CMAKE_INSTALL_LIBDIR
|
||||
CMAKE_INSTALL_DATADIR
|
||||
PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_DATADIR
|
||||
)
|
||||
write_basic_package_version_file(
|
||||
${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
install(
|
||||
EXPORT Calamares
|
||||
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
|
||||
FILE "CalamaresTargets.cmake"
|
||||
NAMESPACE Calamares::
|
||||
)
|
||||
install(EXPORT Calamares DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" FILE "CalamaresTargets.cmake" NAMESPACE Calamares::)
|
||||
|
||||
# Install the cmake files
|
||||
install(
|
||||
@ -603,25 +594,18 @@ install(
|
||||
"CMakeModules/CalamaresCheckModuleSelection.cmake"
|
||||
"CMakeModules/CMakeColors.cmake"
|
||||
"CMakeModules/FindYAMLCPP.cmake"
|
||||
DESTINATION
|
||||
"${CMAKE_INSTALL_CMAKEDIR}"
|
||||
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
|
||||
)
|
||||
|
||||
### Miscellaneous installs
|
||||
#
|
||||
#
|
||||
if(INSTALL_CONFIG)
|
||||
install(
|
||||
FILES settings.conf
|
||||
DESTINATION share/calamares
|
||||
)
|
||||
install(FILES settings.conf DESTINATION share/calamares)
|
||||
endif()
|
||||
|
||||
if(INSTALL_POLKIT)
|
||||
install(
|
||||
FILES com.github.calamares.calamares.policy
|
||||
DESTINATION "${POLKITQT-1_POLICY_FILES_INSTALL_DIR}"
|
||||
)
|
||||
install(FILES com.github.calamares.calamares.policy DESTINATION "${POLKITQT-1_POLICY_FILES_INSTALL_DIR}")
|
||||
endif()
|
||||
|
||||
if(INSTALL_COMPLETION)
|
||||
@ -632,40 +616,26 @@ if ( INSTALL_COMPLETION )
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/data/completion/bash/calamares DESTINATION "${CMAKE_INSTALL_BASHCOMPLETIONDIR}")
|
||||
endif()
|
||||
|
||||
install(
|
||||
FILES calamares.desktop
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
|
||||
)
|
||||
install(FILES calamares.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||
|
||||
install(
|
||||
FILES man/calamares.8
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man8/
|
||||
)
|
||||
install(FILES man/calamares.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8/)
|
||||
|
||||
# uninstall target
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY
|
||||
IMMEDIATE
|
||||
@ONLY
|
||||
)
|
||||
|
||||
add_custom_target( uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
|
||||
)
|
||||
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
|
||||
### CMAKE SUMMARY REPORT
|
||||
#
|
||||
get_directory_property( SKIPPED_MODULES
|
||||
DIRECTORY src/modules
|
||||
DEFINITION LIST_SKIPPED_MODULES
|
||||
)
|
||||
get_directory_property(SKIPPED_MODULES DIRECTORY src/modules DEFINITION LIST_SKIPPED_MODULES)
|
||||
calamares_explain_skipped_modules( ${SKIPPED_MODULES} )
|
||||
|
||||
feature_summary(
|
||||
WHAT DISABLED_FEATURES
|
||||
DESCRIPTION "The following features have been disabled:"
|
||||
QUIET_ON_EMPTY
|
||||
)
|
||||
feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "The following features have been disabled:" QUIET_ON_EMPTY)
|
||||
feature_summary(
|
||||
WHAT OPTIONAL_PACKAGES_NOT_FOUND
|
||||
DESCRIPTION "The following OPTIONAL packages were not found:"
|
||||
@ -682,11 +652,11 @@ feature_summary(
|
||||
#
|
||||
# Note: most distro's will do distro-specific packaging rather than
|
||||
# using CPack, and this duplicates information in the AppStream, too.
|
||||
# TODO:3.3 With newer CMake, move HOMEPAGE_URL to the project()call
|
||||
set(CPACK_PACKAGE_VENDOR calamares)
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A Linux system installer")
|
||||
set(CPACK_PACKAGE_DESCRIPTION "Calamares is a Linux system installer, intended for Linux distributions to use on their ISOs and other bootable media to install the distribution to the end-user's computer. Calamares can also be used as an OEM configuration tool. It is modular, extensible and highly-configurable for Linux distributions from all five major Linux families.")
|
||||
set(CPACK_PACKAGE_HOMEPAGE_URL "https://calamares.io")
|
||||
set(CPACK_PACKAGE_DESCRIPTION
|
||||
"Calamares is a Linux system installer, intended for Linux distributions to use on their ISOs and other bootable media to install the distribution to the end-user's computer. Calamares can also be used as an OEM configuration tool. It is modular, extensible and highly-configurable for Linux distributions from all five major Linux families."
|
||||
)
|
||||
set(CPACK_PACKAGE_ICON "data/images/squid.png")
|
||||
|
||||
include(CPack)
|
||||
|
@ -1,97 +0,0 @@
|
||||
# === This file is part of Calamares - <https://calamares.io> ===
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2014 Aurélien Gâteau <agateau@kde.org>
|
||||
# SPDX-FileCopyrightText: 2017 Adriaan de Groot <groot@kde.org>
|
||||
# SPDX-FileCopyrightText: 2019 Kevin Kofler <kevin.kofler@chello.at>
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
###
|
||||
#
|
||||
# Handles the mess that Boost::Python is before CMake 3.16 and
|
||||
# Boost 1.70 or so.
|
||||
#
|
||||
###
|
||||
#
|
||||
# On Ubuntu 14.04, the libboost-python1.54-dev package comes with one library
|
||||
# for each Python version:
|
||||
# libboost_python-py27.so
|
||||
# libboost_python-py33.so
|
||||
# libboost_python-py34.so
|
||||
#
|
||||
# Boost upstream however installs Boost.Python3 libboost_python3.so, which is
|
||||
# what FindBoost.cmake is looking for. It looks for a library named
|
||||
# "libboost_${component}.so".
|
||||
#
|
||||
# On Gentoo instead, the >=dev-libs/boost-1.54 package provides boost library
|
||||
# with a name like:
|
||||
# libboost_python-2.7.so
|
||||
# libboost_python-3.3.so
|
||||
# libboost_python-3.4.so
|
||||
# depending on what python's targets you selected during install
|
||||
#
|
||||
# On Fedora >= 30 instead, the boost-python3-devel provides boost library with a
|
||||
# name like:
|
||||
# libboost_python37.so
|
||||
# depending on what python's targets you selected during install
|
||||
#
|
||||
# find_boost_python3() tries to find the package with different component
|
||||
# names. By default it tries "python3", "python-py$suffix" and
|
||||
# "python-$dotsuffix", where suffix is based on the `python_version` argument.
|
||||
# One can supply a custom component name by setting the
|
||||
# `CALAMARES_BOOST_PYTHON3_COMPONENT` variable at CMake time.
|
||||
set( CALAMARES_BOOST_PYTHON3_COMPONENT python3 CACHE STRING
|
||||
"Name of the Boost.Python component. If Boost.Python is installed as
|
||||
libboost_python-foo.so then this variable should be set to 'python-foo'."
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
macro( _find_boost_python3_int boost_version componentname found_var )
|
||||
foreach( _fbp_name ${CALAMARES_BOOST_PYTHON3_COMPONENT} ${componentname} )
|
||||
find_package( Boost ${boost_version} QUIET COMPONENTS ${_fbp_name} )
|
||||
string( TOUPPER ${_fbp_name} _fbp_uc_name )
|
||||
if( Boost_${_fbp_uc_name}_FOUND )
|
||||
if( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
|
||||
# No upcasing
|
||||
set( ${found_var} ${_fbp_name} )
|
||||
else()
|
||||
set( ${found_var} ${_fbp_uc_name} )
|
||||
endif()
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro( find_boost_python3 boost_version python_version found_var )
|
||||
set( ${found_var} OFF )
|
||||
set( _fbp_found OFF )
|
||||
|
||||
# turns "3.4.123abc" into "34"
|
||||
string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\..*" "\\1\\2" _fbp_python_short_version ${python_version} )
|
||||
_find_boost_python3_int( ${boost_version} python-py${_fbp_python_short_version} _fbp_found )
|
||||
|
||||
if (NOT _fbp_found)
|
||||
_find_boost_python3_int( ${boost_version} python${_fbp_python_short_version} _fbp_found )
|
||||
endif()
|
||||
|
||||
if (NOT _fbp_found)
|
||||
# The following loop changes the searched name for Gentoo based distributions
|
||||
# turns "3.4.123abc" into "3.4"
|
||||
string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\..*" "\\1.\\2" _fbp_python_short_version ${python_version} )
|
||||
_find_boost_python3_int( ${boost_version} python-${_fbp_python_short_version} _fbp_found )
|
||||
endif()
|
||||
|
||||
set( ${found_var} ${_fbp_found} )
|
||||
|
||||
# This is superfluous, but allows proper reporting in the features list
|
||||
if ( _fbp_found )
|
||||
find_package( Boost ${boost_version} COMPONENTS ${_fbp_found} )
|
||||
else()
|
||||
find_package( Boost ${boost_version} COMPONENTS Python )
|
||||
endif()
|
||||
set_package_properties(
|
||||
Boost PROPERTIES
|
||||
DESCRIPTION "A C++ library which enables seamless interoperability between C++ and Python 3."
|
||||
URL "http://www.boost.org"
|
||||
)
|
||||
endmacro()
|
@ -121,7 +121,8 @@ function( _calamares_add_module_subdirectory_impl )
|
||||
# _mod_testing boolean if the module should be added to the loadmodule tests
|
||||
file(STRINGS "${_mod_dir}/module.desc" MODULE_INTERFACE REGEX "^interface")
|
||||
if ( MODULE_INTERFACE MATCHES "pythonqt" )
|
||||
set( _mod_enabled ${Calamares_WITH_PYTHONQT} )
|
||||
message( FATAL_ERROR "PythonQt is no longer supported" )
|
||||
set( _mod_enabled OFF )
|
||||
set( _mod_reason "No PythonQt support" )
|
||||
set( _mod_testing OFF )
|
||||
elseif ( MODULE_INTERFACE MATCHES "python" )
|
||||
|
@ -21,14 +21,12 @@
|
||||
include(CMakeParseArguments)
|
||||
include(CalamaresAutomoc)
|
||||
|
||||
function( calamares_add_test )
|
||||
# parse arguments (name needs to be saved before passing ARGN into the macro)
|
||||
set( NAME ${ARGV0} )
|
||||
function(calamares_add_test name)
|
||||
set(options GUI)
|
||||
set( oneValueArgs NAME RESOURCES )
|
||||
set(oneValueArgs RESOURCES)
|
||||
set(multiValueArgs SOURCES LIBRARIES DEFINITIONS)
|
||||
cmake_parse_arguments(TEST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
set( TEST_NAME ${NAME} )
|
||||
set(TEST_NAME ${name})
|
||||
|
||||
if(ECM_FOUND AND BUILD_TESTING)
|
||||
ecm_add_test(
|
||||
@ -44,7 +42,10 @@ function( calamares_add_test )
|
||||
calamares_automoc( ${TEST_NAME} )
|
||||
# We specifically pass in the source directory of the test-being-
|
||||
# compiled, so that it can find test-files in that source dir.
|
||||
target_compile_definitions( ${TEST_NAME} PRIVATE -DBUILD_AS_TEST="${CMAKE_CURRENT_SOURCE_DIR}" ${TEST_DEFINITIONS} )
|
||||
target_compile_definitions(
|
||||
${TEST_NAME}
|
||||
PRIVATE -DBUILD_AS_TEST="${CMAKE_CURRENT_SOURCE_DIR}" ${TEST_DEFINITIONS}
|
||||
)
|
||||
if(TEST_GUI)
|
||||
target_link_libraries(${TEST_NAME} Calamares::calamaresui Qt5::Gui)
|
||||
endif()
|
||||
|
@ -1,185 +0,0 @@
|
||||
# === This file is part of Calamares - <https://calamares.io> ===
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2016 Teo Mrnjavac <teo@kde.org>
|
||||
# SPDX-FileCopyrightText: 2017 Adriaan de Groot <groot@kde.org>
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
###
|
||||
#
|
||||
# Find PythonQt
|
||||
#
|
||||
# Sets PYTHONQT_FOUND, PYTHONQT_INCLUDE_DIR, PYTHONQT_LIBRARY, PYTHONQT_LIBRARIES
|
||||
#
|
||||
# Also sets PYTHONQT_INCLUDE_DIRS to add whatever directories
|
||||
# that are needed for extensions.
|
||||
#
|
||||
|
||||
# Python is required
|
||||
find_package(PythonLibs)
|
||||
if(NOT PYTHONLIBS_FOUND)
|
||||
message(FATAL_ERROR "error: Python is required to build PythonQt")
|
||||
endif()
|
||||
|
||||
# Cut X.Y[.Z] down to just X.Y
|
||||
string(REGEX REPLACE
|
||||
"^([0-9][0-9]*)\.([0-9][0-9]*)"
|
||||
"\\1.\\2@"
|
||||
_PYTHONLIBS_MAJMIN
|
||||
${PYTHONLIBS_VERSION_STRING}
|
||||
)
|
||||
string(REGEX REPLACE
|
||||
"@.*"
|
||||
""
|
||||
PYTHONLIBS_MAJMIN
|
||||
${_PYTHONLIBS_MAJMIN}
|
||||
)
|
||||
|
||||
if(NOT EXISTS "${PYTHONQT_INSTALL_DIR}")
|
||||
find_path(PYTHONQT_INSTALL_DIR
|
||||
NAMES
|
||||
include/PythonQt/PythonQt.h
|
||||
include/PythonQt5/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}/include/PythonQt5"
|
||||
"${PYTHONQT_INSTALL_DIR}/src"
|
||||
DOC "Path to the PythonQt include directory")
|
||||
find_path(PYTHONQT_ALL_INCLUDE_DIR PythonQt_QtAll.h
|
||||
PATHS
|
||||
"${PYTHONQT_INCLUDE_DIR}"
|
||||
"${PYTHONQT_INSTALL_DIR}"
|
||||
PATH_SUFFIXES
|
||||
"extensions/PythonQt_QtAll"
|
||||
"src"
|
||||
DOC "Path to the PythonQt 'all' header")
|
||||
|
||||
if ( NOT PythonQt_FIND_QUIETLY )
|
||||
message( STATUS "Searching for PythonQt (PythonLibs ${PYTHONLIBS_MAJMIN}) .." )
|
||||
if ( PYTHONQT_INCLUDE_DIR )
|
||||
message( STATUS " .. found include ${PYTHONQT_INCLUDE_DIR}" )
|
||||
message( STATUS " .. found all include ${PYTHONQT_ALL_INCLUDE_DIR}" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Minimum v3.1 is needed
|
||||
find_library(PYTHONQT_LIBRARY_RELEASE
|
||||
NAMES
|
||||
PythonQt-Qt5-Python${PYTHONLIBS_MAJMIN}
|
||||
PythonQt-Qt5-Python3
|
||||
PythonQt
|
||||
PATHS "${PYTHONQT_INSTALL_DIR}/lib"
|
||||
DOC "The PythonQt library."
|
||||
)
|
||||
find_library(PYTHONQT_LIBRARY_DEBUG
|
||||
NAMES
|
||||
PythonQt-Qt5-Python${PYTHONLIBS_MAJMIN}JMIN${CTK_CMAKE_DEBUG_POSTFIX}
|
||||
PythonQt-Qt5-Python${PYTHONLIBS_MAJMIN}${CMAKE_DEBUG_POSTFIX}
|
||||
PythonQt-Qt5-Python${PYTHONLIBS_MAJMIN}
|
||||
PythonQt-Qt5-Python3${CTK_CMAKE_DEBUG_POSTFIX}
|
||||
PythonQt-Qt5-Python3${CMAKE_DEBUG_POSTFIX}
|
||||
PythonQt-Qt5-Python3
|
||||
PythonQt${CTK_CMAKE_DEBUG_POSTFIX}
|
||||
PythonQt${CMAKE_DEBUG_POSTFIX}
|
||||
PythonQt
|
||||
PATHS "${PYTHONQT_INSTALL_DIR}/lib"
|
||||
DOC "The PythonQt library (debug build)."
|
||||
)
|
||||
find_library(PYTHONQT_QTALL_LIBRARY_RELEASE
|
||||
NAMES
|
||||
PythonQt_QtAll-Qt5-Python${PYTHONLIBS_MAJMIN}
|
||||
PythonQt_QtAll-Qt5-Python3
|
||||
PythonQt_QtAll
|
||||
PATHS "${PYTHONQT_INSTALL_DIR}/lib"
|
||||
DOC "Full Qt bindings for the PythonQt library."
|
||||
)
|
||||
find_library(PYTHONQT_QTALL_LIBRARY_DEBUG
|
||||
NAMES
|
||||
PythonQt_QtAll-Qt5-Python${PYTHONLIBS_MAJMIN}${CTK_CMAKE_DEBUG_POSTFIX}
|
||||
PythonQt_QtAll-Qt5-Python${PYTHONLIBS_MAJMIN}${CMAKE_DEBUG_POSTFIX}
|
||||
PythonQt_QtAll-Qt5-Python${PYTHONLIBS_MAJMIN}
|
||||
PythonQt_QtAll-Qt5-Python3${CTK_CMAKE_DEBUG_POSTFIX}
|
||||
PythonQt_QtAll-Qt5-Python3${CMAKE_DEBUG_POSTFIX}
|
||||
PythonQt_QtAll-Qt5-Python3
|
||||
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 (debug build)."
|
||||
)
|
||||
|
||||
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()
|
||||
|
||||
if ( NOT PythonQt_FIND_QUIETLY )
|
||||
if ( PYTHONQT_LIBRARY )
|
||||
message( STATUS " .. found library ${PYTHONQT_LIBRARY}" )
|
||||
endif()
|
||||
if ( PYTHONQT_QTALL_LIBRARY )
|
||||
message( STATUS " .. found qtall ${PYTHONQT_QTALL_LIBRARY}" )
|
||||
endif()
|
||||
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})
|
||||
set(PYTHONQT_INCLUDE_DIRS ${PYTHONQT_INCLUDE_DIR})
|
||||
if(PYTHONQT_ALL_INCLUDE_DIR)
|
||||
list(APPEND PYTHONQT_INCLUDE_DIRS ${PYTHONQT_ALL_INCLUDE_DIR})
|
||||
endif()
|
||||
elseif(NOT PythonQt_FIND_QUIETLY)
|
||||
set(_missing "")
|
||||
if (NOT PYTHONQT_INCLUDE_DIR)
|
||||
list(APPEND _missing "includes")
|
||||
endif()
|
||||
if (NOT PYTHONQT_LIBRARY)
|
||||
list(APPEND _missing "library")
|
||||
endif()
|
||||
if (NOT PYTHONQT_QTALL_LIBRARY)
|
||||
list(APPEND _missing "qtall")
|
||||
endif()
|
||||
message(STATUS "PythonQt not found, missing components ${_missing}")
|
||||
endif()
|
@ -10,7 +10,7 @@
|
||||
if ( NOT KPMcore_searched_for )
|
||||
set( KPMcore_searched_for TRUE )
|
||||
|
||||
find_package( KPMcore 3.3 )
|
||||
find_package( KPMcore 21.12.0 )
|
||||
set_package_properties(
|
||||
KPMcore PROPERTIES
|
||||
URL "https://invent.kde.org/kde/kpmcore"
|
||||
@ -21,18 +21,6 @@ if ( NOT KPMcore_searched_for )
|
||||
|
||||
if( KPMcore_FOUND )
|
||||
set( KPMcore_API_DEFINITIONS "" )
|
||||
if( KPMcore_VERSION VERSION_GREATER "3.3.70" AND KPMcore_VERSION VERSION_LESS "4.0" )
|
||||
message( FATAL_ERROR "KPMCore beta versions ${KPMcore_VERSION} not supported" )
|
||||
endif()
|
||||
if ( KPMcore_VERSION VERSION_GREATER "3.3.0")
|
||||
list( APPEND KPMcore_API_DEFINITIONS WITH_KPMCORE331API) # kpmcore > 3.3.0 with deprecations
|
||||
endif()
|
||||
if ( KPMcore_VERSION VERSION_GREATER_EQUAL "4.0")
|
||||
list( APPEND KPMcore_API_DEFINITIONS WITH_KPMCORE4API) # kpmcore 4 with new API
|
||||
endif()
|
||||
if( KPMcore_VERSION VERSION_GREATER_EQUAL "4.2" )
|
||||
list( APPEND KPMcore_API_DEFINITIONS WITH_KPMCORE42API) # kpmcore 4.2 with new API
|
||||
endif()
|
||||
else()
|
||||
set( KPMcore_API_DEFINITIONS WITHOUT_KPMcore )
|
||||
endif()
|
||||
|
@ -77,16 +77,15 @@ instructions are on the wiki.
|
||||
### Dependencies
|
||||
|
||||
Main:
|
||||
* Compiler with C++17 support: GCC >= 7 or Clang >= 5
|
||||
* CMake >= 3.3
|
||||
* Qt >= 5.9
|
||||
* Compiler with C++17 support
|
||||
* CMake >= 3.16
|
||||
* Qt >= 5.15
|
||||
* yaml-cpp >= 0.5.1
|
||||
* Python >= 3.3 (required for some modules)
|
||||
* Boost.Python >= 1.55.0 (required for some modules)
|
||||
* Python >= 3.6 (required for some modules)
|
||||
* Boost.Python >= 1.67.0 (required for some modules)
|
||||
* KDE extra-cmake-modules >= 5.18 (recommended; required for some modules;
|
||||
required for some tests)
|
||||
* KDE Frameworks KCoreAddons (>= 5.58 recommended)
|
||||
* PythonQt (optional, deprecated)
|
||||
|
||||
Individual modules may have their own requirements;
|
||||
these are listed in CMake output.
|
||||
|
@ -87,5 +87,4 @@ include(CalamaresAddPlugin)
|
||||
# This list should match the one in libcalamares/CalamaresConfig.h,
|
||||
# which is the C++-language side of the same configuration.
|
||||
set(Calamares_WITH_PYTHON @WITH_PYTHON@)
|
||||
set(Calamares_WITH_PYTHONQT @WITH_PYTHONQT@)
|
||||
set(Calamares_WITH_QML @WITH_QML@)
|
||||
|
@ -1,488 +0,0 @@
|
||||
|
||||
The KD Tools Library is Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB.
|
||||
|
||||
You may use, distribute and copy the KD Tools Library under the terms of
|
||||
GNU Library General Public License version 2, which is displayed below.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, so that any problems introduced by others will not reflect on
|
||||
the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the source code distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
73
ci/abicheck.sh
Executable file
73
ci/abicheck.sh
Executable file
@ -0,0 +1,73 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Compares the ABI of the current working tree with the ABI
|
||||
# from a base-version. Uses libabigail for the actual comparison.
|
||||
#
|
||||
# To use the tool, just run the script. It will build Calamares at
|
||||
# least once, maybe twice (if it needs the base-version ABI information
|
||||
# and hasn't cached it).
|
||||
|
||||
# The base version can be a tag or git-hash; it will be checked-out
|
||||
# in a worktree.
|
||||
#
|
||||
# Note that the hash here now is the very start of 3.3, when ABI
|
||||
# compatibility was not expected yet at **all**.
|
||||
BASE_VERSION=419be4df25bc6fcc1958cb6e44afc1b9e64fce71
|
||||
|
||||
### Build a tree and cache the ABI info into ci/
|
||||
#
|
||||
#
|
||||
do_build() {
|
||||
LABEL=$1
|
||||
SOURCE_DIR=$2
|
||||
|
||||
BUILD_DIR=build-abi-$LABEL
|
||||
rm -rf $BUILD_DIR
|
||||
mkdir $BUILD_DIR
|
||||
|
||||
if ( cd $BUILD_DIR && cmake $SOURCE_DIR -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-Og -g -gdwarf" -DCMAKE_C_FLAGS="-Og -g -gdwarf" && make -j12 ) > /dev/null 2>&1
|
||||
then
|
||||
ls -1 $BUILD_DIR/libcalamares*.so.*
|
||||
# Copy the un-versioned files; .so is a symlink to the just-built one
|
||||
for lib in $BUILD_DIR/libcalamares*.so
|
||||
do
|
||||
cp $lib ci/`basename $lib`.$LABEL
|
||||
done
|
||||
else
|
||||
echo "! failed to build $LABEL"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
### Build current tree and get ABI info
|
||||
#
|
||||
#
|
||||
do_build current `pwd -P`
|
||||
|
||||
### Build ABI base version
|
||||
#
|
||||
# We cache this to save on some build time, if we are chasing a
|
||||
# single branch from an unchanging base version.
|
||||
#
|
||||
if test -f ci/libcalamares.so.$BASE_VERSION
|
||||
then
|
||||
# The ABI version is cached, so we're good
|
||||
:
|
||||
else
|
||||
git worktree remove --force tree-abi-$BASE_VERSION
|
||||
git worktree add tree-abi-$BASE_VERSION $BASE_VERSION > /dev/null 2>&1 || { echo "! could not create worktree for $BASE_VERSION" ; exit 1 ; }
|
||||
do_build $BASE_VERSION $( cd tree-abi-$BASE_VERSION && pwd -P )
|
||||
fi
|
||||
|
||||
### Compare & Report
|
||||
#
|
||||
# abidiff compares the Application Binary Interfaces (ABI) of two
|
||||
# shared libraries in ELF format. It emits a meaningful report describing
|
||||
# the differences between the two ABIs.
|
||||
#
|
||||
# -l prints only the leaf changes, leaving out explanations of why.
|
||||
#
|
||||
abidiff -l ci/libcalamares.so.$BASE_VERSION ci/libcalamares.so.current
|
@ -97,10 +97,12 @@ class EditingOutputter(object):
|
||||
lines = f.readlines()
|
||||
|
||||
mark = None
|
||||
mark_text = None
|
||||
for l in lines:
|
||||
# Note that we didn't strip the lines, so need the \n here
|
||||
if l.startswith("# Total ") and l.endswith(" languages\n"):
|
||||
mark = lines.index(l)
|
||||
mark_text = l
|
||||
break
|
||||
if mark is None:
|
||||
raise TXError("No CMakeLists.txt lines for TX stats found")
|
||||
@ -108,18 +110,17 @@ class EditingOutputter(object):
|
||||
|
||||
nextmark = mark + 1
|
||||
for l in lines[mark+1:]:
|
||||
if l.startswith("set( _tx_"):
|
||||
nextmark += 1
|
||||
continue
|
||||
if l.startswith(" "):
|
||||
nextmark += 1
|
||||
continue
|
||||
if l.startswith(mark_text):
|
||||
break
|
||||
if nextmark > mark + 12 or nextmark > len(lines) - 4:
|
||||
if nextmark > mark + 100 or nextmark > len(lines) - 4:
|
||||
# Try to catch runaway nextmarks: we know there should
|
||||
# be four set-lines, which are unlikely to be 3 lines each;
|
||||
# similarly the CMakeLists.txt is supposed to end with
|
||||
# some boilerplate.
|
||||
#
|
||||
# However, gersemi will reformat to one-language-per-line,
|
||||
# so we can get really long sections, that's why we use 100 as a limit.
|
||||
raise TXError("Could not find end of TX settings in CMakeLists.txt")
|
||||
self.post_lines = lines[nextmark:]
|
||||
|
||||
@ -185,7 +186,8 @@ def get_tx_stats(languages, outputter, verbose):
|
||||
)
|
||||
|
||||
all_langs = []
|
||||
outputter.print("# Total %d languages" % len(languages))
|
||||
mark_text = "# Total %d languages" % len(languages)
|
||||
outputter.print(mark_text)
|
||||
for lang_name in languages:
|
||||
stats = languages[lang_name]["translated"]["percentage"]
|
||||
# Make the by-definition-incomplete languages have a percentage
|
||||
@ -202,6 +204,7 @@ def get_tx_stats(languages, outputter, verbose):
|
||||
output_langs(all_langs, outputter, "good", lambda s : 1.0 > s >= 0.75)
|
||||
output_langs(all_langs, outputter, "ok", lambda s : 0.75 > s >= 0.05)
|
||||
output_langs(all_langs, outputter, "incomplete", lambda s : 0.05 > s)
|
||||
outputter.print(mark_text)
|
||||
|
||||
# Audit the languages that are in TX, mapped to git
|
||||
for lang_name in languages:
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user