Re: Copy files to tmp

2024-03-19 Thread Richard Kimberly Heck

On 3/19/24 10:32, Scott Kostyshak wrote:

On Tue, Mar 19, 2024 at 09:49:59AM +, José Matos wrote:

On Tue, 2024-03-19 at 09:24 +0100, jspi...@gmail.com wrote:

Thanks, this does not seem to be related to external material,
AFAICS.
However, what would help me is a new placeholder, $$OrigAbsName, that
outputs the absolute path to the original filename (see attached). I
know that documenting this for 2.4 is too late, but would you be OK
if I submitted this as a hidden feature and document later?

Jürgen

I am suspicious, in any case it follows my opinion. :-)

I think that this is quite reasonable because the feature is self-
contained and it does not interfere with other features.

So IMHO +1.

+1


And me.

Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: cmake build with qt6 (macos) does not include "plugins"

2024-03-19 Thread pdv

On 07/11/2023 17:42, pdv wrote:

On 06/11/2023 19:17, pdv wrote:

On 04/11/2023 20:35, Kornel Benko wrote:

Am Sat, 4 Nov 2023 18:05:42 +0100
schrieb pdv :


On 04/11/2023 17:55, pdv wrote:

On 21/03/2023 19:27, Kornel Benko wrote:

Am Tue, 21 Mar 2023 15:27:41 +0100
schrieb pdv :


On 21/03/2023 11:00, Kornel Benko wrote:

Am Mon, 20 Mar 2023 20:05:32 +0100
schrieb pdv :
It's within the first if() else(), that's thus for qt6(see 
below). I
suppose this should work for all platforms, but I checked it on 
macos
only. Your patch is limited to APPLE and also works for me; If 
this
problem doesn't occur for other platforms, it's ok for me of 
course.


Probably no one else is using the bundle option (-DLYX_BUNDLE=ON).

If you could try to use cmake without this option, I'd be 
interested

if it works for
you too.


Apparently no problem. -DLYX_BUNDLE=OFF works too for me.


In this case we could get rid of it (probably).

 Kornel






Good, so I will disable this option for lyx2.5 then.

 Kornel


I have build the latest lyx-master and I still need my (previous) 
patch
to build a LyX.app which includes all required Qt6 frameworks (I 
want a

stand-alone app).

I'm using a recent version of CMake and apparently versions older than
3.5 will not longer be supported. To get rid of the annoying warnings
I've upped the minimum version from 3.1 to 3.5 (new patch included).

pdv


Sorry, forgot to include the patch.


Will be done for 2.4.x versions. Also for other CMakeLists.txt's in 
the lyx-sources.


Kornel



OK, thanks.

Regarding the original issue, I'm still largely in the dark.

I've build qt-6.2 (-debug-and-release option), installed cmake3.26 and 
I'm using macos 10.14 and xcode. lyx has been updated to a very recent 
master-version.


Building a complete (qt frameworks included) debuggable LyX2.4.app 
with cmake does not work for me; the plug-ins are not copied into the 
bundle and cmake's fixup_bundle step subsequently fails.


When I apply my patch (see first message) the plugins are copied but 
the fixup_bundle step still fails.


Only the QtCore, ... frameworks have been copied to the bundle 
(probably by the install command in my patch), but not the 
QtCore_debug, ... versions, although no error is reported by 
fixup_bundle at copy time.


That's because they are copied to a folder named /@rpath/ in my 
build-folder instead of into the bundle.
Apparently the @rpath used in the qt libraries is not handled properly 
by the cmake scripts.


Can anyone confirm that a stand-alone LyX2.4.app can be build with 
cmake on macos or have any other suggestion?


pdv



The problem with the _debug libraries is obvious. As for qt5 no _debug 
libraries should be copied for qt6 either. I adapted my patch (included) 
accordingly.


I once more tested a number of configurations and this is my conclusion.
I can build a bundle with LYX_DMG=off and LYX_BUNDLE=on, the latter sets 
also LYX_CPACK=on.


