Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 0 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ on:
branches: [main]

jobs:
podspec:
name: Lint Podspec for ${{ matrix.platform }}
runs-on: macos-14
strategy:
matrix:
platform: [ios, osx, tvos]
steps:
- uses: actions/checkout@v3
- name: Lint Podspec
run: pod lib lint --platforms=${{ matrix.platform }}
xcodebuild:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
Expand Down
66 changes: 66 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
Packages/
Package.pins
# Package.resolved
*.xcodeproj

# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
.swiftpm

.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# AI Tools
CLAUDE.md
.claude
32 changes: 32 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "geos",
platforms: [.iOS(.v12), .macOS(.v10_13), .tvOS(.v12), .watchOS(.v4), .visionOS(.v1)],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "geos",
type: .dynamic,
targets: ["geos"]
),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "geos",
publicHeadersPath: "public",
cxxSettings: [
.define("USE_UNSTABLE_GEOS_CPP_API"),
.define("NDEBUG"),
.headerSearchPath("include"),
.headerSearchPath("src/deps")
]
)
],
cxxLanguageStandard: .cxx17
)
74 changes: 74 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# GEOS

This library is an SPM-compatible repackaging of the source code from [libgeos/geos](https://github.com/libgeos/geos) for use on Apple and Linux systems.

> GEOS is a C++ library for performing operations on two-dimensional vector
> geometries. It is primarily a port of the [JTS Topology
> Suite](https://github.com/locationtech/jts) Java library. It provides many of
> the algorithms used by [PostGIS](http://www.postgis.net/), the
> [Shapely](https://pypi.org/project/Shapely/) package for Python, the
> [sf](https://github.com/r-spatial/sf) package for R, and others.

## Requirements

- Swift 5.9+
- iOS 12.0+ / macOS 10.13+ / tvOS 12.0+ / watchOS 4.0+ / visionOS 1.0+
- Linux

## Usage

### Swift Package Manager (SPM)

Add the following to your `Package.swift`:

```swift
let package = Package(
name: "YourPackage",
dependencies: [
.package(url: "https://github.com/GEOSwift/geos.git", from: "11.0.0")
],
targets: [
.target(
name: "YourTarget",
dependencies: [
.product(name: "geos", package: "geos")
]
)
]
)
```

### Basic Usage

```swift
import geos

// The geos C API is now available for use
```

> [!NOTE]
> `geos` is built as a dynamically-linked library for maximum compliance with the LGPL 2.1 license. Use of statically-linked `geos` is discouraged.

## Versioning

Currently version 11.0.0 packages [libgeos/geos 3.14.1](https://github.com/libgeos/geos/releases/tag/3.14.1).

This package follows [SemVer](https://semver.org) principles and therefore its versions don't map 1:1 with the underlying geos library. When a geos release identifies any changes as breaking, we will release a new major version of this library.

## Licensing

The source code contained in this repo is released under a dual license:
* The contents of the `Sources` directory are taken from [libgeos/geos](https://github.com/libgeos/geos) and distributed under the LGPL 2.1 license (see [COPYING](https://github.com/GEOSwift/geos/blob/main/Sources/COPYING)).
* The other content of this repo is distributed under the MIT [LICENSE](https://github.com/GEOSwift/geos/blob/main/LICENSE).

## Releasing a new version

* Create a new branch.
* Modify `update.sh` to successfully pull the new version of geos and construct an SPM-compatible `Sources` directory. This only entails pointing at a new source archive unless geos releases a new version with different build structure (rare).
* Run `update.sh`.
* Modify `Package.swift` if necessary.
* Test the supported platforms (Apple Devices/Linux) with both CLI and Xcode.
* Update this `README.md` with any relevant information (e.g. new version numbers).
* Commit all modifications and open a PR.
* Once merged, release a new version numbered according to [SemVer](https://semver.org) principles. If the underlying geos release contains *any* breaking changes, increment the major release here. Minor and patch version increments are at your discretion.

Loading