Skip to content

Commit 567312d

Browse files
committed
update libnng to 1.6.0 pre-release
1 parent 1c471df commit 567312d

File tree

4 files changed

+30
-20
lines changed

4 files changed

+30
-20
lines changed

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
#### New Features
44

5-
* `$context()` method added for creating new contexts from nano Objects with supported protocols (i.e. req, rep, surveyor, respondent).
5+
* `$context()` method added for creating new contexts from nano Objects using supported protocols (i.e. req, rep, surveyor, respondent).
66
* Added convenience auxiliary functions `is_nano()` and `is_aio()`.
77

88
#### Updates
99

10+
* NNG library used on Windows and for building from source updated to 1.6.0 pre-release.
11+
* Setting 'NANONEXT_TLS=1' now allows the downloaded NNG library to be built against a system mbedtls installation.
1012
* Deprecated `send_ctx()`, `recv_ctx()` and logging are removed.
1113
* Internal performance optimisations.
1214

configure

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "$NANONEXT_ARM" ]; then
1414
PKG_LIBS="$PKG_LIBS -latomic"
1515
fi
1616
PKG_CFLAGS=""
17-
LIB_VER="1.5.2"
17+
LIB_VER="722bf46"
1818
SYS_LIB=0
1919

2020
# Check for custom locations
@@ -66,23 +66,27 @@ elif [ -d "/usr/local/opt/nng" ]; then
6666
else
6767
echo "prior system libnng installation not found"
6868
echo "preparing to download and build library from source..."
69-
curl -L https://github.com/nanomsg/nng/archive/refs/tags/v$LIB_VER.tar.gz -o nng.tar.gz
69+
curl -L https://api.github.com/repos/nanomsg/nng/tarball/$LIB_VER -o nng.tar.gz
7070
gzip -dc nng.tar.gz | tar -xf -
7171
rm -f nng.tar.gz
72-
cd nng-$LIB_VER
72+
cd nanomsg-nng-$LIB_VER
7373
mkdir build
7474
cd build
7575
which cmake
7676
if [ $? -ne 0 ]; then
7777
export PATH=$PATH:/Applications/CMake.app/Contents/bin
7878
fi
79-
cmake -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fPIC" -DNNG_ELIDE_DEPRECATED=1 -DNNG_TESTS=0 -DNNG_TOOLS=0 ..
79+
if [ "$NANONEXT_TLS" ]; then
80+
cmake -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fPIC" -DNNG_ENABLE_TLS=1 -DNNG_ELIDE_DEPRECATED=1 -DNNG_TESTS=0 -DNNG_TOOLS=0 ..
81+
else
82+
cmake -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fPIC" -DNNG_ELIDE_DEPRECATED=1 -DNNG_TESTS=0 -DNNG_TOOLS=0 ..
83+
fi
8084
make
8185
cd ../..
8286
mkdir lib
83-
mv -f nng-$LIB_VER/build/libnng.a lib
84-
mv -f nng-$LIB_VER/include ./
85-
rm -rf nng-$LIB_VER
87+
mv -f nanomsg-nng-$LIB_VER/build/libnng.a lib
88+
mv -f nanomsg-nng-$LIB_VER/include ./
89+
rm -rf nanomsg-nng-$LIB_VER
8690
PKG_CFLAGS="-I`pwd`/include $PKG_CFLAGS"
8791
PKG_LIBS="-L`pwd`/lib $PKG_LIBS"
8892

@@ -119,23 +123,27 @@ if [ $? -ne 0 ]; then
119123
else
120124
echo "Attempt to use system libnng failed"
121125
echo "Preparing to download and build library from source..."
122-
curl -L https://github.com/nanomsg/nng/archive/refs/tags/v$LIB_VER.tar.gz -o nng.tar.gz
126+
curl -L https://api.github.com/repos/nanomsg/nng/tarball/$LIB_VER -o nng.tar.gz
123127
gzip -dc nng.tar.gz | tar -xf -
124128
rm -f nng.tar.gz
125-
cd nng-$LIB_VER
129+
cd nanomsg-nng-$LIB_VER
126130
mkdir build
127131
cd build
128132
which cmake
129133
if [ $? -ne 0 ]; then
130134
export PATH=$PATH:/Applications/CMake.app/Contents/bin
131135
fi
132-
cmake -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fPIC" -DNNG_ELIDE_DEPRECATED=1 -DNNG_TESTS=0 -DNNG_TOOLS=0 ..
136+
if [ "$NANONEXT_TLS" ]; then
137+
cmake -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fPIC" -DNNG_ENABLE_TLS=1 -DNNG_ELIDE_DEPRECATED=1 -DNNG_TESTS=0 -DNNG_TOOLS=0 ..
138+
else
139+
cmake -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fPIC" -DNNG_ELIDE_DEPRECATED=1 -DNNG_TESTS=0 -DNNG_TOOLS=0 ..
140+
fi
133141
make
134142
cd ../..
135143
mkdir lib
136-
mv -f nng-$LIB_VER/build/libnng.a lib
137-
mv -f nng-$LIB_VER/include ./
138-
rm -rf nng-$LIB_VER
144+
mv -f nanomsg-nng-$LIB_VER/build/libnng.a lib
145+
mv -f nanomsg-nng-$LIB_VER/include ./
146+
rm -rf nanomsg-nng-$LIB_VER
139147
PKG_CFLAGS="-I`pwd`/include $PKG_CFLAGS"
140148
PKG_LIBS="-L`pwd`/lib $PKG_LIBS"
141149
# Test for libnng

src/Makevars.win

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RWINLIB = ../windows/rwinlib-1.5.2
1+
RWINLIB = ../windows/rwinlib-1.6.0-pre
22

33
PKG_CFLAGS=-DNNG_STATIC_LIB -I${RWINLIB}/include $(C_VISIBILITY)
44
PKG_LIBS=-L${RWINLIB}/lib${R_ARCH}${CRT} -lnng -lws2_32

tools/winlibs.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# nanonext - Download precompiled libnng for Windows ---------------------------
22

3-
if (!file.exists("../windows/rwinlib-1.5.2/include/nng.h")) {
3+
if (!file.exists("../windows/rwinlib-1.6.0-pre/include/nng.h")) {
44

55
if (getRversion() < "3.3.0") setInternet2()
6-
download.file("https://github.com/shikokuchuo/rwinlib/archive/refs/tags/v1.5.2.zip", destfile = "nng-release.zip", quiet = TRUE)
6+
download.file("https://github.com/shikokuchuo/rwinlib/archive/refs/tags/v1.6.0-pre.zip", destfile = "nng-1.6.0-pre.zip", quiet = TRUE)
77
dir.create("../windows", showWarnings = FALSE)
8-
unzip("nng-release.zip", exdir = "../windows")
9-
unlink("nng-release.zip")
8+
unzip("nng-1.6.0-pre.zip", exdir = "../windows")
9+
unlink("nng-1.6.0-pre.zip")
1010

1111
}
1212

13-
# cmake -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fPIC" -G "MSYS Makefiles" ..
13+
# cmake -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fPIC" -G "MSYS Makefiles" -DNNG_ELIDE_DEPRECATED=1 -DNNG_TESTS=0 -DNNG_TOOLS=0 ..

0 commit comments

Comments
 (0)