1 |
From: Ole Streicher <olebole@debian.org> |
2 |
Date: Wed, 20 Nov 2019 08:56:53 +0100 |
3 |
Subject: Change install-tree location of wxPLViewer |
4 |
|
5 |
The wxPLViewer application is only used internally by the wxwidgets |
6 |
|
7 |
This is based on commit 4e9679b22 in upstream git, |
8 |
author Alan W. Irwin <airwin@users.sourceforge.net> |
9 |
|
10 |
https://sourceforge.net/p/plplot/plplot/ci/4e9679b2266e190f66969f21392cdcf9766a58c9 |
11 |
|
12 |
Closes: #944579 |
13 |
--- |
14 |
drivers/wxwidgets_dev.cpp | 32 ++++++-------------------------- |
15 |
include/plplotP.h | 2 -- |
16 |
src/plcore.c | 5 +---- |
17 |
utils/CMakeLists.txt | 6 +++++- |
18 |
4 files changed, 12 insertions(+), 33 deletions(-) |
19 |
|
20 |
diff --git a/drivers/wxwidgets_dev.cpp b/drivers/wxwidgets_dev.cpp |
21 |
index 6351c68..43e70be 100644 |
22 |
--- a/drivers/wxwidgets_dev.cpp |
23 |
+++ b/drivers/wxwidgets_dev.cpp |
24 |
@@ -1753,32 +1753,12 @@ void wxPLDevice::SetupMemoryMap() |
25 |
header->completeFlag = 0; |
26 |
#endif // #ifdef PL_WXWIDGETS_IPC3 |
27 |
|
28 |
- //try to find the wxPLViewer executable, in the first instance just assume it |
29 |
- //is in the path. |
30 |
- //wxString exeName = wxT( "/nfs/see-fs-02_users/earpros/usr/src/plplot-plplot/build/utils/" NAME_wxPLViewer ); |
31 |
- wxString exeName = wxT( NAME_wxPLViewer ); |
32 |
- if ( plInBuildTree() ) |
33 |
- { |
34 |
- //if we are in the build tree check for the needed exe in there |
35 |
- wxArrayString files; |
36 |
- wxString utilsDir = wxString( wxT( BUILD_DIR ) ) + wxString( wxT( "/utils" ) ); |
37 |
- wxDir::GetAllFiles( utilsDir, &files, exeName, wxDIR_FILES | wxDIR_DIRS ); |
38 |
- if ( files.size() == 0 ) |
39 |
- wxDir::GetAllFiles( utilsDir, &files, exeName + wxT( ".exe" ), wxDIR_FILES | wxDIR_DIRS ); |
40 |
- if ( files.size() > 0 ) |
41 |
- exeName = files[0]; |
42 |
- } |
43 |
- else |
44 |
- { |
45 |
- //check the plplot bin install directory |
46 |
- wxArrayString files; |
47 |
- wxDir::GetAllFiles( wxT( BIN_DIR ), &files, exeName, wxDIR_FILES | wxDIR_DIRS ); |
48 |
- if ( files.size() == 0 ) |
49 |
- wxDir::GetAllFiles( wxT( BIN_DIR ), &files, exeName + wxT( ".exe" ), wxDIR_FILES | wxDIR_DIRS ); |
50 |
- if ( files.size() > 0 ) |
51 |
- exeName = files[0]; |
52 |
- } |
53 |
- //Run the wxPlViewer with command line parameters telling it the location and size of the buffer |
54 |
+ // The wxPLViewer executable has been built (build-tree case) |
55 |
+ // or installed (install-tree case) in the drivers directory. |
56 |
+ // So use the appropriate build-tree or install-tree location |
57 |
+ // when referring to it. |
58 |
+ wxString exeName = wxString( _( plGetDrvDir() ) ) + _( "/" ) + _( NAME_wxPLViewer ); |
59 |
+ //Run wxPlViewer with command line parameters telling it the location and size of the buffer |
60 |
wxString command; |
61 |
command << wxT( "\"" ) << exeName << wxT( "\" " ) << wxString( mapName, wxConvUTF8 ) << wxT( " " ) << |
62 |
mapSize << wxT( " " ) << m_width << wxT( " " ) << m_height; |
63 |
diff --git a/include/plplotP.h b/include/plplotP.h |
64 |
index 8d44e49..22a2036 100644 |
65 |
--- a/include/plplotP.h |
66 |
+++ b/include/plplotP.h |
67 |
@@ -1275,10 +1275,8 @@ plwytik( PLFLT x, PLFLT y, PLBOOL minor, PLBOOL invert ); |
68 |
|
69 |
// get drivers directory |
70 |
|
71 |
-#ifdef ENABLE_DYNDRIVERS |
72 |
PLDLLIMPEXP const char* |
73 |
plGetDrvDir( void ); |
74 |
-#endif |
75 |
|
76 |
#ifdef PL_HAVE_FREETYPE |
77 |
PLDLLIMPEXP void |
78 |
diff --git a/src/plcore.c b/src/plcore.c |
79 |
index 84b8063..f57e756 100644 |
80 |
--- a/src/plcore.c |
81 |
+++ b/src/plcore.c |
82 |
@@ -2966,7 +2966,7 @@ int plInBuildTree() |
83 |
return inBuildTree; |
84 |
} |
85 |
|
86 |
-#ifdef ENABLE_DYNDRIVERS |
87 |
+// Need this for both the ENABLE_DYNDRIVERS case and the wxPLViewer case. |
88 |
|
89 |
PLCHAR_VECTOR |
90 |
plGetDrvDir() |
91 |
@@ -2998,9 +2998,6 @@ plGetDrvDir() |
92 |
return drvdir; |
93 |
} |
94 |
|
95 |
-#endif |
96 |
- |
97 |
- |
98 |
//-------------------------------------------------------------------------- |
99 |
// void plInitDispatchTable() |
100 |
// |
101 |
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt |
102 |
index 5772910..f2a8411 100644 |
103 |
--- a/utils/CMakeLists.txt |
104 |
+++ b/utils/CMakeLists.txt |
105 |
@@ -52,7 +52,11 @@ if(ENABLE_wxwidgets AND NOT OLD_WXWIDGETS) |
106 |
) |
107 |
|
108 |
set(wxPLViewer_link_libraries PLPLOT::plplotwxwidgets PLPLOT::plplotcxx ${wxwidgets_LINK_FLAGS} ${MATH_LIB} ${RT_LIB}) |
109 |
- configure_executable_build(wxPLViewer "${wxPLViewer_SRCS}" "${wxPLViewer_link_libraries}" "${LIB_INSTALL_RPATH}" ${BIN_DIR}) |
110 |
+ |
111 |
+ # wxPLViewer depends on the plplotwxwidgets and plplotcxx libraries and is installed |
112 |
+ # in the drivers directory. |
113 |
+ set(LIB_INSTALL_RPATH ${LIB_DIR}) |
114 |
+ configure_executable_build(wxPLViewer "${wxPLViewer_SRCS}" "${wxPLViewer_link_libraries}" "${LIB_INSTALL_RPATH}" ${DRV_DIR}) |
115 |
|
116 |
# Set this property rather than using the WIN32 signature of add_executable |
117 |
# inside the configure_executable_build function. |