These are my resulting settings after cmake configure:

LYX_ENABLE_BUILD_TYPE:STRING   = AUTO   : Allows to tweak the 
compiled code (AUTO release prerelease development gprof)
     LYX_CPACK:BOOL = ON : Use the CPack 
management (Implies LYX_INSTALL option)
     LYX_LOCALVERSIONING:BOOL   = ON : Add version info to 
created package name (only used if LYX_CPACK option set)
     LYX_INSTALL:BOOL   = OFF    : Build install 
projects/rules (implies a bunch of other options)
     LYX_NLS:BOOL   = ON : Enable Native 
Language Support (NLS)
     LYX_REQUIRE_SPELLCHECK:BOOL    = OFF    : Abort if no 
spellchecker available

     LYX_ASPELL:BOOL    = ON : Require aspell
     LYX_ENCHANT:BOOL   = OFF    : Require Enchant
     LYX_HUNSPELL:BOOL  = ON : Require Hunspell
     LYX_RELEASE:BOOL   = ON : Build release 
version, build debug when disabled

     LYX_DEBUG:BOOL = OFF    : Enforce debug build
     LYX_NO_OPTIMIZE:BOOL   = OFF    : Don't use any 
optimization/debug flags
     LYX_ENABLE_ASSERTIONS:BOOL = ON : Run sanity checks in 
the program
     LYX_PACKAGE_SUFFIX:BOOL    = ON : Use version suffix 
for packaging
     LYX_SUFFIX_VALUE:STRING    =    : Use this string as 
suffix

     LYX_PCH:BOOL   = OFF    : Use precompiled headers
     LYX_MERGE_FILES:BOOL   = OFF    : Merge source files 
into one compilation unit
     LYX_MERGE_REBUILD:BOOL = OFF    : Rebuild generated 
files from merged files build
     LYX_QUIET:BOOL = ON : Don't generate 
verbose makefiles

     LYX_INSTALL_PREFIX:BOOL    = OFF    : Install path for LyX
     LYX_BUNDLE:BOOL    = ON : Build bundle 
(experimental)

     LYX_ENABLE_URLTESTS:BOOL   = OFF    : Enable for URL tests
     

Re: Copy files to tmp

2024-03-19 Thread Scott Kostyshak
On Tue, Mar 19, 2024 at 09:49:59AM +, José Matos wrote:
> On Tue, 2024-03-19 at 09:24 +0100, jspi...@gmail.com wrote:
> > Thanks, this does not seem to be related to external material,
> > AFAICS.
> > However, what would help me is a new placeholder, $$OrigAbsName, that
> > outputs the absolute path to the original filename (see attached). I
> > know that documenting this for 2.4 is too late, but would you be OK
> > if I submitted this as a hidden feature and document later?
> > 
> > Jürgen
> 
> I am suspicious, in any case it follows my opinion. :-)
> 
> I think that this is quite reasonable because the feature is self-
> contained and it does not interfere with other features.
> 
> So IMHO +1.

+1

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


cmake build on macos (Sonoma, XCode) fails and remedy

2024-03-19 Thread pdv
Using the latest commit and building lyx with cmake on macos-sonoma with 
xcode fails with multiple error messages like this one:


--
CMake Error in po/CMakeLists.txt:
  The custom command generating

/po/LyX2.4.cat.pot

  is attached to multiple targets:

translations
update-gmo

 but none of these is a common dependency of the other(s).  This is not
 allowed by the Xcode "new build system".
---

These issues are solved by adding the following target dependencies 
(patch included)


add_dependencies(update-gmo translations)
add_dependencies(update-gmo update-po)

add_dependencies(cleanupdatetex2lyxtests updatetex2lyxtests)


