summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-15 02:34:28 +0200
committerwm4 <wm4@nowhere>2013-09-15 21:22:30 +0200
commitd6884defa7c6208848e694e482acd22c78e95ce9 (patch)
tree41863a93645ee51b81e7b8b9842730746b3e4cf1 /Makefile
parent132c7f1cf55482d8cf880f30c9b9d6ffc47a77b2 (diff)
downloadmpv-d6884defa7c6208848e694e482acd22c78e95ce9.tar.bz2
mpv-d6884defa7c6208848e694e482acd22c78e95ce9.tar.xz
Add mpv.desktop, let Makefile install the desktop file and the icons
The mpv.desktop file is taken from the Arch package [1]. It appears to be based on the mplayer2 git mplayer.desktop file (e.g. very similar MimeType field), with minor modifications applied by Arch package maintainers. Note that for now, this doesn't show a terminal (Terminal=false), which might not always be ideal. For example, if the file is audio only, or if VO initialization fails for some reason, mpv will run in the background and play audio without showing a window. But users prefer running it without terminal, and don't want to play audio files with it. Maybe a --force-window option will be added in the future, which would always create a VO window, and compensate for these issues. [1] https://aur.archlinux.org/packages/mpv-git/
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 24 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index a689b3130c..676841ee72 100644
--- a/Makefile
+++ b/Makefile
@@ -427,10 +427,10 @@ DOCS/man/en/mpv.1 DOCS/man/en/mpv.pdf: DOCS/man/en/af.rst \
###### installation / clean / generic rules #######
-install: $(INSTALL_BIN) $(INSTALL_MAN) $(INSTALL_PDF)
-install-no-man: $(INSTALL_BIN)
-install-strip: $(INSTALL_BIN_STRIP) $(INSTALL_MAN) $(INSTALL_PDF)
-install-strip-no-man: $(INSTALL_BIN_STRIP)
+install: $(INSTALL_BIN) install-data $(INSTALL_MAN) $(INSTALL_PDF)
+install-no-man: $(INSTALL_BIN) install-data
+install-strip: $(INSTALL_BIN_STRIP) install-data $(INSTALL_MAN) $(INSTALL_PDF)
+install-strip-no-man: $(INSTALL_BIN_STRIP) install-data
install-dirs:
if test ! -d $(BINDIR) ; then $(INSTALL) -d $(BINDIR) ; fi
@@ -453,11 +453,31 @@ install-mpv-pdf-en: DOCS/man/en/mpv.pdf
if test ! -d $(DOCDIR)/mpv ; then $(INSTALL) -d $(DOCDIR)/mpv ; fi
$(INSTALL) -m 644 DOCS/man/en/mpv.pdf $(DOCDIR)/mpv/
+ICONSIZES = 16x16 32x32 64x64
+
+define ICON_INSTALL_RULE
+install-mpv-icon-$(size): etc/mpv-icon-8bit-$(size).png
+ $(INSTALL) -d $(prefix)/share/icons/hicolor/$(size)/apps
+ $(INSTALL) -m 644 etc/mpv-icon-8bit-$(size).png $(prefix)/share/icons/hicolor/$(size)/apps/mpv.png
+endef
+
+$(foreach size,$(ICONSIZES),$(eval $(ICON_INSTALL_RULE)))
+
+install-mpv-icons: $(foreach size,$(ICONSIZES),install-mpv-icon-$(size))
+
+install-mpv-desktop: etc/mpv.desktop
+ $(INSTALL) -d $(prefix)/share/applications
+ $(INSTALL) -m 644 etc/mpv.desktop $(prefix)/share/applications/
+
+install-data: install-mpv-icons install-mpv-desktop
+
uninstall:
$(RM) $(BINDIR)/mpv$(EXESUF)
$(RM) $(MANDIR)/man1/mpv.1
$(RM) $(MANDIR)/en/man1/mpv.1
$(RM) $(DOCDIR)/mpv/mpv.pdf
+ $(RM) $(prefix)/share/applications/mpv.desktop
+ $(RM) $(foreach size,$(ICONSIZES),$(prefix)/share/icons/hicolor/$(size)/apps/mpv.png)
clean:
-$(RM) $(call ADD_ALL_DIRS,/*.o /*.d /*.a /*.ho /*~)