Update Linux appdata file and CMake version strings

CHANGED: Update the Linux appdata file to include new tags

* Include version tags (and others) in the appdata file
* Refactor the version string generation to clean it up

Cherry-pick of:
3370e89967
e54c954aed
This commit is contained in:
Ian McInerney 2019-12-18 17:24:07 +00:00
parent 577bb7bf31
commit 6a027662ae
8 changed files with 141 additions and 35 deletions

View File

@ -894,6 +894,14 @@ add_custom_target( uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" )
#################################################
# Generate platform metadata files
#################################################
if( UNIX AND NOT APPLE )
include( ${CMAKE_MODULE_PATH}/WritePlatformMetadata_linux.cmake )
endif()
#================================================
# Installation
#================================================
@ -919,7 +927,7 @@ if( UNIX AND NOT APPLE )
set( UNIX_MIME_FILES ${UNIX_MIME_DIR}/mime )
set( UNIX_ICON_FILES ${UNIX_MIME_DIR}/icons )
set( UNIX_APPLICATIONS_FILES ${UNIX_MIME_DIR}/applications )
set( UNIX_APPDATA_FILES resources/linux/appdata )
set( UNIX_APPDATA_FILES ${PROJECT_BINARY_DIR}/resources/linux/appdata )
# Install Mime directory
install( DIRECTORY ${UNIX_ICON_FILES}
@ -943,6 +951,9 @@ if( UNIX AND NOT APPLE )
install( DIRECTORY ${UNIX_APPDATA_FILES}
DESTINATION share
COMPONENT resources
FILES_MATCHING
PATTERN "*appdata.xml"
PATTERN "*.in" EXCLUDE
)
endif()

View File

@ -27,6 +27,8 @@ macro( create_git_version_header _git_src_path )
find_package( Git )
if( GIT_FOUND )
message( STATUS "Using Git to determine build version string." )
set( _Git_SAVED_LC_ALL "$ENV{LC_ALL}" )
set( ENV{LC_ALL} C )

View File

@ -0,0 +1,40 @@
#
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2019 Ian McInerney <Ian.S.McInerney@ieee.org>
# Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# This file will create the full KiCad version string. The base of this string
# will be either the git tag followed by the commit hash (if built inside a git
# repository), or the version from KiCadVersion.cmake. The user-provided
# KICAD_VERSION_EXTRA is then appended to the base version string.
# Use git to determine the version string if it's available.
include( ${CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake )
create_git_version_header( ${SRC_PATH} )
# $KICAD_VERSION is set in KiCadVersion.cmake or by git (if it is available).
set( KICAD_VERSION_FULL "${KICAD_VERSION}" )
# Optional user version information defined at configuration.
if( KICAD_VERSION_EXTRA )
set( KICAD_VERSION_FULL "${KICAD_VERSION_FULL}-${KICAD_VERSION_EXTRA}" )
endif()

View File

@ -0,0 +1,46 @@
#
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2019 Ian McInerney <Ian.S.McInerney@ieee.org>
# Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# This file will configure the linux appdata.xml file to include the version
# and build date.
message( STATUS "Creating linux metadata" )
# Create the KiCad version strings
set( SRC_PATH ${PROJECT_SOURCE_DIR} )
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
include( ${CMAKE_MODULE_PATH}/KiCadFullVersion.cmake )
# Create the date of the configure
string( TIMESTAMP KICAD_CONFIG_TIMESTAMP "%Y-%m-%d" )
# Configure the KiCad appdata file
configure_file( ${PROJECT_SOURCE_DIR}/resources/linux/appdata/kicad.appdata.xml.in
${PROJECT_BINARY_DIR}/resources/linux/appdata/kicad.appdata.xml
@ONLY )
# Ensure the file was configured successfully
if( NOT EXISTS ${PROJECT_BINARY_DIR}/resources/linux/appdata/kicad.appdata.xml )
message( FATAL_ERROR "Configuration failed to write file kicad.appdata.xml." )
endif()

View File

@ -22,25 +22,9 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# Automagically create version header file if the version string was
# not defined during the build configuration. If CreateGitVersionHeader
# cannot determine the current repo version, a version.h file is still
# created with KICAD_VERSION set in KiCadVersion.cmake.
# Create the KiCad version strings
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
# Always use git if it's available to determine the version string.
message( STATUS "Using Git to determine build version string." )
include( ${CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake )
create_git_version_header( ${SRC_PATH} )
# $KICAD_VERSION will always be set to something. Even if it is the default
# value set in KiCadVersion.cmake
set( KICAD_VERSION_FULL "${KICAD_VERSION}" )
# Optional user version information defined at configuration.
if( KICAD_VERSION_EXTRA )
set( KICAD_VERSION_FULL "${KICAD_VERSION_FULL}-${KICAD_VERSION_EXTRA}" )
endif()
include( ${CMAKE_MODULE_PATH}/KiCadFullVersion.cmake )
set( _wvh_new_version_text
"/* Do not modify this file, it was automatically generated by CMake. */

View File

@ -222,7 +222,7 @@ and can cause Pcbnew to crash if Python scripts create an invalid object state w
The KiCad version string is defined by the output of `git describe --dirty` when git is available
or the version string defined in CMakeModules/KiCadVersion.cmake with the value of
KICAD_VERSION_EXTRA appended to the former. If the KICAD_VERSION_EXTRA variable is not define,
KICAD_VERSION_EXTRA appended to the former. If the KICAD_VERSION_EXTRA variable is not defined,
it is not appended to the version string. If the KICAD_VERSION_EXTRA variable is defined it
is appended along with a leading '-' to the full version string as follows:

View File

@ -153,10 +153,10 @@ install( TARGETS lib_kicad
endif()
# KiCad build version string defaults to "no-vcs-found" which forces the build version header
# command to look for git to create the version string header when the .git path is found in
# the source path.
set( KICAD_BRANCH_NAME "" CACHE STRING "KiCad repository name." )
# The build version string defaults to the value in the KiCadVersion.cmake file.
# If being built inside a git repository, the git tag and commit hash are used to create
# a new version string instead. The user can supply an additional string to be appended
# to the end inside the KICAD_VERSION_EXTRA variable
set( KICAD_VERSION_EXTRA "" CACHE STRING
"User defined configuration string to append to KiCad version." )
@ -164,8 +164,6 @@ set( KICAD_VERSION_EXTRA "" CACHE STRING
add_custom_target(
version_header ALL
COMMAND ${CMAKE_COMMAND}
-DKICAD_VERSION=${KICAD_VERSION}
-DKICAD_BRANCH_NAME=${KICAD_BRANCH_NAME}
-DKICAD_VERSION_EXTRA=${KICAD_VERSION_EXTRA}
-DOUTPUT_FILE=${CMAKE_BINARY_DIR}/kicad_build_version.h
-DSRC_PATH=${PROJECT_SOURCE_DIR}

View File

@ -1,16 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2016-2017 Lubomir Rintel <lkundrak@v3.sk> -->
<!-- Copyright (C) 2016-2017 KiCad Developers, see AUTHORS.txt for contributors. -->
<!-- Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors. -->
<component type="desktop">
<id>kicad.desktop</id>
<id>org.kicad_pcb.kicad</id>
<name>KiCad</name>
<project_license>AGPL-3.0+</project_license>
<project_license>AGPL-3.0-or-later</project_license>
<metadata_license>CC-BY-SA-4.0</metadata_license>
<summary>EDA Suite</summary>
<summary xml:lang="de">EDA Lösung</summary>
<summary xml:lang="it">Suite EDA</summary>
<summary xml:lang="sv">EDA Programpaket</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>
@ -46,27 +60,38 @@
<screenshots>
<screenshot type="default">
<image width="1024" height="576">http://kicad-pcb.org/img/screenshots/appstream/kicad.png</image>
<image width="1024" height="576">https://kicad-pcb.org/img/screenshots/appstream/kicad.png</image>
</screenshot>
<screenshot>
<caption>Eeschema Schematic Editor</caption>
<image width="1024" height="576">http://kicad-pcb.org/img/screenshots/appstream/eeschema.png</image>
<image width="1024" height="576">https://kicad-pcb.org/img/screenshots/appstream/eeschema.png</image>
</screenshot>
<screenshot>
<caption>PcbNew PCB Layout</caption>
<image width="1024" height="576">http://kicad-pcb.org/img/screenshots/appstream/pcbnew.png</image>
<image width="1024" height="576">https://kicad-pcb.org/img/screenshots/appstream/pcbnew.png</image>
</screenshot>
<screenshot>
<caption>PcbNew 3D Viewer</caption>
<image width="1024" height="576">http://kicad-pcb.org/img/screenshots/appstream/3dviewer.png</image>
<image width="1024" height="576">https://kicad-pcb.org/img/screenshots/appstream/3dviewer.png</image>
</screenshot>
</screenshots>
<url type="homepage">http://kicad-pcb.org/</url>
<url type="bugtracker">http://kicad-pcb.org/help/report-a-bug/</url>
<url type="homepage">https://kicad-pcb.org/</url>
<url type="bugtracker">https://kicad-pcb.org/help/report-a-bug/</url>
<url type="help">https://docs.kicad-pcb.org/</url>
<url type="donation">https://kicad-pcb.org/</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>