pdvdiff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index 065448e6e5..280b3535eb 100755
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -271,4 +271,5 @@ ADD_CUSTOM_TARGET(update-gmo DEPENDS 
${LYX_UPDATED_GMO_FILES})
 ADD_CUSTOM_TARGET(update-po DEPENDS ${LYX_UPDATED_PO_FILES} 
${LYX_UPDATED_GMO_FILES})
 set_target_properties(update-po update-gmo PROPERTIES FOLDER "i18n")
 add_dependencies(update-po translations)
-
+add_dependencies(update-gmo translations)
+add_dependencies(update-gmo update-po)
\ No newline at end of file
diff --git a/src/tex2lyx/test/CMakeLists.txt b/src/tex2lyx/test/CMakeLists.txt
index e620e067c4..7be27f9a13 100644
--- a/src/tex2lyx/test/CMakeLists.txt
+++ b/src/tex2lyx/test/CMakeLists.txt
@@ -105,3 +105,4 @@ add_custom_command(
 
 add_custom_target(cleanupdatetex2lyxtests DEPENDS UpdateFilesRemoved)
 set_target_properties(cleanupdatetex2lyxtests PROPERTIES FOLDER 
"tests/tex2lyx")
+add_dependencies(cleanupdatetex2lyxtests updatetex2lyxtests)
\ No newline at end of file
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Copy files to tmp

2024-03-19 Thread José Matos
On Tue, 2024-03-19 at 09:24 +0100, jspi...@gmail.com wrote:
> Thanks, this does not seem to be related to external material,
> AFAICS.
> However, what would help me is a new placeholder, $$OrigAbsName, that
> outputs the absolute path to the original filename (see attached). I
> know that documenting this for 2.4 is too late, but would you be OK
> if I submitted this as a hidden feature and document later?
> 
> Jürgen

I am suspicious, in any case it follows my opinion. :-)

I think that this is quite reasonable because the feature is self-
contained and it does not interfere with other features.

So IMHO +1.
-- 
José Abílio
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Copy files to tmp

2024-03-19 Thread jspitzm
Am Montag, dem 18.03.2024 um 18:26 -0400 schrieb Richard Kimberly Heck:
> On 3/18/24 13:01, Jürgen Spitzmüller wrote:
> > I am trying to set up a private external template for the inclusion
> > of
> > sound files to beamer slides. Could somebody please remind me what
> > needs to be done to get those files (e.g., mp3's) copied to the tmp
> > with their mangled file name?
> 
> I think this is done in the validation routine, by calling 
> features.includeFile().

Thanks, this does not seem to be related to external material, AFAICS.
However, what would help me is a new placeholder, $$OrigAbsName, that
outputs the absolute path to the original filename (see attached). I
know that documenting this for 2.4 is too late, but would you be OK if
I submitted this as a hidden feature and document later?

Jürgen
diff --git a/src/insets/ExternalSupport.cpp b/src/insets/ExternalSupport.cpp
index 33c14d38be..5893a5d454 100644
--- a/src/insets/ExternalSupport.cpp
+++ b/src/insets/ExternalSupport.cpp
@@ -106,8 +106,10 @@ string const doSubstitution(InsetExternalParams const & params,
 		params.filename.mangledFileName() :
 		params.filename.outputFileName(parentpath);
 	string const basename = changeExtension(
-			onlyFileName(filename), string());
+		onlyFileName(filename), string());
 	string const absname = makeAbsPath(filename, parentpath).absFileName();
+	string const origabsname = makeAbsPath(params.filename.outputFileName(parentpath),
+	   parentpath).absFileName();
 
 	if (what != ALL_BUT_PATHS) {
 		string const filepath = onlyPath(filename);
@@ -136,6 +138,10 @@ string const doSubstitution(InsetExternalParams const & params,
 use_latex_path,
 PROTECT_EXTENSION,
 ESCAPE_DOTS);
+		result = subst_path(result, "$$OrigAbsName", origabsname,
+use_latex_path,
+PROTECT_EXTENSION,
+ESCAPE_DOTS);
 		result = subst_path(result, "$$RelPathMaster",
 relToMasterPath, use_latex_path,
 PROTECT_EXTENSION,
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel