mirror of
https://github.com/vacp2p/nim-ngtcp2.git
synced 2026-01-09 21:18:07 -05:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9456daa178 | ||
|
|
eb04494047 | ||
|
|
525d9cfe25 | ||
|
|
95412ee90a | ||
|
|
98372a266e |
@@ -16,7 +16,8 @@ Updating to a newer version
|
||||
|
||||
Follow these steps when updating the wrapper to a newer version of ngtcp2:
|
||||
|
||||
1. update the git submodule in `sources/` to point to the new version
|
||||
2. run `build.sh` (requires Nim and CMake to be installed)
|
||||
3. update the version in `ngtcp2.nimble`
|
||||
4. commit the changes
|
||||
- update the git submodule in `libs/` to point to the new version
|
||||
- `git submodule update --init --recursive`
|
||||
- run `build.sh` (requires Nim, CMake and clang to be installed)
|
||||
- increase the `version` property in the `ngtcp2.nimble` file
|
||||
- commit the changes
|
||||
|
||||
14
build.sh
14
build.sh
@@ -26,14 +26,26 @@ for file in `ls "${root}/build/lib"/*.c`; do
|
||||
toCompile+=("$file")
|
||||
done
|
||||
|
||||
# futhark is required by generate_ngtcp2.nim
|
||||
nimble install futhark@0.15.0
|
||||
|
||||
nim c --maxLoopIterationsVM:100000000 generate_ngtcp2.nim
|
||||
|
||||
# add prelude
|
||||
cat "${root}/prelude.nim" > ngtcp2.nim
|
||||
|
||||
echo >> ngtcp2.nim # linebreak
|
||||
|
||||
for file in "${toCompile[@]}"; do
|
||||
echo "{.compile: \"$file\".}" >> ngtcp2.nim
|
||||
done
|
||||
|
||||
# removes absolute path prefix from comments "Generated based on"
|
||||
sed -i 's/Generated based on.*\/nim-ngtcp2\/libs\//Generated based on \/nim-ngtcp2\/libs\//g' tmp_ngtcp2.nim
|
||||
|
||||
cat tmp_ngtcp2.nim >> ngtcp2.nim
|
||||
|
||||
echo >> ngtcp2.nim # linebreak
|
||||
|
||||
cat "${root}/extras.nim" >> ngtcp2.nim
|
||||
|
||||
rm -f tmp_ngtcp2.nim
|
||||
|
||||
14
extras.nim
Normal file
14
extras.nim
Normal file
@@ -0,0 +1,14 @@
|
||||
type
|
||||
ptls_handshake_properties_t_anon0_t* = struct_st_ptls_handshake_properties_t_anon0_t
|
||||
ptls_handshake_properties_t_anon0_t_client_t* =
|
||||
struct_st_ptls_handshake_properties_t_anon0_t_client_t
|
||||
ptls_handshake_properties_t_anon0_t_client_t_negotiated_protocols_t* =
|
||||
struct_st_ptls_handshake_properties_t_anon0_t_client_t_negotiated_protocols_t
|
||||
ptls_handshake_properties_t_anon0_t_client_t_ech_t* =
|
||||
struct_st_ptls_handshake_properties_t_anon0_t_client_t_ech_t
|
||||
ptls_handshake_properties_t_anon0_t_server_t* =
|
||||
struct_st_ptls_handshake_properties_t_anon0_t_server_t
|
||||
ptls_handshake_properties_t_anon0_t_server_t_selected_psk_binder_t* =
|
||||
struct_st_ptls_handshake_properties_t_anon0_t_server_t_selected_psk_binder_t
|
||||
ptls_handshake_properties_t_anon0_t_server_t_cookie_t* =
|
||||
struct_st_ptls_handshake_properties_t_anon0_t_server_t_cookie_t
|
||||
29
ngtcp2.nim
29
ngtcp2.nim
@@ -9,6 +9,7 @@ import nativesockets
|
||||
when defined(windows):
|
||||
{.passl: "-lws2_32".}
|
||||
{.passc: "-D_WINDOWS".}
|
||||
{.passc: "-D__CRT__NO_INLINE".}
|
||||
else:
|
||||
{.passc: "-DHAVE_UNISTD_H".}
|
||||
|
||||
@@ -4799,21 +4800,21 @@ else:
|
||||
hint("Declaration of " & "struct_ngtcp2_version_info" &
|
||||
" already exists, not redeclaring")
|
||||
when not declared(NGTCP2_VERSION):
|
||||
when "1.6.0" is static:
|
||||
when "1.11.0-DEV" is static:
|
||||
const
|
||||
NGTCP2_VERSION* = "1.6.0" ## Generated based on /home/r/vacp2p/nim-ngtcp2/build/lib/includes/ngtcp2/version.h:39:9
|
||||
NGTCP2_VERSION* = "1.11.0-DEV" ## Generated based on /home/r/vacp2p/nim-ngtcp2/libs/ngtcp2/lib/includes/ngtcp2/version.h:39:9
|
||||
else:
|
||||
let NGTCP2_VERSION* = "1.6.0" ## Generated based on /home/r/vacp2p/nim-ngtcp2/build/lib/includes/ngtcp2/version.h:39:9
|
||||
let NGTCP2_VERSION* = "1.11.0-DEV" ## Generated based on /home/r/vacp2p/nim-ngtcp2/libs/ngtcp2/lib/includes/ngtcp2/version.h:39:9
|
||||
else:
|
||||
static :
|
||||
hint("Declaration of " & "NGTCP2_VERSION" &
|
||||
" already exists, not redeclaring")
|
||||
when not declared(NGTCP2_VERSION_NUM):
|
||||
when 67072 is static:
|
||||
when 68352 is static:
|
||||
const
|
||||
NGTCP2_VERSION_NUM* = 67072 ## Generated based on /home/r/vacp2p/nim-ngtcp2/build/lib/includes/ngtcp2/version.h:49:9
|
||||
NGTCP2_VERSION_NUM* = 68352 ## Generated based on /home/r/vacp2p/nim-ngtcp2/libs/ngtcp2/lib/includes/ngtcp2/version.h:49:9
|
||||
else:
|
||||
let NGTCP2_VERSION_NUM* = 67072 ## Generated based on /home/r/vacp2p/nim-ngtcp2/build/lib/includes/ngtcp2/version.h:49:9
|
||||
let NGTCP2_VERSION_NUM* = 68352 ## Generated based on /home/r/vacp2p/nim-ngtcp2/libs/ngtcp2/lib/includes/ngtcp2/version.h:49:9
|
||||
else:
|
||||
static :
|
||||
hint("Declaration of " & "NGTCP2_VERSION_NUM" &
|
||||
@@ -10412,4 +10413,18 @@ when not declared(PF_INET6):
|
||||
let PF_INET6* = 10 ## Generated based on /usr/include/x86_64-linux-gnu/bits/socket.h:53:9
|
||||
else:
|
||||
static :
|
||||
hint("Declaration of " & "PF_INET6" & " already exists, not redeclaring")
|
||||
hint("Declaration of " & "PF_INET6" & " already exists, not redeclaring")
|
||||
type
|
||||
ptls_handshake_properties_t_anon0_t* = struct_st_ptls_handshake_properties_t_anon0_t
|
||||
ptls_handshake_properties_t_anon0_t_client_t* =
|
||||
struct_st_ptls_handshake_properties_t_anon0_t_client_t
|
||||
ptls_handshake_properties_t_anon0_t_client_t_negotiated_protocols_t* =
|
||||
struct_st_ptls_handshake_properties_t_anon0_t_client_t_negotiated_protocols_t
|
||||
ptls_handshake_properties_t_anon0_t_client_t_ech_t* =
|
||||
struct_st_ptls_handshake_properties_t_anon0_t_client_t_ech_t
|
||||
ptls_handshake_properties_t_anon0_t_server_t* =
|
||||
struct_st_ptls_handshake_properties_t_anon0_t_server_t
|
||||
ptls_handshake_properties_t_anon0_t_server_t_selected_psk_binder_t* =
|
||||
struct_st_ptls_handshake_properties_t_anon0_t_server_t_selected_psk_binder_t
|
||||
ptls_handshake_properties_t_anon0_t_server_t_cookie_t* =
|
||||
struct_st_ptls_handshake_properties_t_anon0_t_server_t_cookie_t
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
packageName = "ngtcp2"
|
||||
version = "0.35.0"
|
||||
version = "0.36.1"
|
||||
author = "Status Research & Development GmbH"
|
||||
description = "Nim wrapper around the ngtcp2 library"
|
||||
license = "MIT"
|
||||
|
||||
@@ -4,9 +4,12 @@ import strformat
|
||||
# Socket definitions
|
||||
import nativesockets
|
||||
|
||||
{.passc: "-DNGTCP2_STATICLIB".}
|
||||
|
||||
when defined(windows):
|
||||
{.passl: "-lws2_32".}
|
||||
{.passc: "-D_WINDOWS".}
|
||||
{.passc: "-D__CRT__NO_INLINE".}
|
||||
else:
|
||||
{.passc: "-DHAVE_UNISTD_H".}
|
||||
|
||||
@@ -30,4 +33,3 @@ const picotlsInclude = root/"libs"/"picotls"/"include"
|
||||
{.passc: fmt"-I{ngtcp2Lib}".}
|
||||
{.passc: fmt"-I{ngtcp2LibIncludes}".}
|
||||
{.passc: fmt"-I{picotlsInclude}".}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user