{"id":21969428,"url":"https://github.com/rhx/swiftclutter","last_synced_at":"2026-05-03T20:38:16.082Z","repository":{"id":70277804,"uuid":"69226222","full_name":"rhx/SwiftClutter","owner":"rhx","description":"A Swift wrapper around clutter that is largely auto-generated from gobject-introspection","archived":false,"fork":false,"pushed_at":"2021-07-24T05:58:45.000Z","size":70833,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-03T02:03:22.607Z","etag":null,"topics":["clutter","swift","swift-wrappers"],"latest_commit_sha":null,"homepage":"https://rhx.github.io/SwiftClutter/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-26T07:51:31.000Z","updated_at":"2021-07-09T23:32:58.000Z","dependencies_parsed_at":"2023-05-12T02:00:34.074Z","dependency_job_id":null,"html_url":"https://github.com/rhx/SwiftClutter","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/rhx/SwiftClutter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhx%2FSwiftClutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhx%2FSwiftClutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhx%2FSwiftClutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhx%2FSwiftClutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhx","download_url":"https://codeload.github.com/rhx/SwiftClutter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhx%2FSwiftClutter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32584615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clutter","swift","swift-wrappers"],"created_at":"2024-11-29T14:20:02.510Z","updated_at":"2026-05-03T20:38:16.075Z","avatar_url":"https://github.com/rhx.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftClutter\n\nA Swift wrapper around clutter that is largely auto-generated from gobject-introspection\n\n![macOS 11 build](https://github.com/rhx/SwiftClutter/workflows/macOS%2011/badge.svg)\n![macOS 10.15 build](https://github.com/rhx/SwiftClutter/workflows/macOS%2010.15/badge.svg)\n![Ubuntu 20.04 build](https://github.com/rhx/SwiftClutter/workflows/Ubuntu%2020.04/badge.svg)\n![Ubuntu 18.04 build](https://github.com/rhx/SwiftClutter/workflows/Ubuntu%2018.04/badge.svg)\n\n## What is new?\n\nVersion 12 of gir2swift pulls in [PR#10](https://github.com/rhx/gir2swift/pull/10), addressing several issues:\n\n- Improvements to the Build experience and LSP [rhx/SwiftGtk#34](https://github.com/rhx/SwiftGtk/issues/34)\n- Fix issues with LLDB [rhx/SwiftGtk#39](https://github.com/rhx/SwiftGtk/issues/39)\n- **Controversial:** Implicitly marks all declarations named \"priv\" as if they had attribute `private=1`\n- Prevents all \"Private\" records from generating unless generated in their instance record\n  - `-a` option generates all records\n- Introduces CI\n- For Class metadata types no longer generates class wrappers. Ref structs now contain static method which returnes the GType of the class and instance of the Class metatype wrapped in the Ref struct.\n- Adds final class GWeak\u003cT\u003e where T could be any Ref struct of a type which supports ARC. This class is a property wrapper which contains weak reference to any instance of T. This is especially beneficial for capture lists.\n- Adds support for weak observation.\n- Constructors and factories of GObjectInitiallyUnowned classes now consume floating reference upon initialisation as advised by [the GObject documentation](https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html)\n\nPartially implemented:\n- Typed signal generation. Issues shown in [rhx/SwiftGtk#35](https://github.com/rhx/SwiftGtk/issues/35) hat remain to be addressed are listed here: [mikolasstuchlik/gir2swift#2](https://github.com/mikolasstuchlik/gir2swift/pull/2).\n\n### Other notable changes\n\nVersion 11 introduces a new type system into `gir2swift`,\nto ensure it has a representation of the underlying types.\nThis is necessary for Swift 5.3 onwards, which requires more stringent casts.\nAs a consequence, accessors can accept and return idiomatic Swift rather than\nunderlying types or pointers.\nThis means that a lot of the changes will be source-breaking for code that\nwas compiled against libraries built with earlier versions of `gir2swift`.\n\n * Parameters use idiomatic Swift names (e.g. camel case instead of snake case, splitting out of \"for\", \"from\", etc.)\n * Uses the namespace referenced in the `gir` file\n * Requires Swift 5.2 or later\n * Wrapper code is now `@inlinable` to enable the compiler to optimise away most of the wrappers\n * Parameters and return types use more idiomatic Swift (e.g. `Ref` wrappers instead of pointers, `Int` instead of `gint`, etc.)\n * Functions that take or return records now are templated instead of using the type-erased Protocol\n * `ErrorType` has been renamed `GLibError` to ensure it neither clashes with `Swift.Error` nor the `GLib.ErrorType`  scanner enum\n * Parameters or return types for records/classes now use the corresponding, lightweight Swift `Ref` wrapper instead of the underlying pointer\n\n## Prerequisites\n\n### Swift\n\nTo build, you need at least Swift 5.2 (but some Linux distributions have issues and seem to **require at least Swift 5.5**), download from https://swift.org/download/ -- if you are using macOS, make sure you have the command line tools installed as well).  Test that your compiler works using `swift --version`, which should give you something like\n\n\t$ swift --version\n\tApple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)\n    Target: x86_64-apple-darwin20.5.0\n\non macOS, or on Linux you should get something like:\n\n\t$ swift --version\n\tSwift version 5.4 (swift-5.4-RELEASE)\n\tTarget: x86_64-unknown-linux-gnu\n\n### Clutter, GLib 2.56 or higher\n\nThese Swift wrappers have been tested with glib-2.56, 2.58, 2.60, 2.62, 2.64, 2.66, and 2.68.  They should work with higher versions, but YMMV.  Also make sure you have `gobject-introspection` and its `.gir` files installed.\n\n#### Linux\n\n##### Ubuntu\n\nOn Ubuntu 20.04 and 18.04 you can use the gtk that comes with the distribution.  Just install with the `apt` package manager:\n\n\tsudo apt update\n\tsudo apt install libclutter-1.0-dev gir1.2-clutter-1.0 libcogl-dev gir1.2-cogl-1.0 libcogl-pango-dev gir1.2-coglpango-1.0 libgdk-pixbuf2.0-dev gir1.2-gdkpixbuf-2.0 libglib2.0-dev glib-networking gobject-introspection libgirepository1.0-dev libxml2-dev jq\n\n##### Fedora\n\nOn Fedora 29, you can use the gtk that comes with the distribution.  Just install with the `dnf` package manager:\n\n\tsudo dnf install clutter-devel cogl-devel pango-devel cairo-devel cairo-gobject-devel glib2-devel gobject-introspection-devel libxml2-devel\n\n#### macOS\n\nOn macOS, you can install glib and Clutter using HomeBrew (for setup instructions, see http://brew.sh).  Once you have a running HomeBrew installation, you can use it to install a native version of Clutter:\n\n\tbrew update\n\tbrew install clutter glib glib-networking gobject-introspection pkg-config\n\n## Usage\n\nNormally, you don't build this package directly (but for testing you can - see 'Building' below). Instead you need to embed SwiftClutter into your own project using the [Swift Package Manager](https://swift.org/package-manager/).  After installing the prerequisites (see 'Prerequisites' below), add `SwiftClutter` as a dependency to your `Package.swift` file, e.g.:\n\n```Swift\n// swift-tools-version:5.3\n\nimport PackageDescription\n\nlet package = Package(name: \"MyPackage\",\n    dependencies: [\n        .package(name: \"gir2swift\", url: \"https://github.com/rhx/gir2swift.git\", .branch(\"main\")),\n        .package(name: \"Clutter\", url: \"https://github.com/rhx/SwiftClutter.git\", .branch(\"main\")),\n    ],\n    targets: [.target(name: \"MyPackage\", dependencies: [\"Clutter\"])]\n)\n```\n\n## Building\n\nNormally, you don't build this package directly, but you embed it into your own project (see 'Usage' above).  However, you can build and test this module separately to ensure that everything works.  Make sure you have all the prerequisites installed (see above).  After that, you can simply clone this repository and build the command line executable (be patient, this will download all the required dependencies and take a while to compile) using\n\n\tgit clone https://github.com/rhx/SwiftClutter.git\n\tcd SwiftClutter\n    ./run-gir2swift.sh\n    swift build\n    swift test\n\nPlease note that on macOS, due to a bug in the Swift Package Manager prior to Swift 5.4,\nif you have Xcode-12.4 or older, you need to pass in the build flags manually,\ni.e. instead of `swift build` and `swift test` you can run\n\n    swift build `./run-gir2swift.sh flags -noUpdate`\n    swift test  `./run-gir2swift.sh flags -noUpdate`\n\n\n## Building\nNormally, you don't build this package directly, but you embed it into your own project (see 'Embedding' below).  However, you can build and test this module separately to ensure that everything works.  Make sure you have all the prerequisites installed (see above).  After that, you can simply clone this repository and build the command line executable (be patient, this will download all the required dependencies and take a while to compile) using\n\n\tgit clone https://github.com/rhx/SwiftClutter.git\n\tcd SwiftClutter\n\t./build.sh\n\t./test.sh\n\n### Xcode\n\nOn macOS, you can build the project using Xcode instead.  To do this, you need to create an Xcode project first, then open the project in the Xcode IDE:\n\n\t./xcodegen.sh\n\topen Clutter.xcodeproj\n\nAfter that, use the (usual) Build and Test buttons to build/test this package.\n\n## Documentation\n\nYou can find reference documentation inside the [docs](https://rhx.github.io/SwiftGLib/) folder.\nThis was generated using the [jazzy](https://github.com/realm/jazzy) tool.\nIf you want to generate your own documentation, matching your local installation,\nyou can use the `generate-documentation.sh` script in the repository.\nMake sure you have [sourcekitten](https://github.com/jpsim/SourceKitten) and [jazzy](https://github.com/realm/jazzy) installed, e.g. on macOS:\n\n\tbrew install sourcekitten\n\tsudo gem install jazzy\n\t./run-gir2swift.sh\n\t./generate-documentation.sh\n\n\n## Troubleshooting\n\nHere are some common errors you might encounter and how to fix them.\n\n### Missing `.gir` Files\nIf you get an error such as\n\n\tGirs located at\n\tCannot open '/GLib-2.0.gir': No such file or directory\n\nMake sure that you have the relevant `gobject-introspection` packages installed (as per the Pre-requisites section), including their `.gir` and `.pc` files.\n\n### Old Swift toolchain or Xcode\nIf, when you run `swift build`, you get a `Segmentation fault (core dumped)` or circular dependency error such as\n\n\twarning: circular dependency detected while parsing pangocairo: harfbuzz -\u003e freetype2 -\u003e harfbuzz\n\t\nthis probably means that your Swift toolchain is too old, particularly on Linux (at the time of this writing, some Linux distributions require at least Swift 5.5).  Make sure the latest toolchain is the one that is found when you run the Swift compiler (see above).\n\n  If you get an older version, make sure that the right version of the swift compiler is found first in your `PATH`.  On macOS, use xcode-select to select and install the latest version, e.g.:\n\n\tsudo xcode-select -s /Applications/Xcode.app\n\txcode-select --install\n\n### Known Issues\n\n * When building, a lot of warnings appear.  This is largely an issue with automatic `RawRepresentable` conformance in the Swift Standard library.  As a workaround, you can turn this off by passing the `-Xswiftc -suppress-warnings` parameter when building.\n \n * The current build system does not support directory paths with spaces (e.g. the `My Drive` directory used by Google Drive File Stream).\n * BUILD_DIR is not supported in the current build system.\n \nAs a workaround, you can use the old build scripts, e.g. `./build.sh` (instead of `run-gir2swift.sh` and `swift build`) to build a package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhx%2Fswiftclutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhx%2Fswiftclutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhx%2Fswiftclutter/lists"}