parent
52cd9de14d
commit
159eca7faa
109
pstoedit-pkglibdir.patch
Normal file
109
pstoedit-pkglibdir.patch
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
Fix for pstoedit search for plugins.
|
||||||
|
|
||||||
|
By default, pstoedit "make install" installs to PSTOEDITLIBDIR, so if
|
||||||
|
nobody moves them to another location, then it is sufficient to search in
|
||||||
|
PSTOEDITLIBDIR.
|
||||||
|
|
||||||
|
|
||||||
|
But the way how pstoedit searches for plugins is broken:
|
||||||
|
|
||||||
|
If pstoedit.reg does not exist or does not contain common/plugindir, then
|
||||||
|
it tries $exepath/../lib/pstoedit, always sets pluginsloaded, and never
|
||||||
|
tries PSTOEDITLIBDIR.
|
||||||
|
|
||||||
|
If pstoedit.reg contains common/plugindir, then it tries that path,
|
||||||
|
always sets pluginsloaded, and never tries PSTOEDITLIBDIR.
|
||||||
|
|
||||||
|
=> The default installation directory is never tried, if it is not equal
|
||||||
|
to one of above.
|
||||||
|
|
||||||
|
|
||||||
|
The implementation has just another problem:
|
||||||
|
|
||||||
|
If pstoedit.reg contains common/plugindir, and the directory defined
|
||||||
|
there is equal to $pkglibdir, but the string is not literally
|
||||||
|
"{expansion_of_bindir}/../lib/pstoedit", then plugins are loaded twice.
|
||||||
|
So the check as it is makes only a little sense, because nobody would
|
||||||
|
create ~/.pstoedit.reg containing:
|
||||||
|
|
||||||
|
common/plugindir=/usr/bin/../lib/pstoedit
|
||||||
|
|
||||||
|
|
||||||
|
The new implementation does things differently:
|
||||||
|
|
||||||
|
If common/plugindir is defined, it checks only that directory.
|
||||||
|
|
||||||
|
It swaps the check order: First checks whether PSTOEDITLIBDIR exists. If
|
||||||
|
it exists, it skips blind attempts to find plugins.
|
||||||
|
|
||||||
|
As PSTOEDITLIBDIR is always defined by makefile, the blind fallback will
|
||||||
|
be attempted only in obscure environments.
|
||||||
|
|
||||||
|
|
||||||
|
Index: pstoedit-3.70/src/pstoedit.cpp
|
||||||
|
===================================================================
|
||||||
|
--- pstoedit-3.70.orig/src/pstoedit.cpp
|
||||||
|
+++ pstoedit-3.70/src/pstoedit.cpp
|
||||||
|
@@ -30,6 +30,7 @@
|
||||||
|
#include I_string_h
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
+#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include "pstoeditoptions.h"
|
||||||
|
|
||||||
|
@@ -261,33 +262,33 @@ static void loadpstoeditplugins(const ch
|
||||||
|
loadPlugInDrivers(plugindir.c_str(), errstream, verbose); // load the driver plugins
|
||||||
|
pluginsloaded = true;
|
||||||
|
}
|
||||||
|
- // also look in the directory where the pstoedit .exe/dll was found
|
||||||
|
- char szExePath[1000];
|
||||||
|
- szExePath[0] = '\0';
|
||||||
|
- const unsigned long r = P_GetPathToMyself(progname, szExePath, sizeof(szExePath));
|
||||||
|
- if (verbose) errstream << "pstoedit : path to myself:" << progname << " " << r << " " << szExePath<< endl;
|
||||||
|
- char *p = 0;
|
||||||
|
- if (r && (p = strrchr(szExePath, directoryDelimiter)) != 0) {
|
||||||
|
- *p = '\0';
|
||||||
|
- if (!strequal(szExePath, plugindir.c_str())) {
|
||||||
|
- loadPlugInDrivers(szExePath, errstream,verbose);
|
||||||
|
- pluginsloaded = true;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- // now try also $exepath/../lib/pstoedit
|
||||||
|
- strcat_s(szExePath,1000,"/../lib/pstoedit");
|
||||||
|
- if (!strequal(szExePath, plugindir.c_str())) {
|
||||||
|
- loadPlugInDrivers(szExePath, errstream,verbose);
|
||||||
|
- pluginsloaded = true;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
#ifdef PSTOEDITLIBDIR
|
||||||
|
- if (!pluginsloaded) {
|
||||||
|
+ struct stat s;
|
||||||
|
+ if (!pluginsloaded &&
|
||||||
|
+ !stat(PSTOEDITLIBDIR, &s) &&
|
||||||
|
+ S_ISDIR(s.st_mode)) {
|
||||||
|
// also try to load drivers from the PSTOEDITLIBDIR
|
||||||
|
loadPlugInDrivers(PSTOEDITLIBDIR, errstream,verbose);
|
||||||
|
pluginsloaded = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
+ // If the above failed, also look in the directory where the pstoedit .exe/dll was found
|
||||||
|
+ if (!pluginsloaded) {
|
||||||
|
+ char szExePath[1000];
|
||||||
|
+ szExePath[0] = '\0';
|
||||||
|
+ const unsigned long r = P_GetPathToMyself(progname, szExePath, sizeof(szExePath));
|
||||||
|
+ if (verbose) errstream << "pstoedit : path to myself:" << progname << " " << r << " " << szExePath<< endl;
|
||||||
|
+ char *p = 0;
|
||||||
|
+ if (r && (p = strrchr(szExePath, directoryDelimiter)) != 0) {
|
||||||
|
+ *p = '\0';
|
||||||
|
+ loadPlugInDrivers(szExePath, errstream,verbose);
|
||||||
|
+ }
|
||||||
|
+ // now try also $exepath/../lib/pstoedit
|
||||||
|
+ strcat_s(szExePath,1000,"/../lib/pstoedit");
|
||||||
|
+ if (!strequal(szExePath, plugindir.c_str())) {
|
||||||
|
+ loadPlugInDrivers(szExePath, errstream,verbose);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
|
||||||
|
// delete[]plugindir;
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
Name: pstoedit
|
Name: pstoedit
|
||||||
Version: 3.71
|
Version: 3.70
|
||||||
Release: 1%{?dist}
|
Release: 10%{?dist}
|
||||||
Summary: Translates PostScript and PDF graphics into other vector formats
|
Summary: Translates PostScript and PDF graphics into other vector formats
|
||||||
|
|
||||||
Group: Applications/Productivity
|
Group: Applications/Productivity
|
||||||
@ -8,6 +8,7 @@ License: GPLv2+
|
|||||||
URL: http://www.pstoedit.net/
|
URL: http://www.pstoedit.net/
|
||||||
Source0: http://downloads.sourceforge.net/pstoedit/pstoedit-%{version}.tar.gz
|
Source0: http://downloads.sourceforge.net/pstoedit/pstoedit-%{version}.tar.gz
|
||||||
|
|
||||||
|
Patch0: pstoedit-pkglibdir.patch
|
||||||
Patch1: remove-libpng-ldflags.patch
|
Patch1: remove-libpng-ldflags.patch
|
||||||
|
|
||||||
Requires: ghostscript
|
Requires: ghostscript
|
||||||
@ -40,6 +41,7 @@ applications
|
|||||||
%setup -q
|
%setup -q
|
||||||
|
|
||||||
# correctly load plugins (#1247187)
|
# correctly load plugins (#1247187)
|
||||||
|
%patch0 -p1 -b .pkglibdir
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
|
|
||||||
dos2unix doc/*.htm doc/readme.txt
|
dos2unix doc/*.htm doc/readme.txt
|
||||||
@ -87,9 +89,6 @@ find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Apr 16 2018 Sebastian Kisela <skisela@redhat.com> - 3.71-1
|
|
||||||
- New upstream release 3.71
|
|
||||||
|
|
||||||
* Fri Apr 13 2018 Sebastian Kisela <skisela@redhat.com> - 3.70-10
|
* Fri Apr 13 2018 Sebastian Kisela <skisela@redhat.com> - 3.70-10
|
||||||
- Drop unused libpng dependency
|
- Drop unused libpng dependency
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user