and here we go

CMake should run make-appdata.sh
This commit is contained in:
tildearrow 2023-09-13 19:54:31 -05:00
parent 1d7efcb44b
commit c520c291f0
5 changed files with 39 additions and 13 deletions

1
.gitignore vendored
View file

@ -32,3 +32,4 @@ res/binary_to_compressed_c.exe
res/docpdf/manual.html
res/docpdf/manual.pdf
res/docpdf/.venv
res/furnace.appdata.xml

View file

@ -25,6 +25,15 @@ set(SYSTEM_SDL2_DEFAULT OFF)
include(CheckIncludeFile)
include(TestBigEndian)
execute_process(COMMAND git status RESULT_VARIABLE DONT_HAVE_GIT WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
if (NOT DONT_HAVE_GIT)
message(STATUS "Git is available")
else()
message(WARNING "either Git is not available, or this Git repository has not been initialized.
if you have used the \"Source code\" option in the GitHub release page, you are doing it wrong! unless you manually initialize submodules, the build is guaranteed to FAIL spectacularly!
read the \"developer info\" section of README.md for more information.")
endif()
if (ANDROID)
set(USE_RTMIDI_DEFAULT OFF)
set(WITH_PORTAUDIO_DEFAULT OFF)
@ -922,6 +931,15 @@ if (WARNINGS_ARE_ERRORS)
)
endif()
if (NOT ANDROID OR TERMUX)
if (NOT WIN32 AND NOT APPLE)
if (NOT DONT_HAVE_GIT)
add_custom_command(OUTPUT furnace.appdata.xml COMMAND res/make-appdata.sh ARGS ${CMAKE_SOURCE_DIR}/res/furnace.appdata.xml.in ${CMAKE_BINARY_DIR}/furnace.appdata.xml DEPENDS res/furnace.appdata.xml.in WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
list(APPEND USED_SOURCES furnace.appdata.xml)
endif()
endif()
endif()
if(ANDROID AND NOT TERMUX)
add_library(furnace SHARED ${USED_SOURCES})
elseif(WIN32)
@ -952,7 +970,9 @@ if (NOT ANDROID OR TERMUX)
include(GNUInstallDirs)
install(TARGETS furnace RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES res/furnace.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(FILES res/furnace.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
if (NOT DONT_HAVE_GIT)
install(FILES ${CMAKE_BINARY_DIR}/furnace.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
endif()
install(DIRECTORY doc DESTINATION ${CMAKE_INSTALL_DOCDIR})
install(DIRECTORY papers DESTINATION ${CMAKE_INSTALL_DOCDIR}/other)
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DATADIR}/licenses/furnace)

View file

@ -11,7 +11,7 @@
<description>
<p>
the biggest chiptune tracker ever made!
Furnace - the biggest chiptune tracker ever made!
</p>
<p>
it allows you to create songs using a music tracker interface for several computer/game console/arcade sound chips.

View file

@ -1,10 +1,15 @@
#!/bin/bash
echo "generating furnace.appdata.xml..."
if [ $# -lt 2 ]; then
echo "usage: $0 input output"
exit 1
fi
cat furnace.appdata.xml.in > furnace.appdata.xml
#echo "generating $2..."
echo " <releases>" >> furnace.appdata.xml
cat "$1" > "$2"
echo " <releases>" >> "$2"
for i in `git log --tags='v*' --no-walk --format="%as/%(describe:tags)"`; do
releaseDate=${i%/*}
@ -13,13 +18,13 @@ for i in `git log --tags='v*' --no-walk --format="%as/%(describe:tags)"`; do
if [[ $releaseVer =~ "pre" ]]; then
releaseType=development
fi
echo " <release version=\"${releaseVer/pre/~pre}\" date=\"$releaseDate\" type=\"$releaseType\">" >> furnace.appdata.xml
echo " <url>https://github.com/tildearrow/furnace/releases/tag/$releaseVer</url>" >> furnace.appdata.xml
echo " </release>" >> furnace.appdata.xml
echo " <release version=\"${releaseVer/pre/~pre}\" date=\"$releaseDate\" type=\"$releaseType\">" >> "$2"
echo " <url>https://github.com/tildearrow/furnace/releases/tag/$releaseVer</url>" >> "$2"
echo " </release>" >> "$2"
done
echo " </releases>" >> furnace.appdata.xml
echo " </releases>" >> "$2"
echo "</component>" >> furnace.appdata.xml
echo "</component>" >> "$2"
echo "done."
#echo "done."

View file

@ -30,8 +30,8 @@ cp -v ../../../res/logo.png furnace.png || exit 1
ln -s furnace.png .DirIcon || exit 1
cp -v ../../../res/furnace.desktop . || exit 1
#mkdir -p usr/share/metainfo || exit 1
cp -v ../../../res/furnace.appdata.xml usr/share/metainfo/org.tildearrow.furnace.metainfo.xml || exit 1
rm usr/share/metainfo/furnace.appdata.xml || exit 1
#cp -v ../../../res/furnace.appdata.xml usr/share/metainfo/org.tildearrow.furnace.metainfo.xml || exit 1
#rm usr/share/metainfo/furnace.appdata.xml || exit 1
cp -v ../../../res/AppRun . || exit 1
#cp /usr/lib/libm.so.6 usr/lib/ || exit 1