[plplot/el6] Rebuild for octave 3.4.2, new .oct location Update octave cmake macro from svn to detect octave prop
Orion Poplawski
orion at fedoraproject.org
Thu Aug 18 19:29:40 UTC 2011
commit 92efcd174badf20a032ab15268431da6b13f979b
Author: Orion Poplawski <orion at cora.nwra.com>
Date: Thu Aug 18 13:29:29 2011 -0600
Rebuild for octave 3.4.2, new .oct location
Update octave cmake macro from svn to detect octave properly
plplot-octave-config-svn.patch | 194 ++++++++++++++++++++++++++++++++++++++++
plplot.spec | 10 ++-
2 files changed, 202 insertions(+), 2 deletions(-)
---
diff --git a/plplot-octave-config-svn.patch b/plplot-octave-config-svn.patch
new file mode 100644
index 0000000..ef38164
--- /dev/null
+++ b/plplot-octave-config-svn.patch
@@ -0,0 +1,194 @@
+--- plplot-5.9.7/cmake/modules/octave.cmake 2010-10-03 07:11:57.000000000 -0600
++++ plplot-trunk/cmake/modules/octave.cmake 2011-08-18 11:10:26.883039302 -0600
+@@ -1,6 +1,6 @@
+ # cmake/modules/octave.cmake
+ #
+-# Copyright (C) 2006 Alan W. Irwin
++# Copyright (C) 2006-2010 Alan W. Irwin
+ #
+ # This file is part of PLplot.
+ #
+@@ -32,6 +32,12 @@
+ set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
+ endif(ENABLE_octave AND NOT CMAKE_CXX_COMPILER_WORKS)
+
++if(ENABLE_octave AND NOT SWIG_FOUND)
++ message(STATUS "WARNING: "
++ "swig not found. Disabling Octave bindings")
++ set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
++endif(ENABLE_octave AND NOT SWIG_FOUND)
++
+ if(ENABLE_octave AND NOT BUILD_SHARED_LIBS)
+ message(STATUS "WARNING: "
+ "Octave requires shared libraries. Disabling octave bindings")
+@@ -67,17 +73,34 @@
+ endif(ENABLE_octave)
+
+ if(ENABLE_octave)
++ find_program(OCTAVE_CONFIG octave-config)
++ if(OCTAVE_CONFIG)
++ message(STATUS "OCTAVE_CONFIG = ${OCTAVE_CONFIG}")
++ else(OCTAVE_CONFIG)
++ message(STATUS "WARNING: "
++ "octave-config not found. Disabling octave bindings")
++ set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
++ endif(OCTAVE_CONFIG)
++endif(ENABLE_octave)
++
++if(ENABLE_octave)
+ #OCTAVE_VERSION is the (dotted triplet) octave version.
+ execute_process(
+- COMMAND ${OCTAVE} --version
+- OUTPUT_VARIABLE _OCTAVE_VERSION
+- )
+- string(REGEX REPLACE
+- "^.*version ([0-9]\\.[0-9]\\.[0-9]*).*$"
+- "\\1"
+- OCTAVE_VERSION
+- ${_OCTAVE_VERSION}
+- )
++ COMMAND ${OCTAVE_CONFIG} -p VERSION
++ OUTPUT_VARIABLE OCTAVE_VERSION
++ ERROR_VARIABLE OCTAVE_ERROR
++ RESULT_VARIABLE return_code
++ OUTPUT_STRIP_TRAILING_WHITESPACE
++ )
++ if(return_code)
++ message(STATUS "OCTAVE_ERROR = ${OCTAVE_ERROR}")
++ message(STATUS "WARNING: "
++ "${OCTAVE_CONFIG} -p VERSION generates an error (non-zero return code). Disabling octave bindings")
++ set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
++ endif(return_code)
++endif(ENABLE_octave)
++
++if(ENABLE_octave)
+ message(STATUS "OCTAVE_VERSION = ${OCTAVE_VERSION}")
+ # Logic that depends on octave version
+ transform_version(NUMERICAL_OCTAVE_TESTING_MINIMUM_VERSION "2.9.0")
+@@ -106,22 +129,35 @@
+ # if OCTAVE_INCLUDE_PATH is defined from the previous cmake run should be
+ # fine.
+ if(NOT DEFINED OCTAVE_INCLUDE_PATH)
++ execute_process(
++ COMMAND ${OCTAVE_CONFIG} -p OCTINCLUDEDIR
++ OUTPUT_VARIABLE OCTAVE_INCLUDE_DIR
++ OUTPUT_STRIP_TRAILING_WHITESPACE
++ )
++
+ find_path(
+ OCTAVE_INCLUDE_PATH
+ oct.h
+- PATH_SUFFIXES octave-${OCTAVE_VERSION}/octave
++ PATHS ${OCTAVE_INCLUDE_DIR}
++ PATH_SUFFIXES octave
++ )
++
++ execute_process(
++ COMMAND ${OCTAVE_CONFIG} -p OCTLIBDIR
++ OUTPUT_VARIABLE OCTAVE_LIB_DIR
++ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ find_library(
+ OCTAVE_LIBRARIES
+ octave
+- PATH_SUFFIXES octave-${OCTAVE_VERSION}
++ PATHS ${OCTAVE_LIB_DIR}
+ )
+
+ find_library(
+ OCTINTERP_LIBRARIES
+ octinterp
+- PATH_SUFFIXES octave-${OCTAVE_VERSION}
++ PATHS ${OCTAVE_LIB_DIR}
+ )
+
+ if(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES AND OCTINTERP_LIBRARIES)
+@@ -137,6 +173,29 @@
+ CACHE INTERNAL ""
+ )
+ endif(NOT OCTAVE_INCLUDE_PATH_TRIMMED STREQUAL "${OCTAVE_INCLUDE_PATH}")
++ # Octave has a huge number of dependencies and therefore an
++ # impossible-to-untangle set of header #includes that depend on
++ # other packages headers. And there is no information from
++ # mkoctfile or the octave octave_config_info command about where
++ # those header directories are located. But from experiments
++ # with both the Linux and Windows binary versions of octave, it
++ # appears that hdf5.h is one external header that is necessary,
++ # and it is never part of the octave-${OCTAVE_VERSION}/octave
++ # hierarchy so that PATH_SUFFIXES signature is dropped.
++ find_path(
++ OCTAVE_INCLUDE_PATH_EXTERNAL
++ hdf5.h
++ )
++ if(OCTAVE_INCLUDE_PATH_EXTERNAL)
++ set(OCTAVE_INCLUDE_PATH
++ ${OCTAVE_INCLUDE_PATH_EXTERNAL} ${OCTAVE_INCLUDE_PATH}
++ CACHE INTERNAL ""
++ )
++ else(OCTAVE_INCLUDE_PATH_EXTERNAL)
++ message(STATUS "WARNING: "
++ "Required external octave header, hdf5.h, not found. Disabling octave bindings")
++ set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
++ endif(OCTAVE_INCLUDE_PATH_EXTERNAL)
+ else(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES AND OCTINTERP_LIBRARIES)
+ message(STATUS "WARNING: "
+ "octave headers and/or library not found. Disabling octave bindings")
+@@ -177,6 +236,8 @@
+ OUTPUT_VARIABLE OCTAVE_PREFIX
+ )
+ #message(STATUS "OCTAVE_PREFIX = ${OCTAVE_PREFIX}")
++ file(TO_CMAKE_PATH ${OCTAVE_PREFIX} OCTAVE_PREFIX)
++ #message(STATUS "(CMake) OCTAVE_PREFIX = ${OCTAVE_PREFIX}")
+
+ # octave-2.1 (or higher) logic.
+ #_OCTAVE_M_DIR
+@@ -188,18 +249,25 @@
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ OUTPUT_VARIABLE _OCTAVE_M_DIR
+ )
++ #message(STATUS "_OCTAVE_M_DIR = ${_OCTAVE_M_DIR}")
++ file(TO_CMAKE_PATH ${_OCTAVE_M_DIR} _OCTAVE_M_DIR)
++ #message(STATUS "(CMake) _OCTAVE_M_DIR = ${_OCTAVE_M_DIR}")
++
+ #OCTAVE_OCT_DIR
+ if(NOT DEFINED OCTAVE_OCT_DIR)
+- file(WRITE ${CMAKE_BINARY_DIR}/octave_command
+- "printf(octave_config_info(\"localoctfiledir\"));"
+- )
+- execute_process(
+- COMMAND ${OCTAVE} -q -f octave_command
+- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+- OUTPUT_VARIABLE OCTAVE_OCT_DIR
+- )
++ file(WRITE ${CMAKE_BINARY_DIR}/octave_command
++ "printf(octave_config_info(\"localoctfiledir\"));"
++ )
++ execute_process(
++ COMMAND ${OCTAVE} -q -f octave_command
++ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
++ OUTPUT_VARIABLE OCTAVE_OCT_DIR
++ )
++ #message(STATUS "OCTAVE_OCT_DIR = ${OCTAVE_OCT_DIR}")
++ file(TO_CMAKE_PATH ${OCTAVE_OCT_DIR} OCTAVE_OCT_DIR)
++ #message(STATUS "(CMake) OCTAVE_OCT_DIR = ${OCTAVE_OCT_DIR}")
+ endif(NOT DEFINED OCTAVE_OCT_DIR)
+-
++
+ # Replace the OCTAVE_PREFIX with the PLplot prefix in OCTAVE_M_DIR
+ string(REPLACE
+ "${OCTAVE_PREFIX}"
+@@ -220,4 +288,13 @@
+ if(PL_DOUBLE)
+ set(DEFINE_PL_DOUBLE "#define PL_DOUBLE")
+ endif(PL_DOUBLE)
++# option(ENABLE_matwrapped_octave "Enable legacy Octave bindings generated by matwrap" OFF)
++# if(NOT SWIG_FOUND AND NOT ENABLE_matwrapped_octave)
++# message(STATUS "WARNING: "
++# "SWIG not found. Falling back to deprecated matwrapped Octave bindings.")
++# set(ENABLE_matwrapped_octave ON CACHE BOOL "Enable legacy Octave bindings generated by matwrap" FORCE)
++# endif(NOT SWIG_FOUND AND NOT ENABLE_matwrapped_octave)
++ # Force disabling of matwrapped bindings which are no longer maintained.
++ set(ENABLE_matwrapped_octave OFF CACHE BOOL "Enable legacy Octave bindings generated by matwrap" FORCE)
++
+ endif(ENABLE_octave)
diff --git a/plplot.spec b/plplot.spec
index 4ccd036..e0338a6 100644
--- a/plplot.spec
+++ b/plplot.spec
@@ -24,13 +24,14 @@
Name: plplot
Version: 5.9.7
-Release: 3%{?dist}
+Release: 3%{?dist}.1
Summary: Library of functions for making scientific plots
Group: Applications/Engineering
License: LGPLv2+
URL: http://plplot.sourceforge.net/
Source0: http://downloads.sourceforge.net/plplot/%{name}-%{version}.tar.gz
+Patch0: plplot-octave-config-svn.patch
Patch1: plplot-5.9.7-multiarch.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -321,6 +322,7 @@ Requires: pkgconfig
%prep
%setup -q
+%patch0 -p1 -b .octave-config
%patch1 -p1 -b .multiarch
# Convert to UTF-8
for file in ChangeLog NEWS
@@ -631,7 +633,7 @@ fi
%defattr(-,root,root,-)
%{_datadir}/plplot_octave/
%{_datadir}/octave/site/m/PLplot/
-%{_libexecdir}/octave/site/oct/*/plplot_octave.oct
+%{_libdir}/octave/site/oct/*/plplot_octave.oct
%{_datadir}/plplot%{version}/examples/lena.img
%{_datadir}/plplot%{version}/examples/octave/
%{_datadir}/plplot%{version}/examples/test_octave.sh
@@ -698,6 +700,10 @@ fi
%changelog
+* Tue Aug 18 2011 Orion Poplawski <orion at cora.nwra.com> - 5.9.7-3.1
+- Rebuild for octave 3.4.2, new .oct location
+- Update octave cmake macro from svn to detect octave properly
+
* Mon Dec 27 2010 Orion Poplawski <orion at cora.nwra.com> - 5.9.7-3
- Don't use %{_isa} in Requires for gcc-gfortran - not multilib in RHEL
More information about the scm-commits
mailing list