]> git.lyx.org Git - lyx.git/commitdiff
Improve support for distributing desktop files and icons
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 20 Dec 2011 13:11:03 +0000 (13:11 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 20 Dec 2011 13:11:03 +0000 (13:11 +0000)
* add proper INSTALL_POSIX conditional for makefiles
* move all the code to Makefile.am
* rename lyx.desktop to lyx.desptop.in and add proper tags to allow handling of program_suffix.
* add code to install desktop entry and icons under the proper name.

I did not touch scons and cmake, I hope it was not necessary.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40531 a592a061-630c-0410-9148-cb99ea01b6c8

Makefile.am
config/lyxinclude.m4
configure.ac
lib/Makefile.am
lib/lyx.desktop [deleted file]
lib/lyx.desktop.in [new file with mode: 0644]

index efcbeca75ab881bbf43770a09291b306a2c2d65f..ebdfe0e76a150485b9271dda7f4f639e06d8504d 100644 (file)
@@ -22,17 +22,10 @@ SUBDIRS = config development intl po $(BOOST) src sourcedoc lib \
 EXTRA_DIST = ANNOUNCE INSTALL.autoconf RELEASE-NOTES UPGRADING \
        INSTALL.Win32 INSTALL.MacOSX INSTALL.scons INSTALL.cmake \
        README.Win32 README.Cygwin README.localization lyx.1in \
-       autogen.sh lib/lyx.desktop lib/images/lyx.svg
+       autogen.sh
 
 man_MANS = lyx.1
 
-if !INSTALL_WINDOWS
-if !INSTALL_MACOSX
-desktopdir = $(datadir)/applications
-desktop_DATA = lib/lyx.desktop
-endif
-endif
-
 #Wait some time for bumping automake 1.11, which can use dist-xz
 #directly without this code, which is to be removed.
 #xz has low compression by default, but can be affected via
index 1480fe188a918fd6502fae4560eb5e6c704f0d71..bb94bfc5b2b880a77ddbf4d1cb628d25031f5228 100644 (file)
@@ -521,12 +521,14 @@ case $lyx_use_packaging in
           default_prefix=$ac_default_prefix
           case ${host} in
           *cygwin*) lyx_install_cygwin=true ;;
-          esac ;;
+          esac
+          lyx_install_posix=true ;;
     *) LYX_ERROR([Unknown packaging type $lyx_use_packaging]) ;;
 esac
 AM_CONDITIONAL(INSTALL_MACOSX, $lyx_install_macosx)
-AM_CONDITIONAL(INSTALL_CYGWIN, $lyx_install_cygwin)
 AM_CONDITIONAL(INSTALL_WINDOWS, $lyx_install_windows)
+AM_CONDITIONAL(INSTALL_CYGWIN, $lyx_install_cygwin)
+AM_CONDITIONAL(INSTALL_POSIX, $lyx_install_posix)
 dnl Next two lines are only for autoconf <= 2.59
 datadir='${datarootdir}'
 AC_SUBST(datarootdir)
