Skip to content

Commit

Permalink
Updates to generate xcframework
Browse files Browse the repository at this point in the history
Rename project to OpusKit. The build script has been modified to
generate a xcframework that supports the iPhone (arm64) and
iPhoneSimulator (arm64 and x86_64) platforms.
  • Loading branch information
Trey Ethridge committed Feb 8, 2024
1 parent 109347c commit 3f5a08a
Show file tree
Hide file tree
Showing 21 changed files with 390 additions and 2,814 deletions.
14 changes: 14 additions & 0 deletions OpusKit.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Pod::Spec.new do |s|
s.name = 'OpusKit'
s.version = '1.4.0'
s.summary = 'A totally open, royalty-free, highly versatile audio codec.'
s.homepage = 'https://github.com/Phonebooth/OpusKit'
s.author = 'Trey Ethridge'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.source = {
:http => 'https://github.com/Phonebooth/OpusKit/releases/download/' + s.version.to_s + '/OpusKit.xcframework.zip'
}
s.swift_version = '5.0'
s.ios.deployment_target = '14.0'
s.vendored_frameworks = 'OpusKit.xcframework'
end
Binary file added OpusKit.xcframework.zip
Binary file not shown.
19 changes: 19 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// swift-tools-version:5.9
import PackageDescription
let version = "1.4.0"
let package = Package(
name: "OpusKit",
products: [
.library(
name: "OpusKit",
targets: ["OpusKit"]),
],
dependencies: [],
targets: [
.binaryTarget(
name: "OpusKit",
url: "https://github.com/Phonebooth/OpusKit/releases/download/" + version + "/OpusKit.xcframework.zip",
checksum: "a4c3261546118ae0176110d1fef5bc0c23d0ce6ef3cc6ae035eb211206fccf5a"
)
]
)
46 changes: 10 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,33 @@
# Opus-iOS
# OpusKit

> Opus is a totally open, royalty-free, highly versatile audio codec. Opus is unmatched for interactive speech and music transmission over the Internet, but is also intended for storage and streaming applications. It is standardized by the Internet Engineering Task Force (IETF) as RFC 6716 which incorporated technology from Skype's SILK codec and Xiph.Org's CELT codec.
iOS build scripts for the [Opus Codec](http://www.opus-codec.org).

## Usage

1. (Objective-C) [Build the static library](#building-the-static-library)
2. (Optionally for Swift) [Build the framework](#building-the-framework)
3. (Optionally) Use the [CocoaPod spec](/opus-ios.podspec)
The build-libopus.sh script will download the source automatically, but if you want to manually download the source, you can do that. Download the [latest stable tar file](http://opus-codec.org/downloads/)
and place it into the `build/src` directory

## Building the Static Library

#### Step 1

Download the [latest stable tar file](http://opus-codec.org/downloads/) and place it into the `build/src` directory

Note: If it's a new version of opus or if the iOS SDKs changed since the last time you built it, update that version at the top of the `build-libopus.sh` file.
Note: If it's a new version of opus or if the iOS SDKs changed since the last time you built it, update that version at the top of the `build-xcframework.sh` file.

#### Step 2

From the command line, run:

```bash
$ ./build-libopus.sh
$ ./build-xcframework.sh
```

That will take the tar file and build the static library in a directory called `dependencies`

#### Step 3

Follow the steps above for building the framework from the static library
The script will build static libraries for the iPhone (arm64) and iPhone simulator (arm64 and x86_64). It then creates xcarchives for each platform and then generates an xcframework.

Include the xcframework in your project using Swift package manager or Cocoapods.

## Building the Framework

#### Step 1

Open the `opus/opus.xcodeproj` file, select `UniversalTarget` with a `Generic iOS Device`

#### Step 2

Build the framework by pressing Run; this will overwrite the framework in the repo root.

Note: this runs a custom build script within Build Phases that will build a universal framework with both simulator and device slices

If we have issues with submitting to the app store w/ the extra simulator slices, view this: http://arsenkin.com/ios-universal-framework.html / http://stackoverflow.com/a/30866648/308315

#### Step 3

Ensure the framework includes slices for both simulator and device architectures (x86_64 i386 armv7 armv7s arm64)

```bash
$ lipo -info opus.framework/opus
```
pod 'OpusKit', :git => 'https://github.com/phonebooth/OpusKit.git', :tag => '1.4.0'
```


## License

Expand Down
180 changes: 0 additions & 180 deletions build-libopus.sh

This file was deleted.

Loading

0 comments on commit 3f5a08a

Please sign in to comment.