From: Jessica Hamilton Date: Fri, 5 Jun 2015 10:40:35 +0000 (+1200) Subject: Add packaging support for Haiku X-Git-Tag: 2.2.0alpha1~550 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=dcfb918f15f604393295f69d36687b9c0aaaadb7;p=features.git Add packaging support for Haiku See bug #7568 for details. --- diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index ba5344a342..03746027d7 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -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) diff --git a/src/LyX.cpp b/src/LyX.cpp index b57245bb1e..d70c6b0223 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -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()) diff --git a/src/support/Package.cpp b/src/support/Package.cpp index 66b0e60f0a..b15879cc9f 100644 --- a/src/support/Package.cpp +++ b/src/support/Package.cpp @@ -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