Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[URGENT] Fix CocoaPods and Swift Package Manager Installation Methods #872

Merged
merged 1 commit into from Jul 2, 2024
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
3 changes: 3 additions & 0 deletions CHANGES_AND_TODO_LIST.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Zip, nada, zilch. Got any ideas?

If you would like to contribute some code ... awesome! I just ask that you make it conform to the coding conventions already set in here, and to add the necessary of tests for your new code to tests target. And of course, the code should be of general use to more than just a couple of folks. Send your patches to gus@flyingmeat.com.

2024.05.29 Version 2.7.12
Fix Privacy Manifest resource bundling for CocoaPods and Swift Package Manager installation methods.

2023.02.08 - 2023.05.23 Versions 2.7.9 - 2.7.11
CocoaPods-related fixes and tweaks.

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ David Hart
Mike Ash
Julius Scott
Justin Miller
Troy Stump

Aaaaannnd, Gus Mueller (that's me!)
57 changes: 27 additions & 30 deletions FMDB.podspec
Original file line number Diff line number Diff line change
@@ -1,60 +1,57 @@
Pod::Spec.new do |s|
s.name = 'FMDB'
s.version = '2.7.11'
s.version = '2.7.12'
s.summary = 'A Cocoa / Objective-C wrapper around SQLite.'
s.homepage = 'https://github.com/ccgus/fmdb'
s.license = 'MIT'
s.author = { 'August Mueller' => 'gus@flyingmeat.com' }
s.source = { :git => 'https://github.com/ccgus/fmdb.git', :tag => "#{s.version}" }
s.requires_arc = true
s.ios.deployment_target = '11.0'
s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.13'
s.watchos.deployment_target = '7.0'
s.tvos.deployment_target = '11.0'
s.tvos.deployment_target = '12.0'
s.cocoapods_version = '>= 1.12.0'
s.default_subspec = 'standard'

# use the built-in library version of sqlite3
s.subspec 'standard' do |ss|
ss.library = 'sqlite3'
s.subspec 'Core' do |ss|
ss.source_files = 'src/fmdb/FM*.{h,m}'
ss.exclude_files = 'src/fmdb.m'
ss.header_dir = 'fmdb'
ss.resource_bundles = { 'FMDB_Privacy' => 'privacy/PrivacyInfo.xcprivacy' }
end

# use the built-in library version of sqlite3
s.subspec 'standard' do |ss|
ss.dependency 'FMDB/Core'
ss.library = 'sqlite3'
end

# use the built-in library version of sqlite3 with custom FTS tokenizer source files
s.subspec 'FTS' do |ss|
ss.source_files = 'src/extra/fts3/*.{h,m}'
ss.dependency 'FMDB/standard'
ss.source_files = 'src/extra/fts3/*.{h,m}'
end

# Commenting these out (2024.2.26) to get CocoaPods upstream stuff working again.

# build the latest stable version of sqlite3
#s.subspec 'standalone' do |ss|
# ss.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DFMDB_SQLITE_STANDALONE' }
# ss.dependency 'sqlite3'
# ss.source_files = 'src/fmdb/FM*.{h,m}'
# ss.exclude_files = 'src/fmdb.m'
# ss.header_dir = 'fmdb'
#end
s.subspec 'standalone' do |ss|
ss.dependency 'FMDB/Core'
ss.dependency 'sqlite3', '~> 3.46'
ss.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DFMDB_SQLITE_STANDALONE' }
end

# build with FTS support and custom FTS tokenizer source files
#s.subspec 'standalone-fts' do |ss|
# ss.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DFMDB_SQLITE_STANDALONE' }
# ss.source_files = 'src/fmdb/FM*.{h,m}', 'src/extra/fts3/*.{h,m}'
# ss.exclude_files = 'src/fmdb.m'
# ss.header_dir = 'fmdb'
# ss.dependency 'sqlite3/fts'
#end
s.subspec 'standalone-fts' do |ss|
ss.dependency 'FMDB/Core'
ss.dependency 'sqlite3/fts', '~> 3.46'
ss.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DFMDB_SQLITE_STANDALONE' }
ss.source_files = 'src/extra/fts3/*.{h,m}'
end

# use SQLCipher and enable -DSQLITE_HAS_CODEC flag
s.subspec 'SQLCipher' do |ss|
ss.dependency 'SQLCipher', '~> 4.0'
ss.source_files = 'src/fmdb/FM*.{h,m}'
ss.exclude_files = 'src/fmdb.m'
ss.header_dir = 'fmdb'
ss.resource_bundles = {'SQLCipher' => ['privacy/PrivacyInfo.xcprivacy']}
ss.dependency 'FMDB/Core'
ss.dependency 'SQLCipher', '~> 4.6'
ss.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DSQLITE_HAS_CODEC -DHAVE_USLEEP=1 -DSQLCIPHER_CRYPTO', 'HEADER_SEARCH_PATHS' => 'SQLCipher' }
end

s.resource_bundles = {'FMDB' => ['privacy/PrivacyInfo.xcprivacy']}
end
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -20,6 +20,7 @@ let package = Package(
name: "FMDB",
dependencies: [],
path: "src/fmdb",
resources: [.process("../../privacy/PrivacyInfo.xcprivacy")],
publicHeadersPath: "."),
]
)
4 changes: 2 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Then, edit the `Podfile`, adding `FMDB`:

```ruby
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
# platform :ios, '12.0'

target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
Expand Down Expand Up @@ -78,7 +78,7 @@ Declare FMDB as a package dependency.
.package(
name: "FMDB",
url: "https://github.com/ccgus/fmdb",
.upToNextMinor(from: "2.7.8")),
.upToNextMinor(from: "2.7.12")),
```

Use FMDB in target dependencies
Expand Down
2 changes: 1 addition & 1 deletion Tests/FMDatabaseTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ - (void)createCustomFunctions {
*/

- (void)testUserVersion {
NSComparisonResult result = [[FMDatabase FMDBUserVersion] compare:@"2.7.8" options:NSNumericSearch];
NSComparisonResult result = [[FMDatabase FMDBUserVersion] compare:@"2.7.12" options:NSNumericSearch];
XCTAssertEqual(result, NSOrderedSame);
}

Expand Down
2 changes: 1 addition & 1 deletion src/fmdb/FMDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ func executeUpdate(sql: String, values: [Any]?) throws -> Bool { }

+ (NSString*)sqliteLibVersion;

/// The FMDB version number as a string in the form of @c "2.7.8" .
/// The FMDB version number as a string in the form of @c "2.7.12" .
///
/// If you want to compare version number strings, you can use NSNumericSearch option:
///
Expand Down
2 changes: 1 addition & 1 deletion src/fmdb/FMDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ - (NSURL *)databaseURL {
}

+ (NSString*)FMDBUserVersion {
return @"2.7.8";
return @"2.7.12";
}

+ (SInt32)FMDBVersion {
Expand Down