Skip to content

Commit

Permalink
WIP: Add Nettle, Libev and Gnutls for TLS support
Browse files Browse the repository at this point in the history
  • Loading branch information
nyxkrage committed Dec 24, 2022
1 parent f49498f commit 452b530
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@
[submodule "gnutls"]
path = gnutls
url = https://github.com/gnutls/gnutls.git
[submodule "nettle"]
path = nettle
url = https://github.com/gnutls/nettle.git
[submodule "libev"]
path = libev
url = https://github.com/enki/libev.git
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,47 @@ $ sudo cmake --build . --target install
$ popd
```

## Statically compiled nettle
Nettle is a cryptograpy library used by gnutls

``` shellsession
$ pushd nettle
$ ./configure CC=musl-gcc --prefix=$PWD/build --enable-static --disable-documentation --disable-shared --enable-mini-gmp
$ make -j$(nproc)
$ make install
$ popd
```

## Statically compiled libev
Libev is an event loop library required by gnutls

``` shellsession
$ pushd libev
$ ./configure CC=musl-gcc CXX=musl-gcc --prefix=$PWD/build --enable-static --enable-shared=no
$ make -j$(nproc)
$ make install
$ popd
```

## Statically compiled gnutls
The Emacs web browser requires gnutls support to connect to https websites

``` shellsession
$ pushd gnutls
$ ./bootstrap
$ ./configure CC=musl-gcc NETTLE_CFLAGS="-I$PWD/../nettle/build/include" NETTLE_LIBS="-static -L$PWD/../nettle/build/lib64 -lhogweed -lnettle" HOGWEED_CFLAGS="-I$PWD/../nettle/build/include" HOGWEED_LIBS="-static -L$PWD/../nettle/build/lib64 -lhogweed -lnettle" LDFLAGS="-static -L$PWD/../nettle/build/lib64 -lhogweed -lnettle" CFLAGS="-I$PWD/../nettle/build/include" --with-libev-prefix="$PWD/../libev/build" --prefix=$PWD/build --enable-static --disable-shared --with-included-unistring --with-included-libtasn1 --disable-cxx --without-p11-kit --without-idn --disable-doc --disable-gost --with-nettle-mini
$ make -j$(nproc)
$ make install
$ popd
```

## Statically compiled Emacs
We need a statically compiled version of emacs if we want to keep the rootfs minimal

``` shellsession
$ pushd emacs
$ ./autogen.sh
$ ./configure --with-json=no --without-x --without-libsystemd --without-gnutls --with-sound=no --without-lcms2 --without-dbus CFLAGS="-static -O3 -I$PWD/../ncurses/build/include -I$PWD/../libxml2/build/include/libxml2" LDFLAGS="-static -L$PWD/../ncurses/build/lib -L$PWD/../libxml2/build/lib -lpthread -lm -ldl" CC=musl-gcc CXX=musl-gcc --prefix=""
$ ./configure --with-json=no --without-x --without-libsystemd --with-sound=no --without-lcms2 --without-dbus CFLAGS="-static -O3 -I$PWD/../nettle/build/include -I$PWD/../ncurses/build/include -I$PWD/../libxml2/build/include/libxml2 -I$PWD/../gnutls/build/include" LDFLAGS="-static -L$PWD/../nettle/build/lib64 -L$PWD/../ncurses/build/lib -L$PWD/../libxml2/build/lib -L$PWD/../gnutls/build/lib -lnettle -lhogweed -lpthread -lm -ldl -lgnutls" CC=musl-gcc CXX=musl-gcc --prefix=""
$ make -j$(nproc)
$ sudo make DESTDIR=$ROOTFS_MNT install
$ popd
Expand Down
1 change: 1 addition & 0 deletions libev
Submodule libev added at 93823e
1 change: 1 addition & 0 deletions nettle
Submodule nettle added at b28cb4

0 comments on commit 452b530

Please sign in to comment.