Skip to content

Commit

Permalink
freedesktop fixes/changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Dec 7, 2023
1 parent 5214d75 commit bbb7609
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 19 deletions.
47 changes: 35 additions & 12 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if(${USE_ROBOTO})
endif()

option(USE_SKIA_SYSTEM_LIBS "Use skia (third-party) system libraries on Linux" OFF)
if(${USE_SKIA_SYSTEM_LIBS})
if(${USE_SKIA_SYSTEM_LIBS} AND UNIX)
pkg_check_modules(EXPAT REQUIRED expat)
pkg_check_modules(FREETYPE REQUIRED freetype2)
pkg_check_modules(JPEG REQUIRED libjpeg)
Expand Down Expand Up @@ -127,7 +127,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../skia
)

if(${USE_SKIA_SYSTEM_LIBS})
if(${USE_SKIA_SYSTEM_LIBS} AND UNIX)
include_directories(
${EXPAT_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS}
Expand All @@ -148,12 +148,17 @@ if(UNIX)
set(TCMALLOC "libtcmalloc.so.90")
configure_file(
app.desktop.in
${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop
${CMAKE_BINARY_DIR}/${PROJECT_FREEDESKTOP}.desktop
@ONLY
)
configure_file(
meta.xml.in
${CMAKE_BINARY_DIR}/${PROJECT_NAME}.xml
${CMAKE_BINARY_DIR}/meta.xml
@ONLY
)
configure_file(
appdata.xml.in
${CMAKE_BINARY_DIR}/appdata.xml
@ONLY
)
endif()
Expand Down Expand Up @@ -475,7 +480,7 @@ target_link_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../skia/out/build
)

if(${USE_SKIA_SYSTEM_LIBS})
if(${USE_SKIA_SYSTEM_LIBS} AND UNIX)
target_link_directories(
${PROJECT_NAME}
PRIVATE
Expand Down Expand Up @@ -509,7 +514,7 @@ target_link_libraries(
${SKIA_LIBRARIES}
)

if(${USE_SKIA_SYSTEM_LIBS})
if(${USE_SKIA_SYSTEM_LIBS} AND UNIX)
target_link_libraries(
${PROJECT_NAME}
PRIVATE
Expand Down Expand Up @@ -569,42 +574,60 @@ if(UNIX AND NOT APPLE)
)
endif()
install(FILES
${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop
${CMAKE_BINARY_DIR}/${PROJECT_FREEDESKTOP}.desktop
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/applications
)
install(
FILES
${CMAKE_BINARY_DIR}/${PROJECT_NAME}.xml
${CMAKE_BINARY_DIR}/appdata.xml
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/metainfo
RENAME
${PROJECT_FREEDESKTOP}.appdata.xml
)
install(
FILES
${CMAKE_BINARY_DIR}/meta.xml
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/mime/packages
RENAME
${PROJECT_FREEDESKTOP}.xml
)
set(HICOLOR_DIRS "16x16;22x22;32x32;48x48;64x64;96x96;128x128;192x192;256x256")
foreach(HICOLOR_DIR ${HICOLOR_DIRS})
install(
FILES
icons/hicolor/${HICOLOR_DIR}/apps/${PROJECT_NAME}.png
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${HICOLOR_DIR}/apps/
${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${HICOLOR_DIR}/apps
RENAME
${PROJECT_FREEDESKTOP}.png
)
install(
FILES
icons/hicolor/${HICOLOR_DIR}/mimetypes/application-x-${PROJECT_NAME}.png
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${HICOLOR_DIR}/mimetypes/
${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${HICOLOR_DIR}/mimetypes
RENAME
application-x-${PROJECT_FREEDESKTOP}.png
)
endforeach()
install(
FILES
icons/hicolor/scalable/apps/${PROJECT_NAME}.svg
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps/
${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps
RENAME
${PROJECT_FREEDESKTOP}.svg
)
install(
FILES
icons/hicolor/scalable/mimetypes/application-x-${PROJECT_NAME}.svg
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/mimetypes/
${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/mimetypes
RENAME
application-x-${PROJECT_FREEDESKTOP}.svg
)
install(
FILES
Expand Down
10 changes: 7 additions & 3 deletions src/app/app.desktop.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[Desktop Entry]
Version=1.0
Name=@FRICTION_DISPLAY_NAME@
Exec=@FRICTION_NAME@
Icon=@FRICTION_NAME@
Exec=@FRICTION_NAME@ %f
Icon=@PROJECT_FREEDESKTOP@
Comment=@PROJECT_DESCRIPTION@
GenericName=@PROJECT_DESCRIPTION@
StartupNotify=true
Terminal=false
Type=Application
Categories=Graphics;
MimeType=application/x-@FRICTION_NAME@;
MimeType=application/x-@PROJECT_FREEDESKTOP@;
StartupWMClass=@FRICTION_NAME@
42 changes: 42 additions & 0 deletions src/app/appdata.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright Friction contributors -->
<component type="desktop">
<id>@PROJECT_FREEDESKTOP@</id>
<launchable type="desktop-id">@[email protected]</launchable>
<name>Friction</name>
<developer_name>Friction</developer_name>
<summary>Motion graphics software</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<description>
<p>Friction is a powerful and versatile free and open-source motion graphics application that allows you to create stunning vector and raster animations for web and video platforms with ease.</p>
</description>
<releases>
<release date="2023-11-20" version="0.9.5-rc1"/>
<release date="2023-09-04" version="0.9.4"/>
<release date="2023-08-05" version="0.9.3"/>
<release date="2023-07-23" version="0.9.2"/>
<release date="2023-07-04" version="0.9.1"/>
</releases>
<screenshots>
<screenshot type="default">
<image>https://friction.graphics/assets/screenshots/friction-094-screenshot.jpg</image>
<caption>Friction user interface</caption>
</screenshot>
</screenshots>
<url type="homepage">https://friction.graphics</url>
<url type="bugtracker">https://github.com/friction2d/friction/issues</url>
<url type="help">https://friction.graphics/documentation/</url>
<update_contact>[email protected]</update_contact>
<content_rating type="oars-1.1"/>
<keywords>
<keyword>2d</keyword>
<keyword>graphics</keyword>
<keyword>motiongraphics</keyword>
<keyword>animation</keyword>
<keyword>video</keyword>
<keyword>svg</keyword>
<keyword>vector</keyword>
<keyword>raster</keyword>
</keywords>
</component>
2 changes: 1 addition & 1 deletion src/app/meta.xml.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/x-@FRICTION_NAME@">
<mime-type type="application/x-@PROJECT_FREEDESKTOP@">
<comment>@FRICTION_DISPLAY_NAME@</comment>
<glob pattern="*.friction"/>
</mime-type>
Expand Down
1 change: 1 addition & 0 deletions src/cmake/friction-meta.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ set(PROJECT_IDENTIFIER "graphics.friction")
set(PROJECT_DESCRIPTION "Motion Graphics")
set(PROJECT_LICENSE "GPLv3+")
set(PROJECT_HOMEPAGE_URL "https://friction.graphics")
set(PROJECT_FREEDESKTOP "${PROJECT_IDENTIFIER}.${FRICTION_DISPLAY_NAME}")
7 changes: 4 additions & 3 deletions src/scripts/vfxplatform.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AutoReq: no
%global __provides_exclude_from /opt

%description
Friction is an open-source, vector-based application designed for creating web animations and videos.
Friction is a powerful and versatile free and open-source motion graphics application that allows you to create stunning vector and raster animations for web and video platforms with ease.

%prep
%setup -n friction-__FRICTION_VERSION__
Expand All @@ -28,8 +28,9 @@ rm -rf %{buildroot}/opt/friction/share/doc
%defattr(-,root,root,-)
/opt/friction
/usr/bin/friction
/usr/share/applications/friction.desktop
/usr/share/mime/packages/friction.xml
/usr/share/applications/__APPID__.desktop
/usr/share/metainfo/__APPID__.appdata.xml
/usr/share/mime/packages/__APPID__.xml
/usr/share/icons/hicolor

%changelog
Expand Down

0 comments on commit bbb7609

Please sign in to comment.