1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-12-22 14:10:48 +02:00

plplot: make lua bindings work

This commit is contained in:
David Kühling 2011-01-15 16:35:56 +01:00
parent a6e6dffb53
commit 0f9e96c3bf
3 changed files with 95 additions and 6 deletions

View File

@ -9,14 +9,15 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=plplot
PKG_VERSION:=5.9.7
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)/$(PKG_VERSION)%20Source
PKG_MD5SUM:=c53c484ed93ce8446513c31707551b5b
PKG_INSTALL:=1
PKG_FIXUP:=libtool
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:= plplot/host libtool/host libltdl/host qt4 qt4-gui
PKG_BUILD_DEPENDS:= plplot/host libtool/host libltdl/host swig/host
#@INSTALL_GFORTRAN
include $(INCLUDE_DIR)/host-build.mk
@ -137,6 +138,16 @@ $(call Package/plplot/Default/description)
This package contains the Plplot bindings for Tcl
endef
define Package/plplot-lua
$(call Package/plplot/Default)
DEPENDS:= +plplot +liblua
TITLE+= (Lua bindings)
endef
define Package/plplot-lua/description
$(call Package/plplot/Default/description)
This package contains the Plplot bindings for Lua
endef
define Package/plplot-octave
$(call Package/plplot/Default)
@ -152,6 +163,7 @@ endef
TARGET_CFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
CMAKE_FLAGS := \
-Wdev \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_TOOLCHAIN_FILE=$(PKG_BUILD_DIR)/toolchain.cmake \
-DPKG_CONFIG_EXECUTABLE=$(STAGING_DIR_HOST)/bin/pkg-config \
@ -190,6 +202,12 @@ ifdef CONFIG_PACKAGE_plplot-linuxvga
-DPLD_linuxvga=ON
endif
ifdef CONFIG_PACKAGE_plplot-lua
CMAKE_FLAGS += \
-DSWIG_EXECUTABLE=$(STAGING_DIR_HOST)/bin/swig \
-DENABLE_lua=ON
endif
ifdef CONFIG_PACKAGE_plplot-tcl
CMAKE_FLAGS += -DENABLE_tcl=ON
endif
@ -224,6 +242,7 @@ define Build/Configure
# search for programs in the build host directories
echo "SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> $(PKG_BUILD_DIR)/toolchain.cmake
echo "SET(CMAKE_PROGRAM_PATH $(STAGING_DIR_HOST)/bin)" >> $(PKG_BUILD_DIR)/toolchain.cmake
# for libraries and headers in the target directories
echo "SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> $(PKG_BUILD_DIR)/toolchain.cmake
@ -233,11 +252,8 @@ define Build/Configure
cd $(PKG_BUILD_DIR) && cmake $(CMAKE_FLAGS)
endef
# todo: remove, once stabilized
MAKE_FLAGS += -j4
define Build/Compile
$(call Build/Compile/Default, VERBOSE=1)
$(call Build/Compile/Default, VERBOSE=1 -j4)
endef
@ -310,6 +326,11 @@ define Package/plplot-linuxvga/install
$(1)/usr/lib/plplot$(PKG_VERSION)/driversd/
endef
define Package/plplot-lua/install
$(INSTALL_DIR) $(1)/usr/lib/lua
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lua/*/plplot/plplotluac.so $(1)/usr/lib/lua/
endef
define Package/plplot-tcl/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libplplottcltkd.so* \
@ -323,6 +344,11 @@ define Package/plplot-tcl/install
$(1)/usr/share/plplot$(PKG_VERSION)/tcl/
endef
define Package/plplot-tcl/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libplplottcltkd.so* \
$(1)/usr/lib/
endef
define Package/plplot-octave/install
$(INSTALL_DIR) $(1)/usr/lib
@ -346,6 +372,7 @@ $(eval $(call BuildPackage,plplot-cxx))
$(eval $(call BuildPackage,plplot-qt))
$(eval $(call BuildPackage,plplot-linuxvga))
$(eval $(call BuildPackage,plplot-tcl))
$(eval $(call BuildPackage,plplot-lua))
$(eval $(call BuildPackage,plplot-octave))

View File

@ -0,0 +1,13 @@
Index: plplot-5.9.7/cmake/modules/FindSWIG.cmake
===================================================================
--- plplot-5.9.7.orig/cmake/modules/FindSWIG.cmake 2011-01-15 16:00:41.000000000 +0100
+++ plplot-5.9.7/cmake/modules/FindSWIG.cmake 2011-01-15 16:01:09.000000000 +0100
@@ -26,7 +26,7 @@
STRING(REGEX REPLACE "[\n\r]+" ";" SWIG_swiglib_output ${SWIG_swiglib_output})
# force the path to be computed each time in case SWIG_EXECUTABLE has changed.
SET(SWIG_DIR SWIG_DIR-NOTFOUND)
- FIND_PATH(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output})
+ FIND_PATH(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output} NO_CMAKE_FIND_ROOT_PATH)
IF(SWIG_DIR)
SET(SWIG_FOUND 1)
SET(SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake)

View File

@ -0,0 +1,49 @@
Index: plplot-5.9.7/cmake/modules/lua.cmake
===================================================================
--- plplot-5.9.7.orig/cmake/modules/lua.cmake 2011-01-15 16:08:33.000000000 +0100
+++ plplot-5.9.7/cmake/modules/lua.cmake 2011-01-15 16:12:37.000000000 +0100
@@ -75,8 +75,8 @@
find_program(LUA_EXECUTABLE lua)
if(NOT LUA_EXECUTABLE)
message(STATUS "WARNING: "
- "Lua executable not found. Disabling Lua bindings")
- set(ENABLE_lua OFF CACHE BOOL "Enable Lua bindings" FORCE)
+ "Lua executable not found. But no problem.")
+ #set(ENABLE_lua OFF CACHE BOOL "Enable Lua bindings" FORCE)
endif(NOT LUA_EXECUTABLE)
endif(ENABLE_lua)
@@ -90,22 +90,22 @@
ERROR_STRIP_TRAILING_WHITESPACE
)
#message("(preliminary) LUA_VERSION = ${LUA_VERSION}")
- string(REGEX MATCH "[0-9]\\.[0-9]\\.[0-9]" LUA_VERSION "${LUA_VERSION}")
+# string(REGEX MATCH "[0-9]\\.[0-9]\\.[0-9]" LUA_VERSION "${LUA_VERSION}")
#message("(dotted triplet) LUA_VERSION = ${LUA_VERSION}")
# Reduce to just major.minor for purposes of comparison.
- string(SUBSTRING "${LUA_VERSION}" 0 3 LUA_VERSION)
- message(STATUS "LUA_VERSION = ${LUA_VERSION}")
- set(LUA_VERSION_VALID)
- if(${LUA_VERSION} STREQUAL "5.0" AND LUA50_FOUND)
- set(LUA_VERSION_VALID ON)
- elseif(${LUA_VERSION} STREQUAL "5.1" AND LUA51_FOUND)
- set(LUA_VERSION_VALID ON)
- endif(${LUA_VERSION} STREQUAL "5.0" AND LUA50_FOUND)
+# string(SUBSTRING "${LUA_VERSION}" 0 3 LUA_VERSION)
+# message(STATUS "LUA_VERSION = ${LUA_VERSION}")
+ set(LUA_VERSION_VALID ON)
+# if(${LUA_VERSION} STREQUAL "5.0" AND LUA50_FOUND)
+# set(LUA_VERSION_VALID ON)
+# elseif(${LUA_VERSION} STREQUAL "5.1" AND LUA51_FOUND)
+# set(LUA_VERSION_VALID ON)
+# endif(${LUA_VERSION} STREQUAL "5.0" AND LUA50_FOUND)
if(NOT LUA_VERSION_VALID)
message(STATUS "WARNING: "
- "Lua executable found but version not consistent with library. Disabling Lua bindings")
- set(ENABLE_lua OFF CACHE BOOL "Enable Lua bindings" FORCE)
+ "Lua executable found but version not consistent with library. Continuing anyways.")
+ # set(ENABLE_lua OFF CACHE BOOL "Enable Lua bindings" FORCE)
endif(NOT LUA_VERSION_VALID)
endif(ENABLE_lua)