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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ cmake-build-*
/.idea
/.dart_tool/
pubspec_overrides.yaml
build/
build/
.build/
.swiftpm/
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A new Flutter plugin project.
s.author = { 'Your Company' => 'email@example.com' }

s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.source_files = 'desktop_keep_screen_on/Sources/desktop_keep_screen_on/**/*'
s.dependency 'FlutterMacOS'

s.platform = :osx, '10.11'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// swift-tools-version: 5.9
import PackageDescription

let package = Package(
name: "desktop_keep_screen_on",
platforms: [
.macOS("10.11")
],
products: [
.library(name: "desktop-keep-screen-on", targets: ["desktop_keep_screen_on"])
],
dependencies: [
.package(name: "FlutterFramework", path: "../FlutterFramework")
],
targets: [
.target(
name: "desktop_keep_screen_on",
dependencies: [
.product(name: "FlutterFramework", package: "FlutterFramework")
]
)
]
)
2 changes: 1 addition & 1 deletion packages/desktop_lifecycle/macos/desktop_lifecycle.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A new flutter plugin project.
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.source_files = 'desktop_lifecycle/Sources/desktop_lifecycle/**/*'
s.dependency 'FlutterMacOS'

s.platform = :osx, '10.11'
Expand Down
23 changes: 23 additions & 0 deletions packages/desktop_lifecycle/macos/desktop_lifecycle/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// swift-tools-version: 5.9
import PackageDescription

let package = Package(
name: "desktop_lifecycle",
platforms: [
.macOS("10.11")
],
products: [
.library(name: "desktop-lifecycle", targets: ["desktop_lifecycle"])
],
dependencies: [
.package(name: "FlutterFramework", path: "../FlutterFramework")
],
targets: [
.target(
name: "desktop_lifecycle",
dependencies: [
.product(name: "FlutterFramework", package: "FlutterFramework")
]
)
]
)
Binary file removed packages/fts5_simple/macos/Libs/libsimple.dylib
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/fts5_simple/macos/fts5_simple.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ A new flutter plugin project.
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.source_files = 'fts5_simple/Sources/fts5_simple/**/*'
s.dependency 'FlutterMacOS'
s.vendored_libraries = 'libs/libsimple.dylib'
s.vendored_libraries = 'fts5_simple/Libs/libsimple.xcframework/macos-arm64_x86_64/libsimple.dylib'

s.platform = :osx, '10.11'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
Expand Down
19 changes: 19 additions & 0 deletions packages/fts5_simple/macos/fts5_simple/Libs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# libsimple

