mirror of https://github.com/vacp2p/nim-ngtcp2.git
Initial version of ngtcp2 wrapper
This commit is contained in:
commit
6fdeaa707a
|
@ -0,0 +1,5 @@
|
|||
[*]
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = true
|
|
@ -0,0 +1,3 @@
|
|||
*
|
||||
!*/
|
||||
!*.*
|
|
@ -0,0 +1 @@
|
|||
nim 1.2.6
|
|
@ -0,0 +1,6 @@
|
|||
ngtcp2 for Nim
|
||||
==============
|
||||
|
||||
Wrapper around the [ngtcp2](https://github.com/ngtcp2/ngtcp2) C library for
|
||||
[Nim](https://nim-lang.org/). Requires [CMake](https://cmake.org/) to be
|
||||
installed.
|
|
@ -0,0 +1,20 @@
|
|||
import os
|
||||
import nimterop/cimport
|
||||
import ngtcp2/sources
|
||||
|
||||
static:
|
||||
cCompile(ngtcp2src/"lib"/"*.c")
|
||||
|
||||
when defined(windows):
|
||||
const socketheader = "<winsock2.h>"
|
||||
else:
|
||||
const socketheader = "<sys/socket.h>"
|
||||
|
||||
type
|
||||
sockaddr
|
||||
{.header: socketheader, importc: "sockaddr".} = object
|
||||
sockaddr_storage
|
||||
{.header: socketheader, importc: "sockaddr_storage".} = object
|
||||
|
||||
cIncludeDir(ngtcp2src/"lib"/"includes")
|
||||
cImport(ngtcp2src/"lib"/"includes"/"ngtcp2"/"ngtcp2.h")
|
|
@ -0,0 +1,13 @@
|
|||
packageName = "ngtcp2"
|
||||
version = "0.1.0"
|
||||
author = "Status Research & Development GmbH"
|
||||
description = "Nim wrapper around the ngtcp2 library"
|
||||
license = "MIT"
|
||||
|
||||
requires "nim >= 1.2.6"
|
||||
requires "nimterop >= 0.6.11 & < 0.7.0"
|
||||
|
||||
import os
|
||||
|
||||
after install:
|
||||
exec "nim c -r " & currentSourcePath.parentDir/"ngtcp2"/"make.nim"
|
|
@ -0,0 +1,14 @@
|
|||
import nimterop/build
|
||||
import sources
|
||||
|
||||
static:
|
||||
gitPull(
|
||||
"https://github.com/ngtcp2/ngtcp2",
|
||||
checkout="d234d50",
|
||||
outdir=ngtcp2src
|
||||
)
|
||||
cmake(
|
||||
ngtcp2src,
|
||||
check="lib"/"includes"/"ngtcp2"/"version.h",
|
||||
flags="."
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
import nimterop/build
|
||||
|
||||
const ngtcp2src* = getProjectCacheDir("ngtcp2")
|
Loading…
Reference in New Issue