Skip to content

Commit

Permalink
Merge 22fd0cf into 1220f76
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer authored Jul 3, 2024
2 parents 1220f76 + 22fd0cf commit 1da117a
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 7 deletions.
1 change: 1 addition & 0 deletions binder/appendix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ RUN CONDA_DIR=/srv/conda && \
echo "export RADARENV=$RADARENV" >> ~/.profile && \
echo "export CONDA_PREFIX=$CONDA_PREFIX" >> ~/.profile && \
echo "export PROJ_NETWORK=$PROJ_NETWORK" >> ~/.profile && \
${CONDA_PREFIX}/bin/bash -l $BALTRAD_INSTALL_ROOT/install/baltrad/install_baltrad.sh && \
cp binder/kernel.json $CONDA_PREFIX/share/jupyter/kernels/python3/.
13 changes: 13 additions & 0 deletions install/baltrad/fix_macro_beamb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/pybeamb/pybeamb_compat.h b/pybeamb/pybeamb_compat.h
index 3caf9cd..49b79ea 100644
--- a/pybeamb/pybeamb_compat.h
+++ b/pybeamb/pybeamb_compat.h
@@ -73,7 +73,7 @@ along with RAVE. If not, see <http://www.gnu.org/licenses/>.
#define MOD_INIT_CREATE_CAPI(ptr, name) PyCapsule_New(ptr, name, NULL)
#define MOD_INIT_IS_CAPI(ptr) PyCapsule_CheckExact(ptr)
#define MOD_INIT_GET_CAPI(ptr, name) PyCapsule_GetPointer(ptr, name)
-#define MOD_INIT_SETUP_TYPE(itype, otype) Py_TYPE(&itype) = otype
+#define MOD_INIT_SETUP_TYPE(itype, otype) Py_SET_TYPE(&itype, otype)
#define MOD_INIT_VERIFY_TYPE_READY(type) if (PyType_Ready(type) < 0) return MOD_INIT_ERROR

#else
13 changes: 13 additions & 0 deletions install/baltrad/fix_macro_bropo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/pyropo/pyropo_compat.h b/pyropo/pyropo_compat.h
index 9fdd586..5be12c0 100644
--- a/pyropo/pyropo_compat.h
+++ b/pyropo/pyropo_compat.h
@@ -73,7 +73,7 @@ along with RAVE. If not, see <http://www.gnu.org/licenses/>.
#define MOD_INIT_CREATE_CAPI(ptr, name) PyCapsule_New(ptr, name, NULL)
#define MOD_INIT_IS_CAPI(ptr) PyCapsule_CheckExact(ptr)
#define MOD_INIT_GET_CAPI(ptr, name) PyCapsule_GetPointer(ptr, name)
-#define MOD_INIT_SETUP_TYPE(itype, otype) Py_TYPE(&itype) = otype
+#define MOD_INIT_SETUP_TYPE(itype, otype) Py_SET_TYPE(&itype, otype)
#define MOD_INIT_VERIFY_TYPE_READY(type) if (PyType_Ready(type) < 0) return MOD_INIT_ERROR

#else
13 changes: 13 additions & 0 deletions install/baltrad/fix_macro_rave.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/librave/pyapi/pyravecompat.h b/librave/pyapi/pyravecompat.h
index 846e7a7..8167bfa 100644
--- a/librave/pyapi/pyravecompat.h
+++ b/librave/pyapi/pyravecompat.h
@@ -86,7 +86,7 @@ PyObject* PyRaveAPI_StringOrUnicode_FromASCII(const char *buffer);
#define MOD_INIT_CREATE_CAPI(ptr, name) PyCapsule_New(ptr, name, NULL)
#define MOD_INIT_IS_CAPI(ptr) PyCapsule_CheckExact(ptr)
#define MOD_INIT_GET_CAPI(ptr, name) PyCapsule_GetPointer(ptr, name)
-#define MOD_INIT_SETUP_TYPE(itype, otype) Py_TYPE(&itype) = otype
+#define MOD_INIT_SETUP_TYPE(itype, otype) Py_SET_TYPE(&itype, otype)
#define MOD_INIT_VERIFY_TYPE_READY(type) if (PyType_Ready(type) < 0) return MOD_INIT_ERROR