index 700f6ff712b8739b01dafed560b47e8f2aedeb7b..c4f1ebeb31236375e0739418e45b5f7b73804ef4 100644 (file)
@@ -361,6 +361,7 @@ AC_CONFIG_FILES([Makefile \
       development/cygwin/lyxrc.dist \
       development/lyx.spec \
       intl/Makefile \
+      lib/lyx.desktop-temp:lib/lyx.desktop.in
       lib/Makefile \
       lib/doc/Makefile \
       lib/lyx2lyx/lyx2lyx_version.py \
index ade50ffb967b54b18d88f0f63ae10d996e86986a..d2211d59dc9d0892c849452cb2398816bbe38f9a 100644 (file)
@@ -399,7 +399,6 @@ dist_images_DATA = \
        images/layout_Scrap.png \
        images/layout_Section.png \
        images/lyx-quit.png \
-       images/lyx.png \
        images/marginalnote-insert.png \
        images/master-buffer-update.png \
        images/master-buffer-view.png \
@@ -1591,7 +1590,7 @@ dist_springertemplates_DATA = \
        templates/springer/svmult_part.lyx \
        templates/springer/svmult_preface.lyx \
        templates/springer/svmult_referenc.lyx
-       
+
 thesistemplatesdir = $(pkgdatadir)/templates/thesis
 dist_thesistemplates_DATA = \
        templates/thesis/Acknowledgments.lyx \
@@ -1611,19 +1610,6 @@ dist_tex_DATA = \
        tex/lyxskak.sty \
        tex/revtex.cls
 
-if !INSTALL_WINDOWS
-if !INSTALL_MACOSX
-# install application icons. The 'hicolor' theme is the default theme
-# where applications themselves should install their icons.
-scalableappiconsdir = $(datadir)/icons/hicolor/scalable/apps
-scalableappicons_DATA = images/lyx.svg
-
-fixedappiconsdir = $(datadir)/icons/hicolor/48x48/apps
-fixedappicons_DATA = images/lyx.png
-
-endif
-endif
-
 # subscript.sty is not in dist_tex_DATA since we don't want to install it
 # (it is part of TeXLive). We include it in our source package only so that
 # packagers may decide to install it (e.g. for MikTeX).
@@ -1636,6 +1622,32 @@ dist_ui_DATA = \
        ui/stdmenus.inc \
        ui/stdtoolbars.inc
 
+if INSTALL_POSIX
+# install application icons. The 'hicolor' theme is the default theme
+# where applications themselves should install their icons.
+lyx@program_suffix@.svg: images/lyx.svg
+       $(AM_V_GEN)$(INSTALL_DATA) $< $@
+scalableappiconsdir = $(datadir)/icons/hicolor/scalable/apps
+scalableappicons_DATA = lyx@program_suffix@.svg
+
+lyx@program_suffix@.png: images/lyx.png
+       $(AM_V_GEN)$(INSTALL_DATA) $< $@
+fixedappiconsdir = $(datadir)/icons/hicolor/48x48/apps
+fixedappicons_DATA = lyx@program_suffix@.png
+
+# if configure is asked to generate the name with suffix directly, then
+# config.status refuses to rebuild this file (with a variable name), and
+# a build error ensues when lyx.desktop.in is changed.
+lyx@program_suffix@.desktop: lyx.desktop-temp
+       $(AM_V_GEN)$(INSTALL_DATA) $< $@
+desktopdir = $(datadir)/applications
+desktop_DATA = lyx@program_suffix@.desktop
+
+CLEANFILES += lyx@program_suffix@.desktop lyx.desktop-temp \
+              lyx@program_suffix@.svg lyx@program_suffix@.png
+endif
+dist_noinst_DATA += lyx.desktop.in images/lyx.svg images/lyx.png
+
 install-data-hook:
        $(CHMOD) 755 $(DESTDIR)$(pkgdatadir)/configure.py
        for i in $(dist_scripts_PYTHON); do \
diff --git a/lib/lyx.desktop b/lib/lyx.desktop
deleted file mode 100644 (file)
index 53f3c30..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-Version=1.0
-Type=Application
-Name=LyX
-GenericName=Document Processor
-Comment=High level LaTeX frontend
-Exec=lyx %F
-TryExec=lyx
-Icon=lyx
-StartupNotify=false
-StartupWMClass=Lyx
-Terminal=false
-Categories=Office;WordProcessor;Qt;
-MimeType=text/x-lyx;application/x-lyx;
diff --git a/lib/lyx.desktop.in b/lib/lyx.desktop.in
new file mode 100644 (file)
index 0000000..bc6930a
--- /dev/null
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=LyX
+GenericName=Document Processor
+Comment=High level LaTeX frontend
+Exec=lyx@program_suffix@ %F
+TryExec=lyx@program_suffix@
+Icon=lyx@program_suffix@
+StartupNotify=false
+StartupWMClass=Lyx
+Terminal=false
+Categories=Office;WordProcessor;Qt;
+MimeType=text/x-lyx;application/x-lyx;