Merge branch 'qbs' into develop Closes #116

This commit is contained in:
Roman Telezhynskyi 2023-01-28 17:08:50 +02:00
commit d781c34ede
307 changed files with 7136 additions and 527 deletions

View File

@ -5,7 +5,7 @@ Valentina Web page: https://smart-pattern.com.ua/
Wiki: https://wiki.valentinaproject.org
Valentina main repository: https://gitlab.com/smart-pattern/valentina
PPA for Ubuntu (develop): https://launchpad.net/~dismine/+archive/valentina-dev
Help translate https://www.transifex.com/organization/valentina
Help translate https://explore.transifex.com/valentina/valentina-project/
Valentina
==========

View File

@ -66,6 +66,6 @@ script:
# bundle icu's data
- mkdir -p $BUILD_APPDIR/usr/share/icu
- cp /usr/share/icu/*/icudt*.dat $BUILD_APPDIR/usr/share/icu/
- linuxdeployqt $BUILD_APPDIR/usr/share/applications/valentina.desktop -bundle-non-qt-libs -verbose=2 -no-strip
- linuxdeployqt $BUILD_APPDIR/usr/share/applications/ua.com.smart-pattern.valentina.desktop -bundle-non-qt-libs -verbose=2 -no-strip
# Show what we have done
- find $BUILD_APPDIR/

View File

@ -16,3 +16,4 @@ usr/share/icons/hicolor/256x256/mimetypes/*
usr/share/icons/hicolor/512x512/apps/*
usr/share/icons/hicolor/512x512/mimetypes/*
usr/share/applications/*
usr/share/metainfo/*

View File

@ -9,19 +9,19 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>© 2013-2022, Valentina project</string>
<string>© 2013-2023, Valentina project</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
<string>io.bitbucket.valentinaproject.@EXECUTABLE@</string>
<string>ua.com.smart-pattern.@EXECUTABLE@</string>
<key>CFBundleShortVersionString</key>
<string>0.7.52</string>
<string>@SHORT_VERSION@</string>
<key>CFBundleVersion</key>
<string>0.7.52.0</string>
<string>@FULL_VERSION@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDocumentTypes</key>
@ -33,7 +33,7 @@
<string>layout.incs</string>
<key>LSItemContentTypes</key>
<array>
<string>io.bitbucket.valentinaproject.vlt</string>
<string>ua.com.smart-pattern.vlt</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina layout</string>
@ -54,7 +54,7 @@
<key>UTTypeIconFile</key>
<string>layout.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.vlt</string>
<string>ua.com.smart-pattern.vlt</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>

View File

@ -0,0 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16@2x.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256@2x.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -9,19 +9,19 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>© 2013-2022, Valentina project</string>
<string>© 2013-2023, Valentina project</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
<string>io.bitbucket.valentinaproject.@EXECUTABLE@</string>
<string>ua.com.smart-pattern.@EXECUTABLE@</string>
<key>CFBundleShortVersionString</key>
<string>0.7.52</string>
<string>@SHORT_VERSION@</string>
<key>CFBundleVersion</key>
<string>0.7.52.0</string>
<string>@FULL_VERSION@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDocumentTypes</key>
@ -33,7 +33,7 @@
<string>i-measurements.incs</string>
<key>LSItemContentTypes</key>
<array>
<string>io.bitbucket.valentinaproject.vit</string>
<string>ua.com.smart-pattern.vit</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina individual measurements</string>
@ -47,10 +47,10 @@
<string>s-measurements.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>io.bitbucket.valentinaproject.vst</string>
<string>ua.com.smart-pattern.vst</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina multisize measurements</string>
<string>Valentina multisize measurements</string>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
@ -68,7 +68,7 @@
<key>UTTypeIconFile</key>
<string>i-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.vit</string>
<string>ua.com.smart-pattern.vit</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -76,7 +76,7 @@
<string>vit</string>
</array>
<key>public.mime-type</key>
<string>text/xml</string>
<string>text/xml</string>
</dict>
</dict>
<dict>
@ -86,11 +86,11 @@
<string>public.xml</string>
</array>
<key>UTTypeDescription</key>
<string>Valentina multisize measurements</string>
<string>Valentina multisize measurements</string>
<key>UTTypeIconFile</key>
<string>s-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.vst</string>
<string>ua.com.smart-pattern.vst</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -98,7 +98,7 @@
<string>vst</string>
</array>
<key>public.mime-type</key>
<string>text/xml</string>
<string>text/xml</string>
</dict>
</dict>
</array>

View File

@ -0,0 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16@2x.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256@2x.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

View File

@ -9,19 +9,19 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>© 2013-2022, Valentina project</string>
<string>© 2013-2023, Valentina project</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
<string>io.bitbucket.valentinaproject.@EXECUTABLE@</string>
<string>ua.com.smart-pattern.@EXECUTABLE@</string>
<key>CFBundleShortVersionString</key>
<string>0.7.52</string>
<string>@SHORT_VERSION@</string>
<key>CFBundleVersion</key>
<string>0.7.52.0</string>
<string>@FULL_VERSION@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDocumentTypes</key>
@ -33,7 +33,7 @@
<string>pattern.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>io.bitbucket.valentinaproject.val</string>
<string>ua.com.smart-pattern.val</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina pattern file</string>
@ -47,7 +47,7 @@
<string>i-measurements.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>io.bitbucket.valentinaproject.vit</string>
<string>ua.com.smart-pattern.vit</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina individual measurements</string>
@ -61,7 +61,7 @@
<string>s-measurements.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>io.bitbucket.valentinaproject.vst</string>
<string>ua.com.smart-pattern.vst</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina multisize measurements</string>
@ -80,9 +80,9 @@
<key>UTTypeDescription</key>
<string>Valentina pattern file</string>
<key>UTTypeIconFile</key>
<string>pattern</string>
<string>pattern.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.val</string>
<string>ua.com.smart-pattern.val</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -104,7 +104,7 @@
<key>UTTypeIconFile</key>
<string>i-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.vit</string>
<string>ua.com.smart-pattern.vit</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -126,7 +126,7 @@
<key>UTTypeIconFile</key>
<string>s-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.vst</string>
<string>ua.com.smart-pattern.vst</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -148,7 +148,7 @@
<key>UTTypeIconFile</key>
<string>layout.icns</string>
<key>UTTypeIdentifier</key>
<string>io.bitbucket.valentinaproject.vlt</string>
<string>ua.com.smart-pattern.vlt</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>

View File

@ -0,0 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16@2x.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256@2x.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon_512x512@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -23,6 +23,9 @@ BuildRequires: qt5-qtxmlpatterns-devel >= 5.4.0
BuildRequires: qt5-qtsvg-devel >= 5.4.0
BuildRequires: qt5-qttools-devel >= 5.4.0
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
Requires: qt5-qtsvg >= 5.4.0
Requires: qt5-qtbase-gui >= 5.4.0
Requires: qt5-qtxmlpatterns >= 5.4.0
@ -172,6 +175,12 @@ cp dist/debian/valentina.mime dist/debian/%{name} &&
%suse_update_desktop_file -r puzzle Utility Applet
%endif
%check
appstream-util validate-relax --nonet "%{buildroot}%{_datadir}/metainfo/ua.com.smart-pattern.valentina.metainfo.xml"
desktop-file-validate %{buildroot}%{_datadir}/applications/ua.com.smart-pattern.valentina.desktop
desktop-file-validate %{buildroot}%{_datadir}/applications/ua.com.smart-pattern.tape.desktop
desktop-file-validate %{buildroot}%{_datadir}/applications/ua.com.smart-pattern.puzzle.desktop
%post
/sbin/ldconfig
update-desktop-database &> /dev/null ||:
@ -216,9 +225,10 @@ fi
%dir %{_datadir}/mime/
%dir %{_datadir}/mime/packages/
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/tape.desktop
%{_datadir}/applications/puzzle.desktop
%{_datadir}/applications/ua.com.smart-pattern.valentina.desktop
%{_datadir}/applications/ua.com.smart-pattern.tape.desktop
%{_datadir}/applications/ua.com.smart-pattern.puzzle.desktop
%{_datadir}/metainfo/ua.com.smart-pattern.valentina.metainfo.xml
%{_datadir}/icons/hicolor

View File

@ -2,13 +2,15 @@
Type=Application
Name=Puzzle
Exec=puzzle %F
Version=1.0
Version=1.1
GenericName=Valentina's layout editor
GenericName[uk]=Редактор розкладки Валентини
Comment=Create and edit layouts
Comment[uk]=Створюйте і редагуйте розкладки
Comment[ru]=Создавайте и редактируйте раскладку
Icon=puzzle
Terminal=false
MimeType=application/x-valentina-layout;
Categories=Qt;Utility;FileTools;
TryExec=puzzle
Keywords=layout;nesting
StartupWMClass=puzzle

View File

@ -2,13 +2,15 @@
Type=Application
Name=Tape
Exec=tape %F
Version=1.0
Version=1.1
GenericName=Valentina's measurements editor
GenericName[uk]=Редактор мірок Валентини
Comment=Create and edit measurements
Comment[uk]=Створюйте і редагуйте мірки
Comment[ru]=Создавайте и редактируйте мерки
Icon=tape
Terminal=false
MimeType=application/x-valentina-s-measurements;application/x-valentina-i-measurements;
Categories=Qt;Utility;FileTools;
TryExec=tape
Keywords=measurements
StartupWMClass=tape

View File

@ -2,8 +2,9 @@
Type=Application
Name=Valentina
Exec=valentina %F
Version=1.0
Version=1.1
GenericName=Pattern making program
GenericName[uk]=Програма створення викрійок
Comment=Creating pattern of clothes
Comment[uk]=Створеня викрійок одягу
Icon=valentina
@ -11,3 +12,5 @@ Terminal=false
MimeType=application/x-valentina-pattern;
Categories=Graphics;VectorGraphics;2DGraphics;Qt;Engineering;
TryExec=valentina
Keywords=pattern
StartupWMClass=valentina

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2023 Roman Telezhynskyi dismine@gmail.com -->
<component type="desktop">
<id>ua.com.smart-pattern.valentina.desktop</id>
<launchable type="desktop-id">ua.com.smart-pattern.valentina.desktop</launchable>
<name>Valentina</name>
<summary>Provides a cross-platform patternmaking program which allows designers to create and model patterns of clothing</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<description>
<p>
Valentina is a cross-platform patternmaking program which allows designers
to create and model patterns of clothing. This software allows pattern
creation, using either standard sizing tables or an individuals set of
measurements. It blends new technologies with traditional methods to create
a unique pattern making tool.
</p>
</description>
<categories>
<category>Graphics</category>
</categories>
<url type="homepage">https://smart-pattern.com.ua/valentina/download/</url>
<url type="bugtracker">https://gitlab.com/smart-pattern/valentina/-/issues</url>
<url type="translate">https://explore.transifex.com/valentina/valentina-project/</url>
<url type="contact">https://smart-pattern.com.ua/contact/</url>
<url type="vcs-browser">https://gitlab.com/smart-pattern/valentina</url>
<url type="contribute">https://smart-pattern.com.ua/valentina/contribute/</url>
<developer_name>Roman Telezhynskyi</developer_name>
<update_contact>contact@smart-pattern.com.ua</update_contact>
<content_rating type="oars-1.1" />
<releases>
<release version="0.7.53" type="development">
<description>
<p>
This is a development release in the 0.7 series.
</p>
<ul>
<li>Fix layout sheet export with empty name.</li>
<li>Fix visualization for tool Point from circle and tangent.</li>
<li>Fix loading background image.</li>
<li>Puzzle: message "Invalid version: Max supported version 0.1.2" when opening 0.1.1 file in Val 0.7.52.</li>
<li>Fix export measurement separator to CSV.</li>
<li>Fix option Hide labels.</li>
<li>Improve segmenting a curve for calculating a piece path.</li>
<li>[smart-pattern/valentina#184] Fix incorrect seam allowance.</li>
<li>Export area of piece in Final measurements.</li>
<li>New option Show accuracy radius.</li>
<li>New option Interactive tools.</li>
<li>Improve error messages while import CSV data.</li>
<li>Fix regression in dialog Known measurements.</li>
</ul>
</description>
<issues>
<issue url="https://gitlab.com/smart-pattern/valentina/-/issues/187">valentina#187</issue>
<issue url="https://gitlab.com/smart-pattern/valentina/-/issues/189">valentina#189</issue>
</issues>
</release>
</releases>
<release version="0.7.52" type="development" date="2020-09-12">
<description>
<p>
This is a development release in the 0.7 series.
</p>
<ul>
<li>Fix crash when default locale is ru.</li>
<li>Puzzle app. Fix incorrect update of a layout piece.</li>
<li>Fix visualization for tool Point of intersection line and axis.</li>
<li>Improved curve segment warnings.</li>
<li>Tape app. Add action Add separator to menu.</li>
<li>Tape app. Fix crash after switching language.</li>
<li>Fix Valentina app crash after canceling a tool.</li>
<li>Puzzle app. Fix reading a piece name.</li>
<li>Fix warning while segmenting flipped arc.</li>
<li>Tape app. "Export from existing ..." now supports multisize measurements.</li>
<li>Fix main path validation. False positive double curve.</li>
<li>Fix Setup multisize measurements dialog. Improved handling Height dimension.</li>
<li>Fix updating dimension labels in Valentina app.</li>
<li>Fix menu on Mac OS X.</li>
<li>Add function's argument template with name in the Formula Wizard.</li>
<li>Unit type for increments.</li>
<li>Support for options Force Flipping and Forbid Flipping in Puzzle.</li>
<li>Remember selected dimension values.</li>
<li>Fix segmenting a simple curve.</li>
<li>Fix export tiled pdf on Mac OS.</li>
<li>Improve visualization for tools.</li>
<li>Fix calculating an elliptical arc.</li>
<li>Enable Approximation scale option for Elliptical arc.</li>
<li>Fix bug in seam allowance.</li>
<li>Allow resizing Spline path dialog.</li>
<li>Improve highlighting file in file browser for Linux.</li>
</ul>
</description>
</release>
</releases>
</component>

Binary file not shown.

Binary file not shown.

89
qbs/imports/VApp.qbs Normal file
View File

@ -0,0 +1,89 @@
import qbs.FileInfo
import qbs.Utilities
CppApplication {
Depends { name: "buildconfig" }
Depends { name: "bundle"; condition: qbs.targetOS.contains("macos") }
Properties {
condition: qbs.targetOS.contains("macos")
cpp.minimumMacosVersion: buildconfig.minimumMacosVersion
}
Properties {
condition: buildconfig.enableRPath
cpp.rpaths: FileInfo.joinPaths(cpp.rpathOrigin,
"..",
qbs.targetOS.contains("macos")
? "Frameworks"
: buildconfig.installLibraryPath)
}
Properties {
condition: qbs.targetOS.contains("unix") && buildconfig.buildWithCcache
cpp.compilerWrapper: "ccache"
}
Properties {
condition: Qt.core.versionMajor >= 5 && Qt.core.versionMinor < 12
cpp.cxxLanguageVersion: "c++11"
}
// Since Qt 5.12 available support for C++17
Properties {
condition: Qt.core.versionMajor >= 5 && Qt.core.versionMinor >= 12
cpp.cxxLanguageVersion: "c++17"
}
Group {
// See question on StackOwerflow "QSslSocket error when SSL is NOT used" (http://stackoverflow.com/a/31277055/3045403)
// Copy of answer:
// We occasionally had customers getting very similar warning messages but the software was also crashing.
// We determined it was because, although we weren't using SSL either, the program found a copy of OpenSSL on the
// customer's computer and tried interfacing with it. The version it found was too old though (from Qt 5.2 onwards v1.0.0
// or later is required).
//
// Our solution was to distribute the OpenSSL DLLs along with our application (~1.65 MB). The alternative is to compile
// Qt from scratch without OpenSSL support.
condition: qbs.targetOS.contains("windows") && (qbs.architecture.contains("x86_64") || qbs.architecture.contains("x86"))
name: "openssl"
prefix: project.sourceDirectory + "/dist/win/"
files: {
var files = [];
if (qbs.toolchainType.contains("mingw"))
files.push("msvcr120.dll");
// Minimal supported OpenSSL version since Qt 5.12.4 is 1.1.1.
if (Utilities.versionCompare(Qt.core.version, "5.12.4") >= 0) {
if (qbs.architecture.contains("x86_64")) {
files.push(
"openssl/win64/libcrypto-1_1-x64.dll",
"openssl/win64/libssl-1_1-x64.dll"
);
} else {
files.push(
"openssl/win32/libcrypto-1_1.dll",
"openssl/win32/libssl-1_1.dll"
);
}
} else {
if (qbs.architecture.contains("x86_64")) {
files.push(
"openssl/win64/libeay32.dll",
"openssl/win64/ssleay32.dll"
);
} else {
files.push(
"openssl/win32/libeay32.dll",
"openssl/win32/ssleay32.dll"
);
}
}
return files;
}
fileTags: ["openssl_dist"]
qbs.install: true
qbs.installDir: buildconfig.installBinaryPath
}
}

View File

@ -0,0 +1,26 @@
VLib {
Depends { name: "windeployqt"; }
Depends { name: "i18nconfig"; }
buildconfig.staticBuild: false
windeployqt.noVirtualkeyboard: true
Properties {
condition: qbs.targetOS.contains("macos")
bundle.identifierPrefix: 'ua.com.smart-pattern'
}
Properties {
condition: i18nconfig.limitDeploymentOfQtTranslations
windeployqt.languages: i18nconfig.qtTranslationLocales.join(',')
}
installDebugInformation: qbs.buildVariant !== "release"
Properties {
condition: !qbs.targetOS.contains("macos") || (qbs.targetOS.contains("macos") && !buildconfig.enableMultiBundle)
install: true
installDir: buildconfig.installLibraryPath
}
}

34
qbs/imports/VLib.qbs Normal file
View File

@ -0,0 +1,34 @@
import qbs.FileInfo
Library {
Depends { name: "buildconfig" }
Depends { name: "bundle"; condition: qbs.targetOS.contains("macos") }
Depends { name: "cpp" }
type: buildconfig.staticBuild ? "staticlibrary" : "dynamiclibrary"
buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Valentina" : "valentina"
cpp.includePaths: [".."]
// Allow MAC OS X to find library inside a bundle
cpp.sonamePrefix: (!buildconfig.staticBuild && qbs.targetOS.contains("macos")) ? "@rpath" : undefined
Properties {
condition: (!buildconfig.staticBuild && buildconfig.enableRPath)
cpp.rpaths: cpp.rpathOrigin
}
Properties {
condition: qbs.targetOS.contains("unix") && buildconfig.buildWithCcache
cpp.compilerWrapper: "ccache"
}
install: false
installDebugInformation: false
Properties {
condition: qbs.targetOS.contains("macos")
cpp.minimumMacosVersion: buildconfig.minimumMacosVersion
bundle.isBundle: buildconfig.frameworksBuild
}
}

10
qbs/imports/VTestApp.qbs Normal file
View File

@ -0,0 +1,10 @@
VApp {
type: base.concat("autotest")
install: false
condition: buildconfig.enableUnitTests
Properties {
condition: qbs.targetOS.contains("macos")
bundle.isBundle: false
}
}

221
qbs/imports/VToolApp.qbs Normal file
View File

@ -0,0 +1,221 @@
import qbs.FileInfo
import qbs.File
VApp {
Depends { name: "freedesktop2" }
Depends { name: "tenv" }
Depends { name: "windeployqt"; condition: qbs.targetOS.contains("windows") }
Depends { name: "i18nconfig"; }
Depends { name: "i18n"; }
Depends { name: "ib"; condition: qbs.targetOS.contains("macos") }
Depends { name: "macdeployqt"; condition: qbs.targetOS.contains("macos") }
version: "0.7.52"
install: true
installDir: buildconfig.installBinaryPath
installDebugInformation: qbs.buildVariant !== "release"
consoleApplication: false
property bool primaryApp: false
Properties {
condition: qbs.targetOS.contains("macos")
// Breakpoints do not work if debug the app inside of bundle. In debug mode we turn off creating a bundle.
// Probably it will breake some dependencies. Version for Mac designed to work inside an app bundle.
bundle.isBundle: qbs.buildVariant === "release"
bundle.identifierPrefix: 'ua.com.smart-pattern'
bundle.infoPlist:({
"NSHumanReadableCopyright": buildconfig.valentina_copyright_string
})
}
Properties {
condition: buildconfig.enableAppImage && qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")
cpp.dynamicLibraries: ["icudata", "icui18n", "icuuc"]
}
Group {
name: "freedesktop"
prefix: project.sourceDirectory + "/dist/"
files: [
"ua.com.smart-pattern." + product.targetName + ".desktop"
]
}
freedesktop2.desktopKeys: ({
'Exec': FileInfo.joinPaths(qbs.installPrefix,
product.installDir,
product.targetName) + ' %F',
'X-Application-Version': product.version,
})
Group {
name: "Translations"
prefix: project.sourceDirectory + "/share/translations/"
files: {
var files = [];
var locales = i18nconfig.translationLocales;
for (var i = 0; i < locales.length; i++) {
files.push("valentina_" + locales[i] + ".ts");
}
var pmSystems = i18nconfig.pmSystems;
for (var i = 0; i < pmSystems.length; i++) {
for (var j = 0; j < locales.length; j++) {
files.push("measurements_" + pmSystems[i] + "_" + locales[j] + ".ts");
}
}
return files;
}
}
Group {
condition: product.primaryApp || (qbs.targetOS.contains("macos") && (!bundle.isBundle || (bundle.isBundle && buildconfig.enableMultiBundle)))
fileTagsFilter: "qm"
qbs.install: true
qbs.installDir: buildconfig.installDataPath + "/translations"
}
Rule {
multiplex: true
condition: qbs.targetOS.contains("macos") && bundle.isBundle && (buildconfig.enableMultiBundle || primaryApp)
inputs: ["qm"]
outputFileTags: ["bundle.qm", "bundle.content"]
outputArtifacts: {
var locales = product.i18nconfig.translationLocales;
var artifactNames = [];
for (var i = 0; i < locales.length; i++) {
const lprojDir = FileInfo.joinPaths(product.buildDirectory, product.bundle.bundleName,
"Contents", "Resources", "translations", locales[i] + product.bundle.localizedResourcesFolderSuffix);
var qmRex = new RegExp('.*_' + locales[i] + '\.qm$', 'g');
artifactNames = artifactNames.concat((inputs["qm"] || []).filter(function(file){
return qmRex.exec(file.fileName);
}).map(function(file){
return FileInfo.joinPaths(lprojDir, file.fileName);
}));
artifactNames.push(FileInfo.joinPaths(lprojDir, "Localizable.strings"));
const qtTranslationsMask = [
"qt_",
"qtbase_",
"qtxmlpatterns_"
];
qtTranslationsMask.forEach(function(mask) {
var qmFile = FileInfo.joinPaths(product.i18n.qtTranslationsPath, mask + locales[i] + ".qm");
if (File.exists(qmFile)) {
artifactNames.push(FileInfo.joinPaths(lprojDir, mask + locales[i] + ".qm"));
} else {
const lang = locales[i].split('_')[0];
qmFile = FileInfo.joinPaths(product.i18n.qtTranslationsPath, mask + lang + ".qm");
if (File.exists(qmFile))
artifactNames.push(FileInfo.joinPaths(lprojDir, mask + lang + ".qm"));
}
});
}
var artifacts = artifactNames.map(function(art){
var a = {
filePath: art,
fileTags: ["bundle.qm", "bundle.content"]
}
return a;
});
return artifacts;
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "Preparing Valentina translations";
cmd.highlight = "filegen";
var data = [];
const locales = product.i18nconfig.translationLocales;
for (var i = 0; i < locales.length; i++) {
const qmRex = new RegExp('.*_' + locales[i] + '.qm$', 'g');
const src = (inputs["qm"] || []).filter(function(file){
return qmRex.exec(file.fileName);
});
const lprojDir = FileInfo.joinPaths(product.buildDirectory, product.bundle.bundleName,
"Contents", "Resources", "translations", locales[i] + product.bundle.localizedResourcesFolderSuffix);
for (var j = 0; j < src.length; j++) {
data.push({
"source" : src[j].filePath,
"destination": FileInfo.joinPaths(lprojDir, src[j].fileName)
});
}
data.push({
"source" : FileInfo.joinPaths(project.sourceDirectory, "share", "translations", "Localizable.strings"),
"destination": FileInfo.joinPaths(lprojDir, "Localizable.strings")
});
const qtTranslationsMask = [
"qt_",
"qtbase_",
"qtxmlpatterns_"
];
qtTranslationsMask.forEach(function(mask) {
var qmFile = FileInfo.joinPaths(product.i18n.qtTranslationsPath, mask + locales[i] + ".qm");
if (File.exists(qmFile)) {
data.push({
"source" : qmFile,
"destination": FileInfo.joinPaths(lprojDir, mask + locales[i] + ".qm")
});
} else {
const lang = locales[i].split('_')[0];
qmFile = FileInfo.joinPaths(product.i18n.qtTranslationsPath, mask + lang + ".qm");
if (File.exists(qmFile)) {
data.push({
"source" : qmFile,
"destination": FileInfo.joinPaths(lprojDir, mask + lang + ".qm")
});
}
}
});
}
cmd.data = data;
cmd.sourceCode = function() {
data.forEach(function(copyData) {
File.copy(copyData.source, copyData.destination);
});
};
return [cmd];
}
}
Properties {
condition: qbs.targetOS.contains("windows")
windeployqt.noVirtualkeyboard: true
}
Properties {
condition: qbs.targetOS.contains("macos")
ib.appIconName: targetName
macdeployqt.targetApps: ["Tape", "Puzzle"]
}
Properties {
condition: qbs.targetOS.contains("windows") && i18nconfig.limitDeploymentOfQtTranslations
windeployqt.languages: i18nconfig.qtTranslationLocales.join(',')
}
Group {
condition: qbs.targetOS.contains("macos") && bundle.isBundle
fileTagsFilter: "bundle.content"
qbs.install: true
qbs.installDir: buildconfig.installAppPath
qbs.installSourceBase: destinationDirectory
}
}

View File

@ -0,0 +1,861 @@
import qbs.FileInfo
import qbs.Utilities
Module {
property bool staticBuild: true
property bool frameworksBuild: qbs.targetOS.contains("macos") && !staticBuild
property bool enableAddressSanitizer: false
property bool enableUbSanitizer: false
property bool enableThreadSanitizer: false
// Use this property to disable building unit tests.
property bool enableUnitTests: true
// Use this property to disable the use of rpath. This can be used when packaging Valentina for distributions which
// do not permit the use of rpath, such as Fedora.
property bool enableRPath: true
// Use this property to disable the use of precompiled headers. This can be used when packaging Valentina for
// distributions which provides not enough space on build servers.
property bool enablePCH: true
property bool enableAppImage: false
property bool enableMultiBundle: false
property string valentina_copyright_year: { return new Date().getFullYear().toString(); }
property string valentina_copyright_string: "(C) 2013-" + valentina_copyright_year + ", Valentina project"
Depends { name: "ccache"; }
// Use this property to disable the use of ccache.
property bool enableCcache: true
readonly property bool ccachePresent: ccache.ccachePresent
readonly property bool ccachePCHSupport: ccache.pchSupport
readonly property bool buildWithCcache: enableCcache && (enablePCH && ccachePresent && ccachePCHSupport || (!enablePCH && ccachePresent))
property bool treatWarningsAsErrors: true
property string libDirName: "lib"
property string appTarget
readonly property string installAppPath: {
if (qbs.targetOS.contains("macos"))
return "Applications";
else if (qbs.targetOS.contains("windows"))
return ".";
else
return "bin";
}
readonly property string installBinaryPath: {
if (qbs.targetOS.contains("macos"))
return installAppPath + "/" + appTarget + ".app/Contents/MacOS"
else
return installAppPath
}
readonly property string installLibraryPath: {
if (qbs.targetOS.contains("macos"))
return installAppPath + "/" + appTarget + ".app/Contents/Frameworks"
else if (qbs.targetOS.contains("windows"))
return installAppPath
else
return libDirName + "/" + appTarget
}
readonly property string installPluginPath: {
if (qbs.targetOS.contains("macos"))
return installAppPath + "/" + appTarget + ".app/Contents/Plugins"
else
return installLibraryPath + "/plugins"
}
readonly property string installDataPath: {
if (qbs.targetOS.contains("macos"))
return installAppPath + "/" + appTarget + ".app/Contents/Resources"
else if (qbs.targetOS.contains("windows"))
return installAppPath
else
return "share/" + appTarget
}
Depends { name: "cpp" }
Depends { name: "Qt.core"; versionAtLeast: project.minimumQtVersion }
Depends { name: "vcs2"; }
cpp.defines: {
var defines = [
// The following define makes your compiler emit warnings if you use
// any feature of Qt which has been marked as deprecated (the exact warnings
// depend on your compiler). Please consult the documentation of the
// deprecated API in order to know how to port your code away from it.
"QT_DEPRECATED_WARNINGS",
// You can make your code fail to compile if it uses deprecated APIs.
// In order to do so, uncomment the following line.
"QT_DISABLE_DEPRECATED_BEFORE=0x060000", // disables all the APIs deprecated before Qt 6.0.0
// Since Qt 5.4.0 the source code location is recorded only in debug builds.
// We need this information also in release builds. For this need define QT_MESSAGELOGCONTEXT.
"QT_MESSAGELOGCONTEXT",
"QBS_BUILD",
"QT_NO_FOREACH"
];
if (qbs.targetOS.contains("unix")) {
defines.push('BINDIR="' + FileInfo.joinPaths(qbs.installPrefix, "bin") + '"');
const dataDir = FileInfo.joinPaths(qbs.installPrefix, "share");
defines.push('DATADIR="' + dataDir + '"');
defines.push('PKGDATADIR="' + FileInfo.joinPaths(dataDir, "valentina") + '"');
}
if (qbs.buildVariant !== "debug")
defines.push('V_NO_ASSERT');
if (enableAppImage && qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos"))
defines.push('APPIMAGE');
if (enableMultiBundle)
defines.push('MULTI_BUNDLE');
return defines;
}
cpp.visibility: "minimal"
Properties {
condition: Qt.core.versionMajor >= 5 && Qt.core.versionMinor < 12
cpp.cxxLanguageVersion: "c++11"
}
// Since Qt 5.12 available support for C++17
Properties {
condition: Qt.core.versionMajor >= 5 && Qt.core.versionMinor >= 12
cpp.cxxLanguageVersion: "c++17"
}
readonly property string minimumMacosVersion: {
// Check which minimal OSX version supports current Qt version
if (Qt.core.versionMajor >= 6) {
// For Qt 6.5 https://doc-snapshots.qt.io/qt6-6.5/supported-platforms.html
if (Qt.core.versionMinor >= 5) // Qt 6.5
return "11.0";
// See page https://doc.qt.io/qt-6.4/supported-platforms.html
return "10.14"; // Qt 6.4 and above
}
if (Qt.core.versionMajor >= 5) {
// See page https://doc.qt.io/qt-5.15/supported-platforms.html
// For qt 5.14 https://doc.qt.io/archives/qt-5.14/supported-platforms.html
if (Qt.core.versionMinor >= 14) // Qt 5.14
return "10.13";
// For Qt 5.13 https://doc.qt.io/archives/qt-5.13/supported-platforms.html
// For Qt 5.12 https://doc.qt.io/archives/qt-5.12/supported-platforms.html
if (Qt.core.versionMinor >= 12) // Qt 5.12
return "10.12";
// For older versions https://doc.qt.io/archives/qt-5.11/supported-platforms-and-configurations.html
if (Qt.core.versionMinor >= 10) // Qt 5.11 and Qt 5.10
return "10.11";
if (Qt.core.versionMinor >= 9) // Qt 5.9
return "10.10";
if (Qt.core.versionMinor >= 8) // Qt 5.8
return "10.9";
if (Qt.core.versionMinor >= 7) // Qt 5.7
return "10.8";
if (Qt.core.versionMinor >= 4) // Qt 5.4
return "10.7";
return "10.6";
}
return undefined;
}
cpp.separateDebugInformation: true
Properties {
condition: qbs.buildVariant === "debug"
cpp.warningLevel: "all"
cpp.treatWarningsAsErrors: treatWarningsAsErrors
}
property stringList debugFlags: {
var debugFlags = [];
if (qbs.toolchain.contains("gcc")) {
if (qbs.toolchain.contains("clang")) {
debugFlags.push(
"-fparse-all-comments",
"-Wabi",
"-Wabstract-final-class",
"-Wabstract-vbase-init",
"-Waddress",
"-Waddress-of-temporary",
"-Waggregate-return",
"-Wall",
"-Wambiguous-macro",
"-Wambiguous-member-template",
"-Wanalyzer-incompatible-plugin",
"-Wanonymous-pack-parens",
"-Warc",
"-Warc-bridge-casts-disallowed-in-nonarc",
"-Warc-maybe-repeated-use-of-weak",
"-Warc-non-pod-memaccess",
"-Warc-performSelector-leaks",
"-Warc-repeated-use-of-weak",
"-Warc-retain-cycles",
"-Warc-unsafe-retained-assign",
"-Warray-bounds",
"-Warray-bounds-pointer-arithmetic",
"-Wasm",
"-Wasm-operand-widths",
"-Wassign-enum",
"-Watomic-properties",
"-Watomic-property-with-user-defined-accessor",
"-Wattributes",
"-Wauto-import",
"-Wauto-storage-class",
"-Wauto-var-id",
"-Wavailability",
"-Wbackslash-newline-escape",
// "-Wbad-array-new-length",
"-Wbad-function-cast",
"-Wbind-to-temporary-copy",
"-Wno-c++98-compat-bind-to-temporary-copy",
"-Wbitfield-constant-conversion",
"-Wbitwise-op-parentheses",
"-Wbool-conversion",
"-Wbool-conversions",
"-Wbuiltin-macro-redefined",
"-Wbuiltin-requires-header",
"-Wc++-compat",
"-Wc++0x-compat",
"-Wc++0x-extensions",
"-Wc++0x-narrowing",
"-Wc++11-compat",
"-Wc++11-compat-pedantic",
"-Wc++11-compat-reserved-user-defined-literal",
"-Wc++11-extensions",
"-Wc++11-extra-semi",
"-Wc++11-long-long",
"-Wc++11-narrowing",
"-Wc11-extensions",
"-Wcast-align",
"-Wcast-of-sel-type",
"-Wcast-qual",
"-WCFString-literal",
"-Wchar-align",
"-Wchar-subscripts",
"-Wcomment",
"-Wcomments",
"-Wcompare-distinct-pointer-types",
"-Wcomplex-component-init",
"-Wconditional-type-mismatch",
"-Wconditional-uninitialized",
"-Wconfig-macros",
"-Wconstant-conversion",
"-Wconstant-logical-operand",
"-Wconstexpr-not-const",
"-Wconversion",
"-Wconversion-null",
"-Wno-covered-switch-default",
"-Wctor-dtor-privacy",
"-Wcustom-atomic-properties",
"-Wdangling-else",
"-Wdangling-field",
"-Wdangling-initializer-list",
"-Wdeclaration-after-statement",
"-Wdelegating-ctor-cycles",
"-Wdelete-incomplete",
"-Wdelete-non-virtual-dtor",
"-Wdeprecated",
"-Wdeprecated-declarations",
"-Wdeprecated-implementations",
"-Wdeprecated-objc-isa-usage",
"-Wdeprecated-objc-pointer-introspection",
"-Wdeprecated-objc-pointer-introspection-performSelector",
"-Wdeprecated-register",
"-Wdeprecated-writable-strings",
"-Wdirect-ivar-access",
// "-Wdisabled-macro-expansion", Disabled
"-Wdisabled-optimization",
"-Wdiscard-qual",
"-Wdistributed-object-modifiers",
"-Wdiv-by-zero",
"-Wdivision-by-zero",
"-Wdocumentation",
"-Wdocumentation-deprecated-sync",
"-Wdocumentation-html",
"-Wdollar-in-identifier-extension",
"-Wduplicate-decl-specifier",
"-Wduplicate-enum",
"-Wduplicate-method-arg",
"-Wduplicate-method-match",
"-Wdynamic-class-memaccess",
"-Weffc++",
"-Wembedded-directive",
"-Wempty-body",
"-Wempty-translation-unit",
"-Wendif-labels",
"-Wenum-compare",
"-Wenum-conversion",
"-Wexplicit-ownership-type",
"-Wextern-initializer",
"-Wextra",
"-Wextra-semi",
"-Wextra-tokens",
"-Wflexible-array-extensions",
"-Wfloat-equal",
"-Wformat",
"-Wformat-extra-args",
"-Wformat-invalid-specifier",
"-Wformat-non-iso",
"-Wformat-nonliteral",
"-Wformat-security",
"-Wformat-y2k",
"-Wformat-zero-length",
"-Wformat=2",
"-Wfour-char-constants",
"-Wgcc-compat",
"-Wgnu",
"-Wgnu-array-member-paren-init",
"-Wgnu-designator",
"-Wgnu-static-float-init",
"-Wheader-guard",
"-Wheader-hygiene",
"-Widiomatic-parentheses",
"-Wignored-attributes",
"-Wignored-qualifiers",
"-Wimplicit",
"-Wimplicit-atomic-properties",
"-Wimplicit-conversion-floating-point-to-bool",
"-Wimplicit-exception-spec-mismatch",
"-Wimplicit-fallthrough",
"-Wimplicit-fallthrough-per-function",
"-Wimplicit-function-declaration",
"-Wimplicit-int",
"-Wimplicit-retain-self",
"-Wimport",
"-Wimport-preprocessor-directive-pedantic",
"-Wincompatible-library-redeclaration",
"-Wincompatible-pointer-types",
"-Wincompatible-pointer-types-discards-qualifiers",
"-Wincomplete-implementation",
"-Wincomplete-module",
"-Wincomplete-umbrella",
"-Winit-self",
"-Winitializer-overrides",
// "-Winline",
"-Wint-conversion",
"-Wint-conversions",
"-Wint-to-pointer-cast",
"-Wint-to-void-pointer-cast",
"-Winteger-overflow",
"-Winvalid-constexpr",
"-Winvalid-iboutlet",
"-Winvalid-noreturn",
"-Winvalid-offsetof",
"-Winvalid-pch",
"-Winvalid-pp-token",
"-Winvalid-source-encoding",
"-Winvalid-token-paste",
"-Wknr-promoted-parameter",
"-Wlanguage-extension-token",
"-Wlarge-by-value-copy",
"-Wliteral-conversion",
"-Wliteral-range",
"-Wlocal-type-template-args",
"-Wno-c++98-compat-local-type-template-args",
"-Wlogical-not-parentheses",
"-Wlogical-op-parentheses",
// "-Wlong-long", // We have been using C++11
"-Wloop-analysis",
"-Wmain",
"-Wmain-return-type",
"-Wmalformed-warning-check",
"-Wmethod-signatures",
"-Wmicrosoft",
"-Wmicrosoft-exists",
"-Wmismatched-parameter-types",
"-Wmismatched-return-types",
"-Wmismatched-tags",
"-Wmissing-braces",
"-Wmissing-declarations",
"-Wmissing-field-initializers",
"-Wmissing-format-attribute",
"-Wmissing-include-dirs",
"-Wmissing-method-return-type",
"-Wmissing-noreturn",
"-Wmissing-prototypes",
"-Wmissing-selector-name",
"-Wmissing-sysroot",
"-Wmissing-variable-declarations",
"-Wmodule-conflict",
"-Wmost",
"-Wmultichar",
"-Wnarrowing",
"-Wnested-externs",
"-Wnewline-eof",
"-Wnon-gcc",
"-Wnon-literal-null-conversion",
"-Wnon-pod-varargs",
"-Wnon-virtual-dtor",
"-Wnonnull",
"-Wnonportable-cfstrings",
"-Wno-c++98-compat",
"-WNSObject-attribute",
"-Wnull-arithmetic",
"-Wnull-character",
"-Wnull-conversion",
"-Wnull-dereference",
"-Wodr",
"-Wold-style-cast",
"-Wold-style-definition",
"-Wout-of-line-declaration",
"-Wover-aligned",
"-Woverflow",
"-Woverlength-strings",
"-Woverloaded-shift-op-parentheses",
"-Woverloaded-virtual",
"-Woverriding-method-mismatch",
"-Wpacked",
"-Wparentheses",
"-Wparentheses-equality",
"-Wpedantic",
"-Wpointer-arith",
"-Wpointer-sign",
"-Wpointer-to-int-cast",
"-Wpointer-type-mismatch",
"-Wpredefined-identifier-outside-function",
"-Wprivate-extern",
"-Wprotocol",
"-Wprotocol-property-synthesis-ambiguity",
"-Wreadonly-iboutlet-property",
"-Wreceiver-expr",
"-Wreceiver-forward-class",
"-Wredundant-decls",
"-Wreinterpret-base-class",
"-Wreorder",
"-Wrequires-super-attribute",
"-Wreserved-user-defined-literal",
"-Wreturn-stack-address",
"-Wreturn-type",
"-Wreturn-type-c-linkage",
"-Wsection",
"-Wselector",
"-Wselector-type-mismatch",
"-Wself-assign",
"-Wself-assign-field",
"-Wsemicolon-before-method-body",
"-Wsentinel",
"-Wsequence-point",
"-Wserialized-diagnostics",
"-Wshadow-ivar",
"-Wshift-count-negative",
"-Wshift-count-overflow",
"-Wshift-op-parentheses",
"-Wshift-overflow",
"-Wshift-sign-overflow",
"-Wshorten-64-to-32",
"-Wsign-compare",
"-Wsign-conversion",
"-Wsign-promo",
"-Wsizeof-array-argument",
"-Wsizeof-array-decay",
"-Wsizeof-pointer-memaccess",
"-Wsometimes-uninitialized",
"-Wsource-uses-openmp",
// "-Wstack-protector",
"-Wstatic-float-init",
"-Wstatic-in-inline",
"-Wstatic-local-in-inline",
"-Wstatic-self-init",
"-Wstrict-aliasing",
"-Wstrict-aliasing=0",
"-Wstrict-aliasing=1",
"-Wstrict-aliasing=2",
"-Wstrict-overflow",
"-Wstrict-overflow=0",
"-Wstrict-overflow=1",
"-Wstrict-overflow=2",
"-Wstrict-overflow=3",
"-Wstrict-overflow=4",
"-Wstrict-overflow=5",
"-Wstrict-prototypes",
"-Wstrict-selector-match",
"-Wstring-compare",
"-Wstring-conversion",
"-Wstring-plus-int",
"-Wstrlcpy-strlcat-size",
"-Wstrncat-size",
"-Wsuper-class-method-mismatch",
"-Wswitch",
"-Wswitch-default",
"-Wsynth",
"-Wtautological-compare",
"-Wtautological-constant-out-of-range-compare",
"-Wtentative-definition-incomplete-type",
"-Wthread-safety",
"-Wthread-safety-analysis",
"-Wthread-safety-attributes",
"-Wthread-safety-beta",
"-Wthread-safety-precise",
"-Wtrigraphs",
"-Wtype-limits",
"-Wtype-safety",
"-Wtypedef-redefinition",
"-Wtypename-missing",
"-Wundeclared-selector",
"-Wundef",
"-Wundefined-inline",
"-Wundefined-internal",
"-Wundefined-reinterpret-cast",
"-Wunicode",
"-Wunicode-whitespace",
"-Wuninitialized",
"-Wunnamed-type-template-args",
"-Wunneeded-internal-declaration",
"-Wunneeded-member-function",
"-Wunsequenced",
"-Wunsupported-visibility",
"-Wunused",
"-Wunused-argument",
"-Wunused-command-line-argument",
"-Wunused-comparison",
"-Wunused-exception-parameter",
"-Wunused-function",
"-Wunused-label",
"-Wunused-member-function",
"-Wunused-parameter",
"-Wunused-private-field",
"-Wunused-result",
"-Wunused-value",
"-Wunused-variable",
"-Wunused-volatile-lvalue",
"-Wuser-defined-literals",
"-Wvarargs",
"-Wvariadic-macros",
"-Wvector-conversion",
"-Wvector-conversions",
"-Wvexing-parse",
"-Wvisibility",
"-Wvla",
"-Wvla-extension",
"-Wvolatile-register-var",
// "-Wweak-vtables",
"-Wwrite-strings",
"-Wzero-length-array",
"-Qunused-arguments",
"-fcolor-diagnostics",
"-Wno-gnu-zero-variadic-macro-arguments",
"-fms-extensions" // Need for pragma message
)
if (Utilities.versionCompare(cpp.compilerVersion, "14") < 0) {
debugFlags.push("-Wweak-template-vtables")
}
if (Utilities.versionCompare(cpp.compilerVersion, "13") >= 0) {
debugFlags.push(
"-Wreserved-identifier",
"-Wunused-but-set-parameter",
"-Wunused-but-set-variable"
)
}
if (Utilities.versionCompare(cpp.compilerVersion, "15") >= 0) {
debugFlags.push(
"-Warray-parameter"
)
}
if (qbs.targetOS.contains("macos")) {
// Cannot suppress warnings from Qt headers
debugFlags.push(
"-Wno-sign-conversion",
"-Wno-duplicate-enum",
"-Wno-shorten-64-to-32",
"-Wno-deprecated"
)
}
if (qbs.buildVariant === "release") {
debugFlags.push("-Wno-unknown-warning-option")
}
if (qbs.targetOS.contains("windows")) {
// Don't use additional keys on Windows system.
// Can't find a way to ignore Qt header on there.
debugFlags.push(
"-Wall",
"-Wextra",
"-pedantic",
"-Wno-gnu-zero-variadic-macro-arguments",
"-fms-extensions # Need for pragma message"
)
}
} else if (!qbs.toolchain.contains("clang")) {
debugFlags.push(
"-Wall",
"-Wextra",
"-pedantic",
"-Weffc++",
"-Woverloaded-virtual",
"-Wctor-dtor-privacy",
"-Wnon-virtual-dtor",
"-Wold-style-cast",
"-Wconversion",
"-Winit-self",
// "-Wstack-protector",
"-Wunreachable-code",
"-Wcast-align",
"-Wcast-qual",
"-Wdisabled-optimization",
"-Wfloat-equal",
"-Wformat=2",
"-Wimport",
// "-Wmissing-include-dirs",
"-Wpacked",
"-Wredundant-decls",
// "-Winline",
"-Winvalid-pch",
// "-Wunsafe-loop-optimizations",
// "-Wlong-long", // We have been using C++11
"-Wmissing-format-attribute",
"-Wswitch-default",
"-Wuninitialized",
"-Wvariadic-macros",
"-Wlogical-op",
"-Wnoexcept",
"-Wmissing-noreturn",
"-Wpointer-arith",
"-Wstrict-null-sentinel",
"-Wstrict-overflow=5",
"-Wno-error=strict-overflow",
"-Wundef",
"-Wno-unused",
"-Wno-pragmas"
)
if (Utilities.versionCompare(cpp.compilerVersion, "5") >= 0) {
debugFlags.push(
"-Wswitch-bool",
"-Wlogical-not-parentheses",
"-Wsizeof-array-argument",
// "-Wsuggest-final-types",
// "-Wsuggest-final-methods",
"-Wbool-compare"
)
}
if (Utilities.versionCompare(cpp.compilerVersion, "6") >= 0) {
debugFlags.push(
"-Wshift-negative-value",
"-Wshift-overflow",
"-Wshift-overflow=2",
"-Wtautological-compare",
// "-Wnull-dereference",
"-Wduplicated-cond",
"-Wmisleading-indentation"
)
}
if (Utilities.versionCompare(cpp.compilerVersion, "7") >= 0) {
debugFlags.push(
"-Wduplicated-branches",
"-Wrestrict",
"-Walloc-zero",
"-Wnonnull",
"-Wno-stringop-overflow" // cannot suppress warning in Qt headers
)
}
if (Utilities.versionCompare(cpp.compilerVersion, "8") >= 0) {
debugFlags.push(
"-Wmultistatement-macros",
"-Warray-bounds"
)
}
if (Utilities.versionCompare(cpp.compilerVersion, "10") >= 0) {
debugFlags.push(
"-Wredundant-tags"
)
}
if (Utilities.versionCompare(cpp.compilerVersion, "11") >= 0) {
debugFlags.push(
"-Wctad-maybe-unsupported",
"-Wmismatched-tags" // bugged in gcc 10
)
}
if (qbs.targetOS.contains("windows")) {
// Don't use additional keys on Windows system.
// Can't find a way to ignore Qt header on there.
debugFlags.push(
"-Wall",
"-Wno-pragmas",
"-Wno-error=strict-overflow",
"-Wextra"
)
if (Qt.core.versionMajor === 5 && Qt.core.versionMinor === 6) {
debugFlags.push(
"-Wno-array-bounds" // annoying warning
)
}
}
}
}
else if (qbs.toolchain.contains("msvc")) {
debugFlags.push(
"-Wall",
"-wd4061", // enum value is not *explicitly* handled in switch
"-wd4099", // first seen using 'struct' now seen using 'class'
"-wd4127", // conditional expression is constant
"-wd4217", // member template isn't copy constructor
"-wd4250", // inherits (implements) some member via dominance
"-wd4251", // needs to have dll-interface to be used by clients
"-wd4275", // exported class derived from non-exported class
"-wd4347", // "behavior change", function called instead of template
"-wd4355", // "'this': used in member initializer list
"-wd4505", // unreferenced function has been removed
"-wd4510", // default constructor could not be generated
"-wd4511", // copy constructor could not be generated
"-wd4512", // assignment operator could not be generated
"-wd4513", // destructor could not be generated
"-wd4514", // 'function' : unreferenced inline function has been removed
"-wd4610", // can never be instantiated user defined constructor required
"-wd4623", // default constructor could not be generated
"-wd4624", // destructor could not be generated
"-wd4625", // copy constructor could not be generated
"-wd4626", // assignment operator could not be generated
"-wd4640", // a local static object is not thread-safe
"-wd4661", // a member of the template class is not defined.
"-wd4670", // a base class of an exception class is inaccessible for catch
"-wd4672", // a base class of an exception class is ambiguous for catch
"-wd4673", // a base class of an exception class is inaccessible for catch
"-wd4675", // resolved overload was found by argument-dependent lookup
"-wd4702", // unreachable code, e.g. in <list> header.
"-wd4710", // call was not inlined
"-wd4711", // call was inlined
"-wd4820", // some padding was added
"-wd4917", // a GUID can only be associated with a class, interface or namespace
"-wd4351", // elements of array 'array' will be default initialized
// The following are real warnings but are generated by almost all MS headers, including
// standard library headers, so it's impractical to leave them on.
"-wd4619", // there is no warning number 'XXXX'
"-wd4668", // XXX is not defined as a preprocessor macro
"-wd5045", // Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
// Because Microsoft doesn't provide a way to suppress warnings in headers we will suppress
// all warnings we meet in headers globally
"-wd4548",
"-wd4350",
"-wd4242",
"-wd4265",
"-wd4599",
"-wd4371",
"-wd4718",
"-wd4946",
"-wd4868", // compiler may not enforce left-to-right evaluation order in braced initializer list
"-wd4866", // compiler may not enforce left-to-right evaluation order for call to 'C++17 operator'
"-wd4571", // catch(...) semantics changed since Visual C++ 7.1; structured exceptions (SEH) are no longer caught
"-wd5026", // move constructor was implicitly defined as deleted
"-wd5027", // move assignment operator was implicitly defined as deleted
"-wd5039", // pointer or reference to potentially throwing function passed to extern C function under -EHc.
"-wd4774", // format string expected in argument 3 is not a string literal
"-wd5204", // class has virtual functions, but its trivial destructor is not virtual; instances of objects derived
// from this class may not be destructed correctly
"-wd5219", // implicit conversion from '<type>' to '<type>', possible loss of data
"-wd5243" // 'type-name': using incomplete class 'class-name' can cause potential one definition rule violation due
// to ABI limitation
)
}
return debugFlags;
}
cpp.cxxFlags: {
var flags = debugFlags;
if (qbs.toolchain.contains("gcc") && enableAddressSanitizer) {
flags.push("-fno-omit-frame-pointer");
}
return flags;
}
Properties {
condition: Utilities.versionCompare(qbs.version, "1.22") < 0
cpp.systemIncludePaths: {
var qtLibs = [
"QtCore",
"QtSvg",
"QtXml",
"QtPrintSupport",
"QtXmlPatterns",
"QtWidgets",
"QtGui",
"QtNetwork",
"QtTest",
"QtConcurrent"
];
var paths = [];
if (!qbs.targetOS.contains("macos"))
{
paths.push(Qt.core.incPath);
for (var i = 0; i < qtLibs.length; i++) {
paths.push(FileInfo.joinPaths(Qt.core.incPath, qtLibs[i]));
}
} else {
for (var i = 0; i < qtLibs.length; i++) {
paths.push(FileInfo.joinPaths(Qt.core.incPath, qtLibs[i] + ".framework/Versions/" + Qt.core.versionMajor +
"/Headers"));
paths.push(FileInfo.joinPaths(Qt.core.incPath, qtLibs[i] + ".framework/Headers"));
}
}
return paths;
}
}
Properties {
condition: qbs.toolchain.contains("gcc")
cpp.driverFlags: {
var flags = [];
if (enableAddressSanitizer)
flags.push("-fsanitize=address");
if (enableUbSanitizer)
flags.push("-fsanitize=undefined");
if (enableThreadSanitizer)
flags.push("-fsanitize=thread");
return flags;
}
}
vcs2.headerFileName: "vcsRepoState.h"
Group {
name: "Precompiled headers"
condition: buildconfig.enablePCH
prefix: product.sourceDirectory + "/"
files: {
var files = ["stable.h"];
if (qbs.toolchain.contains("msvc"))
files.push("stable.cpp")
return files;
}
fileTags: ["cpp_pch_src"]
}
}

View File

@ -0,0 +1,65 @@
import qbs.Process
import qbs.Utilities
// Don't forget to edit ccache config:
// ccache --set-config=sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime
Module {
readonly property bool ccachePresent: ccacheProbe.present
readonly property bool pchSupport: ccachePCHProbe.pchSupport
// change to shell tool which supports key "-c" to excecute command line
property string shellTool: "bash"
// ccache doesn't provide key to get only version number
readonly property string command: "ccache --version | head -n 1 | grep -oE '[0-9]((\.)[0-9]){0,2}'"
Probe {
id: ccacheProbe
property bool present
property string tool: shellTool
property string toolCommand: command
configure: {
var detector = new Process();
try {
if (detector.exec(tool, ["-c", toolCommand]) === 0) {
var version = detector.readStdOut().trim(); // we can read only one time
present = Utilities.versionCompare(version, "0.0.0") >= 0;
console.info("Found ccache version " + version + ".");
}
} finally {
detector.close();
}
}
}
Probe {
id: ccachePCHProbe
condition: ccachePresent === true
property string tool: shellTool
property string toolCommand: command
property bool pchSupport
configure: {
var detector = new Process();
try {
if (detector.exec(tool, ["-c", toolCommand]) === 0) {
var version = detector.readStdOut().trim(); // we can read only one time
pchSupport = Utilities.versionCompare(version, "3.1.0") >= 0;
if (!pchSupport && Utilities.versionCompare(version, "3.1.0") < 0){
console.info("ccache is tool old, version >= 3.1.0 required to work with precompiled headers.");
pchSupport = false;
}
if (pchSupport)
console.info("ccache supports compilation with precompiled headers.")
}
} finally {
detector.close();
}
}
}
}

61
qbs/modules/ebr/ebr.qbs Normal file
View File

@ -0,0 +1,61 @@
import "rcc.js" as Rcc
Module {
additionalProductTypes: "ebr.rcc"
property bool enableCompression: true
property int thresholdLevel: 70
property string compressAlgorithm: "zstd"
property int compressLevel: -1
Rule {
inputs: ["ebr.external_qrc"]
outputFileTags: ["ebr.rcc"]
outputArtifacts: {
var artifact = {
filePath: input.completeBaseName + ".rcc",
fileTags: ["ebr.rcc"]
};
return [artifact];
}
prepare: {
var args = ["-binary", input.filePath, "-o", output.filePath];
var enableCompression = input.moduleProperty("ebr", "enableCompression");
if (enableCompression) {
var compressAlgorithm = input.moduleProperty("ebr", "compressAlgorithm");
if (product.Qt.core.versionMajor >= 5 && product.Qt.core.versionMinor >= 13) {
// Since Qt 5.13 we have option to select compress algorithm
if (compressAlgorithm !== "zstd")
args.push("-compress-algo", compressAlgorithm);
} else {
if (compressAlgorithm !== "zlib")
compressAlgorithm = "zlib";
}
var thresholdLevel = input.moduleProperty("ebr", "thresholdLevel");
if (thresholdLevel !== 70)
args.push("-threshold", thresholdLevel);
var compressLevel = input.moduleProperty("ebr", "compressLevel");
if (compressLevel !== -1) {
// rcc will silently ignore incorrect values
if (compressAlgorithm === "zstd")
compressLevel = Rcc.bound(0, compressLevel, 19);
else if (compressAlgorithm === "zlib")
compressLevel = Rcc.bound(1, compressLevel, 9);
}
if (compressLevel !== -1)
args.push("-compress", compressLevel);
} else {
args.push("-no-compress");
}
var cmd = new Command(Rcc.fullPath(product), args);
cmd.description = "rcc (external) "+ input.fileName;
cmd.highlight = 'filegen';
return cmd;
}
}
}

13
qbs/modules/ebr/rcc.js Normal file
View File

@ -0,0 +1,13 @@
var Utilities = require("qbs.Utilities");
function fullPath(product)
{
if (Utilities.versionCompare(product.Qt.core.version, "6.1") < 0)
return product.Qt.core.binPath + '/' + product.Qt.core.rccName;
return product.Qt.core.libExecPath + '/' + product.Qt.core.rccName;
}
function bound(min, val, max)
{
return Math.max(min, Math.min(max, val));
}

View File

@ -0,0 +1,192 @@
/****************************************************************************
**
** Copyright (C) 2019 Alberto Mardegan <mardy@users.sourceforge.net>
** Contact: http://www.qt.io/licensing
**
** This file is part of Qbs.
**
** 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 http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
import qbs.ModUtils
import qbs.TextFile
import "freedesktop2.js" as Fdo
Module {
property string name: product.name
property var desktopKeys
readonly property var defaultDesktopKeys: {
return {
'Type': 'Application',
'Name': product.freedesktop2.name,
'Exec': product.targetName,
'Terminal': 'false',
'Version': '1.1',
}
}
property bool _fdoSupported: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("darwin")
additionalProductTypes: "freedesktop.desktopfile"
FileTagger {
patterns: [ "*.desktop" ]
fileTags: [ "freedesktop.desktopfile_source" ]
}
Rule {
alwaysRun: true
condition: _fdoSupported
inputs: [ "freedesktop.desktopfile_source" ]
outputFileTags: [ "freedesktop.desktopfile" ]
Artifact {
fileTags: [ "freedesktop.desktopfile" ]
filePath: input.fileName
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "Generating " + output.fileName + " from " + input.fileName;
cmd.highlight = "codegen";
cmd.sourceCode = function() {
var aggregateDesktopKeys = Fdo.parseDesktopFile(input.filePath);
var desktopKeys = ModUtils.moduleProperty(product, "desktopKeys") || {}
var mainSection = aggregateDesktopKeys['Desktop Entry'];
for (key in desktopKeys) {
if (desktopKeys.hasOwnProperty(key)) {
mainSection[key] = desktopKeys[key];
}
}
var defaultValues = product.freedesktop2.defaultDesktopKeys
for (key in defaultValues) {
if (!(key in mainSection)) {
mainSection[key] = defaultValues[key];
}
}
Fdo.dumpDesktopFile(output.filePath, aggregateDesktopKeys);
}
return [cmd];
}
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.desktopfile" ]
qbs.install: true
qbs.installDir: "share/applications"
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.appIcon" ]
qbs.install: true
qbs.installDir: "share/icons/hicolor/scalable/apps"
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.48x48AppsIcons" ]
qbs.install: true
qbs.installDir: "share/icons/hicolor/48x48/apps"
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.64x64AppsIcons" ]
qbs.install: true
qbs.installDir: "share/icons/hicolor/64x64/apps"
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.128x128AppsIcons" ]
qbs.install: true
qbs.installDir: "share/icons/hicolor/128x128/apps"
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.256x256AppsIcons" ]
qbs.install: true
qbs.installDir: "share/icons/hicolor/256x256/apps"
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.512x512AppsIcons" ]
qbs.install: true
qbs.installDir: "share/icons/hicolor/512x512/apps"
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.48x48MimetypesIcons" ]
qbs.install: true
qbs.installDir: "share/icons/hicolor/48x48/mimetypes"
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.64x64MimetypesIcons" ]
qbs.install: true
qbs.installDir: "share/icons/hicolor/64x64/mimetypes"
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.128x128MimetypesIcons" ]
qbs.install: true
qbs.installDir: "share/icons/hicolor/128x128/mimetypes"
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.256x256MimetypesIcons" ]
qbs.install: true
qbs.installDir: "share/icons/hicolor/256x256/mimetypes"
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.512x512MimetypesIcons" ]
qbs.install: true
qbs.installDir: "share/icons/hicolor/512x512/mimetypes"
}
FileTagger {
patterns: [ "*.metainfo.xml", "*.appdata.xml" ]
fileTags: [ "freedesktop.appstream" ]
}
Group {
condition: product.freedesktop2._fdoSupported
fileTagsFilter: [ "freedesktop.appstream" ]
qbs.install: true
qbs.installDir: "share/metainfo"
}
}

View File

@ -0,0 +1,69 @@
/****************************************************************************
**
** Copyright (C) 2019 Alberto Mardegan <mardy@users.sourceforge.net>
** Contact: http://www.qt.io/licensing
**
** This file is part of Qbs.
**
** 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 http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
var TextFile = require("qbs.TextFile");
function parseDesktopFile(filePath) {
var file = new TextFile(filePath);
var fileValues = {};
var currentSection = {};
var sectionRex = /^\[(.+)\]$/g
while (!file.atEof()) {
var line = file.readLine().trim();
if (line.length == 0) continue;
if (line[0] == '#') continue;
var match = sectionRex.exec(line);
if (match) {
var currentSectionName = match[1];
fileValues[currentSectionName] = {};
currentSection = fileValues[currentSectionName];
continue;
}
var parts = line.split('=', 2);
currentSection[parts[0]] = parts[1]
}
file.close();
return fileValues
}
function dumpDesktopFile(filePath, keys) {
var file = new TextFile(filePath, TextFile.WriteOnly);
for (var sectionName in keys) {
file.writeLine('[' + sectionName + ']');
var section = keys[sectionName];
for (var key in section) {
var line = key + '=' + section[key];
file.writeLine(line);
}
// Write an empty line between sections (and before EOF)
file.writeLine('');
}
file.close();
}

243
qbs/modules/i18n/i18n.qbs Normal file
View File

@ -0,0 +1,243 @@
import qbs.File
import qbs.FileInfo
import qbs.TextFile
import qbs.Process
/**
This module generates 'i18n.pro' artifact, which then acts as an input for 'lupdate' program, which in turn produces
translation files, which are compiled by 'lrelease' program into 'qm' files, which can be loaded by an application.
*/
Module {
Depends { name: "Qt.core" }
additionalProductTypes: ["i18n"]
/*
Unfortunately you can not simply add empty files to the product, cause 'Qt.core' module has a rule, which calls 'lrelease' on
every 'ts' file in the product and 'lrelease' triggers error if these files are empty. Additionaly 'lupdate' also triggers
errors, when parsing 'pro' file. Instead this property can be used to create new translation file.
*/
property stringList additionalTranslations: []
// Explicitly trigger build even if build a product
property bool update: false
// Build with legacy way though .pro file
property bool buildWithPro: true
property string lupdateName: "lupdate"
readonly property string qtTranslationsPath: qtTranslationsProbe.qtTranslationsPath
Rule {
condition: update && buildWithPro
multiplex: true
inputs: ["i18n.hpp", "i18n.src", "i18n.ui", "i18n.res", "i18n.ts"]
prepare: {
var proCmd = new JavaScriptCommand();
proCmd.description = 'generating ' + output.filePath;
proCmd.highlight = 'codegen';
proCmd.sourceCode = function() {
var f = new TextFile(output.filePath, TextFile.WriteOnly);
try {
f.writeLine("lupdate_only {");
if (inputs["i18n.hpp"] !== undefined)
for (var i = 0; i < inputs["i18n.hpp"].length; i++)
f.writeLine("HEADERS += " + FileInfo.relativePath(product.sourceDirectory, inputs["i18n.hpp"][i].filePath));
f.writeLine("");
if (inputs["i18n.src"] !== undefined)
for (var i = 0; i < inputs["i18n.src"].length; i++)
f.writeLine("SOURCES += " + FileInfo.relativePath(product.sourceDirectory, inputs["i18n.src"][i].filePath));
f.writeLine("");
if (inputs["i18n.ui"] !== undefined)
for (var i = 0; i < inputs["i18n.ui"].length; i++)
f.writeLine("FORMS += " + FileInfo.relativePath(product.sourceDirectory, inputs["i18n.ui"][i].filePath));
f.writeLine("");
// lupdate processes QML files that are listed in the .qrc file
if (inputs["i18n.res"] !== undefined)
for (var i = 0; i < inputs["i18n.res"].length; i++)
f.writeLine("RESOURCES += " + FileInfo.relativePath(product.sourceDirectory, inputs["i18n.res"][i].filePath));
f.writeLine("}");
f.writeLine("");
if (inputs["i18n.ts"] !== undefined)
for (var i = 0; i < inputs["i18n.ts"].length; i++)
f.writeLine("TRANSLATIONS += " + FileInfo.relativePath(product.sourceDirectory, inputs["i18n.ts"][i].filePath));
for (var i = 0; i < product.i18n.additionalTranslations.length; i++) {
var targetDirectory = product.sourceDirectory + "/" + FileInfo.path(product.i18n.additionalTranslations[i]);
if (!File.exists(targetDirectory))
console.error("Directory '" + targetDirectory + "' does not exists. Please create it.");
f.writeLine("TRANSLATIONS += " + product.i18n.additionalTranslations[i]);
}
} finally {
f.close();
}
}
return [proCmd];
}
Artifact {
filePath: product.sourceDirectory + "/" + product.name + ".i18n.pro"
fileTags: ["i18n.pro"]
}
}
Rule {
condition: buildWithPro
inputs: ["i18n.pro"]
prepare: {
var lupdateName = product.i18n.lupdateName;
var cmdLupdate = new Command(product.Qt.core.binPath + '/' + lupdateName, ["-verbose", input.filePath]);
cmdLupdate.description = "Invoking '" + lupdateName + "' program";
cmdLupdate.highlight = 'filegen';
var cmdClean = new JavaScriptCommand();
cmdClean.description = "Removing " + input.fileName;
cmdClean.highlight = "filegen";
cmdClean.sourceCode = function() {
File.remove(input.filePath);
}
return [cmdLupdate, cmdClean]
}
outputFileTags: ["i18n"]
}
Rule {
condition: update && !buildWithPro
multiplex: true
inputs: ["i18n.hpp", "i18n.src", "i18n.ui", "i18n.ts"]
prepare: {
var proCmd = new JavaScriptCommand();
proCmd.description = 'generating ' + output.filePath;
proCmd.highlight = 'codegen';
proCmd.sourceCode = function() {
var f = new TextFile(output.filePath, TextFile.WriteOnly);
try {
// Since Qt 5.13 lupdate supports passing a project description in JSON file. For producing such a
// description from .pro file we can use new tool lprodump. But tehnically we don't need it. We can
// totally fake format.
// JSON file structure:
// Project ::= {
// string projectFile // Name of the project file. (required)
// string codec // Source code codec. Valid values are
// // currently "utf-16" or "utf-8" (default).
// string[] translations // List of .ts files of the project. (required)
// string[] includePaths // List of include paths.
// string[] sources // List of source files. (required)
// string[] excluded // List of source files, which are
// // excluded for translation.
// Project[] subProjects // List of sub-projects.
// }
// It seems all we need are projectFile, sources and translations options.
var sources = [];
if (inputs["i18n.hpp"] !== undefined)
for (var i = 0; i < inputs["i18n.hpp"].length; i++)
sources.push(inputs["i18n.hpp"][i].filePath);
if (inputs["i18n.src"] !== undefined)
for (var i = 0; i < inputs["i18n.src"].length; i++)
sources.push(inputs["i18n.src"][i].filePath);
if (inputs["i18n.ui"] !== undefined)
for (var i = 0; i < inputs["i18n.ui"].length; i++)
sources.push(inputs["i18n.ui"][i].filePath);
// lupdate processes QML files that are listed in the .qrc file
if (inputs["i18n.res"] !== undefined)
for (var i = 0; i < inputs["i18n.res"].length; i++)
sources.push(inputs["i18n.res"][i].filePath);
var translations = [];
if (inputs["i18n.ts"] !== undefined)
for (var i = 0; i < inputs["i18n.ts"].length; i++)
translations.push(inputs["i18n.ts"][i].filePath);
for (var i = 0; i < product.i18n.additionalTranslations.length; i++) {
var targetDirectory = product.sourceDirectory + "/" + FileInfo.path(product.i18n.additionalTranslations[i]);
if (!File.exists(targetDirectory))
console.error("Directory '" + targetDirectory + "' does not exists. Please create it.");
translations.push(product.i18n.additionalTranslations[i]);
}
var project = {
projectFile: "", // Looks like can be empty
sources: sources.sort(),
translations: translations.sort()
};
f.write(JSON.stringify([project], null, 2));
} finally {
f.close();
}
}
return [proCmd];
}
Artifact {
filePath: product.sourceDirectory + "/" + product.name + ".i18n.json"
fileTags: ["i18n.json"]
}
}
Rule {
condition: !buildWithPro
inputs: ["i18n.json"]
prepare: {
var lupdateName = product.i18n.lupdateName;
var cmdLupdate = new Command(product.Qt.core.binPath + '/' + lupdateName, ["-verbose", "-project", input.filePath]);
cmdLupdate.description = "Invoking '" + lupdateName + "' program";
cmdLupdate.highlight = 'filegen';
var cmdClean = new JavaScriptCommand();
cmdClean.description = "Removing " + input.fileName;
cmdClean.highlight = "filegen";
cmdClean.sourceCode = function() {
File.remove(input.filePath);
}
return [cmdLupdate, cmdClean]
}
outputFileTags: ["i18n"]
}
Probe {
id: qtTranslationsProbe
readonly property string binPath: product.Qt.core.binPath
property string qtTranslationsPath
configure: {
var qmakeProcess = new Process();
try {
var suffix = FileInfo.executableSuffix();
var qmakePath = FileInfo.joinPaths(binPath, "qmake" + suffix);
qmakeProcess.exec(qmakePath, ["-query"]);
if (qmakeProcess.exitCode() !== 0) {
throw "The qmake executable '" + FileInfo.toNativeSeparators(qmakePath) + "' failed with exit code " +
qmakeProcess.exitCode() + ".";
}
while (!qmakeProcess.atEnd()) {
var line = qmakeProcess.readLine();
var index = (line || "").indexOf(":");
if (index !== -1) {
if (line.slice(0, index) === "QT_INSTALL_TRANSLATIONS") {
var path = line.slice(index + 1).trim();
if (path)
qtTranslationsPath = FileInfo.fromNativeSeparators(path);
break;
}
}
}
} finally {
qmakeProcess.close();
}
}
}
}

