From cd2e4b3cefef65a1f239dcefcb01ad5a85368d81 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 27 Feb 2021 17:34:11 +0200 Subject: [PATCH] Fixes and improvements to XDG installation --- FreeDesktop/sameboy.xml | 17 +++++++++++++++++ FreeDesktop/x-gameboy-color-rom.xml | 10 ++++++++++ Makefile | 16 +++++++++++++--- 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 FreeDesktop/sameboy.xml create mode 100644 FreeDesktop/x-gameboy-color-rom.xml diff --git a/FreeDesktop/sameboy.xml b/FreeDesktop/sameboy.xml new file mode 100644 index 0000000..6c0df37 --- /dev/null +++ b/FreeDesktop/sameboy.xml @@ -0,0 +1,17 @@ + + + + Game Boy ROM + + + + + + + Game Boy Color ROM + + + + + + diff --git a/FreeDesktop/x-gameboy-color-rom.xml b/FreeDesktop/x-gameboy-color-rom.xml new file mode 100644 index 0000000..0a42874 --- /dev/null +++ b/FreeDesktop/x-gameboy-color-rom.xml @@ -0,0 +1,10 @@ + + + + YOUR MOM + + + + + + diff --git a/Makefile b/Makefile index 5335f33..d065750 100644 --- a/Makefile +++ b/Makefile @@ -434,23 +434,33 @@ libretro: # If you somehow find a reasonable way to make associate an icon with an extension in this dumpster # fire of a desktop environment, open an issue or a pull request ifneq ($(CAN_INSTALL),) -ICON_NAMES := apps/sameboy +ICON_NAMES := apps/sameboy mimetypes/x-gameboy-rom mimetypes/x-gameboy-color-rom ICON_SIZES := 16x16 32x32 64x64 128x128 256x256 512x512 ICONS := $(foreach name,$(ICON_NAMES), $(foreach size,$(ICON_SIZES),$(DESTDIR)$(PREFIX)/share/icons/hicolor/$(size)/$(name).png)) -install: sdl $(DESTDIR)$(PREFIX)/share/applications/sameboy.desktop $(ICONS)(PREFIX)/share/mime/application/x-gameboy-color-rom.xml +install: sdl $(DESTDIR)$(PREFIX)/share/applications/sameboy.desktop $(ICONS) FreeDesktop/sameboy.xml mkdir -p $(DESTDIR)$(PREFIX)/share/sameboy/ cp -rf $(BIN)/SDL/* $(DESTDIR)$(PREFIX)/share/sameboy/ mv $(DESTDIR)$(PREFIX)/share/sameboy/sameboy $(DESTDIR)$(PREFIX)/bin/sameboy ifeq ($(DESTDIR),) + -update-mime-database -n $(PREFIX)/mime + -xdg-desktop-menu install --mode system FreeDesktop/sameboy.xml -xdg-icon-resource forceupdate --mode system -xdg-desktop-menu forceupdate --mode system + -su $(SUDO_USER) -c "xdg-desktop-menu forceupdate --mode system" endif $(DESTDIR)$(PREFIX)/share/icons/hicolor/%/apps/sameboy.png: FreeDesktop/AppIcon/%.png -@$(MKDIR) -p $(dir $@) cp -f $^ $@ - +$(DESTDIR)$(PREFIX)/share/icons/hicolor/%/mimetypes/x-gameboy-rom.png: FreeDesktop/Cartridge/%.png + -@$(MKDIR) -p $(dir $@) + cp -f $^ $@ + +$(DESTDIR)$(PREFIX)/share/icons/hicolor/%/mimetypes/x-gameboy-color-rom.png: FreeDesktop/ColorCartridge/%.png + -@$(MKDIR) -p $(dir $@) + cp -f $^ $@ + $(DESTDIR)$(PREFIX)/share/applications/sameboy.desktop: FreeDesktop/sameboy.desktop -@$(MKDIR) -p $(dir $@) cp -f $^ $@