Skip to content

Commit

Permalink
unidata.ucar.edu/netcdf
Browse files Browse the repository at this point in the history
  • Loading branch information
and-ri committed Aug 13, 2023
1 parent 4546bb3 commit 8e00d14
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
63 changes: 63 additions & 0 deletions projects/unidata.ucar.edu/netcdf/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
distributable:
url: https://github.com/Unidata/netcdf-c/archive/v{{version}}.tar.gz
strip-components: 1
versions:
github: Unidata/netcdf-c
dependencies:
hdfgroup.org/HDF5: '*'
sourceware.org/bzip2: '*'
curl.se: '*'
gnome.org/libxml2: '*'
zlib.net: '*'
build:
dependencies:
tea.xyz/gx/cc: c99
gnu.org/make: '*'
cmake.org: '*'
gnu.org/m4: '*'
script:
- run: |
cmake -S . -B build_shared $ARGS -DBUILD_SHARED_LIBS=ON
cmake --build build_shared
cmake --install build_shared
- run: |
cmake -S . -B build_static $ARGS -DBUILD_SHARED_LIBS=OFF
cmake --build build_static
cmake --install build_static
- install build_static/liblib/libnetcdf.a {{prefix}}/lib/
- sed -i.bak "s|$TEA_PREFIX|\${TEA_PREFIX}|g" {{prefix}}/bin/nc-config
- rm {{prefix}}/bin/nc-config.bak
- sed -i.bak "s|$TEA_PREFIX|\${pcfiledir}/../../..|g" {{prefix}}/lib/pkgconfig/netcdf.pc
- rm {{prefix}}/lib/pkgconfig/netcdf.pc
- sed -i.bak "s|$TEA_PREFIX|\${TEA_PREFIX}|g" {{prefix}}/lib/cmake/netCDF/netCDFConfig.cmake
- rm {{prefix}}/lib/cmake/netCDF/netCDFConfig.cmake.bak
- sed -i.bak "s|$TEA_PREFIX|\${TEA_PREFIX}|g" {{prefix}}/lib/libnetcdf.settings
- rm {{prefix}}/lib/libnetcdf.settings.bak
env:
ARGS:
- -DENABLE_TESTS=OFF
- -DENABLE_NETCDF_4=ON
- -DENABLE_DOXYGEN=OFF
- -DCMAKE_INSTALL_PREFIX={{prefix}}
- -DCMAKE_INSTALL_LIBDIR=lib
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_FIND_FRAMEWORK=LAST
- -DCMAKE_VERBOSE_MAKEFILE=ON
- -Wno-dev
- -DBUILD_TESTING=OFF
linux:
ARGS:
- -DCMAKE_POSITION_INDEPENDENT_CODE=ON
provides:
- bin/nc-config
- bin/nccopy
- bin/ncdump
- bin/ncgen
- bin/ncgen3
test:
dependencies:
tea.xyz/gx/cc: c99
script:
- cc test.c -lnetcdf -o test
- ./test | grep {{version}}
- nc-config --version | grep {{version}}
6 changes: 6 additions & 0 deletions projects/unidata.ucar.edu/netcdf/test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <stdio.h>
#include "netcdf_meta.h"
int main() {
printf(NC_VERSION);
return 0;
}

0 comments on commit 8e00d14

Please sign in to comment.