Skip to content

Commit db18994

Browse files
authored
Merge pull request #218 from r-lib/dev
Unwrap mbedtls and nng source bundles
2 parents 7e4ebca + c231640 commit db18994

File tree

393 files changed

+141837
-88
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

393 files changed

+141837
-88
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ src/Makevars
77
nanonext.Rcheck/00_pkg_src/nanonext/
88
nanonext.Rcheck/
99
*.gz
10-
docs
11-
install
10+
/docs/
11+
/build/
12+
/install/
1213
inst/doc
1314
compile_commands.json
1415
.cache
15-
revdep/
16+
/revdep/
1617
.claude
1718
CLAUDE.md
1819
.DS_Store

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ Config/usethis/last-upkeep: 2025-04-23
3939
Encoding: UTF-8
4040
Roxygen: list(markdown = TRUE)
4141
RoxygenNote: 7.3.3
42-
SystemRequirements: 'libnng' >= 1.9 and 'libmbedtls' >= 2.5, or 'cmake'
43-
and 'xz' to compile NNG and/or Mbed TLS included in package sources
42+
SystemRequirements: 'libnng' >= 1.9 and 'libmbedtls' >= 2.5, or 'cmake' to
43+
compile NNG and/or Mbed TLS included in package sources

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# nanonext (development version)
22

3+
* Building from source no longer requires `xz`.
4+
35
# nanonext 1.7.2
46

