File: 0006-Fix-NetCDF-version-check.patch

package info (click to toggle)
ruby-netcdf 0.8.0-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,428 kB
  • sloc: ansic: 3,952; ruby: 1,843; makefile: 6; csh: 6
file content (75 lines) | stat: -rw-r--r-- 2,861 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Tue, 3 Mar 2026 00:20:10 +0900
Subject: Fix NetCDF version check

Forwarded: not-needed
Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
--- a/ext/numru/extconf.rb
+++ b/ext/numru/extconf.rb
@@ -28,8 +28,8 @@
 
 if ( ! ( have_header("narray.h") && have_header("narray_config.h") ) ) then
 print <<EOS
-** configure error **  
-   Header narray.h or narray_config.h is not found. If you have these files in 
+** configure error **
+   Header narray.h or narray_config.h is not found. If you have these files in
    /narraydir/include, try the following:
 
    % ruby extconf.rb --with-narray-include=/narraydir/include
@@ -38,7 +38,7 @@
    exit(-1)
 end
 
-unless  ncversion 
+unless  ncversion
   # configure netcdf version
   if xsystem("nc-config --version")
     ncversion = `nc-config --version`.chomp!.sub!(/^n.* /i,"") # rm "netCDF "
@@ -51,8 +51,8 @@
 
 ncver0 = ncversion[0..0]  # "3" or "4"
 ncver = ncversion.gsub(/\./,'')
-unless /^\d\d\d(\-rc)?$/ =~ ncver   # 3 digits
-  raise("Invalid netcdf version: #{ncversion}. Use --with-netcdf-version=") 
+unless /^\d{3,}(\-rc)?$/ =~ ncver
+  raise("Invalid netcdf version: #{ncversion}. Use --with-netcdf-version=")
 end
 $CFLAGS += ' -DNCVER='+ncver
 
@@ -110,10 +110,10 @@
     CONFIG['LDSHARED'].sub!(/gcc/,'g++')
     $LIBS.sub!(/-lc\s/,'') ; $LIBS.sub!(/-lc$/,'')
     print <<-EOS
-      ** Warning **  non-portable treatments are made, 
+      ** Warning **  non-portable treatments are made,
       which was sucessfull redhat linux 9:
        * gcc was replaced with g++ in CONFIG['LDSHARED']
-       * -lc library was removed if in $LIBS 
+       * -lc library was removed if in $LIBS
 
     EOS
     #  p '@@@'
@@ -123,8 +123,8 @@
   else
     if ( ! ( have_header("netcdf.h") && have_library("netcdf") ) )then
       print <<-EOS
-      ** configure error **  
-         Header netcdf.h or the compiled netcdf library is not found. 
+      ** configure error **
+         Header netcdf.h or the compiled netcdf library is not found.
          If you have the library installed under /netcdfdir (that is, netcdf.h is
          in /netcdfdir/include and the library in /netcdfdir/lib/),
          try the following:
@@ -160,9 +160,9 @@
       newmkfl.puts("\t\t@$(RM) *.nc demo/*.nc demo/*~ lib/*~ doc/*~ test/*.nc test/*~ Makefile.orig")
    when /^all:/
       newmkfl.puts(line)
-      newmkfl.puts("")         
+      newmkfl.puts("")
       newmkfl.puts("test: all")            # insert the "test" target
-      newmkfl.puts("\t\t@cd test && ruby test.rb && echo 'test did not fail :-p (please ignore the warnings)' && cd ..") 
+      newmkfl.puts("\t\t@cd test && ruby test.rb && echo 'test did not fail :-p (please ignore the warnings)' && cd ..")
 #   when /lib\/netcdf/
 #      line = line.chomp! + "/"
 #      newmkfl.puts(line)