commit 67c0fffcc44395f0292901856460c2ca23e33a90
parent 4e07dac176595e80b1113093ef91e8f345a09c52
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 14 Sep 2026 23:44:36 +0200
htrdr: fix compilation with netcdf 4.9.3
Add a build script that patches the pkgconfig of netcdf, bugged when
linked statically.
Diffstat:
3 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/src/rad-apps/htrdr_0.12.sh b/src/rad-apps/htrdr_0.12.sh
@@ -39,6 +39,12 @@ if [ "${ATMOSPHERE}" = "ENABLE" ]; then
. "rad-libs/htsky_0.3.1-r1.sh"
fi
+netcdf_version="$(pkg-config --modversion netcdf)"
+
+if [ "${netcdf_version}" = "4.9.3" ]; then
+ . "sci-libs/netcdf_4.9.3_patch.sh"
+fi
+
if [ "${COMBUSTION}" = "ENABLE" ]; then
. "rad-libs/atrstm_0.1.1.sh"
fi
@@ -60,6 +66,7 @@ else
[ "${ATMOSPHERE}" = "ENABLE" ] && dep="${dep} htsky"
[ "${COMBUSTION}" = "ENABLE" ] && dep="${dep} atrstm"
[ "${PLANETS}" = "ENABLE" ] && dep="${dep} rnatm rngrd star-buffer"
+ [ -n "${NETCDF_PATCH_SH}" ] && dep="${dep} netcdf"
url="$\(REPO\)/htrdr.git"
dep="${dep} aw mrumtl rsys star-3d star-camera star-sf star-sp star-vx"
diff --git a/src/sci-libs/netcdf_4.9.3_patch.mk b/src/sci-libs/netcdf_4.9.3_patch.mk
@@ -0,0 +1,8 @@
+netcdf:
+ @prefix=$$(cat .prefix) &&\
+ pc="$$(pkg-config --path netcdf)" &&\
+ path="$${prefix}/lib/pkgconfig" &&\
+ mkdir -p "$${path}" &&\
+ sed -e 's/HDF5::HDF5/hdf5/' \
+ -e 's/hdf5::hdf5_hl/hdf5_hl/' \
+ -e 's/CURL::libcurl/curl/' "$${pc}" > "$${path}/netcdf.pc"
diff --git a/src/sci-libs/netcdf_4.9.3_patch.sh b/src/sci-libs/netcdf_4.9.3_patch.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# Copyright (C) 2023-2026 |Méso|Star> (contact@meso-star.com)
+#
+# This file is part of Star-Build.
+#
+# Star-Build is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Star-Build is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Star-Build. If not, see <http://www.gnu.org/licenses/>.
+
+name="netcdf"
+version="4.9.3"
+
+if [ -n "${NETCDF_PATCH_SH}" ]; then
+ check_conflict "${name}" "${version}" "${NETCDF_PATCH_SH}"
+else
+ export NETCDF_PATCH_SH="${version}"
+ cat sci-libs/netcdf_4.9.3_patch.mk
+fi