]> git.lyx.org Git - features.git/commitdiff
Add packaging support for Haiku
authorJessica Hamilton <jessica.l.hamilton@gmail.com>
Fri, 5 Jun 2015 10:40:35 +0000 (22:40 +1200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 8 Jun 2015 15:18:14 +0000 (17:18 +0200)
See bug #7568 for details.

config/lyxinclude.m4
src/LyX.cpp
src/support/Package.cpp

index ba5344a342c18c3488af53a57d5f2131894430f2..03746027d7d9ae4f8ea5a33c7eb0a99388c79f73 100644 (file)
@@ -562,12 +562,13 @@ AC_DEFUN([LYX_USE_PACKAGING],
 [AC_MSG_CHECKING([what packaging should be used])
 AC_ARG_WITH(packaging,
   [AC_HELP_STRING([--with-packaging=THIS], [use THIS packaging for installation:
-                           Possible values: posix, windows, macosx])],
+                           Possible values: posix, windows, macosx, haiku])],
   [lyx_use_packaging="$withval"], [
   case $host in
     *-apple-darwin*) lyx_use_packaging=macosx ;;
-     *-pc-mingw32*) lyx_use_packaging=windows;;
-                  *) lyx_use_packaging=posix;;
+    *-pc-mingw32*) lyx_use_packaging=windows ;;
+    *haiku*) lyx_use_packaging=haiku ;;
+    *) lyx_use_packaging=posix ;;
   esac])
 AC_MSG_RESULT($lyx_use_packaging)
 lyx_install_posix=false
@@ -600,10 +601,16 @@ case $lyx_use_packaging in
           pkgdatadir='${datadir}/${PACKAGE}'
           default_prefix=$ac_default_prefix
           case ${host} in
-          *cygwin*) lyx_install_cygwin=true ;;
-               *apple-darwin*) lyx_install_macosx=true ;;
+            *cygwin*) lyx_install_cygwin=true ;;
+            *apple-darwin*) lyx_install_macosx=true ;;
           esac
           lyx_install_posix=true ;;
+       haiku) AC_DEFINE(USE_HAIKU_PACKAGING, 1, [Define to 1 if LyX should use a Haiku-style file layout])
+          PACKAGE=lyx${version_suffix}
+          program_suffix=$version_suffix
+          pkgdatadir='${datadir}/${PACKAGE}'
+          default_prefix=$ac_default_prefix
+          lyx_install_posix=true ;;
     *) AC_MSG_ERROR([unknown packaging type $lyx_use_packaging.]) ;;
 esac
 AM_CONDITIONAL(INSTALL_MACOSX, $lyx_install_macosx)
index b57245bb1e1fc2226964082db05838a89fa630fe..d70c6b02238fd4d230e4026969369f581a2f1f49 100644 (file)
@@ -833,7 +833,7 @@ bool LyX::init()
                return false;
 
        // Set the PATH correctly.
-#if !defined (USE_POSIX_PACKAGING)
+#if !defined (USE_POSIX_PACKAGING) && !defined (USE_HAIKU_PACKAGING)
        // Add the directory containing the LyX executable to the path
        // so that LyX can find things like tex2lyx.
        if (package().build_support().empty())
index 66b0e60f0ad80455490926792f0665fd606d813d..b15879cc9fb46a3b0afec19f0498f3f08c0a3975 100644 (file)
@@ -34,8 +34,9 @@
 
 #if !defined (USE_WINDOWS_PACKAGING) && \
     !defined (USE_MACOSX_PACKAGING) && \
+    !defined (USE_HAIKU_PACKAGING) && \
     !defined (USE_POSIX_PACKAGING)
-#error USE_FOO_PACKAGING must be defined for FOO = WINDOWS, MACOSX or POSIX.
+#error USE_FOO_PACKAGING must be defined for FOO = WINDOWS, MACOSX, HAIKU or POSIX.
 #endif
 
 #if defined (USE_MACOSX_PACKAGING)
@@ -696,6 +697,9 @@ FileName const get_default_user_support_dir(FileName const & home_dir)
        (void)home_dir; // Silence warning about unused variable.
        return FileName(addPath(fromqstr(QDesktopServices::storageLocation(QDesktopServices::DataLocation)), PACKAGE));
 
+#elif defined (USE_HAIKU_PACKAGING)
+       return FileName(addPath(home_dir.absFileName(), string("/config/settings/") + PACKAGE));
+
 #else // USE_POSIX_PACKAGING
        return FileName(addPath(home_dir.absFileName(), string(".") + PACKAGE));
 #endif