Date:2011-01-04 17:49:15 (13 years 2 months ago)
Author:David Kühling
Commit:fa537a3c6490e4f378771dc3a84a178a284581ba
Message:plplot: many fixes, separate packages for qt,tcl,octave,c++ interfaces Octave interface still crashes when attempting to plot via Qt :( Tcl interface is currently unusable since openwrt's Tcl package is too crippled.

Files: plplot/Makefile (5 diffs)
plplot/patches/010-fix-matwrap.patch (1 diff)
plplot/patches/020-fix-massage.patch (1 diff)
plplot/patches/030-qws-argv.patch (1 diff)

Change Details

plplot/Makefile
1616PKG_INSTALL:=1
1717PKG_FIXUP:=libtool
1818
19PKG_BUILD_DEPENDS:= plplot/host libtool/host qt4 qt4-gui
19PKG_BUILD_DEPENDS:= plplot/host libtool/host libltdl/host qt4 qt4-gui
2020#@INSTALL_GFORTRAN
2121
2222include $(INCLUDE_DIR)/host-build.mk
2323include $(INCLUDE_DIR)/package.mk
2424
25CMAKE_HOST_FLAGS=-DCMAKE_INSTALL_PREFIX=/usr \
26             -DDEFAULT_NO_DEVICES=ON \
27        -DPKG_CONFIG_EXECUTABLE=Not-Found -DDEFAULT_NO_BINDINGS=ON
28
2529## Need host-compiled plplot build dir for cmake to work for the target
2630define Host/Configure
27    mkdir $(HOST_BUILD_DIR)/build_dir
31    mkdir -p $(HOST_BUILD_DIR)/build_dir
2832    cd $(HOST_BUILD_DIR)/build_dir && \
29      cmake -DCMAKE_INSTALL_PREFIX=/usr \
30             -DDEFAULT_NO_DEVICES=ON \
31        -DPKG_CONFIG_EXECUTABLE=Not-Found -DDEFAULT_NO_BINDINGS=ON \
33      cmake $(CMAKE_HOST_FLAGS) \
3234            $(HOST_BUILD_DIR)
3335endef
3436
37define Host/Compile/Octave
38    $(MAKE) -C $(HOST_BUILD_DIR)/bindings/octave massage
39endef
40
3541define Host/Compile
36    make -C $(HOST_BUILD_DIR)/build_dir
42    $(if $(CONFIG_PACKAGE_plplot-octave),$(Host/Compile/Octave),)
43    $(MAKE) -C $(HOST_BUILD_DIR)/build_dir -j2
44endef
45
46define Host/Install/Octave
47    $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
48    $(CP) $(HOST_BUILD_DIR)/bindings/octave/massage \
49        $(STAGING_DIR_HOST)/bin/plplot-massage
3750endef
3851
3952define Host/Install
40    $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib/cmake
41    $(CP) $(HOST_BUILD_DIR)/build_dir $(STAGING_DIR_HOST)/lib/cmake/
53    $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib/$(PKG_NAME)-$(PKG_VERSION)
54    $(CP) $(HOST_BUILD_DIR)/build_dir \
55        $(STAGING_DIR_HOST)/lib/$(PKG_NAME)-$(PKG_VERSION)
56    $(if $(CONFIG_PACKAGE_plplot-octave),$(Host/Install/Octave),)
4257endef
4358
4459define Package/plplot/Default
45  SECTION:=utils
46  CATEGORY:=Utilities
60  SECTION:=libs
61  CATEGORY:=Libraries
4762
4863  TITLE:=PLplot plotting library
4964  URL:=http://plplot.sourceforge.net/
50# SUBMENU:=Plplot
65  SUBMENU:=PLplot
5166endef
5267
5368define Package/plplot/Default/description
...... 
5873
5974define Package/plplot
6075$(call Package/plplot/Default)
61  DEPENDS:=+qt4 +qt4-gui
76  DEPENDS:=+libltdl
6277  TITLE+=
6378endef
6479
6580define Package/plplot/description
6681$(call Package/plplot/Default/description)
67 This package contains the Plplot executable files
82 This package contains the Plplot library with a few file output devices.
6883endef
6984
70# define Package/plplot-data
71# $(call Package/plplot/Default)
72# TITLE=+ (function files)
73# endef
85define Package/plplot-cxx
86$(call Package/plplot/Default)
87  DEPENDS:= +plplot +libstdcpp
88  TITLE+= (C++ bindings)
89endef
7490
75# define Package/plplot-data/description
76# $(call Package/plplot/Default/description)
77# This package contains the platform-independant .m-files.
78# endef
91define Package/plplot-cxx/description
92$(call Package/plplot/Default/description)
93 This package contains the Plplot C++ bindings.
94endef
7995
80CONFIGURE_ARGS +=
81#MAKE_FLAGS += "LD=$(TARGET_CROSS)gcc -nostdlib"
96define Package/plplot-qt
97$(call Package/plplot/Default)
98  DEPENDS:= +plplot +qt4 +qt4-gui
99  TITLE+= (Qt bindings&device)
100endef
101
102define Package/plplot-qt/description
103$(call Package/plplot/Default/description)
104 This package contains the Plplot Qt visualization driver and Qt bindings.
105endef
106
107define Package/plplot-tcl
108$(call Package/plplot/Default)
109  DEPENDS:= +plplot +tcl
110  TITLE+= (Tcl bindings)
111endef
112
113define Package/plplot-tcl/description
114$(call Package/plplot/Default/description)
115 This package contains the Plplot bindings for Tcl
116endef
117
118
119define Package/plplot-octave
120$(call Package/plplot/Default)
121  DEPENDS:= +plplot +octave
122  TITLE+= (Octave bindings)
123endef
124
125define Package/plplot-octave/description
126$(call Package/plplot/Default/description)
127 This package contains the Plplot bindings for GNU Octave
128endef
129
130CMAKE_FLAGS := \
131    -DCMAKE_INSTALL_PREFIX=/usr \
132    -DCMAKE_TOOLCHAIN_FILE=$(PKG_BUILD_DIR)/toolchain.cmake \
133    -DPKG_CONFIG_EXECUTABLE=$(STAGING_DIR_HOST)/bin/pkg-config \
134    -DDEFAULT_NO_DEVICES=ON \
135    -DPLD_ps=ON \
136    -DPLD_svg=ON \
137    -DPLD_mem=ON \
138    -DPLD_null=ON \
139    -DDEFAULT_NO_BINDINGS=ON \
140    -DNaNAwareCCompiler=ON \
141    -DCMAKE_USE_NAMESPACE=ON \
142    -DCMAKE_NATIVE_BINARY_DIR=$(STAGING_DIR_HOST)/lib/$(PKG_NAME)-$(PKG_VERSION)/build_dir
143
144ifdef CONFIG_PACKAGE_plplot-cxx
145    CMAKE_FLAGS += -DENABLE_cxx=ON
146endif
147
148ifdef CONFIG_PACKAGE_plplot-qt
149    CMAKE_FLAGS += \
150        -DPLD_qtwidget=ON \
151        -DPLD_extqt=ON \
152        -DENABLE_qt=ON \
153        -DQT_QMAKE_EXECUTABLE=$(STAGING_DIR_HOST)/bin/qmake \
154        -DQT_MOC_EXECUTABLE=$(STAGING_DIR_HOST)/bin/moc \
155        -DQT_UIC_EXECUTABLE=$(STAGING_DIR_HOST)/bin/uic \
156        -DQT_RCC_EXECUTABLE=$(STAGING_DIR_HOST)/bin/rcc
157endif
158
159ifdef CONFIG_PACKAGE_plplot-tcl
160    CMAKE_FLAGS += -DENABLE_tcl=ON
161endif
162
163ifdef CONFIG_PACKAGE_plplot-octave
164    CMAKE_FLAGS += \
165        -DENABLE_octave=ON \
166        -DUSE_RPATH=ON \
167        -DMKOCTFILE=$(STAGING_DIR)/usr/bin/mkoctfile \
168        -DOCTAVE_OCT_DIR=/usr/lib/octave/site/oct/$(OPTIMIZE_FOR_CPU)-openwrt-linux-gnu \
169        -Dmassage_LOCATION=$(STAGING_DIR_HOST)/lib/$(PKG_NAME)-$(PKG_VERSION)/build_dir/bindings/octave/massage
170endif
171
172# $(if $(CONFIG_PACKAGE_libX11),FEATURE_XLOCK=y,FEATURE_XLOCK=n) \
82173
83174define Build/Configure
84175    echo "SET(CMAKE_SYSTEM_NAME Linux)" > $(PKG_BUILD_DIR)/toolchain.cmake
...... 
103194    echo "SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> $(PKG_BUILD_DIR)/toolchain.cmake
104195    echo "SET(PL_USE_NAMESPACE 1)" >> $(PKG_BUILD_DIR)/toolchain.cmake
105196
106    cd $(PKG_BUILD_DIR) && \
107      cmake -DCMAKE_INSTALL_PREFIX=/usr \
108             -DCMAKE_TOOLCHAIN_FILE=$(PKG_BUILD_DIR)/toolchain.cmake \
109        -DPKG_CONFIG_EXECUTABLE=$(STAGING_DIR_HOST)/bin/pkg-config \
110             -DDEFAULT_NO_DEVICES=ON -DPLD_ps=ON -DPLD_svg=ON \
111        -DPLD_extqt=ON \
112        -DDEFAULT_NO_BINDINGS=ON \
113        -DENABLE_cxx=ON -DNaNAwareCCompiler=ON \
114        -DQT_QMAKE_EXECUTABLE=$(STAGING_DIR_HOST)/bin/qmake \
115        -DQT_MOC_EXECUTABLE=$(STAGING_DIR_HOST)/bin/moc \
116        -DQT_UIC_EXECUTABLE=$(STAGING_DIR_HOST)/bin/uic \
117        -DQT_RCC_EXECUTABLE=$(STAGING_DIR_HOST)/bin/rcc \
118        -DENABLE_qt=ON \
119        -DCMAKE_USE_NAMESPACE=ON \
120        -DCMAKE_NATIVE_BINARY_DIR=$(STAGING_DIR_HOST)/lib/cmake/build_dir
121# -DQt4_INCLUDE_DIR=$(STAGING_DIR_ROOT)/usr/include \
122# -DQt4_LIRARY=$(STAGING_DIR_ROOT)/usr/lib/libQtGui.so \
123
197    cd $(PKG_BUILD_DIR) && cmake $(CMAKE_FLAGS)
124198endef
125199
126200define Build/Compile
127    $(call Build/Compile/Default, VERBOSE=1 -j2)
201    $(call Build/Compile/Default, VERBOSE=1)
128202endef
129203
130204define Build/Install
...... 
148222endef
149223
150224define Package/plplot/install
151    $(INSTALL_DIR) $(1)/usr
225    $(INSTALL_DIR) $(1)/usr/lib
226    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libplplotd.so* \
227        $(1)/usr/lib/
228    $(INSTALL_DIR) $(1)/usr/lib/plplot$(PKG_VERSION)/driversd
229    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/plplot$(PKG_VERSION)/driversd/{mem,null,ps,svg}.{so,rc} \
230         $(1)/usr/lib/plplot$(PKG_VERSION)/driversd/
152231    $(INSTALL_DIR) $(1)/usr/share/plplot$(PKG_VERSION)
153    $(CP) $(PKG_INSTALL_DIR)/usr/{bin,lib} \
154        $(1)/usr
155    $(CP) $(PKG_INSTALL_DIR)/usr/share/plplot$(PKG_VERSION)/*.{map,pal,fnt} \
232    $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/plplot$(PKG_VERSION)/*.{map,pal,fnt} \
233        $(1)/usr/share/plplot$(PKG_VERSION)/
234endef
235
236define Package/plplot-cxx/install
237    $(INSTALL_DIR) $(1)/usr/lib
238    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libplplotcxxd.so* \
239        $(1)/usr/lib/
240endef
241
242define Package/plplot-qt/install
243    $(INSTALL_DIR) $(1)/usr/lib
244    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libplplotqtd.so* \
245        $(1)/usr/lib/
246    $(INSTALL_DIR) $(1)/usr/lib/plplot$(PKG_VERSION)/driversd
247    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/plplot$(PKG_VERSION)/driversd/qt.{so,rc} \
248         $(1)/usr/lib/plplot$(PKG_VERSION)/driversd/
249endef
250
251define Package/plplot-tcl/install
252    $(INSTALL_DIR) $(1)/usr/lib
253    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libplplottcltkd.so* \
254        $(1)/usr/lib/
255    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libtclmatrixd.so* \
256        $(1)/usr/lib/
257    $(INSTALL_DIR) $(1)/usr/share/plplot$(PKG_VERSION)/tcl
258    $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/plplot$(PKG_VERSION)/pkgIndex.tcl \
156259        $(1)/usr/share/plplot$(PKG_VERSION)/
260    $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/plplot$(PKG_VERSION)/tcl/*\
261        $(1)/usr/share/plplot$(PKG_VERSION)/tcl/
262endef
263
264
265define Package/plplot-octave/install
266    $(INSTALL_DIR) $(1)/usr/lib
267    $(CP) $(PKG_INSTALL_DIR)/usr/lib/octave \
268        $(1)/usr/lib/
269    $(INSTALL_DIR) $(1)/usr/share
270    $(CP) $(PKG_INSTALL_DIR)/usr/share/{octave,plplot_octave} \
271        $(1)/usr/share/
157272endef
158273
159274# define Package/plplot-data/install
...... 
164279
165280$(eval $(call HostBuild))
166281$(eval $(call BuildPackage,plplot))
167#$(eval $(call BuildPackage,plplot-data))
282$(eval $(call BuildPackage,plplot-cxx))
283$(eval $(call BuildPackage,plplot-qt))
284$(eval $(call BuildPackage,plplot-tcl))
285$(eval $(call BuildPackage,plplot-octave))
168286
169287
170288# The following comments configure the Emacs editor. Just ignore them.
plplot/patches/010-fix-matwrap.patch
1Index: plplot-5.9.7/bindings/octave/matwrap/matwrap
2===================================================================
3--- plplot-5.9.7.orig/bindings/octave/matwrap/matwrap 2011-01-04 13:31:52.000000000 +0100
4@@ -21,7 +21,9 @@
5 #
6 # Parse the command line arguments:
7 #
8-@cpp_ignore_dirs = ('/usr/include/', '/usr/local/include/');
9+# double-slash prefixes occur with newer GCCs and cause this script to fail
10+# if not treated here. See also regexp fixes below.
11+@cpp_ignore_dirs = ('/usr/include/', '/usr/local/include/', '//usr/include/', '//usr/local/include/');
12                 # Directory hierarchies to ignore when the
13                 # -cpp switch is active. These should be
14                 # followed by a trailing slash to avoid
15@@ -214,8 +216,8 @@
16                 # Then it must have been included at the
17                 # top level. Add it to our list.
18     my $incstr = $fname; # Assume we include the file as is.
19- if ($incstr =~ s@^/usr/include/@@ || # Is it a system include file?
20- $incstr =~ s@^/usr/local/include/@@ ||
21+ if ($incstr =~ s@^/+usr/include/@@ || # Is it a system include file?
22+ $incstr =~ s@^/+usr/local/include/@@ ||
23         $incstr =~ s@.*/gcc-lib/.*/include/@@) { # Is it a system include
24                 # file that was fixed by gcc?
25       $include_str .= "#include <$incstr>\n"; # Use a different syntax.
26@@ -228,6 +230,8 @@
27       grep(substr($fname, 0, length($_)) eq $_, @cpp_ignore_dirs) ||
28                 # Or does it begin with the list of forbidden
29                 # directories?
30+ $fname =~ m@/gcc/@ ||
31+ $fname =~ m@rej.h@ ||
32       $fname =~ m@/gcc-lib/@) { # Somewhere in gcc fixed includes?
33     $remember_defs_in_file = 0; # We're not really interested in this file.
34       } else {
plplot/patches/020-fix-massage.patch
1Index: plplot-5.9.7/bindings/octave/CMakeLists.txt
2===================================================================
3--- plplot-5.9.7.orig/bindings/octave/CMakeLists.txt 2011-01-04 17:02:32.000000000 +0100
4@@ -222,7 +222,7 @@
5     COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/plplot_octave_def >> plplot_stub.m
6     COMMAND echo >> plplot_stub.m
7     COMMAND
8- ${massage_LOCATION} >> plplot_stub.m 2> missing_help
9+ plplot-massage >> plplot_stub.m 2> missing_help
10     DEPENDS
11     ${CMAKE_CURRENT_BINARY_DIR}/tmp_stub
12     ${CMAKE_CURRENT_SOURCE_DIR}/plplot_octave_def
plplot/patches/030-qws-argv.patch
1Index: plplot-5.9.7/drivers/qt.cpp
2===================================================================
3--- plplot-5.9.7.orig/drivers/qt.cpp 2011-01-04 17:25:22.000000000 +0100
4@@ -90,12 +90,14 @@
5     ++appCounter;
6     if ( qApp == NULL && appCounter == 1 )
7     {
8- argc = 1;
9- argv = new char*[2];
10+ argc = 2;
11+ argv = new char*[3];
12         argv[0] = new char[10];
13- argv[1] = new char[1];
14+ argv[1] = new char[10];
15+ argv[2] = new char[1];
16         snprintf( argv[0], 10, "qt_driver" );
17- argv[1][0] = '\0';
18+ snprintf( argv[1], 10, "-qws" );
19+ argv[2][0] = '\0';
20         new QApplication( argc, argv, isGUI );
21         res = true;
22     }

Archive Download the corresponding diff file



interactive