Browse Source
Update and modernize linux metadata files
Update and modernize linux metadata files
* Switch to using org.kicad.kicad as the main app ID * Move the appstream file to a metainfo file * Rename all metadata files to use the reverse DNS scheme * Add header matching to mime type files where possible * Add a mime type for gerber job files * Add a QA test that verifies all the linux metadata files and run it in CI * Update the visible names in the launcher entries to be more consistent with the internal visible names * Update various strings and items in the metainfo file so they are more descriptive and easier to read6.0.7
35 changed files with 752 additions and 156 deletions
-
1.gitlab-ci.yml
-
43.gitlab/linux-metadata-validate.yml
-
12CMakeModules/BuildSteps/WritePlatformMetadata_linux.cmake
-
10qa/resources/linux/mimeFiles/gerbers/drillFiles/drillFile.drl
-
10qa/resources/linux/mimeFiles/gerbers/drillFiles/drillFileNoExt
-
5qa/resources/linux/mimeFiles/gerbers/gerberFiles/gerber.gbr
-
8qa/resources/linux/mimeFiles/gerbers/gerberFiles/gerber.gts
-
5qa/resources/linux/mimeFiles/gerbers/gerberFiles/gerberCommentNoExt
-
5qa/resources/linux/mimeFiles/gerbers/gerberFiles/gerberFSLANoExt
-
7qa/resources/linux/mimeFiles/gerbers/gerberFiles/gerberG75NoExt
-
5qa/resources/linux/mimeFiles/gerbers/gerberFiles/gerberMONoExt
-
15qa/resources/linux/mimeFiles/gerbers/gerberFiles/gerberTFNoExt
-
19qa/resources/linux/mimeFiles/kicad/boardFiles/brd.brd
-
19qa/resources/linux/mimeFiles/kicad/boardFiles/brdNoExt
-
10qa/resources/linux/mimeFiles/kicad/boardFiles/kicadpcb.kicad_pcb
-
10qa/resources/linux/mimeFiles/kicad/boardFiles/kicadpcbNoExt
-
22qa/resources/linux/mimeFiles/kicad/projectFiles/kicadpro.kicad_pro
-
7qa/resources/linux/mimeFiles/kicad/projectFiles/pro.pro
-
10qa/resources/linux/mimeFiles/kicad/schematicFiles/kicadsch.kicad_sch
-
10qa/resources/linux/mimeFiles/kicad/schematicFiles/kicadschNoExt
-
14qa/resources/linux/mimeFiles/kicad/schematicFiles/sch.sch
-
14qa/resources/linux/mimeFiles/kicad/schematicFiles/schNoExt
-
303qa/resources/linux/verifyMetadataFiles.sh
-
56resources/CMakeLists.txt
-
80resources/linux/appdata/kicad.appdata.xml.in
-
3resources/linux/launchers/org.kicad.bitmap2component.desktop.in
-
7resources/linux/launchers/org.kicad.eeschema.desktop.in
-
5resources/linux/launchers/org.kicad.gerbview.desktop.in
-
2resources/linux/launchers/org.kicad.kicad.desktop.in
-
2resources/linux/launchers/org.kicad.pcbcalculator.desktop.in
-
7resources/linux/launchers/org.kicad.pcbnew.desktop.in
-
91resources/linux/metainfo/org.kicad.kicad.metainfo.xml.in
-
43resources/linux/mime/kicad-gerbers.xml.in
-
46resources/linux/mime/kicad-kicad.xml.in
-
2translation/POTDIRS
@ -0,0 +1,43 @@ |
|||
########################################################################## |
|||
# Run a validation of the metadata files for Linux |
|||
########################################################################## |
|||
validate_linux_metadata: |
|||
stage: test |
|||
needs: [] |
|||
interruptible: false |
|||
# This is the only CI image with the utilities needed for this test |
|||
image: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:33 |
|||
only: |
|||
refs: |
|||
- master |
|||
- branches |
|||
- merge_requests |
|||
- pushes |
|||
changes: |
|||
# Only run if the resources, its tests, or the translations are updated |
|||
- resources/linux/**/* |
|||
- qa/resources/linux/**/* |
|||
- translation/**/* |
|||
except: |
|||
- schedules |
|||
# Only build the metadata files in this CI job |
|||
script: |
|||
- mkdir -p build/linux |
|||
- cd build/linux |
|||
- cmake |
|||
-DCMAKE_BUILD_TYPE=Debug |
|||
-DKICAD_STDLIB_LIGHT_DEBUG=ON |
|||
-DKICAD_SCRIPTING=ON |
|||
-DKICAD_SCRIPTING_MODULES=ON |
|||
-DKICAD_SCRIPTING_PYTHON3=ON |
|||
-DKICAD_SCRIPTING_WXPYTHON=ON |
|||
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON |
|||
-DKICAD_SCRIPTING_ACTION_MENU=ON |
|||
-DKICAD_USE_OCE=OFF |
|||
-DKICAD_USE_OCC=ON |
|||
-DKICAD_SPICE=ON |
|||
-DKICAD_BUILD_I18N=ON |
|||
../../ |
|||
- make metadata |
|||
- cd ../../ |
|||
- ./qa/resources/linux/verifyMetadataFiles.sh ./ ./build/linux |
@ -0,0 +1,10 @@ |
|||
M48 |
|||
;DRILL file {Pcbnew (2013-june-11)-stable} date Sun 22 Dec 2013 07:48:59 PM CST |
|||
;FORMAT={-:-/ absolute / inch / decimal} |
|||
FMAT,2 |
|||
INCH,TZ |
|||
T1C0.025 |
|||
T2C0.032 |
|||
T3C0.032 |
|||
T4C0.120 |
|||
T5C0.126 |
@ -0,0 +1,10 @@ |
|||
M48 |
|||
;DRILL file {Pcbnew (2013-june-11)-stable} date Sun 22 Dec 2013 07:48:59 PM CST |
|||
;FORMAT={-:-/ absolute / inch / decimal} |
|||
FMAT,2 |
|||
INCH,TZ |
|||
T1C0.025 |
|||
T2C0.032 |
|||
T3C0.032 |
|||
T4C0.120 |
|||
T5C0.126 |
@ -0,0 +1,5 @@ |
|||
G04 (created by PCBNEW (2013-june-11)-stable) date Sun 22 Dec 2013 07:48:57 PM CST* |
|||
%MOIN*% |
|||
G04 Gerber Fmt 3.4, Leading zero omitted, Abs format* |
|||
%FSLAX34Y34*% |
|||
G01* |
@ -0,0 +1,8 @@ |
|||
G04 (created by PCBNEW (2013-june-11)-stable) date Sun 22 Dec 2013 07:48:57 PM CST* |
|||
%MOIN*% |
|||
G04 Gerber Fmt 3.4, Leading zero omitted, Abs format* |
|||
%FSLAX34Y34*% |
|||
G01* |
|||
G70* |
|||
G90* |
|||
G04 APERTURE LIST* |
@ -0,0 +1,5 @@ |
|||
G04 (created by PCBNEW (2013-june-11)-stable) date Sun 22 Dec 2013 07:48:57 PM CST* |
|||
%MOIN*% |
|||
G04 Gerber Fmt 3.4, Leading zero omitted, Abs format* |
|||
%FSLAX34Y34*% |
|||
G01* |
@ -0,0 +1,5 @@ |
|||
%FSLAX34Y34*% |
|||
G04 (created by PCBNEW (2013-june-11)-stable) date Sun 22 Dec 2013 07:48:57 PM CST* |
|||
%MOIN*% |
|||
G04 Gerber Fmt 3.4, Leading zero omitted, Abs format* |
|||
G01* |
@ -0,0 +1,7 @@ |
|||
G75* |
|||
G70* |
|||
%OFA0B0*% |
|||
%FSLAX24Y24*% |
|||
%IPPOS*% |
|||
%LPD*% |
|||
%AMOC8* |
@ -0,0 +1,5 @@ |
|||
%MOIN*% |
|||
%FSLAX34Y34*% |
|||
G04 (created by PCBNEW (2013-june-11)-stable) date Sun 22 Dec 2013 07:48:57 PM CST* |
|||
G04 Gerber Fmt 3.4, Leading zero omitted, Abs format* |
|||
G01* |
@ -0,0 +1,15 @@ |
|||
%TF.GenerationSoftware,KiCad,Pcbnew,(5.99.0-9879-gcc9787e47a)*% |
|||
%TF.CreationDate,2021-03-20T01:50:30+00:00*% |
|||
%TF.ProjectId,pic_programmer,7069635f-7072-46f6-9772-616d6d65722e,rev?*% |
|||
%TF.SameCoordinates,Original*% |
|||
%TF.FileFunction,Copper,L2,Bot*% |
|||
%TF.FilePolarity,Positive*% |
|||
%FSLAX46Y46*% |
|||
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* |
|||
G04 Created by KiCad (PCBNEW (5.99.0-9879-gcc9787e47a)) date 2021-03-20 01:50:30* |
|||
%MOMM*% |
|||
%LPD*% |
|||
G01* |
|||
G04 APERTURE LIST* |
|||
G04 Aperture macros list* |
|||
%AMRoundRect* |
@ -0,0 +1,19 @@ |
|||
PCBNEW-BOARD Version 2 date Sun 22 Dec 2013 07:55:02 PM CST |
|||
|
|||
# Created by Pcbnew(2013-june-11)-stable |
|||
|
|||
$GENERAL |
|||
encoding utf-8 |
|||
Units mm |
|||
LayerCount 2 |
|||
EnabledLayers 1FFF8001 |
|||
Links 102 |
|||
NoConn 0 |
|||
Di 68.381879 43.454319 158.927801 139.715241 |
|||
Ndraw 169 |
|||
Ntrack 481 |
|||
Nzone 0 |
|||
BoardThickness 1.6002 |
|||
Nmodule 45 |
|||
Nnets 46 |
|||
$EndGENERAL |
@ -0,0 +1,19 @@ |
|||
PCBNEW-BOARD Version 2 date Sun 22 Dec 2013 07:55:02 PM CST |
|||
|
|||
# Created by Pcbnew(2013-june-11)-stable |
|||
|
|||
$GENERAL |
|||
encoding utf-8 |
|||
Units mm |
|||
LayerCount 2 |
|||
EnabledLayers 1FFF8001 |
|||
Links 102 |
|||
NoConn 0 |
|||
Di 68.381879 43.454319 158.927801 139.715241 |
|||
Ndraw 169 |
|||
Ntrack 481 |
|||
Nzone 0 |
|||
BoardThickness 1.6002 |
|||
Nmodule 45 |
|||
Nnets 46 |
|||
$EndGENERAL |
@ -0,0 +1,10 @@ |
|||
(kicad_pcb (version 20210228) (generator pcbnew) |
|||
|
|||
(general |
|||
(thickness 1.6) |
|||
) |
|||
|
|||
(paper "A4") |
|||
(title_block |
|||
(title "SERIAL PIC PROGRAMMER") |
|||
) |
@ -0,0 +1,10 @@ |
|||
(kicad_pcb (version 20210228) (generator pcbnew) |
|||
|
|||
(general |
|||
(thickness 1.6) |
|||
) |
|||
|
|||
(paper "A4") |
|||
(title_block |
|||
(title "SERIAL PIC PROGRAMMER") |
|||
) |
@ -0,0 +1,22 @@ |
|||
{ |
|||
"board": { |
|||
"design_settings": { |
|||
"defaults": { |
|||
"board_outline_line_width": 0.381, |
|||
"copper_line_width": 0.381, |
|||
"copper_text_italic": false, |
|||
"copper_text_size_h": 1.524, |
|||
"copper_text_size_v": 2.032, |
|||
"copper_text_thickness": 0.30479999999999996, |
|||
"copper_text_upright": true, |
|||
"courtyard_line_width": 0.049999999999999996, |
|||
"dimension_precision": 1, |
|||
"dimension_units": 0, |
|||
"dimensions": { |
|||
"arrow_length": 1270000, |
|||
"extension_offset": 500000, |
|||
"keep_text_aligned": true, |
|||
"suppress_zeroes": false, |
|||
"text_position": 0, |
|||
"units_format": 1 |
|||
}, |
@ -0,0 +1,7 @@ |
|||
update=21/11/2017 21:19:54 |
|||
version=1 |
|||
last_client=kicad |
|||
[cvpcb] |
|||
version=1 |
|||
NetIExt=net |
|||
[cvpcb/libraries] |
@ -0,0 +1,10 @@ |
|||
(kicad_sch (version 20210126) (generator eeschema) |
|||
|
|||
(paper "A4") |
|||
|
|||
(title_block |
|||
(title "JDM - COM84 PIC Programmer with 13V DC/DC converter") |
|||
(date "Sun 22 Mar 2015") |
|||
(rev "3") |
|||
(company "KiCad") |
|||
) |
@ -0,0 +1,10 @@ |
|||
(kicad_sch (version 20210126) (generator eeschema) |
|||
|
|||
(paper "A4") |
|||
|
|||
(title_block |
|||
(title "JDM - COM84 PIC Programmer with 13V DC/DC converter") |
|||
(date "Sun 22 Mar 2015") |
|||
(rev "3") |
|||
(company "KiCad") |
|||
) |
@ -0,0 +1,14 @@ |
|||
EESchema Schematic File Version 2 |
|||
LIBS:power |
|||
LIBS:device |
|||
LIBS:transistors |
|||
LIBS:conn |
|||
LIBS:linear |
|||
LIBS:regul |
|||
LIBS:74xx |
|||
LIBS:cmos4000 |
|||
LIBS:adc-dac |
|||
LIBS:memory |
|||
LIBS:xilinx |
|||
LIBS:special |
|||
LIBS:microcontrollers |
@ -0,0 +1,14 @@ |
|||
EESchema Schematic File Version 2 |
|||
LIBS:power |
|||
LIBS:device |
|||
LIBS:transistors |
|||
LIBS:conn |
|||
LIBS:linear |
|||
LIBS:regul |
|||
LIBS:74xx |
|||
LIBS:cmos4000 |
|||
LIBS:adc-dac |
|||
LIBS:memory |
|||
LIBS:xilinx |
|||
LIBS:special |
|||
LIBS:microcontrollers |
@ -0,0 +1,303 @@ |
|||
#!/bin/bash |
|||
# WARNING: This script will modify file assocations and MIME types on the system it |
|||
# runs on. Use at your own risk! |
|||
|
|||
# The root of the code directory is the first argument |
|||
KICAD_CODE_DIR=$1 |
|||
|
|||
# The root of the build directory is the second argument |
|||
KICAD_BUILD_DIR=$2 |
|||
|
|||
KICAD_LAUNCHER_DIR=$KICAD_BUILD_DIR/resources/linux/launchers |
|||
KICAD_METAINFO_DIR=$KICAD_BUILD_DIR/resources/linux/metainfo |
|||
KICAD_MIME_DIR=$KICAD_BUILD_DIR/resources/linux/mime |
|||
KICAD_ICON_DIR=$KICAD_CODE_DIR/resources/linux/icons/hicolor |
|||
|
|||
KICAD_MIME_TEST_FILES=$KICAD_CODE_DIR/qa/resources/linux/mimeFiles |
|||
|
|||
################################################################### |
|||
# Verify the metainfo file |
|||
# There are two different checkers we can use, and each distro perfers |
|||
# different ones - so lets just test using them both and make them both |
|||
# happy. |
|||
################################################################### |
|||
METAINFO_VALID=1 |
|||
echo "Validating metainfo files" |
|||
|
|||
# Test using appstreamcli to see its errors |
|||
appstreamcli validate --explain --pedantic $KICAD_METAINFO_DIR/org.kicad.kicad.metainfo.xml |
|||
[ $? -ne 0 ] && METAINFO_VALID=0 |
|||
|
|||
# Test using the appstream-util package to see its errors |
|||
appstream-util validate-strict $KICAD_METAINFO_DIR/org.kicad.kicad.metainfo.xml |
|||
[ $? -ne 0 ] && METAINFO_VALID=0 |
|||
|
|||
if [ $METAINFO_VALID -eq 1 ] |
|||
then |
|||
echo "Metainfo files passed both checkers successfully" |
|||
fi |
|||
|
|||
|
|||
################################################################### |
|||
# Verify the launcher files |
|||
################################################################### |
|||
LAUNCHERS_VALID=1 |
|||
|
|||
echo "" |
|||
echo "Validating desktop launcher files" |
|||
|
|||
# Bitmap2component |
|||
desktop-file-validate $KICAD_LAUNCHER_DIR/org.kicad.bitmap2component.desktop |
|||
[ $? -ne 0 ] && LAUNCHERS_VALID=0 |
|||
|
|||
# Eeschema standalone |
|||
desktop-file-validate $KICAD_LAUNCHER_DIR/org.kicad.eeschema.desktop |
|||
[ $? -ne 0 ] && LAUNCHERS_VALID=0 |
|||
|
|||
# GerbView |
|||
desktop-file-validate $KICAD_LAUNCHER_DIR/org.kicad.gerbview.desktop |
|||
[ $? -ne 0 ] && LAUNCHERS_VALID=0 |
|||
|
|||
# Main KiCad application |
|||
desktop-file-validate $KICAD_LAUNCHER_DIR/org.kicad.kicad.desktop |
|||
[ $? -ne 0 ] && LAUNCHERS_VALID=0 |
|||
|
|||
# PCB calculator |
|||
desktop-file-validate $KICAD_LAUNCHER_DIR/org.kicad.pcbcalculator.desktop |
|||
[ $? -ne 0 ] && LAUNCHERS_VALID=0 |
|||
|
|||
# Pcbnew standalond |
|||
desktop-file-validate $KICAD_LAUNCHER_DIR/org.kicad.pcbnew.desktop |
|||
[ $? -ne 0 ] && LAUNCHERS_VALID=0 |
|||
|
|||
if [ $LAUNCHERS_VALID -eq 1 ] |
|||
then |
|||
echo "All launcher files valid" |
|||
else |
|||
echo "Errors with launcher files" |
|||
fi |
|||
|
|||
|
|||
################################################################### |
|||
# Install the desktop and MIME-type files and update the databases |
|||
################################################################### |
|||
|
|||
GERBER_MIME_INSTALLED=0 |
|||
KICAD_MIME_INSTALLED=0 |
|||
|
|||
echo "" |
|||
echo "Installing MIME type files for testing" |
|||
|
|||
mkdir -p ~/.local/share/mime |
|||
|
|||
xdg-mime install --mode user $KICAD_MIME_DIR/kicad-gerbers.xml |
|||
[ $? -eq 0 ] && GERBER_MIME_INSTALLED=1 |
|||
|
|||
xdg-icon-resource install --mode user --context mimetypes --size 128 $KICAD_ICON_DIR/128x128/mimetypes/application-x-kicad-pcb.png |
|||
xdg-icon-resource install --mode user --context mimetypes --size 128 $KICAD_ICON_DIR/128x128/mimetypes/application-x-kicad-project.png |
|||
xdg-icon-resource install --mode user --context mimetypes --size 128 $KICAD_ICON_DIR/128x128/mimetypes/application-x-kicad-schematic.png |
|||
|
|||
xdg-mime install --mode user $KICAD_MIME_DIR/kicad-kicad.xml |
|||
[ $? -eq 0 ] && KICAD_MIME_INSTALLED=1 |
|||
|
|||
# Install the desktop files |
|||
echo "" |
|||
echo "Installing desktop files for testing" |
|||
|
|||
# Ensure the directory exists (it might not in the CI image) |
|||
mkdir -p ~/.local/share/applications |
|||
|
|||
# For some reason, desktop-file-install doesn't seem to actually install it properly, so just copy them |
|||
cp $KICAD_LAUNCHER_DIR/org.kicad.bitmap2component.desktop ~/.local/share/applications/ |
|||
cp $KICAD_LAUNCHER_DIR/org.kicad.eeschema.desktop ~/.local/share/applications/ |
|||
cp $KICAD_LAUNCHER_DIR/org.kicad.gerbview.desktop ~/.local/share/applications/ |
|||
cp $KICAD_LAUNCHER_DIR/org.kicad.kicad.desktop ~/.local/share/applications/ |
|||
cp $KICAD_LAUNCHER_DIR/org.kicad.pcbcalculator.desktop ~/.local/share/applications/ |
|||
cp $KICAD_LAUNCHER_DIR/org.kicad.pcbnew.desktop ~/.local/share/applications/ |
|||
|
|||
# Force a database update to get the desktop files and MIME types associated |
|||
update-desktop-database ~/.local/share/applications/ |
|||
update-mime-database ~/.local/share/mime/ |
|||
|
|||
|
|||
################################################################### |
|||
# Validate the MIME types |
|||
################################################################### |
|||
KICAD_MIME_VALID=1 |
|||
GERBER_MIME_VALID=1 |
|||
|
|||
# Fake a Gnome desktop environment to force xdg-mime to query using gio and ensure the MIME types are installed |
|||
# for a desktop environment. Otherwise it fallsback to using the "file --mime-type" command, which has prebuilt |
|||
# magic files from https://github.com/file/file/blob/master/magic/Magdir/kicad and isn't affected by the MIME |
|||
# type files we just installed. |
|||
export DE=gnome |
|||
|
|||
# Test install the gerber MIME file to test with it |
|||
echo "" |
|||
|
|||
if [ $GERBER_MIME_INSTALLED -eq 1 ] |
|||
then |
|||
echo "Validating Gerber MIME-type" |
|||
|
|||
# Test the drl extension default |
|||
OUT_STR=$(xdg-mime query default application/x-excellon 2>&1) |
|||
printf " Testing drill file default application: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "org.kicad.gerbview.desktop" ]] && echo " ERROR" && GERBER_MIME_VALID=0 |
|||
|
|||
# Test the gerber extension default |
|||
OUT_STR=$(xdg-mime query default application/x-gerber 2>&1) |
|||
printf " Testing gerber file default application: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "org.kicad.gerbview.desktop" ]] && echo " ERROR" && GERBER_MIME_VALID=0 |
|||
|
|||
# Test the drl extension |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/gerbers/drillFiles/drillFile.drl 2>&1) |
|||
printf " Testing drill file with extension drl: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-excellon" ]] && echo " ERROR" && GERBER_MIME_VALID=0 |
|||
|
|||
# Test the parsing of the header for M48 |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/gerbers/drillFiles/drillFileNoExt 2>&1) |
|||
printf " Testing drill file header M48 check: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-excellon" ]] && echo " ERROR" && GERBER_MIME_VALID=0 |
|||
|
|||
# Test the official gbr extension |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/gerbers/gerberFiles/gerber.gbr 2>&1) |
|||
printf " Testing gerber file with gbr extension: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-gerber" ]] && echo " ERROR" && GERBER_MIME_VALID=0 |
|||
|
|||
# Test the parsing of the header for a comment (G04) |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/gerbers/gerberFiles/gerberCommentNoExt 2>&1) |
|||
printf " Testing gerber file header G04 check: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-gerber" ]] && echo " ERROR" && GERBER_MIME_VALID=0 |
|||
|
|||
# Test the parsing of the header for %FSLA |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/gerbers/gerberFiles/gerberFSLANoExt 2>&1) |
|||
printf " Testing gerber file header %%FLSA check: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-gerber" ]] && echo " ERROR" && GERBER_MIME_VALID=0 |
|||
|
|||
# Test the parsing of the header for %MO |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/gerbers/gerberFiles/gerberMONoExt 2>&1) |
|||
printf " Testing gerber file header %%MO check: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-gerber" ]] && echo " ERROR" && GERBER_MIME_VALID=0 |
|||
|
|||
# Test the parsing of the header for %TF. |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/gerbers/gerberFiles/gerberTFNoExt 2>&1) |
|||
printf " Testing gerber file header %%TF. check: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-gerber" ]] && echo " ERROR" && GERBER_MIME_VALID=0 |
|||
|
|||
# Test the parsing of the header for G75*. |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/gerbers/gerberFiles/gerberG75NoExt 2>&1) |
|||
printf " Testing gerber file header G75* check: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-gerber" ]] && echo " ERROR" && GERBER_MIME_VALID=0 |
|||
|
|||
# Test parsing another popular gerber extension (will require a lookup) |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/gerbers/gerberFiles/gerber.gts 2>&1) |
|||
printf " Testing gerber file with gts extension (not glob'd): %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-gerber" ]] && echo " ERROR" && GERBER_MIME_VALID=0 |
|||
|
|||
if [ $GERBER_MIME_VALID -eq 1 ] |
|||
then |
|||
echo "All Gerber MIME-type files valid" |
|||
else |
|||
echo "Errors with Gerber MIME-type files" |
|||
fi |
|||
else |
|||
echo "Gerber MIME type files not installed, skipping validation" |
|||
GERBER_MIME_VALID=0 |
|||
fi |
|||
|
|||
|
|||
# Test install the KiCad MIME file to test with it |
|||
echo "" |
|||
|
|||
if [ $KICAD_MIME_INSTALLED -eq 1 ] |
|||
then |
|||
echo "Validating KiCad MIME-type" |
|||
|
|||
# Test the KiCad project file extension default |
|||
OUT_STR=$(xdg-mime query default application/x-kicad-project 2>&1) |
|||
printf " Testing KiCad project file default application: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "org.kicad.kicad.desktop" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
# Test the KiCad schematic file extension default |
|||
OUT_STR=$(xdg-mime query default application/x-kicad-schematic 2>&1) |
|||
printf " Testing KiCad schematic file default application: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "org.kicad.eeschema.desktop" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
# Test the KiCad project file extension default |
|||
OUT_STR=$(xdg-mime query default application/x-kicad-pcb 2>&1) |
|||
printf " Testing KiCad board file default application: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "org.kicad.pcbnew.desktop" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
# Test the old pcbnew board file extension (brd) - (will cause lookup since not glob'd) |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/kicad/boardFiles/brd.brd 2>&1) |
|||
printf " Testing old Pcbnew board file with extension brd: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-kicad-pcb" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
# Test the old pcbnew board file with header check |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/kicad/boardFiles/brdNoExt 2>&1) |
|||
printf " Testing old Pcbnew board file header: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-kicad-pcb" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
# Test the new pcbnew board file extension (kicad_pcb) |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/kicad/boardFiles/kicadpcb.kicad_pcb 2>&1) |
|||
printf " Testing new Pcbnew board file with extension kicad_pcb: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-kicad-pcb" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
# Test the new pcbnew board file with header check |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/kicad/boardFiles/kicadpcbNoExt 2>&1) |
|||
printf " Testing new Pcbnew board file header: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-kicad-pcb" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
|
|||
# Test the old eeschema schematic file extension (sch) |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/kicad/schematicFiles/sch.sch 2>&1) |
|||
printf " Testing old Eeschema schematic file with extension sch: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-kicad-schematic" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
# Test the brd extension |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/kicad/schematicFiles/schNoExt 2>&1) |
|||
printf " Testing old Eeschema schematic file header: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-kicad-schematic" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
# Test the new Eeschema schematic file extension (kicad_sch) |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/kicad/schematicFiles/kicadsch.kicad_sch 2>&1) |
|||
printf " Testing new Eeschema schematic file with extension kicad_sch: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-kicad-schematic" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
# Test the new Eeschema board file with header check |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/kicad/schematicFiles/kicadschNoExt 2>&1) |
|||
printf " Testing new Eeschema schematic file header: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-kicad-schematic" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
|
|||
# Test the old project file extension (pro) |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/kicad/projectFiles/pro.pro 2>&1) |
|||
printf " Testing old KiCad project file with extension pro: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-kicad-project" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
# Test the new project file extension (kicad_pro) |
|||
OUT_STR=$(xdg-mime query filetype $KICAD_MIME_TEST_FILES/kicad/projectFiles/kicadpro.kicad_pro 2>&1) |
|||
printf " Testing new KiCad project file with extension kicad_pro: %s\n" "$OUT_STR" |
|||
[[ "$OUT_STR" != "application/x-kicad-project" ]] && echo " ERROR" && KICAD_MIME_VALID=0 |
|||
|
|||
if [ $KICAD_MIME_VALID -eq 1 ] |
|||
then |
|||
echo "All KiCad MIME-type files valid" |
|||
else |
|||
echo "Errors with KiCad MIME-type files" |
|||
fi |
|||
else |
|||
echo "KiCad MIME type files not installed, skipping validation" |
|||
KICAD_MIME_VALID=0 |
|||
fi |
|||
|
|||
|
|||
################################################################### |
|||
# Process return codes to flag errors for CI |
|||
################################################################### |
|||
[ $METAINFO_VALID -ne 0 ] && exit 1 |
|||
[ $LAUNCHERS_VALID -ne 0 ] && exit 1 |
|||
[ $KICAD_MIME_VALID -ne 0 ] && exit 1 |
|||
[ $GERBER_MIME_VALID -ne 0 ] && exit 1 |
|||
|
|||
exit 0 |
@ -1,80 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- Copyright (C) 2016-2017 Lubomir Rintel <lkundrak@v3.sk> --> |
|||
<!-- Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors. --> |
|||
<component type="desktop"> |
|||
<id>org.kicad_pcb.kicad</id> |
|||
<name>KiCad</name> |
|||
|
|||
<launchable type="desktop-id">kicad.desktop</launchable> |
|||
|
|||
<project_license>GPL-3.0-or-later</project_license> |
|||
<metadata_license>CC-BY-SA-4.0</metadata_license> |
|||
|
|||
<summary>EDA Suite</summary> |
|||
|
|||
<provides> |
|||
<binary>kicad</binary> |
|||
<binary>eeschema</binary> |
|||
<binary>pcbnew</binary> |
|||
<binary>gerbview</binary> |
|||
<binary>pl_editor</binary> |
|||
<binary>bitmap2component</binary> |
|||
<binary>pcb_calculator</binary> |
|||
</provides> |
|||
|
|||
<translation type="gettext">kicad</translation> |
|||
|
|||
<keywords> |
|||
<keyword>KiCad</keyword> |
|||
<keyword>EDA</keyword> |
|||
<keyword>PCB</keyword> |
|||
<keyword>Schema</keyword> |
|||
<keyword>PcbNew</keyword> |
|||
<keyword>Eeschema</keyword> |
|||
</keywords> |
|||
|
|||
<description> |
|||
<p> |
|||
KiCad is a Cross Platform and Open Source Electronics Design Automation Suite. |
|||
The programs handle Schematic Capture, and PCB Layout with Gerber output. |
|||
</p> |
|||
</description> |
|||
|
|||
<screenshots> |
|||
<screenshot type="default"> |
|||
<image width="1280" height="791">https://kicad.org/img/screenshots/appstream/kicad_6.png</image> |
|||
</screenshot> |
|||
|
|||
<screenshot> |
|||
<caption>Eeschema Schematic Editor</caption> |
|||
<image width="1280" height="791">https://kicad.org/img/screenshots/appstream/eeschema_6.png</image> |
|||
</screenshot> |
|||
|
|||
<screenshot> |
|||
<caption>PcbNew PCB Layout</caption> |
|||
<image width="1280" height="791">https://kicad.org/img/screenshots/appstream/pcbnew_6.png</image> |
|||
</screenshot> |
|||
|
|||
<screenshot> |
|||
<caption>PcbNew 3D Viewer</caption> |
|||
<image width="1280" height="791">https://kicad.org/img/screenshots/appstream/3dviewer_6.png</image> |
|||
</screenshot> |
|||
</screenshots> |
|||
|
|||
<url type="homepage">https://kicad.org/</url> |
|||
<url type="bugtracker">https://kicad.org/help/report-a-bug/</url> |
|||
<url type="help">https://docs.kicad.org/</url> |
|||
<url type="donation">https://go.kicad.org/donate</url> |
|||
<url type="translate">https://hosted.weblate.org/projects/kicad/</url> |
|||
|
|||
<update_contact>kicad-developers@lists.launchpad.net</update_contact> |
|||
<developer_name>The KiCad Developers</developer_name> |
|||
|
|||
<!-- This is actually a valid tag, but the utilities don't think so --> |
|||
<content_rating type="oars-1.1" /> |
|||
|
|||
<releases> |
|||
<release version="@KICAD_VERSION_FULL@" date="@KICAD_CONFIG_TIMESTAMP@" /> |
|||
</releases> |
|||
|
|||
</component> |
@ -0,0 +1,91 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- Copyright (C) 2016-2017 Lubomir Rintel <lkundrak@v3.sk> --> |
|||
<!-- Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors. --> |
|||
<component type="desktop"> |
|||
<id>org.kicad.kicad</id> |
|||
<name>KiCad</name> |
|||
|
|||
<launchable type="desktop-id">org.kicad.kicad.desktop</launchable> |
|||
|
|||
<project_license>GPL-3.0-or-later</project_license> |
|||
<metadata_license>CC-BY-SA-4.0</metadata_license> |
|||
|
|||
<summary>An EDA suite for schematic and circuit board design</summary> |
|||
|
|||
<provides> |
|||
<binary>kicad</binary> |
|||
<binary>eeschema</binary> |
|||
<binary>pcbnew</binary> |
|||
<binary>gerbview</binary> |
|||
<binary>pl_editor</binary> |
|||
<binary>bitmap2component</binary> |
|||
<binary>pcb_calculator</binary> |
|||
<mediatype>application/x-gerber</mediatype> |
|||
<mediatype>application/x-excellon</mediatype> |
|||
<mediatype>application/x-kicad-project</mediatype> |
|||
<mediatype>application/x-kicad-schematic</mediatype> |
|||
<mediatype>application/x-kicad-pcb</mediatype> |
|||
</provides> |
|||
|
|||
<translation type="gettext">kicad</translation> |
|||
|
|||
<keywords> |
|||
<keyword>KiCad</keyword> |
|||
<keyword>EDA</keyword> |
|||
<keyword>PCB</keyword> |
|||
<keyword>Schema</keyword> |
|||
<keyword>PcbNew</keyword> |
|||
<keyword>Eeschema</keyword> |
|||
<keyword>Gerber</keyword> |
|||
</keywords> |
|||
|
|||
<categories> |
|||
<category>Electronics</category> |
|||
<category>Engineering</category> |
|||
<category>Science</category> |
|||
<category>Electricity</category> |
|||
</categories> |
|||
|
|||
<description> |
|||
<p> |
|||
KiCad is a free and open-source electronics design automation (EDA) suite. It features schematic capture, integrated circuit simulation, printed circuit board (PCB) layout, 3D rendering, and plotting/data export to numerous formats. KiCad also includes a high-quality component library featuring thousands of symbols, footprints, and 3D models. KiCad has minimal system requirements and runs on Linux, Windows, and macOS. |
|||
</p> |
|||
</description> |
|||
|
|||
<screenshots> |
|||
<screenshot type="default"> |
|||
<image width="1280" height="791">https://kicad.org/img/screenshots/appstream/kicad_6.png</image> |
|||
</screenshot> |
|||
|
|||
<screenshot> |
|||
<caption>KiCad Schematic Editor</caption> |
|||
<image width="1280" height="791">https://kicad.org/img/screenshots/appstream/eeschema_6.png</image> |
|||
</screenshot> |
|||
|
|||
<screenshot> |
|||
<caption>KiCad PCB Layout Editor</caption> |
|||
<image width="1280" height="791">https://kicad.org/img/screenshots/appstream/pcbnew_6.png</image> |
|||
</screenshot> |
|||
|
|||
<screenshot> |
|||
<caption>KiCad 3D Viewer</caption> |
|||
<image width="1280" height="791">https://kicad.org/img/screenshots/appstream/3dviewer_6.png</image> |
|||
</screenshot> |
|||
</screenshots> |
|||
|
|||
<url type="homepage">https://kicad.org/</url> |
|||
<url type="bugtracker">https://kicad.org/help/report-an-issue/</url> |
|||
<url type="help">https://docs.kicad.org/</url> |
|||
<url type="donation">https://go.kicad.org/donate</url> |
|||
<url type="translate">https://hosted.weblate.org/projects/kicad/</url> |
|||
|
|||
<update_contact>kicad-developers@lists.launchpad.net</update_contact> |
|||
<developer_name>The KiCad Developers</developer_name> |
|||
|
|||
<!-- This is actually a valid tag, but the utilities don't think so --> |
|||
<content_rating type="oars-1.1" /> |
|||
|
|||
<releases> |
|||
<release version="@KICAD_VERSION_FULL@" date="@KICAD_CONFIG_TIMESTAMP@" /> |
|||
</releases> |
|||
</component> |
@ -1,16 +1,33 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> |
|||
<mime-type type="application/x-gerber"> |
|||
<sub-class-of type="text/plain"/> |
|||
<comment>Gerber File</comment> |
|||
<glob pattern="*.gbr"/> |
|||
</mime-type> |
|||
<mime-type type="application/x-excellon"> |
|||
<sub-class-of type="text/plain"/> |
|||
<comment>Excellon drill file</comment> |
|||
<glob pattern="*.drl"/> |
|||
<magic priority="50"> |
|||
<match value="M48" type="string" offset="0"/> |
|||
</magic> |
|||
</mime-type> |
|||
<mime-type type="application/x-gerber"> |
|||
<sub-class-of type="text/plain"/> |
|||
<comment>Gerber file</comment> |
|||
<glob pattern="*.gbr"/> |
|||
<!--Try to match with some common opening commands--> |
|||
<magic priority="50"> |
|||
<!--A comment line--> |
|||
<match type="string" offset="0" value="G04"/> |
|||
<!--Some setup macros--> |
|||
<match type="string" offset="0" value="%FSLA"/> |
|||
<match type="string" offset="0" value="%MO"/> |
|||
<match type="string" offset="0" value="%TF."/> |
|||
<!--Seems to be common with files exported from some programs--> |
|||
<match type="string" offset="0" value="G75*"/> |
|||
</magic> |
|||
</mime-type> |
|||
<mime-type type="application/x-gerber-job"> |
|||
<sub-class-of type="text/plain"/> |
|||
<comment>Gerber job file</comment> |
|||
<glob pattern="*.gbrjob"/> |
|||
</mime-type> |
|||
<mime-type type="application/x-excellon"> |
|||
<sub-class-of type="text/plain"/> |
|||
<comment>Excellon drill file</comment> |
|||
<glob pattern="*.drl"/> |
|||
<magic priority="50"> |
|||
<!--This is always the header for an excellon drill file--> |
|||
<match type="string" offset="0" value="M48"/> |
|||
</magic> |
|||
</mime-type> |
|||
</mime-info> |
@ -1,20 +1,32 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> |
|||
<mime-type type="application/x-kicad-project"> |
|||
<sub-class-of type="text/plain"/> |
|||
<comment>KiCad Project</comment> |
|||
<glob pattern="*.pro"/> |
|||
<glob pattern="*.kicad_pro"/> |
|||
</mime-type> |
|||
<mime-type type="application/x-kicad-schematic"> |
|||
<sub-class-of type="text/plain"/> |
|||
<comment>KiCad Schematic</comment> |
|||
<glob pattern="*.sch"/> |
|||
<glob pattern="*.kicad_sch"/> |
|||
</mime-type> |
|||
<mime-type type="application/x-kicad-pcb"> |
|||
<sub-class-of type="text/plain"/> |
|||
<comment>KiCad Printed Circuit Board</comment> |
|||
<glob pattern="*.kicad_pcb"/> |
|||
</mime-type> |
|||
<mime-type type="application/x-kicad-project"> |
|||
<sub-class-of type="text/plain"/> |
|||
<comment>KiCad Project</comment> |
|||
<glob pattern="*.pro"/> |
|||
<glob pattern="*.kicad_pro"/> |
|||
</mime-type> |
|||
<mime-type type="application/x-kicad-schematic"> |
|||
<sub-class-of type="text/plain"/> |
|||
<comment>KiCad Schematic</comment> |
|||
<glob pattern="*.sch"/> |
|||
<glob pattern="*.kicad_sch"/> |
|||
<magic priority="100"> |
|||
<!--The new schematic file (.kicad_sch) header--> |
|||
<match type="string" offset="0" value="(kicad_sch"/> |
|||
<!--The old schematic file (.sch) header--> |
|||
<match type="string" offset="0" value="EESchema Schematic File"/> |
|||
</magic> |
|||
</mime-type> |
|||
<mime-type type="application/x-kicad-pcb"> |
|||
<sub-class-of type="text/plain"/> |
|||
<comment>KiCad Printed Circuit Board</comment> |
|||
<glob pattern="*.kicad_pcb"/> |
|||
<magic priority="100"> |
|||
<!--The new board file (.kicad_pcb) header--> |
|||
<match type="string" offset="0" value="(kicad_pcb"/> |
|||
<!--The old board file (.brd) header--> |
|||
<match type="string" offset="0" value="PCBNEW-BOARD"/> |
|||
</magic> |
|||
</mime-type> |
|||
</mime-info> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue