diff -Nru ruby-pgplot-0.1.9/debian/changelog ruby-pgplot-0.2.0/debian/changelog --- ruby-pgplot-0.1.9/debian/changelog 2020-02-27 21:29:14.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/changelog 2020-02-26 07:20:42.000000000 +0000 @@ -1,30 +1,20 @@ -ruby-pgplot (0.1.9-3build4) focal; urgency=medium +ruby-pgplot (0.2.0-1) unstable; urgency=medium - [ Rafael David Tinoco ] - * Sponsoring ruby2.7 transitions + [ Utkarsh Gupta ] + * Add salsa-ci.yml + * Update d/ch - [ Lucas Kanashiro ] - * No-change rebuild for ruby2.7 - - -- Rafael David Tinoco Thu, 27 Feb 2020 21:29:14 +0000 - -ruby-pgplot (0.1.9-3build3) cosmic; urgency=medium - - * No-change rebuild for libgfortran soname change. - - -- Matthias Klose Tue, 17 Jul 2018 12:27:24 +0000 - -ruby-pgplot (0.1.9-3build2) bionic; urgency=high - - * No change rebuild against ruby-defaults without ruby2.3. - - -- Dimitri John Ledkov Thu, 01 Mar 2018 12:30:25 +0000 - -ruby-pgplot (0.1.9-3build1) bionic; urgency=medium - - * No-change rebuild for ruby2.5 update. + [ Youhei SASAKI ] + * New upstream version 0.2.0 + * d/changelog: remove trailing-whitespace + * Drop obsolete patches + * d/{control,compat}: use debhelper-compat + * Add d/control: Add Rules-Requires-Root + * d/control: Update Vcs-{Git,Browser}. use salsa + * d/control: Bump Standard Version 4.5.0 + * d/copyright: fix insecure-copyright-format-uri - -- Matthias Klose Thu, 01 Feb 2018 19:14:17 +0000 + -- Youhei SASAKI Wed, 26 Feb 2020 16:20:42 +0900 ruby-pgplot (0.1.9-3) unstable; urgency=medium @@ -51,7 +41,7 @@ ruby-pgplot (0.1.9-1.1) unstable; urgency=medium * Non-maintainer upload. - * Build main and -dbg packages on same set of arches (fixes + * Build main and -dbg packages on same set of arches (fixes non-x86 FTBFS) -- Wookey Mon, 26 Oct 2015 21:27:37 +0000 @@ -83,7 +73,7 @@ * Bump standards version to 3.9.5 * Update gem2deb depends to 0.6.1~ [ Cédric Boutillier ] - * remove obsolete DM-Upload-Allowed flag + * remove obsolete DM-Upload-Allowed flag * use DEP5 copyright-format/1.0 official URL for Format field -- Praveen Arimbrathodiyil Thu, 02 Jan 2014 21:12:44 +0530 diff -Nru ruby-pgplot-0.1.9/debian/compat ruby-pgplot-0.2.0/debian/compat --- ruby-pgplot-0.1.9/debian/compat 2016-03-06 12:58:24.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru ruby-pgplot-0.1.9/debian/control ruby-pgplot-0.2.0/debian/control --- ruby-pgplot-0.1.9/debian/control 2018-03-01 12:30:25.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/control 2020-02-26 07:20:42.000000000 +0000 @@ -1,10 +1,9 @@ Source: ruby-pgplot Section: contrib/ruby Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Youhei SASAKI +Maintainer: Youhei SASAKI Uploaders: Debian Ruby Extras Maintainers -Build-Depends: debhelper (>= 9~), +Build-Depends: debhelper-compat (= 12), gem2deb ( >= 0.6.1~), gfortran, libpng-dev, @@ -14,11 +13,12 @@ ruby, ruby-all-dev, ruby-narray -Standards-Version: 3.9.7 +Standards-Version: 4.5.0 Homepage: http://pgplot.rubyforge.org/ XS-Ruby-Versions: all -Vcs-Git: https://anonscm.debian.org/git/pkg-ruby-extras/ruby-pgplot.git -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-ruby-extras/ruby-pgplot.git +Vcs-Git: https://salsa.debian.org/ruby-team/ruby-pgplot.git +Vcs-Browser: https://salsa.debian.org/ruby-team/ruby-pgplot +Rules-Requires-Root: no Package: ruby-pgplot Architecture: any diff -Nru ruby-pgplot-0.1.9/debian/copyright ruby-pgplot-0.2.0/debian/copyright --- ruby-pgplot-0.1.9/debian/copyright 2016-03-06 12:58:24.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/copyright 2020-02-26 07:20:42.000000000 +0000 @@ -1,6 +1,8 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ruby-pgplot Source: http://pgplot.rubyforge.org/ +Comment: This software is Ruby interface to the PGPLOT graphics library, + and the PGPLOT is non-free software. Files: * Copyright: 2006 Masahiro TANAKA diff -Nru ruby-pgplot-0.1.9/debian/patches/0000-Update-NArray-PATH.patch ruby-pgplot-0.2.0/debian/patches/0000-Update-NArray-PATH.patch --- ruby-pgplot-0.1.9/debian/patches/0000-Update-NArray-PATH.patch 2016-03-06 12:59:13.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/patches/0000-Update-NArray-PATH.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -From: Youhei SASAKI -Date: Sun, 6 Mar 2016 21:59:11 +0900 -Subject: Update-NArray-PATH - ---- - ext/extconf.rb | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/ext/extconf.rb b/ext/extconf.rb -index f576b30..e31d94b 100644 ---- a/ext/extconf.rb -+++ b/ext/extconf.rb -@@ -56,8 +56,9 @@ if narray_h_dir = - find_dir_in_gemspec || - find_dir_w_file("../"+narray_d,narray_h) || - find_dir_w_file(gems_dir+narray_d,narray_h) || -+ find_dir_w_file(CONFIG['vendorarchdir'],narray_h) || - find_dir_w_file(CONFIG['sitearchdir'],narray_h) || -- find_dir_w_file(CONFIG['archdir'],narray_h) -+ find_dir_w_file(CONFIG['archdir'],narray_h) - $CPPFLAGS = " -I#{narray_h_dir} " + $CPPFLAGS - end - exit unless have_header("narray.h") diff -Nru ruby-pgplot-0.1.9/debian/patches/0001-Add-enable-autobuild-option.patch ruby-pgplot-0.2.0/debian/patches/0001-Add-enable-autobuild-option.patch --- ruby-pgplot-0.1.9/debian/patches/0001-Add-enable-autobuild-option.patch 2016-03-06 12:59:13.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/patches/0001-Add-enable-autobuild-option.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -From: David MacMahon -Date: Sat, 2 Mar 2013 11:06:42 -0800 -Subject: Add --enable-autobuild option - -This enables the automatic download and build of the pgplot library only if the -user provides the --enable-autobuild option. This is more security conscious -as it requires the user's explicit permission (by providing --enable-autobuild) -to download and install this third party library. ---- - ext/extconf-auto.rb | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/ext/extconf-auto.rb b/ext/extconf-auto.rb -index 64020d1..5891862 100644 ---- a/ext/extconf-auto.rb -+++ b/ext/extconf-auto.rb -@@ -14,7 +14,24 @@ - - load "./extconf.rb" - -+# Exit if user did not specify "--enable-autobuild" -+if !enable_config('autobuild', false) -+ # Print reminder about --enable-autobuild option if pgplot was not found -+ if !$have_pgplot -+ puts -+ puts "The PGPLOT library was not found. To auto-build it as part of" -+ puts "installing Ruby/PGLOT, pass the --enable-autobuild option." -+ puts -+ puts "Examples:" -+ puts -+ puts " Gem install: gem install pgplot -- --enable-autobuild" -+ puts "Manual install: ruby extconf.rb --enable-autobuild" -+ end -+ exit -+end -+# Exit if pgplot library was found - exit if $have_pgplot -+# Exit unless a fortran compiler was found - exit unless %w[gfortran g77].any?{|cmd| system("which #{cmd}")} - - puts "enabling auto-build PGPLOT Library..." diff -Nru ruby-pgplot-0.1.9/debian/patches/0002-Add-disable-extra-libs-option.patch ruby-pgplot-0.2.0/debian/patches/0002-Add-disable-extra-libs-option.patch --- ruby-pgplot-0.1.9/debian/patches/0002-Add-disable-extra-libs-option.patch 2016-03-06 12:59:13.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/patches/0002-Add-disable-extra-libs-option.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ -From: David MacMahon -Date: Sat, 2 Mar 2013 11:31:48 -0800 -Subject: Add --disable-extra-libs option - -Some PGPLOT installations have incompletely linked PGPLOT libraries so linking -against libcpgplot requires also linking against other libraries such as -libpgplot, libX11, libpng, etc. These extra checks are mostly benign for -PGPLOT installations that don't need them, but they can cause problems. -For example, mkmf uses "gcc" when checking for the Fortran libraries, but the -resulting Makefile uses "cc" when linking. If "cc" uses a different library -path than "gcc", it is possible for the check to succeed but the link to fail. -This might have been due to a weird combination of factors in my system -(e.g. custom Ruby build using gcc installed via MacPorts and MacOS's cc), but -if it happened to me it could happen to others. Adding the --disable-extra-lib -option provides a solution for this case. ---- - ext/extconf.rb | 100 +++++++++++++++++++++++++++++++-------------------------- - 1 file changed, 55 insertions(+), 45 deletions(-) - -diff --git a/ext/extconf.rb b/ext/extconf.rb -index e31d94b..d091c5d 100644 ---- a/ext/extconf.rb -+++ b/ext/extconf.rb -@@ -15,11 +15,18 @@ require "mkmf" - - #$DEBUG = true - -+# Allow user to pass --disable-extra-libs to prevent checking for some libs. -+# Some PGPLOT installations need these extra checks and the extra checks are -+# mostly benign for PGPLOT installations that don't need them so the extra -+# checks are enabled by default. The extra checks can cause problems on some -+# installations where they are not necessary. -+check_extra_libs = enable_config('extra-libs', true) -+ - # configure options: - # --with-x11-dir=path - # --with-x11-include=path - # --with-x11-lib=path --dir_config("x11") -+dir_config("x11") if check_extra_libs - - # configure options: - # --with-pgplot-dir=path -@@ -68,56 +75,59 @@ if RUBY_PLATFORM =~ /cygwin|mingw/ - exit unless have_library("narray","na_make_object") - end - --# Check FORTRAN Libraries --# --# SUN WorkShop FORTRAN 77 compiler ver5.0 --# configure options: --with-sunws --if with_config("sunws") -- $libs = "-lM77 -lsunmath "+$libs -- exit unless find_library("F77", "f77_init", "/opt/SUNWspro/lib") -- $defs.push "-DSPARC_FORTRAN" --# --# GNU FORTRAN v4 --elsif have_library("gfortran") -- $CFLAGS = "-Wall "+$CFLAGS -- $defs.push "-DGNU_FORTRAN" --# --# GNU FORTRAN v3 --elsif have_library("g77") -- $CFLAGS = "-Wall "+$CFLAGS -- $defs.push "-DGNU_FORTRAN" --else -- puts "failed" -- exit --end -+if check_extra_libs -+ # Check FORTRAN Libraries -+ # -+ # SUN WorkShop FORTRAN 77 compiler ver5.0 -+ # configure options: --with-sunws -+ if with_config("sunws") -+ $libs = "-lM77 -lsunmath "+$libs -+ exit unless find_library("F77", "f77_init", "/opt/SUNWspro/lib") -+ $defs.push "-DSPARC_FORTRAN" -+ # -+ # GNU FORTRAN v4 -+ elsif have_library("gfortran") -+ $CFLAGS = "-Wall "+$CFLAGS -+ $defs.push "-DGNU_FORTRAN" -+ # -+ # GNU FORTRAN v3 -+ elsif have_library("g77") -+ $CFLAGS = "-Wall "+$CFLAGS -+ $defs.push "-DGNU_FORTRAN" -+ else -+ puts "failed" -+ exit -+ end - --# Check GrWin Library (for cygwin (and mingw32?)) --# configure options: --with-grwin --if with_config("grwin") -- #$LDFLAGS = "-Wl,--subsystem,console "+$LDFLAGS -- if RUBY_PLATFORM =~ /cygwin|mingw/ -- $libs += " -mwindows" -+ # Check GrWin Library (for cygwin (and mingw32?)) -+ # configure options: --with-grwin -+ if with_config("grwin") -+ #$LDFLAGS = "-Wl,--subsystem,console "+$LDFLAGS -+ if RUBY_PLATFORM =~ /cygwin|mingw/ -+ $libs += " -mwindows" -+ end -+ exit unless have_library("GrWin", "GWinit") - end -- exit unless have_library("GrWin", "GWinit") --end - --$found_lib = [] -+ $found_lib = [] - --# Check X11 Library --if have_library("X11", "XOpenDisplay") -- $found_lib << 'X11' --end -+ # Check X11 Library -+ if have_library("X11", "XOpenDisplay") -+ $found_lib << 'X11' -+ end - --# Check PNG Library --libs_save = $libs --$libs = append_library($libs, "z") --if have_library("png","png_create_write_struct") -- $found_lib << 'png' --else -- $libs = libs_save --end -+ # Check PNG Library -+ libs_save = $libs -+ $libs = append_library($libs, "z") -+ if have_library("png","png_create_write_struct") -+ $found_lib << 'png' -+ else -+ $libs = libs_save -+ end -+ -+ $libs = append_library($libs, "pgplot") -+end # check_extra_libs - --$libs = append_library($libs, "pgplot") - $have_pgplot = false - - # Check PGPLOT Header diff -Nru ruby-pgplot-0.1.9/debian/patches/0003-Close-files-in-cogen.rb.patch ruby-pgplot-0.2.0/debian/patches/0003-Close-files-in-cogen.rb.patch --- ruby-pgplot-0.1.9/debian/patches/0003-Close-files-in-cogen.rb.patch 2016-03-06 12:59:13.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/patches/0003-Close-files-in-cogen.rb.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From: David MacMahon -Date: Sun, 3 Mar 2013 11:03:03 -0800 -Subject: Close files in cogen.rb - -This is important for running cogen.rb from within Rakefile. Without -explicitly closing the output file, a truncated version of rb_pgplot.c -may be packaged in the gem file before the rb_pgplot.c file gets closed -when the rake process exits. ---- - ext/cogen.rb | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/ext/cogen.rb b/ext/cogen.rb -index aabbae4..d5cebdc 100644 ---- a/ext/cogen.rb -+++ b/ext/cogen.rb -@@ -153,6 +153,8 @@ def cogen_pgplot - fout.print - end - end -+ fout.close -+ fin.close - end - - cogen_pgplot if $0 == __FILE__ diff -Nru ruby-pgplot-0.1.9/debian/patches/0004-Be-smart-about-extra-library-checks.patch ruby-pgplot-0.2.0/debian/patches/0004-Be-smart-about-extra-library-checks.patch --- ruby-pgplot-0.1.9/debian/patches/0004-Be-smart-about-extra-library-checks.patch 2016-03-06 12:59:13.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/patches/0004-Be-smart-about-extra-library-checks.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,171 +0,0 @@ -From: David MacMahon -Date: Sun, 3 Mar 2013 11:04:45 -0800 -Subject: Be smart about extra library checks - -Try to find libcpgplot before looking for extra libs like x11, gfortran, -png, etc. If the initial check for libcpgplot fails, then look for the -extra libraries and re-check for libcpgplot. This removes the need for -the --enable-extra-libs option. ---- - ext/extconf.rb | 132 ++++++++++++++++++++++++++++----------------------------- - 1 file changed, 66 insertions(+), 66 deletions(-) - -diff --git a/ext/extconf.rb b/ext/extconf.rb -index d091c5d..48d1c1b 100644 ---- a/ext/extconf.rb -+++ b/ext/extconf.rb -@@ -15,19 +15,6 @@ require "mkmf" - - #$DEBUG = true - --# Allow user to pass --disable-extra-libs to prevent checking for some libs. --# Some PGPLOT installations need these extra checks and the extra checks are --# mostly benign for PGPLOT installations that don't need them so the extra --# checks are enabled by default. The extra checks can cause problems on some --# installations where they are not necessary. --check_extra_libs = enable_config('extra-libs', true) -- --# configure options: --# --with-x11-dir=path --# --with-x11-include=path --# --with-x11-lib=path --dir_config("x11") if check_extra_libs -- - # configure options: - # --with-pgplot-dir=path - # --with-pgplot-include=path -@@ -75,68 +62,81 @@ if RUBY_PLATFORM =~ /cygwin|mingw/ - exit unless have_library("narray","na_make_object") - end - --if check_extra_libs -- # Check FORTRAN Libraries -- # -- # SUN WorkShop FORTRAN 77 compiler ver5.0 -- # configure options: --with-sunws -- if with_config("sunws") -- $libs = "-lM77 -lsunmath "+$libs -- exit unless find_library("F77", "f77_init", "/opt/SUNWspro/lib") -- $defs.push "-DSPARC_FORTRAN" -- # -- # GNU FORTRAN v4 -- elsif have_library("gfortran") -- $CFLAGS = "-Wall "+$CFLAGS -- $defs.push "-DGNU_FORTRAN" -- # -- # GNU FORTRAN v3 -- elsif have_library("g77") -- $CFLAGS = "-Wall "+$CFLAGS -- $defs.push "-DGNU_FORTRAN" -- else -- puts "failed" -- exit -- end -+$have_pgplot = false -+ -+# Check PGPLOT Header -+if have_header("cpgplot.h") - -- # Check GrWin Library (for cygwin (and mingw32?)) -- # configure options: --with-grwin -- if with_config("grwin") -- #$LDFLAGS = "-Wl,--subsystem,console "+$LDFLAGS -- if RUBY_PLATFORM =~ /cygwin|mingw/ -- $libs += " -mwindows" -+ # Check PGPLOT Library without extra libs -+ if find_library("cpgplot","cpgbeg", "/usr/lib", -+ "/usr/local/lib", "/usr/local/pgplot" ) -+ $have_pgplot = true -+ else -+ # Check for extra libs then re-check for PGPLOT library -+ puts "First check for PGPLOT library failed," -+ puts "checking for auxiliary libraries and retrying." -+ -+ # Check FORTRAN Libraries -+ # -+ # SUN WorkShop FORTRAN 77 compiler ver5.0 -+ # configure options: --with-sunws -+ if with_config("sunws") -+ $libs = "-lM77 -lsunmath "+$libs -+ exit unless find_library("F77", "f77_init", "/opt/SUNWspro/lib") -+ $defs.push "-DSPARC_FORTRAN" -+ # -+ # GNU FORTRAN v4 -+ elsif have_library("gfortran") -+ $CFLAGS = "-Wall "+$CFLAGS -+ $defs.push "-DGNU_FORTRAN" -+ # -+ # GNU FORTRAN v3 -+ elsif have_library("g77") -+ $CFLAGS = "-Wall "+$CFLAGS -+ $defs.push "-DGNU_FORTRAN" -+ else -+ puts "failed" -+ exit - end -- exit unless have_library("GrWin", "GWinit") -- end - -- $found_lib = [] -+ # Check GrWin Library (for cygwin (and mingw32?)) -+ # configure options: --with-grwin -+ if with_config("grwin") -+ #$LDFLAGS = "-Wl,--subsystem,console "+$LDFLAGS -+ if RUBY_PLATFORM =~ /cygwin|mingw/ -+ $libs += " -mwindows" -+ end -+ exit unless have_library("GrWin", "GWinit") -+ end - -- # Check X11 Library -- if have_library("X11", "XOpenDisplay") -- $found_lib << 'X11' -- end -+ $found_lib = [] - -- # Check PNG Library -- libs_save = $libs -- $libs = append_library($libs, "z") -- if have_library("png","png_create_write_struct") -- $found_lib << 'png' -- else -- $libs = libs_save -- end -+ # configure options: -+ # --with-x11-dir=path -+ # --with-x11-include=path -+ # --with-x11-lib=path -+ dir_config("x11") - -- $libs = append_library($libs, "pgplot") --end # check_extra_libs -+ # Check X11 Library -+ if have_library("X11", "XOpenDisplay") -+ $found_lib << 'X11' -+ end - --$have_pgplot = false -+ # Check PNG Library -+ libs_save = $libs -+ $libs = append_library($libs, "z") -+ if have_library("png","png_create_write_struct") -+ $found_lib << 'png' -+ else -+ $libs = libs_save -+ end - --# Check PGPLOT Header --if have_header("cpgplot.h") -+ $libs = append_library($libs, "pgplot") - -- # Check PGPLOT Library -- if find_library("cpgplot","cpgbeg", "/usr/lib", -- "/usr/local/lib", "/usr/local/pgplot" ) -- $have_pgplot = true -+ if find_library("cpgplot","cpgbeg", "/usr/lib", -+ "/usr/local/lib", "/usr/local/pgplot" ) -+ $have_pgplot = true -+ end - end - end - diff -Nru ruby-pgplot-0.1.9/debian/patches/0005-extconf.rb.patch ruby-pgplot-0.2.0/debian/patches/0005-extconf.rb.patch --- ruby-pgplot-0.1.9/debian/patches/0005-extconf.rb.patch 2016-03-06 12:59:13.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/patches/0005-extconf.rb.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,324 +0,0 @@ -From: Masahiro TANAKA -Date: Tue, 5 Mar 2013 18:46:58 +0900 -Subject: extconf.rb: * need to check extra-libs before auto-build. * need to - define $found_lib. * define methods to make program structure clear. * merge - extconf-auto.rb. - ---- - ext/extconf.rb | 280 +++++++++++++++++++++++++++++++++++---------------------- - 1 file changed, 171 insertions(+), 109 deletions(-) - -diff --git a/ext/extconf.rb b/ext/extconf.rb -index 48d1c1b..02a1672 100644 ---- a/ext/extconf.rb -+++ b/ext/extconf.rb -@@ -1,30 +1,67 @@ --# extconf.rb : Configure script for Ruby/PGPLOT --# --# Copyright (c) 2000,2001 Masahiro TANAKA --# --# This program is free software. --# You can distribute/modify this program --# under the same terms as Ruby itself. --# NO WARRANTY. --# --# usage: ruby extconf.rb [configure options] -- --# Narray is now Gem based, so require rubygems --# so that we can use Gem class to find narray. - require "mkmf" - --#$DEBUG = true -+def main -+ extconf_start -+ check_narray - --# configure options: --# --with-pgplot-dir=path --# --with-pgplot-include=path --# --with-pgplot-lib=path --dir_config("pgplot") -+ $objs = %w(rb_pgplot.o kwarg.o) -+ $enable_autobuild = enable_config('autobuild', false) -+ $found_lib = [] -+ -+ # Check PGPLOT Header -+ if have_header("cpgplot.h") -+ if have_library("cpgplot","cpgbeg") -+ create_makefile("pgplot") -+ exit -+ end -+ -+ # Check for extra libs then re-check for PGPLOT library -+ puts "First check for PGPLOT library failed." -+ check_extra_libs -+ $libs = append_library($libs, "pgplot") -+ -+ if have_library("cpgplot","cpgbeg") -+ create_makefile("pgplot") -+ exit -+ end -+ elsif $enable_autobuild -+ check_extra_libs -+ end -+ -+ if $enable_autobuild -+ autobuild_pgplot -+ else -+ puts " -+The PGPLOT library was not found. To auto-build PGPLOT library -+as part of installing Ruby/PGPLOT, pass the --enable-autobuild option. -+ -+Examples: -+ Gem install: gem install pgplot -- --enable-autobuild -+ Manual install: ruby extconf.rb --enable-autobuild -+" -+ end -+end -+ -+ -+def extconf_start -+ # configure options: -+ # --with-pgplot-dir=path -+ # --with-pgplot-include=path -+ # --with-pgplot-lib=path -+ dir_config("pgplot") -+ -+ # configure options: -+ # --with-x11-dir=path -+ # --with-x11-include=path -+ # --with-x11-lib=path -+ dir_config("x11") -+ -+ # Otherwise you can also specify: -+ # --with-opt-dir=path -+ # --with-opt-include=path -+ # --with-opt-lib=path -+end - --# Otherwise you can also specify: --# --with-opt-dir=path --# --with-opt-include=path --# --with-opt-lib=path - - def find_dir_w_file(d,h) - g = Dir.glob(RbConfig.expand(d+"/"+h)) -@@ -42,107 +79,132 @@ def find_dir_in_gemspec - nil - end - --# Check NArray --gems_dir="$(rubylibprefix)/gems/$(ruby_version)/gems/" --narray_d="narray-0.[56].*" --narray_h="narray.h" --if narray_h_dir = -- find_dir_in_gemspec || -- find_dir_w_file("../"+narray_d,narray_h) || -- find_dir_w_file(gems_dir+narray_d,narray_h) || -- find_dir_w_file(CONFIG['vendorarchdir'],narray_h) || -- find_dir_w_file(CONFIG['sitearchdir'],narray_h) || -- find_dir_w_file(CONFIG['archdir'],narray_h) -- $CPPFLAGS = " -I#{narray_h_dir} " + $CPPFLAGS --end --exit unless have_header("narray.h") - --if RUBY_PLATFORM =~ /cygwin|mingw/ -- $LDFLAGS = " -L#{CONFIG['sitearchdir']} "+$LDFLAGS -- exit unless have_library("narray","na_make_object") --end -+def check_narray -+ gems_dir="$(rubylibprefix)/gems/$(ruby_version)/gems/" -+ narray_d="narray-0.[56].*" -+ narray_h="narray.h" -+ if narray_h_dir = -+ find_dir_in_gemspec || -+ find_dir_w_file("../"+narray_d,narray_h) || -+ find_dir_w_file(gems_dir+narray_d,narray_h) || -+ find_dir_w_file(CONFIG['vendorarchdir'],narray_h) || -+ find_dir_w_file(CONFIG['sitearchdir'],narray_h) || -+ find_dir_w_file(CONFIG['archdir'],narray_h) -+ $CPPFLAGS = " -I#{narray_h_dir} " + $CPPFLAGS -+ end -+ exit unless have_header("narray.h") - --$have_pgplot = false -+ if RUBY_PLATFORM =~ /cygwin|mingw/ -+ $LDFLAGS = " -L#{CONFIG['sitearchdir']} "+$LDFLAGS -+ exit unless have_library("narray","na_make_object") -+ end -+end - --# Check PGPLOT Header --if have_header("cpgplot.h") - -- # Check PGPLOT Library without extra libs -- if find_library("cpgplot","cpgbeg", "/usr/lib", -- "/usr/local/lib", "/usr/local/pgplot" ) -- $have_pgplot = true -+def check_extra_libs -+ # Check FORTRAN Libraries -+ # -+ # SUN WorkShop FORTRAN 77 compiler ver5.0 -+ # configure options: --with-sunws -+ if with_config("sunws") -+ $libs = "-lM77 -lsunmath "+$libs -+ exit unless find_library("F77", "f77_init", "/opt/SUNWspro/lib") -+ $defs.push "-DSPARC_FORTRAN" -+ # -+ # GNU FORTRAN v4 -+ elsif have_library("gfortran") -+ $CFLAGS = "-Wall "+$CFLAGS -+ $defs.push "-DGNU_FORTRAN" -+ # -+ # GNU FORTRAN v3 -+ elsif have_library("g77") -+ $CFLAGS = "-Wall "+$CFLAGS -+ $defs.push "-DGNU_FORTRAN" - else -- # Check for extra libs then re-check for PGPLOT library -- puts "First check for PGPLOT library failed," -- puts "checking for auxiliary libraries and retrying." -- -- # Check FORTRAN Libraries -- # -- # SUN WorkShop FORTRAN 77 compiler ver5.0 -- # configure options: --with-sunws -- if with_config("sunws") -- $libs = "-lM77 -lsunmath "+$libs -- exit unless find_library("F77", "f77_init", "/opt/SUNWspro/lib") -- $defs.push "-DSPARC_FORTRAN" -- # -- # GNU FORTRAN v4 -- elsif have_library("gfortran") -- $CFLAGS = "-Wall "+$CFLAGS -- $defs.push "-DGNU_FORTRAN" -- # -- # GNU FORTRAN v3 -- elsif have_library("g77") -- $CFLAGS = "-Wall "+$CFLAGS -- $defs.push "-DGNU_FORTRAN" -- else -- puts "failed" -- exit -- end -+ puts "failed" -+ exit -+ end - -- # Check GrWin Library (for cygwin (and mingw32?)) -- # configure options: --with-grwin -- if with_config("grwin") -- #$LDFLAGS = "-Wl,--subsystem,console "+$LDFLAGS -- if RUBY_PLATFORM =~ /cygwin|mingw/ -- $libs += " -mwindows" -- end -- exit unless have_library("GrWin", "GWinit") -+ # Check GrWin Library (for cygwin (and mingw32?)) -+ # configure options: --with-grwin -+ if with_config("grwin") -+ #$LDFLAGS = "-Wl,--subsystem,console "+$LDFLAGS -+ if RUBY_PLATFORM =~ /cygwin|mingw/ -+ $libs += " -mwindows" - end -+ exit unless have_library("GrWin", "GWinit") -+ end -+ -+ # Check X11 Library -+ if have_library("X11", "XOpenDisplay") -+ $found_lib << 'X11' -+ end - -- $found_lib = [] -+ # Check PNG Library -+ libs_save = $libs -+ $libs = append_library($libs, "z") -+ if have_library("png","png_create_write_struct") -+ $found_lib << 'png' -+ else -+ $libs = libs_save -+ end -+end - -- # configure options: -- # --with-x11-dir=path -- # --with-x11-include=path -- # --with-x11-lib=path -- dir_config("x11") - -- # Check X11 Library -- if have_library("X11", "XOpenDisplay") -- $found_lib << 'X11' -- end -+def autobuild_pgplot -+ # Exit unless a fortran compiler was found -+ exit unless %w[gfortran g77].any?{|cmd| system("which #{cmd}")} -+ puts "enabling auto-build PGPLOT Library..." - -- # Check PNG Library -- libs_save = $libs -- $libs = append_library($libs, "z") -- if have_library("png","png_create_write_struct") -- $found_lib << 'png' -- else -- $libs = libs_save -- end -+ $subdir = 'build_lib' -+ $CFLAGS = "-I#{$subdir}/build "+$CFLAGS -+ $LDFLAGS = "-L#{$subdir}/build "+$LDFLAGS -+ $libs = append_library($libs, "cpgplot") -+ $defs.push '-DPGPLOT_DIR=\\"$(PGPLOT_DIR)\\"' - -- $libs = append_library($libs, "pgplot") -+ # Generate Makefile -+ create_makefile("pgplot") - -- if find_library("cpgplot","cpgbeg", "/usr/lib", -- "/usr/local/lib", "/usr/local/pgplot" ) -- $have_pgplot = true -+ # Append PGPLOT install task to Makefile -+ exit unless $makefile_created -+ puts "appending extra install tasks to Makefile" -+ File.open("Makefile","a") do |w| -+ w.print " -+PGPLOT_DIR = $(RUBYARCHDIR)/pgplot -+PGPLOT_BUILD = #{$subdir}/build -+ -+$(PGPLOT_BUILD)/libcpgplot.a: -+ (cd #{$subdir}; make build/libcpgplot.a) -+$(PGPLOT_BUILD)/cpgplot.h: $(PGPLOT_BUILD)/libcpgplot.a -+rb_pgplot.o: $(PGPLOT_BUILD)/cpgplot.h -+$(DLLIB): $(PGPLOT_BUILD)/libcpgplot.a -+ -+install: install-pgplot -+install-pgplot: -+ $(MAKEDIRS) $(PGPLOT_DIR) -+ $(INSTALL_DATA) $(PGPLOT_BUILD)/grfont.dat $(PGPLOT_DIR) -+ $(INSTALL_DATA) $(PGPLOT_BUILD)/rgb.txt $(PGPLOT_DIR) -+" -+ if $found_lib.include? "X11" -+ w.print \ -+" $(INSTALL_PROG) $(PGPLOT_BUILD)/pgxwin_server $(PGPLOT_DIR) -+ -+$(PGPLOT_BUILD)/pgxwin_server: $(PGPLOT_BUILD)/cpgplot.h -+ (cd #{$subdir}; make build/pgxwin_server) -+$(DLLIB): $(PGPLOT_BUILD)/pgxwin_server -+" - end - end --end - --$objs = %w(rb_pgplot.o kwarg.o) -+ puts "creating #{$subdir}/drivers.conf" -+ File.open("#{$subdir}/drivers.conf","w") do |w| -+ w.puts "GIDRIV PPDRIV PSDRIV" -+ w.puts "PNDRIV" if $found_lib.include? "png" -+ w.puts "WDDRIV XWDRIV" if $found_lib.include? "X11" -+ end - --if $have_pgplot -- # Generate Makefile -- create_makefile("pgplot") -+ puts "Ready to download and auto-build PGPLOT !!" - end -+ -+main diff -Nru ruby-pgplot-0.1.9/debian/patches/0006-rm-extconf-auto.rb.patch ruby-pgplot-0.2.0/debian/patches/0006-rm-extconf-auto.rb.patch --- ruby-pgplot-0.1.9/debian/patches/0006-rm-extconf-auto.rb.patch 2016-03-06 12:59:13.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/patches/0006-rm-extconf-auto.rb.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -From: Masahiro TANAKA -Date: Tue, 5 Mar 2013 18:48:57 +0900 -Subject: rm extconf-auto.rb - ---- - ext/extconf-auto.rb | 89 ----------------------------------------------------- - pgplot.gemspec | 4 +-- - 2 files changed, 1 insertion(+), 92 deletions(-) - delete mode 100644 ext/extconf-auto.rb - -diff --git a/ext/extconf-auto.rb b/ext/extconf-auto.rb -deleted file mode 100644 -index 5891862..0000000 ---- a/ext/extconf-auto.rb -+++ /dev/null -@@ -1,89 +0,0 @@ --# extconf.rb : Configure script for Ruby/PGPLOT --# --# Copyright (c) 2000,2001 Masahiro TANAKA --# --# This program is free software. --# You can distribute/modify this program --# under the same terms as Ruby itself. --# NO WARRANTY. --# --# usage: ruby extconf.rb [configure options] -- --# Narray is now Gem based, so require rubygems --# so that we can use Gem class to find narray. -- --load "./extconf.rb" -- --# Exit if user did not specify "--enable-autobuild" --if !enable_config('autobuild', false) -- # Print reminder about --enable-autobuild option if pgplot was not found -- if !$have_pgplot -- puts -- puts "The PGPLOT library was not found. To auto-build it as part of" -- puts "installing Ruby/PGLOT, pass the --enable-autobuild option." -- puts -- puts "Examples:" -- puts -- puts " Gem install: gem install pgplot -- --enable-autobuild" -- puts "Manual install: ruby extconf.rb --enable-autobuild" -- end -- exit --end --# Exit if pgplot library was found --exit if $have_pgplot --# Exit unless a fortran compiler was found --exit unless %w[gfortran g77].any?{|cmd| system("which #{cmd}")} -- --puts "enabling auto-build PGPLOT Library..." -- --$subdir = 'build_lib' -- --$CFLAGS = "-I#{$subdir}/build "+$CFLAGS --$LDFLAGS = "-L#{$subdir}/build "+$LDFLAGS -- --$libs = append_library($libs, "pgplot") --$libs = append_library($libs, "cpgplot") --$defs.push '-DPGPLOT_DIR=\\"$(PGPLOT_DIR)\\"' -- --# Generate Makefile --create_makefile("pgplot") -- --# Append PGPLOT install task to Makefile --if $makefile_created -- puts "appending extra install tasks to Makefile" -- File.open("Makefile","a") do |w| -- w.print < -Date: Wed, 30 Oct 2013 20:59:01 +0900 -Subject: s.add_dependency('narray', '< 0.7.0') - ---- - pgplot.gemspec | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pgplot.gemspec b/pgplot.gemspec -index 88f23e2..4e41bc4 100644 ---- a/pgplot.gemspec -+++ b/pgplot.gemspec -@@ -52,7 +52,7 @@ PGPLOT_GEMSPEC = Gem::Specification.new do |s| - test/pgtick.rb - ] - -- s.add_dependency('narray', '>= 0.5.0') -+ s.add_dependency('narray', '< 0.7.0') - - if s.respond_to? :specification_version then - s.specification_version = 2 diff -Nru ruby-pgplot-0.1.9/debian/patches/0008-mv-homepage.patch ruby-pgplot-0.2.0/debian/patches/0008-mv-homepage.patch --- ruby-pgplot-0.1.9/debian/patches/0008-mv-homepage.patch 2016-03-06 12:59:13.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/patches/0008-mv-homepage.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -From: Masahiro TANAKA -Date: Fri, 16 May 2014 10:23:43 +0900 -Subject: mv homepage - ---- - pgplot.gemspec | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pgplot.gemspec b/pgplot.gemspec -index 4e41bc4..05bc3ec 100644 ---- a/pgplot.gemspec -+++ b/pgplot.gemspec -@@ -17,7 +17,7 @@ PGPLOT_GEMSPEC = Gem::Specification.new do |s| - s.description = "PGPLOT wrapper for Ruby" - s.email = "masa16.tanaka@gmail.com" - s.extensions = ["ext/extconf.rb"] -- s.homepage = "http://pgplot.rubyforge.org/" -+ s.homepage = "http://masa16.github.io/ruby-pgplot/" - s.require_paths = ["."] - s.rubyforge_project = "pgplot" - s.rubygems_version = "2.0.0" diff -Nru ruby-pgplot-0.1.9/debian/patches/0009-fix-docs.patch ruby-pgplot-0.2.0/debian/patches/0009-fix-docs.patch --- ruby-pgplot-0.1.9/debian/patches/0009-fix-docs.patch 2016-03-06 12:59:13.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/patches/0009-fix-docs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ -From: Masahiro TANAKA -Date: Fri, 16 May 2014 11:22:23 +0900 -Subject: fix docs - ---- - doc/Makefile | 6 +++--- - doc/index.rd | 4 ++-- - doc/mkdoc.rb | 4 +++- - doc/myrd2html.rb | 7 +++++-- - 4 files changed, 13 insertions(+), 8 deletions(-) - -diff --git a/doc/Makefile b/doc/Makefile -index 47e9c02..7354af3 100644 ---- a/doc/Makefile -+++ b/doc/Makefile -@@ -1,6 +1,6 @@ - .SUFFIXES: .rd .html .ja.rd .html.ja .rb $(SUFFIXES) - --rd2=ruby myrd2html.rb -+rd2=ruby -Ku myrd2html.rb - - .rd.html: - $(rd2) --lang=en --kw="Ruby,PGPLOT,NArray" $(opt) $< > $@ -@@ -42,8 +42,8 @@ tutorial-01.html.ja: tutorial-01.ja.rd trailer.html - - # Method description - rbpgplot.html: mkdoc.rb -- #ruby -Kn mkdoc.rb $(HOME)/2012/src/pgplot/src rbpgplot.html -- ruby mkdoc.rb rbpgplot.html -+ ruby -Kn mkdoc.rb /data/masa/2013/src/pgplot/src rbpgplot.html -+ #ruby mkdoc.rb rbpgplot.html - - # Method index categolized - rbpg-ind.rd: rbpg-ind.txt mkind.rb trailer.html -diff --git a/doc/index.rd b/doc/index.rd -index 8bbcca6..91df739 100644 ---- a/doc/index.rd -+++ b/doc/index.rd -@@ -11,11 +11,11 @@ graphics library. - - * (()) - * GNU FORTRAN compiler --* (()) version 0.5/0.6 -+* (()) version 0.5 or 0.6 (no plan to support narray-devel) - - == Download - --* (()) -+* (()) - - == Installation - -diff --git a/doc/mkdoc.rb b/doc/mkdoc.rb -index 3d249e0..15d31df 100644 ---- a/doc/mkdoc.rb -+++ b/doc/mkdoc.rb -@@ -1,3 +1,5 @@ -+# -*- coding: utf-8 -*- -+ - class Formatter - def initialize(stream) - @stream = stream -@@ -276,7 +278,7 @@ pgqvsz:0:1,1,1,1 - def manualfunclist - @manualfunc={} - curfunc=nil -- File.open("../rb_pgplot.c.in").each do |line| -+ File.open("../ext/rb_pgplot.c.in").each do |line| - case line - when %r'^/\* (PG\w+)' - curfunc = $1.downcase -diff --git a/doc/myrd2html.rb b/doc/myrd2html.rb -index 134dc39..b375bc1 100644 ---- a/doc/myrd2html.rb -+++ b/doc/myrd2html.rb -@@ -1,3 +1,6 @@ -+# -*- coding: utf-8 -*- -+ -+ - while /^--/ =~ ARGV[0] - a = ARGV.shift - case a -@@ -17,9 +20,9 @@ $date = File.mtime(rdfile).strftime("%b %d %Y") - - case $lang - when 'ja' -- rd2 = 'rd2 -r ./rd2html-img-lib.rb --html-lang=ja --with-css=./css.css --out-code=utf8' -+ rd2 = '/usr/bin/ruby -Ku /usr/bin/rd2 -r ./rd2html-img-lib.rb --html-lang=ja --with-css=./css.css --out-code=utf8' - else -- rd2 = 'rd2 -r ./rd2html-img-lib.rb --html-lang=en --with-css=./css.css' -+ rd2 = '/usr/bin/ruby -Ku /usr/bin/rd2 -r ./rd2html-img-lib.rb --html-lang=en --with-css=./css.css' - end - - rd2 << " --html-title='#{$title}'" if $title diff -Nru ruby-pgplot-0.1.9/debian/patches/series ruby-pgplot-0.2.0/debian/patches/series --- ruby-pgplot-0.1.9/debian/patches/series 2016-03-06 12:59:13.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -0000-Update-NArray-PATH.patch -0001-Add-enable-autobuild-option.patch -0002-Add-disable-extra-libs-option.patch -0003-Close-files-in-cogen.rb.patch -0004-Be-smart-about-extra-library-checks.patch -0005-extconf.rb.patch -0006-rm-extconf-auto.rb.patch -0007-s.add_dependency-narray-0.7.0.patch -0008-mv-homepage.patch -0009-fix-docs.patch diff -Nru ruby-pgplot-0.1.9/debian/salsa-ci.yml ruby-pgplot-0.2.0/debian/salsa-ci.yml --- ruby-pgplot-0.1.9/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ ruby-pgplot-0.2.0/debian/salsa-ci.yml 2020-02-26 07:20:42.000000000 +0000 @@ -0,0 +1,6 @@ +--- +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml +variables: + SALSA_CI_COMPONENTS: 'main contrib non-free' diff -Nru ruby-pgplot-0.1.9/doc/index.rd ruby-pgplot-0.2.0/doc/index.rd --- ruby-pgplot-0.1.9/doc/index.rd 2013-03-02 12:23:14.000000000 +0000 +++ ruby-pgplot-0.2.0/doc/index.rd 2018-04-15 10:38:44.000000000 +0000 @@ -11,11 +11,11 @@ * (()) * GNU FORTRAN compiler -* (()) version 0.5/0.6 +* (()) version 0.5 or 0.6 (no plan to support narray-devel) == Download -* (()) +* (()) == Installation diff -Nru ruby-pgplot-0.1.9/doc/Makefile ruby-pgplot-0.2.0/doc/Makefile --- ruby-pgplot-0.1.9/doc/Makefile 2013-03-02 12:23:14.000000000 +0000 +++ ruby-pgplot-0.2.0/doc/Makefile 2018-04-15 10:38:44.000000000 +0000 @@ -42,8 +42,8 @@ # Method description rbpgplot.html: mkdoc.rb - #ruby -Kn mkdoc.rb $(HOME)/2012/src/pgplot/src rbpgplot.html - ruby mkdoc.rb rbpgplot.html + ruby -Kn mkdoc.rb /data/masa/2013/src/pgplot/src rbpgplot.html + #ruby mkdoc.rb rbpgplot.html # Method index categolized rbpg-ind.rd: rbpg-ind.txt mkind.rb trailer.html diff -Nru ruby-pgplot-0.1.9/doc/mkdoc.rb ruby-pgplot-0.2.0/doc/mkdoc.rb --- ruby-pgplot-0.1.9/doc/mkdoc.rb 2013-03-02 12:23:14.000000000 +0000 +++ ruby-pgplot-0.2.0/doc/mkdoc.rb 2018-04-15 10:38:44.000000000 +0000 @@ -276,7 +276,7 @@ def manualfunclist @manualfunc={} curfunc=nil - File.open("../rb_pgplot.c.in").each do |line| + File.open("../ext/rb_pgplot.c.in").each do |line| case line when %r'^/\* (PG\w+)' curfunc = $1.downcase diff -Nru ruby-pgplot-0.1.9/ext/build_lib/Makefile ruby-pgplot-0.2.0/ext/build_lib/Makefile --- ruby-pgplot-0.1.9/ext/build_lib/Makefile 2013-03-02 12:23:14.000000000 +0000 +++ ruby-pgplot-0.2.0/ext/build_lib/Makefile 2018-04-15 10:38:44.000000000 +0000 @@ -12,6 +12,7 @@ $(sd)/drivers.list: $(pkg) gunzip -c $(pkg) | tar xf - touch $(sd)/drivers.list + ruby patch.rb $(sd) $(bd)/drivers.list: drivers.conf $(sd)/drivers.list ruby drivers.rb $(sd) $(bd) diff -Nru ruby-pgplot-0.1.9/ext/build_lib/patch.rb ruby-pgplot-0.2.0/ext/build_lib/patch.rb --- ruby-pgplot-0.1.9/ext/build_lib/patch.rb 1970-01-01 00:00:00.000000000 +0000 +++ ruby-pgplot-0.2.0/ext/build_lib/patch.rb 2018-04-15 10:38:44.000000000 +0000 @@ -0,0 +1,16 @@ +require 'fileutils' + +$src_dir = ARGV[0] || 'pgplot' + +fnw = File.join($src_dir,"drivers/pndriv.c") +fnr = fnw + ".orig" + +FileUtils.mv(fnw,fnr) + +open(fnr,"rt") do |r| + open(fnw,"wt") do |w| + while s = r.gets + w.print s.sub(/png_ptr->jmpbuf/,"png_jmpbuf(png_ptr)") + end + end +end diff -Nru ruby-pgplot-0.1.9/ext/cogen.rb ruby-pgplot-0.2.0/ext/cogen.rb --- ruby-pgplot-0.1.9/ext/cogen.rb 2013-03-02 12:23:14.000000000 +0000 +++ ruby-pgplot-0.2.0/ext/cogen.rb 2018-04-15 10:38:44.000000000 +0000 @@ -153,6 +153,8 @@ fout.print end end + fout.close + fin.close end cogen_pgplot if $0 == __FILE__ diff -Nru ruby-pgplot-0.1.9/ext/extconf-auto.rb ruby-pgplot-0.2.0/ext/extconf-auto.rb --- ruby-pgplot-0.1.9/ext/extconf-auto.rb 2013-03-02 12:23:14.000000000 +0000 +++ ruby-pgplot-0.2.0/ext/extconf-auto.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -# extconf.rb : Configure script for Ruby/PGPLOT -# -# Copyright (c) 2000,2001 Masahiro TANAKA -# -# This program is free software. -# You can distribute/modify this program -# under the same terms as Ruby itself. -# NO WARRANTY. -# -# usage: ruby extconf.rb [configure options] - -# Narray is now Gem based, so require rubygems -# so that we can use Gem class to find narray. - -load "./extconf.rb" - -exit if $have_pgplot -exit unless %w[gfortran g77].any?{|cmd| system("which #{cmd}")} - -puts "enabling auto-build PGPLOT Library..." - -$subdir = 'build_lib' - -$CFLAGS = "-I#{$subdir}/build "+$CFLAGS -$LDFLAGS = "-L#{$subdir}/build "+$LDFLAGS - -$libs = append_library($libs, "pgplot") -$libs = append_library($libs, "cpgplot") -$defs.push '-DPGPLOT_DIR=\\"$(PGPLOT_DIR)\\"' - -# Generate Makefile -create_makefile("pgplot") - -# Append PGPLOT install task to Makefile -if $makefile_created - puts "appending extra install tasks to Makefile" - File.open("Makefile","a") do |w| - w.print < -# -# This program is free software. -# You can distribute/modify this program -# under the same terms as Ruby itself. -# NO WARRANTY. -# -# usage: ruby extconf.rb [configure options] - -# Narray is now Gem based, so require rubygems -# so that we can use Gem class to find narray. require "mkmf" -#$DEBUG = true - -# configure options: -# --with-x11-dir=path -# --with-x11-include=path -# --with-x11-lib=path -dir_config("x11") +def main + extconf_start + check_narray + + $objs = %w(rb_pgplot.o kwarg.o) + $enable_autobuild = enable_config('autobuild', false) + $found_lib = [] + + # Check PGPLOT Header + if have_header("cpgplot.h") + if have_library("cpgplot","cpgbeg") + create_makefile("pgplot") + exit + end -# configure options: -# --with-pgplot-dir=path -# --with-pgplot-include=path -# --with-pgplot-lib=path -dir_config("pgplot") + # Check for extra libs then re-check for PGPLOT library + puts "First check for PGPLOT library failed." + check_extra_libs + $libs = append_library($libs, "pgplot") + + if have_library("cpgplot","cpgbeg") + create_makefile("pgplot") + exit + end + elsif $enable_autobuild + check_extra_libs + end -# Otherwise you can also specify: -# --with-opt-dir=path -# --with-opt-include=path -# --with-opt-lib=path + if $enable_autobuild + autobuild_pgplot + else + puts " +The PGPLOT library was not found. To auto-build PGPLOT library +as part of installing Ruby/PGPLOT, pass the --enable-autobuild option. + +Examples: + Gem install: gem install pgplot -- --enable-autobuild + Manual install: ruby extconf.rb --enable-autobuild -def find_dir_w_file(d,h) - g = Dir.glob(RbConfig.expand(d+"/"+h)) - File.dirname(g.last) if g and !g.empty? +" + end end -def find_dir_in_gemspec - begin - require 'rubygems' - if gemspec=Gem::Specification.find_by_path('narray') - return File.join(gemspec.full_gem_path, gemspec.require_path) + +def extconf_start + # configure options: + # --with-pgplot-dir=path + # --with-pgplot-include=path + # --with-pgplot-lib=path + dir_config("pgplot") + + # configure options: + # --with-x11-dir=path + # --with-x11-include=path + # --with-x11-lib=path + dir_config("x11") + + # Otherwise you can also specify: + # --with-opt-dir=path + # --with-opt-include=path + # --with-opt-lib=path +end + +def find_narray_h + $LOAD_PATH.each do |x| + p x + if File.exist? File.join(x,'narray.h') + $INCFLAGS = "-I#{x} " + $INCFLAGS + break end - rescue end - nil end -# Check NArray -gems_dir="$(rubylibprefix)/gems/$(ruby_version)/gems/" -narray_d="narray-0.[56].*" -narray_h="narray.h" -if narray_h_dir = - find_dir_in_gemspec || - find_dir_w_file("../"+narray_d,narray_h) || - find_dir_w_file(gems_dir+narray_d,narray_h) || - find_dir_w_file(CONFIG['sitearchdir'],narray_h) || - find_dir_w_file(CONFIG['archdir'],narray_h) - $CPPFLAGS = " -I#{narray_h_dir} " + $CPPFLAGS -end -exit unless have_header("narray.h") - -if RUBY_PLATFORM =~ /cygwin|mingw/ - $LDFLAGS = " -L#{CONFIG['sitearchdir']} "+$LDFLAGS - exit unless have_library("narray","na_make_object") +def find_libnarray_a + $LOAD_PATH.each do |x| + if File.exist? File.join(x,'libnarray.a') + $LDFLAGS = "-L#{x} " + $LDFLAGS + break + end + end end -# Check FORTRAN Libraries -# -# SUN WorkShop FORTRAN 77 compiler ver5.0 -# configure options: --with-sunws -if with_config("sunws") - $libs = "-lM77 -lsunmath "+$libs - exit unless find_library("F77", "f77_init", "/opt/SUNWspro/lib") - $defs.push "-DSPARC_FORTRAN" -# -# GNU FORTRAN v4 -elsif have_library("gfortran") - $CFLAGS = "-Wall "+$CFLAGS - $defs.push "-DGNU_FORTRAN" -# -# GNU FORTRAN v3 -elsif have_library("g77") - $CFLAGS = "-Wall "+$CFLAGS - $defs.push "-DGNU_FORTRAN" -else - puts "failed" - exit -end +def check_narray + require "narray" + find_narray_h + if !have_header("narray.h") + puts " + Header numo/narray.h was not found. Give pathname as follows: + % ruby extconf.rb --with-narray-include=narray_h_dir" + exit(1) + end -# Check GrWin Library (for cygwin (and mingw32?)) -# configure options: --with-grwin -if with_config("grwin") - #$LDFLAGS = "-Wl,--subsystem,console "+$LDFLAGS - if RUBY_PLATFORM =~ /cygwin|mingw/ - $libs += " -mwindows" + if RUBY_PLATFORM =~ /mswin|cygwin|mingw/ + find_libnarray_a + unless have_library("narray","na_make_object") + puts "libnarray.a not found" + exit(1) + end end - exit unless have_library("GrWin", "GWinit") end -$found_lib = [] -# Check X11 Library -if have_library("X11", "XOpenDisplay") - $found_lib << 'X11' -end - -# Check PNG Library -libs_save = $libs -$libs = append_library($libs, "z") -if have_library("png","png_create_write_struct") - $found_lib << 'png' -else - $libs = libs_save -end +def check_extra_libs + # Check FORTRAN Libraries + # + # SUN WorkShop FORTRAN 77 compiler ver5.0 + # configure options: --with-sunws + if with_config("sunws") + $libs = "-lM77 -lsunmath "+$libs + exit unless find_library("F77", "f77_init", "/opt/SUNWspro/lib") + $defs.push "-DSPARC_FORTRAN" + # + # GNU FORTRAN v4 + elsif have_library("gfortran") + $CFLAGS = "-Wall "+$CFLAGS + $defs.push "-DGNU_FORTRAN" + # + # GNU FORTRAN v3 + elsif have_library("g77") + $CFLAGS = "-Wall "+$CFLAGS + $defs.push "-DGNU_FORTRAN" + else + puts "failed" + exit + end -$libs = append_library($libs, "pgplot") -$have_pgplot = false + # Check GrWin Library (for cygwin (and mingw32?)) + # configure options: --with-grwin + if with_config("grwin") + #$LDFLAGS = "-Wl,--subsystem,console "+$LDFLAGS + if RUBY_PLATFORM =~ /cygwin|mingw/ + $libs += " -mwindows" + end + exit unless have_library("GrWin", "GWinit") + end -# Check PGPLOT Header -if have_header("cpgplot.h") + # Check X11 Library + if have_library("X11", "XOpenDisplay") + $found_lib << 'X11' + end - # Check PGPLOT Library - if find_library("cpgplot","cpgbeg", "/usr/lib", - "/usr/local/lib", "/usr/local/pgplot" ) - $have_pgplot = true + # Check PNG Library + libs_save = $libs + $libs = append_library($libs, "z") + if have_library("png","png_create_write_struct") + $found_lib << 'png' + else + $libs = libs_save end end -$objs = %w(rb_pgplot.o kwarg.o) -if $have_pgplot +def autobuild_pgplot + # Exit unless a fortran compiler was found + exit unless %w[gfortran g77].any?{|cmd| system("which #{cmd}")} + puts "enabling auto-build PGPLOT Library..." + + $subdir = 'build_lib' + $CFLAGS = "-I#{$subdir}/build "+$CFLAGS + $LDFLAGS = "-L#{$subdir}/build "+$LDFLAGS + $libs = append_library($libs, "cpgplot") + $defs.push '-DPGPLOT_DIR=\\"$(PGPLOT_DIR)\\"' + # Generate Makefile create_makefile("pgplot") + + # Append PGPLOT install task to Makefile + exit unless $makefile_created + puts "appending extra install tasks to Makefile" + File.open("Makefile","a") do |w| + w.print " +PGPLOT_DIR = $(RUBYARCHDIR)/pgplot +PGPLOT_BUILD = #{$subdir}/build + +$(PGPLOT_BUILD)/libcpgplot.a: + (cd #{$subdir}; make build/libcpgplot.a) +$(PGPLOT_BUILD)/cpgplot.h: $(PGPLOT_BUILD)/libcpgplot.a +rb_pgplot.o: $(PGPLOT_BUILD)/cpgplot.h +$(DLLIB): $(PGPLOT_BUILD)/libcpgplot.a + +install: install-pgplot +install-pgplot: + $(MAKEDIRS) $(PGPLOT_DIR) + $(INSTALL_DATA) $(PGPLOT_BUILD)/grfont.dat $(PGPLOT_DIR) + $(INSTALL_DATA) $(PGPLOT_BUILD)/rgb.txt $(PGPLOT_DIR) +" + if $found_lib.include? "X11" + w.print \ +" $(INSTALL_PROG) $(PGPLOT_BUILD)/pgxwin_server $(PGPLOT_DIR) + +$(PGPLOT_BUILD)/pgxwin_server: $(PGPLOT_BUILD)/cpgplot.h + (cd #{$subdir}; make build/pgxwin_server) +$(DLLIB): $(PGPLOT_BUILD)/pgxwin_server +" + end + end + + puts "creating #{$subdir}/drivers.conf" + File.open("#{$subdir}/drivers.conf","w") do |w| + w.puts "GIDRIV PPDRIV PSDRIV" + w.puts "PNDRIV" if $found_lib.include? "png" + w.puts "WDDRIV XWDRIV" if $found_lib.include? "X11" + end + + puts "Ready to download and auto-build PGPLOT !!" end + +main diff -Nru ruby-pgplot-0.1.9/ext/version.h ruby-pgplot-0.2.0/ext/version.h --- ruby-pgplot-0.1.9/ext/version.h 2013-03-02 12:23:14.000000000 +0000 +++ ruby-pgplot-0.2.0/ext/version.h 2018-04-15 10:38:44.000000000 +0000 @@ -1 +1 @@ -#define RUBY_PGPLOT_VERSION "0.1.9" +#define RUBY_PGPLOT_VERSION "0.2.0" diff -Nru ruby-pgplot-0.1.9/pgplot.gemspec ruby-pgplot-0.2.0/pgplot.gemspec --- ruby-pgplot-0.1.9/pgplot.gemspec 2013-03-02 12:23:14.000000000 +0000 +++ ruby-pgplot-0.2.0/pgplot.gemspec 2018-04-15 10:38:44.000000000 +0000 @@ -16,44 +16,16 @@ s.date = Time.now.strftime("%F") s.description = "PGPLOT wrapper for Ruby" s.email = "masa16.tanaka@gmail.com" - s.extensions = ["ext/extconf-auto.rb"] - s.homepage = "http://pgplot.rubyforge.org/" + s.extensions = ["ext/extconf.rb"] + s.homepage = "http://masa16.github.io/ruby-pgplot/" s.require_paths = ["."] s.rubyforge_project = "pgplot" s.rubygems_version = "2.0.0" s.summary = "PGPLOT wrapper for Ruby. The PGPLOT library needs to be " \ "installed in advance using GNU FORTRAN compiler" - s.files = %w[ - README - README.ja - FuncUsage - demo/pgdemo1.rb - demo/pgdemo15.rb - demo/pgdemo3.rb - demo/pgdemo4.rb - demo/pgdemo9.rb - ext/cogen.rb - ext/depend - ext/extconf.rb - ext/extconf-auto.rb - ext/kwarg.c - ext/rb_pgplot.c.in - ext/version.h - ext/build_lib/Makefile - ext/build_lib/download.rb - ext/build_lib/drivers.rb - ext/build_lib/makefile.rb - test/pgband.rb - test/pgcurs.rb - test/pggray.rb - test/pglcur.rb - test/pgline.rb - test/pgncur.rb - test/pgolin.rb - test/pgtick.rb - ] + s.files = `git ls-files FuncUsage README README.ja Rakefile demo ext pgplot.gemspec test`.split($/) - s.add_dependency('narray', '>= 0.5.0') + s.add_dependency('narray', '< 0.7.0') if s.respond_to? :specification_version then s.specification_version = 2 @@ -78,7 +50,6 @@ --exclude ext/cpgplot.h --exclude ext/depend --exclude ext/extconf.rb - --exclude ext/extconf-auto.rb --exclude ext/kwarg.c --exclude ext/rb_pgplot.c.in --exclude ext/version.h diff -Nru ruby-pgplot-0.1.9/Rakefile ruby-pgplot-0.2.0/Rakefile --- ruby-pgplot-0.1.9/Rakefile 2013-03-02 12:23:14.000000000 +0000 +++ ruby-pgplot-0.2.0/Rakefile 2018-04-15 10:38:44.000000000 +0000 @@ -1,16 +1 @@ -require 'rubygems' -require 'rubygems/package_task' - -load './pgplot.gemspec' - -file 'ext/rb_pgplot.c' => ['ext/rb_pgplot.c.in', 'ext/cogen.rb'] do - require './ext/cogen.rb' - Dir.chdir('ext') do - cogen_pgplot - end -end - -Gem::PackageTask.new(PGPLOT_GEMSPEC) do |pkg| - pkg.need_zip = true - pkg.need_tar = true -end +require "bundler/gem_tasks"