Skip to content

Commit

Permalink
move libzmq patching outside of configure
Browse files Browse the repository at this point in the history
  • Loading branch information
mschubert committed Oct 10, 2023
1 parent b5fb90c commit 4f80dae
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
^doc$
^configure.backup$
^patch_libzmq.sh$
^Meta$
^doc(s)?$
\.gitignore
Expand Down
22 changes: 3 additions & 19 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,24 @@ PKG_LIBS="libzmq/src/.libs/libzmq.a"
if [ ! -f src/libzmq/autogen.sh ]; then
# the tarball has the submodules, a fresh clone does not
git submodule update --init --recursive
./patch_libzmq.sh
fi

if [ ! -f src/libzmq/src/.libs/libzmq.a ]; then
cd src/libzmq

if [ ! -f src/Makefile.am.orig ]; then
# remove code format helper and valgrind support that CRAN complains about
# sed -i does not work on macOS
mv Makefile.am Makefile.am.orig
sed '/WITH_CLANG_FORMAT/,/VALGRIND_SUPPRESSIONS_FILES/d' Makefile.am.orig > Makefile.am
fi

if [ ! -f src/curve_client_tools.hpp.orig ]; then
# remove disabled gcc check that cran complains about
mv src/curve_client_tools.hpp src/curve_client_tools.hpp.orig
sed '/^#pragma/s|^|//|' src/curve_client_tools.hpp.orig > src/curve_client_tools.hpp
fi
if [ ! -f include/zmq_utils.h.orig ]; then
mv include/zmq_utils.h src/zmq_utils.h.orig
sed '/^#pragma/s|^|//|' include/zmq_utils.h.orig > include/zmq_utils.h
fi

if [ ! -f Makefile.in ]; then
./autogen.sh || die
fi

CXX="$CXX" CXXFLAGS="$CXXFLAGS -fPIC" CPPFLAGS="$CPPFLAGS" ./configure \
--enable-static \
--disable-shared \
--enable-drafts \
--disable-maintainer-mode \
--disable-Werror \
--enable-drafts \
--disable-libbsd \
--disable-libunwind \
--disable-libbsd \
--disable-perf \
--disable-curve \
--disable-curve-keygen \
Expand Down
21 changes: 21 additions & 0 deletions patch_libzmq.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
cd src/libzmq

if [ ! -f src/Makefile.am.orig ]; then
# remove code format helper and valgrind support that CRAN complains about
# sed -i does not work on macOS
mv Makefile.am Makefile.am.orig
sed '/WITH_CLANG_FORMAT/,/VALGRIND_SUPPRESSIONS_FILES/d' Makefile.am.orig > Makefile.am
fi

if [ ! -f src/curve_client_tools.hpp.orig ]; then
# remove disabled gcc check that cran complains about
mv src/curve_client_tools.hpp src/curve_client_tools.hpp.orig
sed '/^#pragma/s|^|//|' src/curve_client_tools.hpp.orig > src/curve_client_tools.hpp
fi
if [ ! -f include/zmq_utils.h.orig ]; then
mv include/zmq_utils.h src/zmq_utils.h.orig
sed '/^#pragma/s|^|//|' include/zmq_utils.h.orig > include/zmq_utils.h
fi

cd -

0 comments on commit 4f80dae

Please sign in to comment.