Swiftpack.co - ugocottin/CFirebird as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by ugocottin.
ugocottin/CFirebird 0.1.0
Swift modulemap for Firebird
⭐️ 0
🕓 2 weeks ago
macOS
.package(url: "https://github.com/ugocottin/CFirebird.git", from: "0.1.0")

CFirebird

Modulemap to use fbclient library on linux and macOS. The Firebird library is not provided, you have to install it yourself.

Linux

Download the firebird library and install it on your system.

macOS

Download the firebird library and install it on your system.

Link on macOS

Using linkerSettings

let package = Package(
	name: "YourLibrary",
	...
	targets: [
		.target(name: "your-target", linkerSettings: [.unsafeFlags(["-L/usr/local/lib"])])
	]
)

The drawback of this is that SwiftPM disable compilation for remote package dependencies that contains unsafe flags.

Using pkg-config

Put the following configuration to /usr/local/lib/pkgconfig/libfbclient.pc:

prefix=/Library/Frameworks/Firebird.framework
include_dir=${prefix}/Headers
lib_dir=${prefix}/Libraries

Name: libfbclient
Description: none
Version: <YOUR FIREBIRD VERSION>
Cflags: -I${include_dir}
Libs: -L${lib_dir}

Please set your Firebird version in the Version field of the pkgconfig file.

Validate the installation

To ensure that the library if working, execute the tests!

$ swift test

Usage

In Package.swift, add the following depedency

# package.swift
.package(url: "https://github.com/ugocottin/CFirebird.git", from: "0.0.0")

In your swift files, import the Firebird system library

import CFirebird

Enjoy!

GitHub

link
Stars: 0
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Initial release
3 weeks ago

That's all

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics