Download raw body.
[wip new] geo/ncview
On 2025/09/16 16:44, Marco van Hulten wrote:
> I've added a port for ncview, something to view netCDF files.
>
> Building and installing works. I can open some netCDF files, but not
> all of them. I'll have a deeper look into that.
>
> Clang fails on undefined symbols, even as header files are included, so
> I needed to set COMPILER to port-gcc only. Without that override,
> including weird patches like the one attached brings the compilation
> further. In the end it still fails on symbol 'main' not found.
Builds for me if I use bash to run configure. When there are that
many problems there is no point doing whack-a-mole, just add the dep.
Post-release now though.
diff -uNp -ur ncview.orig/Makefile ncview/Makefile
--- ncview.orig/Makefile Tue Sep 16 15:24:28 2025
+++ ncview/Makefile Fri Oct 3 11:36:53 2025
@@ -16,12 +16,13 @@ WANTLIB += ICE SM X11 Xaw Xt c expat m
SITES = https://cirrus.ucsd.edu/~pierce/ncview/
-# clang fails on undefined symbols, even as header files are included
-COMPILER = ports-gcc
+BUILD_DEPENDS = shells/bash
+LIB_DEPENDS = math/netcdf \
+ math/udunits \
+ graphics/png
-LIB_DEPENDS = math/netcdf math/udunits graphics/png
-
-SEPARATE_BUILD = Yes (build in a directory other than WRKSRC)
+SEPARATE_BUILD = Yes
+CONFIGURE_ENV = ac_cv_file__usr_local_lib_libpng_so=yes
CONFIGURE_ARGS = --with-png_incdir=$(LOCALBASE)/include \
--with-png_libdir=$(LOCALBASE)/lib
diff -uNp -ur ncview.orig/patches/patch-configure ncview/patches/patch-configure
--- ncview.orig/patches/patch-configure Tue Sep 16 14:43:45 2025
+++ ncview/patches/patch-configure Fri Oct 3 11:32:02 2025
@@ -1,109 +1,9 @@
Index: configure
--- configure.orig
+++ configure
-@@ -2274,7 +2274,7 @@ if test x$HAS_NC_CONFIG = xno; then
- echo "where you should replace /home/joe/bin etc. with the location where you have"
- echo "installed the nc-config script that came with the netcdf 4 distribution."
- echo "-----------------------------------------------------------------------------------"
-- exit -1
-+ exit 1
- fi
- NETCDF_CC=`$NC_CONFIG_FULLQUAL --cc`
- NETCDF_LDFLAGS=`$NC_CONFIG_FULLQUAL --libs`
-@@ -2308,7 +2308,7 @@ if test $NETCDF_V4 = "no"; then
- echo "the full version of netcdf-4 with HDF-5 support, then please install"
- echo "ncview version 1.93g instead."
- echo "-------------------------------------------------------------------"
-- exit -1
-+ exit 1
- fi
-
- #------------------------------------------------------------------------
-@@ -4269,7 +4269,7 @@ if test "x$no_x" == "xyes"; then
- echo " ^^^^^^^^^^ ^^^^^^^^^^^^^^^^ these are what"
- echo "you want to set to reflect the location of files such as libX11.so and X.h on your"
- echo "particular system."
-- exit -1
-+ exit 1
- fi
- if test "$no_x" = yes; then
- # Not all programs may use this symbol, but it does not hurt to define it.
-@@ -5074,7 +5074,7 @@ fi
- echo "You must specify a directory that has ALL the udunits-2 include files"
- echo "(converter.h as well as udunits2.h)."
- echo "--------------------------------------------------------------------------------"
-- exit -1
-+ exit 1
- fi
- as_ac_Header=`$as_echo "ac_cv_header_$UDUNITS2_INCDIR/udunits2.h" | $as_tr_sh`
- ac_fn_c_check_header_mongrel "$LINENO" "$UDUNITS2_INCDIR/udunits2.h" "$as_ac_Header" "$ac_includes_default"
-@@ -5088,7 +5088,7 @@ fi
- fi
- if test $err -eq 1; then
- echo "Error: user specified udunits2 include directory does not have udunits2.h!"
-- exit -1
-+ exit 1
- fi
- if test x$UDUNITS2_INCDIR = x; then
- ac_fn_c_check_header_mongrel "$LINENO" "udunits2.h" "ac_cv_header_udunits2_h" "$ac_includes_default"
-@@ -5190,7 +5190,7 @@ fi
- fi
- if test $err -eq 1; then
- echo "Error: user specified udunits2 library directory does not have $UDUNITS2_LIBNAME !"
-- exit -1
-+ exit 1
- fi
- if test x$NETCDF_LIBDIR = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_read_xml in -ludunits2" >&5
-@@ -5419,7 +5419,7 @@ fi
-
- if test x"$haveExpat"x != "xyesx"; then
- as_fn_error $? "Could not find the expat library despite the fact that the udunits2 library is installed. This probably means some sort of configuration file error. Please consult with the package maintainer." "$LINENO" 5
-- exit -1
-+ exit 1
- fi
- EXPAT_LIBS=$LIBS
- echo "Expat libraries (needed by udunits2): $EXPAT_LIBS"
-@@ -5494,12 +5494,12 @@ fi
- echo "but that directory does NOT have required png include file png.h."
- echo "You must specify a directory that has the png include files"
- echo "--------------------------------------------------------------------------------"
-- exit -1
-+ exit 1
- fi
- fi
- if test $err -eq 1; then
- echo "Error: user specified png include directory does not have png.h!"
-- exit -1
-+ exit 1
- fi
- if test x$PNG_INCDIR = x; then
- ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default"
-@@ -5585,7 +5586,7 @@ fi
- fi
- if test $err -eq 1; then
- echo "Error: user specified png library directory does not have $PNG_LIBNAME !"
-- exit -1
-+ exit 1
- fi
- if test x$PNG_LIBDIR = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_write_png in -lpng" >&5
-@@ -5849,7 +5850,7 @@ if test x$CC_TEST_SAME != x$NETCDF_CC_TEST_SAME; then
- echo "To do this, set environmental variable CC to $NETCDF_CC"
- echo "and run ./configure again"
- echo "==================================================================="
-- exit -1
-+ exit 1
- fi
-
- #----------------------------------------------------------------------------------
-@@ -5870,8 +5871,7 @@ if test x$ac_compiler_gnu = xyes; then
- RPATH_FLAGS=""
- for word in $UDUNITS2_LDFLAGS $NETCDF_LDFLAGS; do
- if test `expr $word : -L/` -eq 3; then
-- #RPDIR=`expr substr $word 3 999`;
-- RPDIR=${word:2}
-+ RPDIR=`expr substr $word 3 999`;
- RPATH_FLAGS="$RPATH_FLAGS -Wl,-rpath,$RPDIR"
- fi
- done
+@@ -1,4 +1,4 @@
+-#! /bin/sh
++#! /usr/local/bin/bash
+ # Guess values for system-dependent variables and create Makefiles.
+ # Generated by GNU Autoconf 2.69 for ncview 2.0.0.
+ #
[wip new] geo/ncview