Root/plplot/Makefile

Source at commit 9ab42d31051c429967aab1cebb3170547364636e created 13 years 7 days ago.
By David K├╝hling, plplot: disable detection of pango for now, since that can break compilation
1#
2# Copyright (C) 2011 David Kuehling <dvdkhlng TA gmx TOD de>
3#
4# License GPLv2 or later. NO WARRANTY.
5#
6# OpenWRT package for the Plplot
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=plplot
11PKG_VERSION:=5.9.7
12PKG_RELEASE:=4
13PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14PKG_SOURCE_URL:=@SF/$(PKG_NAME)/$(PKG_VERSION)%20Source
15PKG_MD5SUM:=c53c484ed93ce8446513c31707551b5b
16PKG_INSTALL:=1
17PKG_FIXUP:=libtool
18PKG_BUILD_PARALLEL:=1
19
20PKG_BUILD_DEPENDS:= plplot/host libtool/host libltdl/host swig/host
21#@INSTALL_GFORTRAN
22
23include $(INCLUDE_DIR)/host-build.mk
24include $(INCLUDE_DIR)/package.mk
25
26CMAKE_HOST_FLAGS=-DCMAKE_INSTALL_PREFIX=/usr \
27             -DDEFAULT_NO_DEVICES=ON \
28        -DPKG_CONFIG_EXECUTABLE=Not-Found -DDEFAULT_NO_BINDINGS=ON
29
30## Need host-compiled plplot build dir for cmake to work for the target
31define Host/Configure
32    mkdir -p $(HOST_BUILD_DIR)/build_dir
33    cd $(HOST_BUILD_DIR)/build_dir && \
34      cmake $(CMAKE_HOST_FLAGS) \
35            $(HOST_BUILD_DIR)
36endef
37
38define Host/Compile/Octave
39    $(MAKE) -C $(HOST_BUILD_DIR)/bindings/octave massage
40endef
41
42define Host/Compile
43    $(if $(CONFIG_PACKAGE_plplot-octave),$(Host/Compile/Octave),)
44    $(MAKE) -C $(HOST_BUILD_DIR)/build_dir VERBOSE=1 -j4
45endef
46
47define Host/Install/Octave
48    $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
49    $(CP) $(HOST_BUILD_DIR)/bindings/octave/massage \
50        $(STAGING_DIR_HOST)/bin/plplot-massage
51endef
52
53define Host/Install
54    $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib/$(PKG_NAME)-$(PKG_VERSION)
55    $(CP) $(HOST_BUILD_DIR)/build_dir \
56        $(STAGING_DIR_HOST)/lib/$(PKG_NAME)-$(PKG_VERSION)
57    $(if $(CONFIG_PACKAGE_plplot-octave),$(Host/Install/Octave),)
58endef
59
60define Package/plplot/Default
61  SECTION:=libs
62  CATEGORY:=Libraries
63
64  TITLE:=PLplot plotting library
65  URL:=http://plplot.sourceforge.net/
66  SUBMENU:=PLplot
67endef
68
69define Package/plplot/Default/description
70PLplot is a cross-platform software package for creating scientific plots. It
71comes with language bindings for many interpreter languages like Lua, Tcl,
72Python. Also it can be used as plooting backend for GNU Octave.
73endef
74
75define Package/plplot
76$(call Package/plplot/Default)
77  DEPENDS:=+libltdl +zlib +libfreetype
78  TITLE+=
79endef
80
81define Package/plplot/description
82$(call Package/plplot/Default/description)
83 This package contains the Plplot library with a few file output devices.
84endef
85
86define Package/plplot-demo
87$(call Package/plplot/Default)
88  DEPENDS:= +plplot
89  TITLE+= (Example Programs)
90endef
91
92define Package/plplot-demo/description
93$(call Package/plplot/Default/description)
94 This package contains the Plplot example programs.
95endef
96
97define Package/plplot-cxx
98$(call Package/plplot/Default)
99  DEPENDS:= +plplot +libstdcpp
100  TITLE+= (C++ bindings)
101endef
102
103define Package/plplot-cxx/description
104$(call Package/plplot/Default/description)
105 This package contains the Plplot C++ bindings.
106endef
107
108define Package/plplot-qt
109$(call Package/plplot/Default)
110  DEPENDS:= +plplot +qt4 +qt4-gui
111  TITLE+= (Qt bindings&device)
112endef
113
114define Package/plplot-qt/description
115$(call Package/plplot/Default/description)
116 This package contains the Plplot Qt visualization driver and Qt bindings.
117endef
118
119define Package/plplot-linuxvga
120$(call Package/plplot/Default)
121  DEPENDS:= +plplot +svgalib
122  TITLE+= (svgalib driver)
123endef
124
125define Package/plplot-linuxvga/description
126$(call Package/plplot/Default/description)
127 This package contains the SVGAlib based visualization driver for PLplot.
128endef
129
130define Package/plplot-tcl
131$(call Package/plplot/Default)
132  DEPENDS:= +plplot +tcl
133  TITLE+= (Tcl bindings)
134endef
135
136define Package/plplot-tcl/description
137$(call Package/plplot/Default/description)
138 This package contains the Plplot bindings for Tcl
139endef
140
141define Package/plplot-lua
142$(call Package/plplot/Default)
143  DEPENDS:= +plplot +liblua
144  TITLE+= (Lua bindings)
145endef
146
147define Package/plplot-lua/description
148$(call Package/plplot/Default/description)
149 This package contains the Plplot bindings for Lua
150endef
151
152define Package/plplot-python
153$(call Package/plplot/Default)
154  DEPENDS:= +plplot +python
155  TITLE+= (!BROKEN! Python bindings)
156endef
157
158define Package/plplot-python/description
159$(call Package/plplot/Default/description)
160 This package contains the Plplot bindings for Python.
161 Note that this needs either the Pythnon-Numpy or Python-Numeric library
162 to work. Both haven\'t been ported yet, so plplot-python is
163 disfunctional!
164endef
165
166define Package/plplot-octave
167$(call Package/plplot/Default)
168  DEPENDS:= +plplot +octave
169  TITLE+= (Octave bindings)
170endef
171
172define Package/plplot-octave/description
173$(call Package/plplot/Default/description)
174 This package contains the Plplot bindings for GNU Octave
175endef
176
177TARGET_CFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
178
179CMAKE_FLAGS := \
180    -Wdev \
181    -DCMAKE_INSTALL_PREFIX=/usr \
182    -DCMAKE_TOOLCHAIN_FILE=$(PKG_BUILD_DIR)/toolchain.cmake \
183    -DPKG_CONFIG_EXECUTABLE=$(STAGING_DIR_HOST)/bin/pkg-config \
184    -DSWIG_EXECUTABLE=$(STAGING_DIR_HOST)/bin/swig \
185    -DDEFAULT_NO_DEVICES=ON \
186    -DUSE_RPATH=OFF \
187    -DPLD_ps=ON \
188    -DPLD_svg=ON \
189    -DPLD_mem=ON \
190    -DPLD_null=ON \
191    -DDEFAULT_NO_BINDINGS=ON \
192    -DNaNAwareCCompiler=ON \
193    -DCMAKE_USE_NAMESPACE=ON \
194    -DCMAKE_NATIVE_BINARY_DIR=$(STAGING_DIR_HOST)/lib/$(PKG_NAME)-$(PKG_VERSION)/build_dir
195
196# everything done under unstall target!
197ifdef CONFIG_PACKAGE_plplot-demo
198endif
199
200ifdef CONFIG_PACKAGE_plplot-cxx
201    CMAKE_FLAGS += -DENABLE_cxx=ON
202endif
203
204ifdef CONFIG_PACKAGE_plplot-qt
205    CMAKE_FLAGS += \
206        -DPLD_qtwidget=ON \
207        -DPLD_extqt=ON \
208        -DENABLE_qt=ON \
209        -DQT_QMAKE_EXECUTABLE=$(STAGING_DIR_HOST)/bin/qmake \
210        -DQT_MOC_EXECUTABLE=$(STAGING_DIR_HOST)/bin/moc \
211        -DQT_UIC_EXECUTABLE=$(STAGING_DIR_HOST)/bin/uic \
212        -DQT_RCC_EXECUTABLE=$(STAGING_DIR_HOST)/bin/rcc
213endif
214
215ifdef CONFIG_PACKAGE_plplot-linuxvga
216    CMAKE_FLAGS += \
217        -DPLD_linuxvga=ON
218endif
219
220ifdef CONFIG_PACKAGE_plplot-lua
221    CMAKE_FLAGS += -DENABLE_lua=ON
222endif
223
224ifdef CONFIG_PACKAGE_plplot-python
225    CMAKE_FLAGS += -DENABLE_python=ON
226endif
227
228ifdef CONFIG_PACKAGE_plplot-tcl
229    CMAKE_FLAGS += -DENABLE_tcl=ON
230endif
231
232ifdef CONFIG_PACKAGE_plplot-octave
233    CMAKE_FLAGS += \
234        -DENABLE_octave=ON \
235        -DMKOCTFILE=$(STAGING_DIR)/usr/bin/mkoctfile \
236        -DOCTAVE_OCT_DIR=/usr/lib/octave/site/oct/$(OPTIMIZE_FOR_CPU)-openwrt-linux-gnu \
237        -Dmassage_LOCATION=$(STAGING_DIR_HOST)/lib/$(PKG_NAME)-$(PKG_VERSION)/build_dir/bindings/octave/massage
238endif
239
240# $(if $(CONFIG_PACKAGE_libX11),FEATURE_XLOCK=y,FEATURE_XLOCK=n) \
241
242define Build/Configure
243    echo "SET(CMAKE_SYSTEM_NAME Linux)" > $(PKG_BUILD_DIR)/toolchain.cmake
244    echo "SET(CMAKE_SYSTEM_VERSION 1)" >> $(PKG_BUILD_DIR)/toolchain.cmake
245    echo "SET(CMAKE_BUILD_TYPE None)" >> $(PKG_BUILD_DIR)/toolchain.cmake
246    echo "SET(CMAKE_C_COMPILER $(TARGET_CC:ccache=))" >> $(PKG_BUILD_DIR)/toolchain.cmake
247    echo "SET(CMAKE_CXX_COMPILER $(TARGET_CC:ccache=))" >> $(PKG_BUILD_DIR)/toolchain.cmake
248    echo "SET(CMAKE_C_FLAGS \"$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS) $(TARGET_CFLAGS) $(EXTRA_CFLAGS)\" CACHE STRING \"\" FORCE)" >> $(PKG_BUILD_DIR)/toolchain.cmake
249    echo "SET(CMAKE_CXX_FLAGS \"$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS) $(TARGET_CFLAGS) $(EXTRA_CFLAGS)\" CACHE STRING \"\" FORCE)" >> $(PKG_BUILD_DIR)/toolchain.cmake
250    echo "SET(CMAKE_VERBOSE_MAKEFILE ON)" >> $(PKG_BUILD_DIR)/toolchain.cmake
251
252        # where is the target environment
253    echo "SET(CMAKE_FIND_ROOT_PATH $(STAGING_DIR))" >> $(PKG_BUILD_DIR)/toolchain.cmake
254# echo "SET(CMAKE_PREFIX_PATH /usr)" >> $(PKG_BUILD_DIR)/toolchain.cmake
255    echo "SET(CMAKE_LIBRARY_PATH $(STAGING_DIR)/usr/lib $(STAGING_DIR)/lib $(STAGING_DIR_ROOT)/lib)" >> $(PKG_BUILD_DIR)/toolchain.cmake
256    echo "SET(CMAKE_SKIP_BUILD_RPATH ON)" >> $(PKG_BUILD_DIR)/toolchain.cmake
257# echo "SET(CMAKE_INSTALL_RPATH /usr/lib;/lib)" >> $(PKG_BUILD_DIR)/toolchain.cmake
258
259    echo "SET(CMAKE_INCLUDE_PATH /usr/include)" >> $(PKG_BUILD_DIR)/toolchain.cmake
260    echo "SET(CMAKE_SYSTEM_INCLUDE_PATH /include)" >> $(PKG_BUILD_DIR)/toolchain.cmake
261        # search for programs in the build host directories
262    echo "SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> $(PKG_BUILD_DIR)/toolchain.cmake
263    echo "SET(CMAKE_PROGRAM_PATH $(STAGING_DIR_HOST)/bin $(STAGING_DIR)/usr/bin)" >> $(PKG_BUILD_DIR)/toolchain.cmake
264
265        # for libraries and headers in the target directories
266    echo "SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> $(PKG_BUILD_DIR)/toolchain.cmake
267    echo "SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> $(PKG_BUILD_DIR)/toolchain.cmake
268    echo "SET(PL_USE_NAMESPACE 1)" >> $(PKG_BUILD_DIR)/toolchain.cmake
269
270    cd $(PKG_BUILD_DIR) && cmake $(CMAKE_FLAGS)
271endef
272
273define Build/Compile
274    $(call Build/Compile/Default, VERBOSE=1 -j4)
275endef
276
277
278define Build/Install
279    $(call Build/Install/Default)
280# $(INSTALL_DATA) ./files/... $(PKG_INSTALL_DIR)/usr/share/plplot/
281endef
282
283define Build/InstallDev
284    $(INSTALL_DIR) $(1)/usr/include/plplot
285    $(CP) $(PKG_INSTALL_DIR)/usr/include/plplot/*.h \
286        $(1)/usr/include/plplot/
287
288    $(INSTALL_DIR) $(1)/usr/lib
289    $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
290    $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* \
291        $(1)/usr/lib/
292    $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
293        $(1)/usr/lib/pkgconfig/
294# $(SED) 's,-I$$$${includedir},,g' $(1)/usr/lib/pkgconfig/plplotd.pc
295# $(SED) 's,-L$$$${libdir},,g' $(1)/usr/lib/pkgconfig/plplotd.pc
296endef
297
298define Package/plplot/install
299    $(INSTALL_DIR) $(1)/usr/lib
300    $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{plplotd,csirocsa,qsastime}.so* \
301        $(1)/usr/lib/
302    $(INSTALL_DIR) $(1)/usr/lib/plplot$(PKG_VERSION)/driversd
303    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/plplot$(PKG_VERSION)/driversd/{mem,null,ps,svg}.{so,rc} \
304         $(1)/usr/lib/plplot$(PKG_VERSION)/driversd/
305    $(INSTALL_DIR) $(1)/usr/share/plplot$(PKG_VERSION)
306    $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/plplot$(PKG_VERSION)/*.{map,pal,fnt} \
307        $(1)/usr/share/plplot$(PKG_VERSION)/
308endef
309
310# ugly, but necessary: compiling demo-programs on install, using the just
311# installed libs.
312define Package/plplot-demo/install
313    $(SED) 's;/usr/lib/pkgconfig;$(STAGING_DIR)/usr/lib/pkgconfig;g' \
314        $(PKG_INSTALL_DIR)/usr/share/plplot$(PKG_VERSION)/examples/c/Makefile
315    $(MAKE) -C $(PKG_INSTALL_DIR)/usr/share/plplot$(PKG_VERSION)/examples/c/ \
316         C_INCLUDE_PATH=$(STAGING_DIR)/usr/include/plplot \
317         CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CFLAGS) $(TARGET_LDFLAGS)"\
318        RPATHCMD=
319
320    $(INSTALL_DIR) $(1)/usr/bin
321    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/plplot$(PKG_VERSION)/examples/c/x??c \
322        $(1)/usr/bin/
323endef
324
325define Package/plplot-cxx/install
326    $(INSTALL_DIR) $(1)/usr/lib
327    $(CP) $(PKG_INSTALL_DIR)/usr/lib/libplplotcxxd.so* \
328        $(1)/usr/lib/
329endef
330
331define Package/plplot-qt/install
332    $(INSTALL_DIR) $(1)/usr/lib
333    $(CP) $(PKG_INSTALL_DIR)/usr/lib/libplplotqtd.so* \
334        $(1)/usr/lib/
335    $(INSTALL_DIR) $(1)/usr/lib/plplot$(PKG_VERSION)/driversd
336    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/plplot$(PKG_VERSION)/driversd/qt.{so,rc} \
337         $(1)/usr/lib/plplot$(PKG_VERSION)/driversd/
338endef
339
340define Package/plplot-linuxvga/install
341    $(INSTALL_DIR) $(1)/usr/lib
342    $(INSTALL_DIR) $(1)/usr/lib/plplot$(PKG_VERSION)/driversd
343    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/plplot$(PKG_VERSION)/driversd/linuxvga.{so,rc} \
344         $(1)/usr/lib/plplot$(PKG_VERSION)/driversd/
345endef
346
347define Package/plplot-tcl/install
348    $(INSTALL_DIR) $(1)/usr/lib
349    $(CP) $(PKG_INSTALL_DIR)/usr/lib/libplplottcltkd.so* \
350        $(1)/usr/lib/
351    $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtclmatrixd.so* \
352        $(1)/usr/lib/
353    $(INSTALL_DIR) $(1)/usr/share/plplot$(PKG_VERSION)/tcl
354    $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/plplot$(PKG_VERSION)/pkgIndex.tcl \
355        $(1)/usr/share/plplot$(PKG_VERSION)/
356    $(CP) $(PKG_INSTALL_DIR)/usr/share/plplot$(PKG_VERSION)/tcl/*\
357        $(1)/usr/share/plplot$(PKG_VERSION)/tcl/
358endef
359
360define Package/plplot-lua/install
361    $(INSTALL_DIR) $(1)/usr/lib/lua
362    $(CP) $(PKG_INSTALL_DIR)/usr/lib/lua/*/plplot/plplotluac.so $(1)/usr/lib/lua/
363endef
364
365define Package/plplot-python/install
366    $(INSTALL_DIR) $(1)/usr/lib/python
367    $(CP) $(PKG_INSTALL_DIR)/usr/lib/python/*/plplot/*.so* $(1)/usr/lib/python/
368endef
369
370define Package/plplot-octave/install
371    $(INSTALL_DIR) $(1)/usr/lib
372    $(CP) $(PKG_INSTALL_DIR)/usr/lib/octave \
373        $(1)/usr/lib/
374    $(INSTALL_DIR) $(1)/usr/share
375    $(CP) $(PKG_INSTALL_DIR)/usr/share/{octave,plplot_octave} \
376        $(1)/usr/share/
377endef
378
379# define Package/plplot-data/install
380# $(INSTALL_DIR) $(1)/
381# (cd $(PKG_INSTALL_DIR)/ && tar -cf - usr/share) \
382# | (cd $(1)/ && tar -xvf -)
383# endef
384
385$(eval $(call HostBuild))
386$(eval $(call BuildPackage,plplot))
387$(eval $(call BuildPackage,plplot-demo))
388$(eval $(call BuildPackage,plplot-cxx))
389$(eval $(call BuildPackage,plplot-qt))
390$(eval $(call BuildPackage,plplot-linuxvga))
391$(eval $(call BuildPackage,plplot-tcl))
392$(eval $(call BuildPackage,plplot-lua))
393$(eval $(call BuildPackage,plplot-python))
394$(eval $(call BuildPackage,plplot-octave))
395
396
397# The following comments configure the Emacs editor. Just ignore them.
398# Local Variables:
399# compile-command: "make -C ~/h/src/qi/openwrt-xburst package/plplot/compile -j2 V=99"
400# End:
401

Archive Download this file



interactive