View File

@ -0,0 +1,68 @@
Module {
readonly property stringList translationLocales: [
"uk_UA",
"de_DE",
"cs_CZ",
"he_IL",
"fr_FR",
"it_IT",
"nl_NL",
"id_ID",
"es_ES",
"fi_FI",
"en_US",
"en_CA",
"en_IN",
"ro_RO",
"zh_CN",
"pt_BR",
"el_GR",
"pl_PL"
]
property bool limitDeploymentOfQtTranslations: true
readonly property stringList qtTranslationLocales: [
"uk",
"de",
"cs",
"he",
"fr",
"it",
// "nl", Not supported by Qt
// "id", Not supported by Qt
"es",
"fi",
"en",
// "ro", Not supported by Qt
"zh_CN",
"pt",
// "el", Not supported by Qt
"pl",
// "zh_TW", Not supported by Valentina
// "ar", Not supported by Valentina
// "bg", Not supported by Valentina
// "ca", Not supported by Valentina
// "da", Not supported by Valentina
// "fa", Not supported by Valentina
// "gd", Not supported by Valentina
// "gl", Not supported by Valentina
// "hu", Not supported by Valentina
// "ja", Not supported by Valentina
// "ko", Not supported by Valentina
// "lt", Not supported by Valentina
// "lv", Not supported by Valentina
// "ru", Not supported by Valentina
// "sk", Not supported by Valentina
// "sl", Not supported by Valentina
// "sv", Not supported by Valentina
// "tr", Not supported by Valentina
]
readonly property stringList pmSystems: [
"p0", "p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15",
"p16", "p17", "p18", "p19", "p20", "p21", "p22", "p23", "p24", "p25", "p26", "p27", "p28", "p29",
"p30", "p31", "p32", "p33", "p34", "p35", "p36", "p37", "p38", "p39", "p40", "p41", "p42", "p43",
"p44", "p45", "p46", "p47", "p48", "p49", "p50", "p51", "p52", "p53", "p54", "p998"
]
}