#else
37 changes: 37 additions & 0 deletions install/baltrad/fix_macro_type_hlhdf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/pyhlhdf/pyhlcompat.h b/pyhlhdf/pyhlcompat.h
index aadbdac..73ad6b9 100644
--- a/pyhlhdf/pyhlcompat.h
+++ b/pyhlhdf/pyhlcompat.h
@@ -82,7 +82,7 @@ PyObject* PyHlhdf_StringOrUnicode_FromASCII(const char *buffer, Py_ssize_t size)
PyModuleDef_HEAD_INIT, name, doc, -1, methods, NULL, NULL, NULL, NULL }; \
ob = PyModule_Create(&moduledef);

-#define MOD_INIT_SETUP_TYPE(itype, otype) Py_TYPE(&itype) = otype
+#define MOD_INIT_SETUP_TYPE(itype, otype) Py_SET_TYPE(&itype, otype)
#define MOD_INIT_VERIFY_TYPE_READY(type) if (PyType_Ready(type) < 0) return MOD_INIT_ERROR

#else
diff --git a/test/python/rave_info_type.c b/test/python/rave_info_type.c
index 5451301..9ac225b 100644
--- a/test/python/rave_info_type.c
+++ b/test/python/rave_info_type.c
@@ -334,7 +334,8 @@ static PyTypeObject RaveInfoType_Type = {
(getattrofunc)_getattr_typeo, /*tp_getattro*/
(setattrofunc)0, /*tp_setattro*/
0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ Py_TPFLAGS_DEFAULT, /*tp_flags*/
+ //Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
(traverseproc)0, /*tp_traverse*/
(inquiry)0, /*tp_clear*/
@@ -378,7 +379,8 @@ static PyTypeObject RaveInfoObject_Type = {
(getattrofunc)_getattro_object,/*tp_getattro*/
(setattrofunc)_setattro_object,/*tp_setattro*/
0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ //Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ Py_TPFLAGS_DEFAULT, /*tp_flags*/
0, /*tp_doc*/
(traverseproc)0, /*tp_traverse*/
(inquiry)0, /*tp_clear*/
13 changes: 13 additions & 0 deletions install/baltrad/fix_macro_wrwp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/pywrwp/pywrwp_compat.h b/pywrwp/pywrwp_compat.h
index 3caf9cd..49b79ea 100644
--- a/pywrwp/pywrwp_compat.h
+++ b/pywrwp/pywrwp_compat.h
@@ -73,7 +73,7 @@ along with RAVE. If not, see <http://www.gnu.org/licenses/>.
#define MOD_INIT_CREATE_CAPI(ptr, name) PyCapsule_New(ptr, name, NULL)
#define MOD_INIT_IS_CAPI(ptr) PyCapsule_CheckExact(ptr)
#define MOD_INIT_GET_CAPI(ptr, name) PyCapsule_GetPointer(ptr, name)
-#define MOD_INIT_SETUP_TYPE(itype, otype) Py_TYPE(&itype) = otype
+#define MOD_INIT_SETUP_TYPE(itype, otype) Py_SET_TYPE(&itype, otype)
#define MOD_INIT_VERIFY_TYPE_READY(type) if (PyType_Ready(type) < 0) return MOD_INIT_ERROR

#else
3 changes: 2 additions & 1 deletion install/baltrad/install_baltrad_beamb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$CONDA_PREFIX/hlhdf/lib:$CONDA_PREFIX/r
cd $BALTRAD_INSTALL_ROOT/tmp
git clone --depth=1 https://github.com/baltrad/beamb.git
cd beamb/
git apply $BALTRAD_INSTALL_ROOT/install/baltrad/fix_macro_beamb.patch

# build, test and install
./configure --prefix=$CONDA_PREFIX/beamb --with-rave=$CONDA_PREFIX/rave
make
make test
make install
echo $CONDA_PREFIX/beamb/share/beamb/pybeamb > $CONDA_PREFIX/lib/python3.9/site-packages/beamb.pth
echo $CONDA_PREFIX/beamb/share/beamb/pybeamb > $CONDA_PREFIX/lib/python3.11/site-packages/beamb.pth

# activation script
grep -l beamb ${CONDA_PREFIX}/etc/conda/activate.d/baltrad.sh
Expand Down
1 change: 1 addition & 0 deletions install/baltrad/install_baltrad_bropo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$CONDA_PREFIX/hlhdf/lib:$CONDA_PREFIX/r
cd $BALTRAD_INSTALL_ROOT/tmp
git clone --depth 1 https://github.com/baltrad/bropo.git
cd bropo/
git apply $BALTRAD_INSTALL_ROOT/install/baltrad/fix_macro_bropo.patch

# build, test and install
./configure --prefix=$CONDA_PREFIX/bropo \
Expand Down
3 changes: 2 additions & 1 deletion install/baltrad/install_baltrad_hlhdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ set +e

# download
cd $BALTRAD_INSTALL_ROOT/tmp
git clone --depth=1 https://github.com/openradar/hlhdf.git
git clone --depth=1 https://github.com/baltrad/hlhdf.git
cd hlhdf/
git apply $BALTRAD_INSTALL_ROOT/install/baltrad/fix_macro_type_hlhdf.patch

# build, test and install
./configure --prefix=$CONDA_PREFIX/hlhdf \
Expand Down
11 changes: 6 additions & 5 deletions install/baltrad/install_baltrad_rave.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$CONDA_PREFIX/hlhdf/lib
cd $BALTRAD_INSTALL_ROOT/tmp
git clone --depth=1 https://github.com/baltrad/rave.git
cd rave
sed -i -e 's/import jprops/#import jprops/g' Lib/rave_bdb.py
sed -i -e 's/import jprops/#import jprops/g' Lib/rave_dom_db.py
sed -i -e 's/import jprops/#import jprops/g' Lib/rave_bdb.py
sed -i -e 's/from baltrad.bdbclient/#from baltrad.bdbclient/g' Lib/rave_bdb.py
sed -i -e 's/from keyczar import keyczar/#from keyczar import keyczar/g' Lib/BaltradFrame.py
git apply $BALTRAD_INSTALL_ROOT/install/baltrad/fix_macro_rave.patch
#sed -i -e 's/import jprops/#import jprops/g' Lib/rave_bdb.py
#sed -i -e 's/import jprops/#import jprops/g' Lib/rave_dom_db.py
#sed -i -e 's/import jprops/#import jprops/g' Lib/rave_bdb.py
#sed -i -e 's/from baltrad.bdbclient/#from baltrad.bdbclient/g' Lib/rave_bdb.py
#sed -i -e 's/from keyczar import keyczar/#from keyczar import keyczar/g' Lib/BaltradFrame.py
# kmuehlbauer: This file is missing currently, so disabling
# cp -p ~/binder/baltrad/fix_shebang.sh bin/. # Copies in path to Python for conda

Expand Down
1 change: 1 addition & 0 deletions install/baltrad/install_baltrad_wrwp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mkdir $CONDA_PREFIX/rave/tmp
cd $BALTRAD_INSTALL_ROOT/tmp
git clone --depth 1 https://github.com/baltrad/baltrad-wrwp.git
cd baltrad-wrwp/
git apply $BALTRAD_INSTALL_ROOT/install/baltrad/fix_macro_wrwp.patch

# build, test and install
./configure --prefix=$CONDA_PREFIX/baltrad-wrwp --with-rave=$CONDA_PREFIX/rave --with-blas=$CONDA_PREFIX/lib --with-cblas=$CONDA_PREFIX/lib --with-lapack=$CONDA_PREFIX/lib --with-lapacke=$CONDA_PREFIX/include,$CONDA_PREFIX/lib
Expand Down

0 comments on commit 1da117a

Please sign in to comment.