@@ -104,28 +104,30 @@ function build_netcdf {
104104 if [ -e netcdf-stamp ]; then return ; fi
105105 fetch_unpack https://downloads.unidata.ucar.edu/netcdf-c/${NETCDF_VERSION} /netcdf-c-${NETCDF_VERSION} .tar.gz
106106 # cmake build
107- # (cd netcdf-c-${NETCDF_VERSION} \
108- # && mkdir build \
109- # && cd build \
110- # && export HDF5_PLUGIN_PATH=$BUILD_PREFIX/lib/netcdf-plugins \
111- # && mkdir -p $HDF5_PLUGIN_PATH \
112- # && cmake ../ -DCMAKE_INSTALL_PREFIX=${BUILD_PREFIX} -DENABLE_NETCDF_4=ON -DENABLE_DAP=ON -DBUILD_SHARED_LIBS=ON -DPLUGIN_INSTALL_DIR=YES \
113- # && make -j4 \
114- # && make install \
115- # && ls -l $HDF5_PLUGIN_PATH )
107+ (cd netcdf-c-${NETCDF_VERSION} \
108+ && curl https://raw.githubusercontent.com/MacPython/netcdf4-python-wheels/master/CMakeLists.txt.patch -o CMakeLists.txt.patch \
109+ && patch -p0 < CMakeLists.txt.patch \
110+ && mkdir build \
111+ && cd build \
112+ && export HDF5_PLUGIN_PATH=$BUILD_PREFIX /lib/netcdf-plugins \
113+ && mkdir -p $HDF5_PLUGIN_PATH \
114+ && cmake ../ -DCMAKE_INSTALL_PREFIX=${BUILD_PREFIX} -DENABLE_NETCDF_4=ON -DENABLE_DAP=ON -DBUILD_SHARED_LIBS=ON -DPLUGIN_INSTALL_DIR=YES \
115+ && make -j4 \
116+ && make install \
117+ && ls -l $HDF5_PLUGIN_PATH )
116118 # autotools build
117- if [[ ! -z " IS_OSX" && " $PLAT " = " arm64" ]] && [[ " $CROSS_COMPILING " = " 1" ]]; then
118- (cd netcdf-c-${NETCDF_VERSION} \
119- && ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap --disable-libxml2 \
120- && make -j4 \
121- && make install )
122- else
123- (cd netcdf-c-${NETCDF_VERSION} \
124- && export HDF5_PLUGIN_PATH=$BUILD_PREFIX /lib/netcdf-plugins \
125- && ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap --disable-libxml2 --with-plugin-dir=$HDF5_PLUGIN_PATH \
126- && make -j4 \
127- && make install )
128- fi
119+ # if [[ ! -z "IS_OSX" && "$PLAT" = "arm64" ]] && [[ "$CROSS_COMPILING" = "1" ]]; then
120+ # (cd netcdf-c-${NETCDF_VERSION} \
121+ # && ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap \
122+ # && make -j4 \
123+ # && make install )
124+ # else
125+ # (cd netcdf-c-${NETCDF_VERSION} \
126+ # && export HDF5_PLUGIN_PATH=$BUILD_PREFIX/lib/netcdf-plugins \
127+ # && ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap --with-plugin-dir=$HDF5_PLUGIN_PATH \
128+ # && make -j4 \
129+ # && make install )
130+ # fi
129131 touch netcdf-stamp
130132}
131133
0 commit comments