View File

@ -0,0 +1,106 @@
import qbs.File
import qbs.FileInfo
import qbs.Environment
import qbs.Utilities
import qbs.ModUtils
/**
This module uses _macdeployqt_ program to collect Qt runtime for MacOS deployment.
*/
Module {
additionalProductTypes: ["macdeployqt"]
property bool artifacts: true
property string macdeployqtArtifact: artifacts ? "maceployqt.txt" : undefined
property string macdeployqtProgram: "macdeployqt"
property bool noPlugins: false
property int verbose: undefined
property bool noStrip: true
property bool useDebugLibs: false
property bool alwaysOverwrite: false
property bool appstoreCompliant: false
property string libpath: undefined
property stringList targetApps: undefined
Rule {
// alwaysRun: true
multiplex: true
condition: product.qbs.targetOS.contains("macos") && product.bundle.isBundle && (product.buildconfig.enableMultiBundle || (!product.buildconfig.enableMultiBundle && product.primaryApp))
inputs: ["bundle.content"]
prepare: {
var macdeployqtProgram = product.macdeployqt.macdeployqtProgram;
// Checking if directory exists as a dirty workaround to check if `--no-install` options has been set from command line.
if (!File.exists(product.qbs.installRoot)) {
var cmd = new JavaScriptCommand();
cmd.macdeployqtProgram = macdeployqtProgram;
cmd.description = "can not invoke '" + macdeployqtProgram + "' when '--no-install` options has been set from command line";
cmd.sourceCode = function () {
console.warn("Can not invoke '" + macdeployqtProgram + "' when '--no-install` options has been set from command line (tip: remove your build directory entirely after unchecking '--no-install' option)");
}
} else {
const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath;
var cmdArgs = [installRoot + "/" + product.targetName + ".app"];
if (product.macdeployqt.noPlugins)
cmdArgs.push("--no-plugins");
if (product.macdeployqt.verbose !== undefined)
cmdArgs.push("--verbose", product.macdeployqt.verbose);
if (product.macdeployqt.noStrip)
cmdArgs.push("-no-strip");
if (product.macdeployqt.useDebugLibs)
cmdArgs.push("-use-debug-libs");
if (product.macdeployqt.alwaysOverwrite)
cmdArgs.push("-always-overwrite");
if (product.macdeployqt.appstoreCompliant)
cmdArgs.push("-appstore-compliant");
if (product.macdeployqt.libpath !== undefined)
cmdArgs.push("--libpath", product.macdeployqt.libpath);
if (product.macdeployqt.targetApps !== undefined && !product.buildconfig.enableMultiBundle && product.primaryApp)
{
product.macdeployqt.targetApps.forEach(function(targetApp) {
cmdArgs.push("-executable=\"" + installRoot + "/" + product.targetName + ".app/Contents/MacOS/" + targetApp + "\"");
});
}
var cmd = new Command(product.Qt.core.binPath + "/" + macdeployqtProgram, cmdArgs);
cmd.jobPool = "macdeployqt";
cmd.description = "invoking '" + macdeployqtProgram;
cmd.stdoutFilePath = product.buildDirectory + "/" + product.macdeployqt.macdeployqtArtifact;
}
cmd.workingDirectory = product.qbs.installRoot;
cmd.highlight = "filegen";
return [cmd]
}
Artifact {
filePath: product.buildDirectory + "/" + product.macdeployqt.macdeployqtArtifact
fileTags: ["macdeployqt"]
}
}
JobLimit {
jobPool: "macdeployqt"
jobCount: 1
}
}

Some files were not shown because too many files have changed in this diff Show More