57
#### Updates

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Installation from source requires 'libnng' >= v1.9.0 and 'libmbedtls' >= 2.5.0 (
164164

165165
As system libraries, 'libnng' is available as libnng-dev (deb) or nng-devel (rpm), and 'libmbedtls' as libmbedtls-dev (deb) or libmbedtls-devel (rpm). The `INCLUDE_DIR` and `LIB_DIR` environment variables may be set prior to package installation to specify a custom location for 'libmbedtls' or 'libnng' other than the standard filesystem locations.
166166

167-
*Additional requirements for Solaris: (i) the 'xz' package - available on OpenCSW, and (ii) a more recent version of 'cmake' than available on OpenCSW - refer to the 'cmake' website for the latest source file.*
167+
*Solaris: requires a more recent version of 'cmake' than available on OpenCSW - refer to the 'cmake' website for the latest source file.*
168168

169169
#### Windows
170170

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ variables may be set prior to package installation to specify a custom
194194
location for ‘libmbedtls’ or ‘libnng’ other than the standard filesystem
195195
locations.
196196

197-
*Additional requirements for Solaris: (i) the ‘xz’ package - available
198-
on OpenCSW, and (ii) a more recent version of ‘cmake’ than available on
197+
*Solaris: requires a more recent version of ‘cmake’ than available on
199198
OpenCSW - refer to the ‘cmake’ website for the latest source file.*
200199

201200
#### Windows

cleanup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/sh
2-
rm -rf src/Makevars install
2+
rm -rf src/Makevars build install

cleanup.win

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rm -rf src/Makevars install
1+
rm -rf src/Makevars build install

configure

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#!/bin/sh
22

3-
# Library versions
4-
LIB_VER="111"
5-
TLS_VER="362"
6-
73
# Initialise
84
PKG_CFLAGS=""
95
PKG_LIBS=""
@@ -84,25 +80,10 @@ then
8480
exit 1
8581
fi
8682
fi
87-
echo "Detecting 'xz'..."
88-
which xz
89-
if [ $? -ne 0 ]
90-
then
91-
tar -xf src/mbedtls-$TLS_VER.tar.xz
92-
if [ $? -ne 0 ]
93-
then
94-
echo "No 'xz' command found"
95-
exit 1
96-
fi
97-
else
98-
xz -dc src/mbedtls-$TLS_VER.tar.xz | tar -xf -
99-
fi
100-
cd mbedtls-$TLS_VER
10183
echo "Compiling 'libmbedtls' from source ..."
102-
cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_INSTALL_LIBDIR=lib .
103-
cmake --build . --target install
104-
cd ..
105-
rm -rf mbedtls-$TLS_VER
84+
cmake -S src/mbedtls -B build -DCMAKE_INSTALL_PREFIX=install -DCMAKE_INSTALL_LIBDIR=lib
85+
cmake --build build --target install
86+
rm -rf build
10687
else
10788
echo "Found 'libmbedtls' $MBEDTLS_CFLAGS"
10889
PKG_CFLAGS="$MBEDTLS_CFLAGS $PKG_CFLAGS"
@@ -158,25 +139,10 @@ then
158139
exit 1
159140
fi
160141
fi
161-
echo "Detecting 'xz'..."
162-
which xz
163-
if [ $? -ne 0 ]
164-
then
165-
tar -xf src/nng-$LIB_VER.tar.xz
166-
if [ $? -ne 0 ]
167-
then
168-
echo "No 'xz' command found"
169-
exit 1
170-
fi
171-
else
172-
xz -dc src/nng-$LIB_VER.tar.xz | tar -xf -
173-
fi
174-
cd nng-$LIB_VER
175142
echo "Compiling 'libnng' from source ..."
176-
cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_INSTALL_LIBDIR=lib .
177-
cmake --build . --target install
178-
cd ..
179-
rm -rf nng-$LIB_VER
143+
cmake -S src/nng -B build -DCMAKE_INSTALL_PREFIX=install -DCMAKE_INSTALL_LIBDIR=lib
144+
cmake --build build --target install
145+
rm -rf build
180146
else
181147
echo "Found 'libnng' $NNG_CFLAGS"
182148
PKG_CFLAGS="$NNG_CFLAGS $PKG_CFLAGS"

configure.ucrt

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
1-
# Library versions
2-
LIB_VER="111"
3-
TLS_VER="362"
4-
51
# Find compiler and export flags
62
CC=`"${R_HOME}/bin/R" CMD config CC`
73
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
84
LDFLAGS=`"${R_HOME}/bin/R" CMD config LDFLAGS`
95
export CC CFLAGS LDFLAGS
106

11-
tar -xf src/mbedtls-$TLS_VER.tar.xz
12-
cd mbedtls-$TLS_VER
137
echo "Compiling 'libmbedtls' from source ..."
14-
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=../install .
15-
cmake --build . --target install
16-
cd ..
17-
rm -rf mbedtls-$TLS_VER
8+
cmake -S src/mbedtls -B build -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=install
9+
cmake --build build --target install
10+
rm -rf build
1811

19-
tar -xf src/nng-$LIB_VER.tar.xz
20-
cd nng-$LIB_VER
2112
echo "Compiling 'libnng' from source ..."
22-
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=../install .
23-
cmake --build . --target install
24-
cd ..
25-
rm -rf nng-$LIB_VER
13+
cmake -S src/nng -B build -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=install
14+
cmake --build build --target install
15+
rm -rf build
2616

2717
# Success
2818
exit 0

configure.win

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
# Library versions
2-
LIB_VER="111"
3-
TLS_VER="362"
4-
5-
tar -xf src/mbedtls-$TLS_VER.tar.xz
6-
tar -xf src/nng-$LIB_VER.tar.xz
7-
81
for ARCH in x64 i386; do
92

103
if [ -e "${R_HOME}/bin/${ARCH}/R" ]; then
@@ -13,30 +6,21 @@ for ARCH in x64 i386; do
136
LDFLAGS=`"${R_HOME}/bin/${ARCH}/R" CMD config LDFLAGS`
147
export CC CFLAGS LDFLAGS
158

16-
cd mbedtls-$TLS_VER
17-
mkdir ${ARCH}
18-
cd ${ARCH}
199
echo "Compiling 'libmbedtls' from source for ${ARCH} ..."
20-
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=../../install/${ARCH} ..
21-
cmake --build . --target install
22-
cd ../..
10+
cmake -S src/mbedtls -B build -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=install/${ARCH}
11+
cmake --build build --target install
12+
rm -rf build
2313

24-
cd nng-$LIB_VER
25-
mkdir ${ARCH}
26-
cd ${ARCH}
2714
echo "Compiling 'libnng' from source for ${ARCH} ..."
28-
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=../../install/${ARCH} ..
29-
cmake --build . --target install
30-
cd ../..
15+
cmake -S src/nng -B build -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=install/${ARCH}
16+
cmake --build build --target install
17+
rm -rf build
3118

3219
else
3320
echo "Note: ${ARCH} not installed, skipping ..."
3421
fi
3522

3623
done
3724

38-
rm -rf mbedtls-$TLS_VER
39-
rm -rf nng-$LIB_VER
40-
4125
# Success
4226
exit 0

0 commit comments

Comments
 (0)