[packages/plplot] - fixed itcl/itk/iwidgets detection

qboosh qboosh at pld-linux.org
Wed Apr 20 21:42:16 CEST 2016


commit d88c15d355145d617732f8880293a970ad4b1efd
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Apr 20 21:42:36 2016 +0200

    - fixed itcl/itk/iwidgets detection

 plplot-no-DISPLAY.patch | 23 +++++++++++++++++++++++
 plplot.spec             | 32 ++++++++++++++++++--------------
 2 files changed, 41 insertions(+), 14 deletions(-)
---
diff --git a/plplot.spec b/plplot.spec
index f6529b4..feb34fd 100644
--- a/plplot.spec
+++ b/plplot.spec
@@ -1,7 +1,6 @@
 # TODO:
-# - fix itk detection (import requires $DISPLAY, so use force or file presence)
+# - ada builds (on ix86 at least), enable by default?
 # - fix building with installed plplot/plplot-devel (tries to use installed drivers for dyn_test)
-# - ada build (on ix86 at least), enable by default?
 # - perl_pdl - why disabled?
 # - bindings: gnome2, tk-x-plat?
 # NOTES (see cmake/modules/drivers-init.cmake for some issue notes):
@@ -36,7 +35,7 @@ Summary:	PLplot - a library of functions that are useful for making scientific p
 Summary(pl.UTF-8):	PLplot - biblioteka funkcji przydatnych do tworzenia wykresów naukowych
 Name:		plplot
 Version:	5.11.1
-Release:	0.1
+Release:	1
 License:	LGPL v2+
 Group:		Libraries
 Source0:	http://downloads.sourceforge.net/plplot/%{name}-%{version}.tar.gz
@@ -668,28 +667,33 @@ cd build
 %else
 	-DENABLE_lua=OFF \
 %endif
+	-DENABLE_itcl=%{?with_itcl:ON}%{!?with_itcl:OFF} \
+	-DENABLE_itk=%{?with_itcl:ON}%{!?with_itcl:OFF} \
+	-DENABLE_ocaml=%{?with_ocaml:ON}%{!?with_ocaml:OFF} \
+	-DENABLE_octave=%{?with_octave:ON}%{!?with_octave:OFF} \
+	%{!?with_perl_pdl:-DENABLE_pdl=OFF} \
+	-DENABLE_tk=ON \
 	-DF95_MOD_DIR=%{_includedir}/plplot \
 	-DOCTAVE_INCLUDE_PATH=%{_includedir}/octave \
 	-DOCTAVE_OCT_DIR=%{octave_oct_sitedir} \
 	-DOCTAVE_M_DIR=%{octave_m_sitedir} \
-	-DUSE_INCRTCL_VERSION_4=ON \
-	-DUSE_RPATH=OFF \
-	-DENABLE_tk=ON \
-	-DENABLE_ocaml=%{?with_ocaml:ON}%{!?with_ocaml:OFF} \
-	-DENABLE_octave=%{?with_octave:ON}%{!?with_octave:OFF} \
-	-DENABLE_itcl=%{?with_itcl:ON}%{!?with_itcl:OFF} \
-	-DENABLE_itk=%{?with_itcl:ON}%{!?with_itcl:OFF} \
+	-DPL_FREETYPE_FONT_PATH=/usr/share/fonts/TTF \
 	%{?with_cgm:-DPLD_cgm=ON} \
 	-DPLD_ntk=ON \
 	-DPLD_pdf=ON \
 	%{?with_plmeta:-DPLD_plmeta=ON} \
 	-DPLD_pstex=ON \
-	-DPL_FREETYPE_FONT_PATH=/usr/share/fonts/TTF \
+	-DPython_ADDITIONAL_VERSIONS=2.7 \
 	-DTRY_OCTAVE4=ON \
+	-DUSE_INCRTCL_VERSION_4=ON \
+	-DUSE_RPATH=OFF \
+%if %{with itcl}
+	-DPLPLOT_ITCL_VERSION="$(rpm -q itcl --qf '%%{VERSION}')" \
+	-DPLPLOT_ITK_VERSION="$(rpm -q itk --qf '%%{VERSION}')" \
+	-DIWIDGETS_VERSIONS_LIST="$(rpm -q iwidgets --qf '%%{VERSION}');$(rpm -q itk --qf '%%{VERSION}');$(rpm -q itcl --qf '%%{VERSION}')" \
+%endif
 	-DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-gtk2-unicode-config \
-	-DwxWidgets_USE_UNICODE=ON \
-	-DPython_ADDITIONAL_VERSIONS=2.7 \
-	%{!?with_perl_pdl:-DENABLE_pdl=OFF}
+	-DwxWidgets_USE_UNICODE=ON
 
 %{__make}
 
diff --git a/plplot-no-DISPLAY.patch b/plplot-no-DISPLAY.patch
index 8143263..53c3cea 100644
--- a/plplot-no-DISPLAY.patch
+++ b/plplot-no-DISPLAY.patch
@@ -88,3 +88,26 @@
        else(NOT PLPLOT_TK_VERSION)
  	set(TK_RC 0)
        endif(NOT PLPLOT_TK_VERSION)
+@@ -318,7 +318,7 @@
+       file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl "puts -nonewline [package require Itk ${SUGGESTED_ITK_VERSION}]; exit")
+       # Refine SUGGESTED_ITK_VERSION to exact value or fail.
+       execute_process(
+-	COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl
++	COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_LIST_DIR}/CheckTclPackage_Available.tcl itk ${SUGGESTED_ITK_VERSION}
+ 	RESULT_VARIABLE ITK_RC
+ 	OUTPUT_VARIABLE _plplot_itk_version
+ 	)
+--- plplot-5.11.1/cmake/modules/CheckTclPackage_Available.tcl.orig	1970-01-01 01:00:00.000000000 +0100
++++ plplot-5.11.1/cmake/modules/CheckTclPackage_Available.tcl	2016-04-20 17:35:06.305618401 +0200
+@@ -0,0 +1,11 @@
++catch {package require bogusPackageNameToScanAvailablePackages}
++
++set packageName [lindex $argv 0]
++set packageReq [lindex $argv 1]
++set matchingVersions {}
++foreach packageVersion [package versions $packageName] {
++	if [package vsatisfies $packageVersion $packageReq] { lappend matchingVersions $packageVersion }
++}
++
++puts [lindex [lsort -command {package vcompare} -decreasing $matchingVersions] 0]
++exit
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/plplot.git/commitdiff/d88c15d355145d617732f8880293a970ad4b1efd



More information about the pld-cvs-commit mailing list