`libsimple.xcframework` contains a universal macOS dylib assembled from the
official [libsimple v0.7.1 release](https://github.com/wangfenjin/simple/releases/tag/v0.7.1):

- `libsimple-osx-arm64.zip`
(`b699f0fca1e7d1f8776d067708ecf4d0bcc2d765e4b643862e129058583b885f`)
- `libsimple-osx-x64.zip`
(`d6f7e9fc9dac3c2bcfb5389618d41f2f0db6ea5a83dd8b9a363cf9b02fa20f95`)

After extracting both archives, create and ad-hoc sign the universal dylib:

```sh
lipo -create \
libsimple-osx-arm64/libsimple.dylib \
libsimple-osx-x64/libsimple.dylib \
-output libsimple.dylib
codesign --force --sign - libsimple.dylib
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>libsimple.dylib</string>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>libsimple.dylib</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file not shown.
28 changes: 28 additions & 0 deletions packages/fts5_simple/macos/fts5_simple/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// swift-tools-version: 5.9
import PackageDescription

let package = Package(
name: "fts5_simple",
platforms: [
.macOS("10.11")
],
products: [
.library(name: "fts5-simple", targets: ["fts5_simple"])
],
dependencies: [
.package(name: "FlutterFramework", path: "../FlutterFramework")
],
targets: [
.binaryTarget(
name: "libsimple",
path: "Libs/libsimple.xcframework"
),
.target(
name: "fts5_simple",
dependencies: [
.product(name: "FlutterFramework", package: "FlutterFramework"),
"libsimple"
]
)
]
)
8 changes: 0 additions & 8 deletions packages/ogg_opus_player/darwin/Classes/OggOpusPlayerPlugin.h

This file was deleted.

15 changes: 0 additions & 15 deletions packages/ogg_opus_player/darwin/Classes/OggOpusPlayerPlugin.m

This file was deleted.

1 change: 0 additions & 1 deletion packages/ogg_opus_player/darwin/Classes/ogg_opus_player.h

This file was deleted.

15 changes: 14 additions & 1 deletion packages/ogg_opus_player/darwin/function.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cd "$(dirname \"$0\")"
REPOROOT=$(pwd)

# Where we'll end up storing things in the end
OUTPUTDIR="${REPOROOT}"
OUTPUTDIR="${REPOROOT}/ogg_opus_player"
mkdir -p ${OUTPUTDIR}/Frameworks

BUILDDIR="${REPOROOT}/build"
Expand Down Expand Up @@ -162,6 +162,19 @@ function generate_xc_framework_info_plist() {
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>lib${lib_name}.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
<dict>
<key>HeadersPath</key>
<string>Headers</string>
Expand Down
6 changes: 3 additions & 3 deletions packages/ogg_opus_player/darwin/ogg_opus_player.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ A new flutter plugin project.
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*', 'Headers/**/*'
s.source_files = 'ogg_opus_player/Sources/**/*'
s.ios.dependency 'Flutter'
s.osx.dependency 'FlutterMacOS'
s.frameworks = 'Speech', 'AVFoundation', 'AudioToolbox'
s.ios.deployment_target = '13.0'
s.osx.deployment_target = '10.15'

s.ios.vendored_frameworks = 'Frameworks/libogg.xcframework', 'Frameworks/libopus.xcframework', 'Frameworks/libopusenc.xcframework', 'Frameworks/libopusfile.xcframework'
s.osx.vendored_libraries = 'Libs/libogg.a', 'Libs/libopus.a', 'Libs/libopusenc.a', 'Libs/libopusfile.a'
s.ios.vendored_frameworks = 'ogg_opus_player/Frameworks/libogg.xcframework', 'ogg_opus_player/Frameworks/libopus.xcframework', 'ogg_opus_player/Frameworks/libopusenc.xcframework', 'ogg_opus_player/Frameworks/libopusfile.xcframework'
s.osx.vendored_libraries = 'ogg_opus_player/Frameworks/libogg.xcframework/macos-arm64_x86_64/libogg.a', 'ogg_opus_player/Frameworks/libopus.xcframework/macos-arm64_x86_64/libopus.a', 'ogg_opus_player/Frameworks/libopusenc.xcframework/macos-arm64_x86_64/libopusenc.a', 'ogg_opus_player/Frameworks/libopusfile.xcframework/macos-arm64_x86_64/libopusfile.a'

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386', 'ENABLE_BITCODE' => 'NO' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>libogg.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
<dict>
<key>HeadersPath</key>
<string>Headers</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>libopus.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
<dict>
<key>HeadersPath</key>
<string>Headers</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>libopusenc.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
<dict>
<key>HeadersPath</key>
<string>Headers</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>libopusfile.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
<dict>
<key>HeadersPath</key>
<string>Headers</string>
Expand Down
34 changes: 34 additions & 0 deletions packages/ogg_opus_player/darwin/ogg_opus_player/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// swift-tools-version: 5.9
import PackageDescription

let package = Package(
name: "ogg_opus_player",
platforms: [
.iOS("13.0"),
.macOS("10.15")
],
products: [
.library(name: "ogg-opus-player", targets: ["ogg_opus_player"])
],
dependencies: [
.package(name: "FlutterFramework", path: "../FlutterFramework")
],
targets: [
.binaryTarget(name: "libogg", path: "Frameworks/libogg.xcframework"),
.binaryTarget(name: "libopus", path: "Frameworks/libopus.xcframework"),
.binaryTarget(name: "libopusenc", path: "Frameworks/libopusenc.xcframework"),
.binaryTarget(name: "libopusfile", path: "Frameworks/libopusfile.xcframework"),
.target(
name: "ogg_opus_player_c",
dependencies: ["libogg", "libopus", "libopusenc", "libopusfile"],
publicHeadersPath: "include/ogg_opus_player_c"
),
.target(
name: "ogg_opus_player",
dependencies: [
.product(name: "FlutterFramework", package: "FlutterFramework"),
"ogg_opus_player_c"
]
)
]
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Foundation
#if SWIFT_PACKAGE
import ogg_opus_player_c
#endif

class OggOpusReader {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Foundation
#if SWIFT_PACKAGE
import ogg_opus_player_c
#endif

fileprivate let numberOfChannels: Int32 = 1;
fileprivate let outputBitRate: Int32 = 16 * 1024;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern "C" {
#endif

#include <stddef.h>
#include <ogg_os_types.h>
#include "ogg_os_types.h"

typedef struct {
void *iov_base;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extern "C" {
# endif

#include <stddef.h>
#include <opus.h>
#include "opus.h"

#ifndef OPE_EXPORT
# if defined(WIN32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ extern "C" {

# include <stdarg.h>
# include <stdio.h>
# include <ogg.hh>
# include <opus_multistream.h>
# include "ogg.hh"
# include "opus_multistream.h"

/**@cond PRIVATE*/

Expand Down
Loading
Loading