Skip to content
This repository has been archived by the owner on May 29, 2021. It is now read-only.

CaramelForSwift/CUv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

CUv

A module for libuv in pure Swift applications. This module was built for the use of the Caramel framework.

Installation

First, you must build and install libuv. This package assumes libuv is installed to "/usr", so we'll install it here.

  1. Clone libuv
  2. Check out to the tag you want (this build assumes a minimum of v1.7.5)
  3. cd libuv
  4. sh autogen.sh
  5. ./configure --prefix=/usr
  6. make install (with sudo as needed)

Usage

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)")

License

Written by Steve Streza.

This package is released into the public domain. Any license provided by libuv are still applicable.