Browse Source

Install file associations and icons using autotools (issue #605)

Condensed version of pull request #24, containing the following commits:
- 31f803f Install .desktop and mime-info files with autotools.
- a354096 unix: Install icon using autotools as well.
- 4b1beb2 Fix Icon= in love.desktop.
- d0d3fe4 unix: Install game file icon as well.
- 9a6e291 unix: Update/fix README file name in Makefile.am.

All of the above commits were made by Michał Górny, and this single
code import was committed by Bart van Strien (so blame me if I broke
it..)
Michał Górny 12 years ago
parent
commit
53408e3768

+ 21 - 1
platform/unix/Makefile.am

@@ -1,3 +1,23 @@
 ACLOCAL_AMFLAGS = -I platform/unix/m4
 SUBDIRS = src
-EXTRA_DIST = changes.txt license.txt readme.txt
+EXTRA_DIST = changes.txt license.txt readme.md \
+	platform/unix/love.desktop.in
+
+applicationsdir=$(datarootdir)/applications
+mimeinfodir=$(datarootdir)/mime/packages
+pixmapsdir=$(datarootdir)/pixmaps
+mimeiconsdir=$(datarootdir)/icons/hicolor/scalable/mimetypes
+
+applications_DATA = platform/unix/love.desktop
+dist_mimeinfo_DATA = platform/unix/love.xml
+dist_pixmaps_DATA = platform/unix/love.svg
+dist_mimeicons_DATA = platform/unix/application-x-love-game.svg
+
+platform/unix/love.desktop: platform/unix/love.desktop.in
+	$(MKDIR_P) platform/unix
+	rm -f $@ [email protected]
+	$(SED) \
+		-e "s|@bindir[@]|$(bindir)|" \
+		${srcdir}/[email protected] > [email protected]
+	chmod a-w [email protected]
+	mv [email protected] $@

+ 0 - 0
platform/unix/game.svg → platform/unix/application-x-love-game.svg


+ 2 - 0
platform/unix/configure.ac

@@ -10,6 +10,8 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 AC_PROG_LIBTOOL
 AC_PROG_CC
 AC_PROG_CXX
+AC_PROG_SED
+AC_PROG_MKDIR_P
 AC_C_BIGENDIAN
 AC_SEARCH_LIBS([sqrt], [m], [], AC_MSG_ERROR([Can't LÖVE without C math library]))
 AC_SEARCH_LIBS([SDL_Init], [SDL], [], AC_MSG_ERROR([Can't LÖVE without SDL]))

+ 2 - 3
platform/unix/love.desktop → platform/unix/love.desktop.in

@@ -2,10 +2,9 @@
 Name=LÖVE
 Comment=The unquestionably awesome 2D game engine
 MimeType=application/x-love-game;
-Exec=/usr/bin/love
+Exec=@bindir@/love
 Type=Application
 Categories=Development;Game;
 Terminal=false
-Icon=love.svg
+Icon=love
 NoDisplay=true
-

+ 0 - 0
platform/unix/app.svg → platform/unix/love.svg