A module for libuv in pure Swift applications. This module was built for the use of the Caramel framework.
First, you must build and install libuv. This package assumes libuv is installed to "/usr", so we'll install it here.
- Clone libuv
- Check out to the tag you want (this build assumes a minimum of
v1.7.5
) cd libuv
sh autogen.sh
./configure --prefix=/usr
make install
(withsudo
as needed)
Add this to your Package.swift
file:
import PackageDescription
let package = Package(
dependencies: [
.Package(url: "https://github.com/CaramelForSwift/CUv.git", majorVersion: 1)
]
)
Then you can import the module and use libuv
functions like so:
import CUv
let loop = uv_default_loop()
uv_run(loop, UV_RUN_DEFAULT)
print("Event loop: \(loop)")
Written by Steve Streza.
This package is released into the public domain. Any license provided by libuv
are still applicable.