This should fix issue TDE/tdebase#217 and not break compatibility with older versions.
Needs to be tested on distributions with Ghostscript < 9.51 (e.g. Debian Jessie/Stretch/Buster etc.)
This should fix issue TDE/tdebase#217 and not break compatibility with older versions.
Needs to be tested on distributions with Ghostscript < 9.51 (e.g. Debian Jessie/Stretch/Buster etc.)
On Bullseye: The option was there actually until version 9.54, but deprecated since 9.51. That is probably the reason it still works for ≤ 9.54 (but is probably unnecessary).
On Bullseye: The option was there actually until version 9.54, but deprecated since 9.51. That is probably the reason it still works for ≤ 9.54 (but is probably unnecessary).
At the same time, there is still a question that it would be sufficient simply to remove -c .setpdfwrite without conditions. See comment in TDE/tdebase#127.
There are problems that need to be resolved.
At the same time, there is still a question that it would be sufficient simply to remove `-c .setpdfwrite` without conditions. See comment in TDE/tdebase#127.
This is quietly assumed that gs is present during building. For example, for deb packages it is currently not true. Here it would be necessary to use find_program and use the condition whether gs was found for other code.
This is quietly assumed that `gs` is present during building. For example, for deb packages it is currently not true. Here it would be necessary to use `find_program` and use the condition whether `gs` was found for other code.
This makes a silent change in the source code – it is neither desirable or permissible. For two reasons:
a) On some systems, the source code is on read-only mount and changes are not possible.
b) In repeated processing of CMake rules, the change will be performed for the second time.
The correct way is to use the file processing with the output to the binary directory and then install the file from the binary directory.
The -i argument for sed prerequisites the use of GNU sed. This will be a problem on some systems, such as FreeBSD – there is GNU sed available as gsed. Because changes in source code is not desirable, there is no need for -i. However, it is also appropriate to consider using perl instead of sed.
Here are some major problems:
1. This makes a silent change in the source code – it is neither desirable or permissible. For two reasons:
a) On some systems, the source code is on read-only mount and changes are not possible.
b) In repeated processing of CMake rules, the change will be performed for the second time.
The correct way is to use the file processing with the output to the binary directory and then install the file from the binary directory.
2. The `-i` argument for `sed` prerequisites the use of GNU sed. This will be a problem on some systems, such as FreeBSD – there is GNU sed available as `gsed`. Because changes in source code is not desirable, there is no need for `-i`. However, it is also appropriate to consider using perl instead of sed.
This should fix issue TDE/tdebase#217 and not break compatibility with older versions.
Needs to be tested on distributions with Ghostscript < 9.51 (e.g. Debian Jessie/Stretch/Buster etc.)
Looks good but will let Slavek testing on older distros since on bullseye there was no problem in first place.
On Bullseye: The option was there actually until version 9.54, but deprecated since 9.51. That is probably the reason it still works for ≤ 9.54 (but is probably unnecessary).
There are problems that need to be resolved.
At the same time, there is still a question that it would be sufficient simply to remove
-c .setpdfwrite
without conditions. See comment in TDE/tdebase#127.# Determine GhostScript version to correct the
# ps2pdf command. Solves issue tdebase#217.
execute_process(
COMMAND gs --version
This is quietly assumed that
gs
is present during building. For example, for deb packages it is currently not true. Here it would be necessary to usefind_program
and use the condition whethergs
was found for other code.if( "${GS_VERSION}" VERSION_LESS "9.51" )
execute_process(
COMMAND sed -i '3s/%filterargs/& -c .setpdfwrite/' ps2pdf.xml
Here are some major problems:
a) On some systems, the source code is on read-only mount and changes are not possible.
b) In repeated processing of CMake rules, the change will be performed for the second time.
The correct way is to use the file processing with the output to the binary directory and then install the file from the binary directory.
-i
argument forsed
prerequisites the use of GNU sed. This will be a problem on some systems, such as FreeBSD – there is GNU sed available asgsed
. Because changes in source code is not desirable, there is no need for-i
. However, it is also appropriate to consider using perl instead of sed.Note: Typo in previous comment – of course I had in mind TDE/tdebase#217.
b063ebadee
tocc09bbe410
3 years agoI removed the check as it seems unnecessary to keep the
.setpdfwrite
option after all.cc09bbe410
to256b1cf85d
3 years agoIt looks good for me.
We'll see what the opinion of @MicheleC is.
Nice!! If it works well with old systems, then it is a great solution.
256b1cf85d
into master 3 years agoMerged and backported.
Reviewers
256b1cf85d
.