1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
|
/****************************************************************************
**
** Copyright (C) 2019 Alberto Mardegan
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qbs.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\qmltype freedesktop
\inqmlmodule QbsModules
\since Qbs 1.16
\brief Provides support for some freedesktop.org specifications.
The \c freedesktop module contains properties and rules for building and working with
applications compliant to freedesktop.org specifications on UNIX platforms.
The areas in which this module can be of use include:
\list
\li Creation or post-processing of
\l{https://specifications.freedesktop.org/desktop-entry-spec/latest/}{\c{.desktop}
files}
\li Installation of \l{https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html}{AppStream} metadata
\li Defining the location for
\l{https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#directory_layout}
{application icons}
\endlist
This module is available on all platforms but is currently only useful on UNIX platforms.
\section2 Example usage
\target example-freedesktop
\code
Application {
...
Depends { name: "freedesktop" }
Group {
files: [
...
// Declare the desktop and appstream files
"data/my-app.desktop",
"data/my-app.metainfo.xml",
]
}
// Add/change some fields in the desktop file
freedesktop.desktopKeys: ({
'Exec': FileInfo.joinPaths(qbs.installPrefix,
product.installDir,
product.targetName) + ' --argument',
'X-Application-Version': product.version,
})
// Define the source directory for application icons
freedesktop.hicolorRoot: project.sourceDirectory + "/icons/"
// Declare the application icons
Group {
prefix: project.sourceDirectory + "/icons/"
files: [
"32x32/apps/my-application.png",
"32x32@2/apps/my-application.png",
"32x32/mimetypes/application-format.png",
...
"scalable/apps/my-application.svg",
]
fileTags: "freedesktop.appIcon"
}
}
\endcode
\section2 Relevant File Tags
\target filetags-freedesktop
\table
\header
\li Tag
\li Auto-tagged File Names
\li Since
\li Description
\row
\li \c{"freedesktop.desktopfile_source"}
\li \c{*.desktop}
\li 1.16
\li A source file with this tag is a \c{.desktop} file or fragment that
will be merged into the application's final \c{.desktop} file.
\row
\li \c{"freedesktop.desktopfile"}
\li -
\li 1.16
\li Attached to the output artifacts of the rule that produces the
merged \c{.desktop} file.
\row
\li \c{"freedesktop.appstream"}
\li \c{*.metainfo.xml}, \c{*.appdata.xml}
\li 1.16
\li Source files with this tag are AppStream metadata files which will
be installed under \l{qbs::}{installPrefix}\c{/share/metainfo}
\row
\li \c{"freedesktop.appIcon"}
\li -
\li 1.16
\li Source files with this tag are application icons compliant with the
\l{https://specifications.freedesktop.org/icon-theme-spec/}{freedesktop.org Icon Theme Specification}.
These icons will be installed under \l{qbs::}{installPrefix}\c{/share/icons/hicolor} in their
respective resolution-based directories (e.g., \c{48x48/apps/}, \c{256x256/apps/}),
ensuring compatibility with desktop environments following this specification.
\note After Qbs version 2.5, the \c{hicolorRoot} property must be set to define the source directory for
these icons. Without setting this property, icons will not be installed.
\endtable
*/
/*!
\qmlproperty string freedesktop::appName
The display name of the application which will be stored in the \c{.desktop} file.
\defaultvalue \l{Product::name}{product.name}
*/
/*!
\qmlproperty var freedesktop::desktopKeys
A dictionary of key-value pairs to add to the application's \c{.desktop}
file.
The contents of this property will be aggregated with the values from any
\c{.desktop} file. If this property and any \c{.desktop} files contain the
same key, this property will take precedence.
\nodefaultvalue
*/
/*!
\qmlproperty string freedesktop::hicolorRoot
Defines the source directory for application icons, which are installed
according to the \l{https://specifications.freedesktop.org/icon-theme-spec/}{freedesktop.org Icon Theme Specification}.
It is used with the \c{freedesktop.appIcon} tag to install icons into the
\c{share/icons/hicolor} directory structure (e.g., \c{48x48/apps/}, \c{256x256/apps/}).
If \c{hicolorRoot} is not set, icons will not be installed. Set this property
to the path containing your icon files.
\nodefaultvalue
\since 2.5
*/
|