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.1
Swift modulemap for Firebird
⭐️ 0
🕓 1 year ago
macOS
.package(url: "https://github.com/ugocottin/CFirebird.git", from: "0.1.1")

CFirebird

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

Linking the Firbird library

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

In your swift files, import the Firebird system library

import CFirebird

Enjoy!

GitHub

link
Stars: 0
Last commit: 2 days ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

1 year ago

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