Skip to content

Commit

Permalink
Integrate CAtk as a system library
Browse files Browse the repository at this point in the history
  • Loading branch information
rhx committed Aug 17, 2019
1 parent 869fd9a commit d79d6c8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.0
// swift-tools-version:4.2

import PackageDescription

Expand All @@ -8,11 +8,15 @@ let package = Package(
.library(name: "Atk", targets: ["Atk"]),
],
dependencies: [
.package(url: "https://github.com/rhx/CAtk.git", .branch("master")),
.package(url: "https://github.com/rhx/SwiftGObject.git", .branch("master"))
],
targets: [
.target(name: "Atk", dependencies: ["GLibObject"]),
.systemLibrary(name: "CAtk", pkgConfig: "atk glib-2.0 gio-unix-2.0",
providers: [
.brew(["atk", "glib", "glib-networking", "gobject-introspection"]),
.apt(["libatk1.0-dev", "libglib2.0-dev", "glib-networking", "gobject-introspection", "libgirepository1.0-dev"])
]),
.target(name: "Atk", dependencies: ["CAtk", "GLibObject"]),
.testTarget(name: "AtkTests", dependencies: ["Atk"]),
]
)
20 changes: 20 additions & 0 deletions Sources/CAtk/atk_bridging.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
struct _AtkAction {};
struct _AtkComponent {};
struct _AtkDocument {};
struct _AtkEditableText {};
struct _AtkHyperlinkImpl {};
struct _AtkHypertext {};
struct _AtkImage {};
struct _AtkImplementor {};
struct _AtkRange {};
struct _AtkSelection {};
struct _AtkStreamableContent {};
struct _AtkTable {};
struct _AtkTableCell {};
struct _AtkText {};
struct _AtkValue {};
struct _AtkWindow {};

#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <sys/types.h>
#include <atk/atk.h>
8 changes: 8 additions & 0 deletions Sources/CAtk/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module CAtk [system] {
header "atk_bridging.h"

link "gobject-2.0"
link "glib-2.0"

export *
}

0 comments on commit d79d6c8

Please sign in to comment.