diff options
-rw-r--r-- | gtk/configure.ac | 6 | ||||
-rw-r--r-- | gtk/module.defs | 4 | ||||
-rw-r--r-- | gtk/src/Makefile.am | 50 |
3 files changed, 28 insertions, 32 deletions
diff --git a/gtk/configure.ac b/gtk/configure.ac index 4c75f4a90..43dc81942 100644 --- a/gtk/configure.ac +++ b/gtk/configure.ac @@ -52,6 +52,10 @@ else AC_SUBST(HB_DIR, '$(top_srcdir)/'"..") fi +AC_ARG_ENABLE(flatpak, + AS_HELP_STRING([--enable-flatpak], [enable QSV encoder]), + use_flatpak=yes, use_flatpak=no) + AC_ARG_ENABLE(dl, AS_HELP_STRING([--enable-dl], [enable libdl]), use_libdl=yes, use_libdl=no) @@ -183,6 +187,8 @@ case $host in ;; esac +AM_CONDITIONAL([GHB_FLATPAK], [test "$use_flatpak" = "yes"]) + if test "x$use_fdk_aac" = "xyes" ; then HB_LIBS="$HB_LIBS -lfdk-aac" fi diff --git a/gtk/module.defs b/gtk/module.defs index 6bd07efc7..bef536d22 100644 --- a/gtk/module.defs +++ b/gtk/module.defs @@ -43,3 +43,7 @@ endif ifeq (1,$(FEATURE.qsv)) GTK.CONFIGURE.extra += --enable-qsv endif + +ifeq (1,$(FEATURE.flatpak)) + GTK.CONFIGURE.extra += --enable-flatpak +endif diff --git a/gtk/src/Makefile.am b/gtk/src/Makefile.am index cd873b0c7..f376996b7 100644 --- a/gtk/src/Makefile.am +++ b/gtk/src/Makefile.am @@ -3,8 +3,6 @@ icons = \ hb-icon.svg -flatpak_icon = fr.handbrake.ghb.svg - icons_dep = \ hb-icon.svg \ hb-start.svg \ @@ -19,10 +17,14 @@ icons_dep = \ hb-edit.svg \ hb-complete.svg +if GHB_FLATPAK +icons += fr.handbrake.ghb.svg +hb_menu = fr.handbrake.ghb.desktop +flatpak_appdata = fr.handbrake.ghb.appdata.xml +else hb_menu = ghb.desktop -flatpak_menu = fr.handbrake.ghb.desktop +endif -flatpak_appdata = fr.handbrake.ghb.appdata.xml AM_CPPFLAGS = \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ @@ -151,17 +153,8 @@ gtk_update_icon_cache = gtk-update-icon-cache -f -t $(DESTDIR)/$(datadir)/icons/ uninstall-local: for icon in $(icons); do \ - SIZE=`echo $$icon | cut -d. -f2`; \ - FILE=`echo $$icon | cut -d. -f1,3`; \ - if [ "$$SIZE" = "svg" ]; then \ - SIZE="scalable"; \ - FILE="$$FILE.svg"; \ - else \ - SIZE="$${SIZE}x$${SIZE}"; \ - fi; \ - rm -f $(DESTDIR)/$(datadir)/icons/hicolor/$$SIZE/apps/$$FILE; \ + rm -f $(DESTDIR)/$(datadir)/icons/hicolor/scalable/apps/$$icon; \ done - rm -f $(DESTDIR)/$(datadir)/icons/hicolor/scalable/apps/$(flatpak_icon) @-if test -z "$(DESTDIR)"; then \ echo "Updating Gtk icon cache."; \ $(gtk_update_icon_cache); \ @@ -169,24 +162,16 @@ uninstall-local: echo "*** Icon cache not updated. After install, run this:"; \ echo "*** $(gtk_update_icon_cache)"; \ fi - rm -f $(DESTDIR)/$(datadir)/applications/$(hb_menu); \ - rm -f $(DESTDIR)/$(datadir)/applications/$(flatpak_menu) \ - rm -f $(DESTDIR)/$(datadir)/appdata/$(flatpak_appdata) + rm -f $(DESTDIR)/$(datadir)/applications/$(hb_menu) + @-if test -n "$(flatpak_appdata)"; then \ + rm -f $(DESTDIR)/$(datadir)/appdata/$(flatpak_appdata); \ + fi install-data-local: for icon in $(icons); do \ - SIZE=`echo $$icon | cut -d. -f2`; \ - FILE=`echo $$icon | cut -d. -f1,3`; \ - if [ "$$SIZE" = "svg" ]; then \ - SIZE="scalable"; \ - FILE="$$FILE.svg"; \ - else \ - SIZE="$${SIZE}x$${SIZE}"; \ - fi; \ - mkdir -p $(DESTDIR)/$(datadir)/icons/hicolor/$$SIZE/apps/; \ - $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)/$(datadir)/icons/hicolor/$$SIZE/apps/$$FILE; \ + mkdir -p $(DESTDIR)/$(datadir)/icons/hicolor/scalable/apps/; \ + $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)/$(datadir)/icons/hicolor/scalable/apps/$$icon; \ done - $(INSTALL_DATA) $(srcdir)/$(flatpak_icon) $(DESTDIR)/$(datadir)/icons/hicolor/scalable/apps/$(flatpak_icon) @-if test -z "$(DESTDIR)"; then \ echo "Updating Gtk icon cache."; \ $(gtk_update_icon_cache); \ @@ -195,7 +180,8 @@ install-data-local: echo "*** $(gtk_update_icon_cache)"; \ fi mkdir -p $(DESTDIR)/$(datadir)/applications/; \ - mkdir -p $(DESTDIR)/$(datadir)/appdata/; \ - $(INSTALL_DATA) $(srcdir)/$(hb_menu) $(DESTDIR)/$(datadir)/applications/$(hb_menu); \ - $(INSTALL_DATA) $(srcdir)/$(flatpak_menu) $(DESTDIR)/$(datadir)/applications/$(flatpak_menu); \ - $(INSTALL_DATA) $(srcdir)/$(flatpak_appdata) $(DESTDIR)/$(datadir)/appdata/$(flatpak_appdata) + $(INSTALL_DATA) $(srcdir)/$(hb_menu) $(DESTDIR)/$(datadir)/applications/$(hb_menu) + @-if test -n "$(flatpak_appdata)"; then \ + mkdir -p $(DESTDIR)/$(datadir)/appdata/; \ + $(INSTALL_DATA) $(srcdir)/$(flatpak_appdata) $(DESTDIR)/$(datadir)/appdata/$(flatpak_appdata); \ + fi |