Skip to content

Replacement for #401: Update podspec for SQLCipher+fts3 - #503

Open
evands wants to merge 4 commits into
ccgus:masterfrom
evands:sqlcipher_fts3_cocoapods
Open

evands wants to merge 4 commits into
ccgus:masterfrom
evands:sqlcipher_fts3_cocoapods

Conversation

@evands

@evands evands commented Jun 8, 2016

Copy link
Copy Markdown

It turned out to be significantly easier and clearer to just create a new branch and pull request for this fix. The first commit just simplifies the podspec to use dependencies to deduplicate code; the second adds FMDB/SQLCipher/FTS3

@ccgus

ccgus commented Jun 8, 2016

Copy link
Copy Markdown
Owner

@stephanheilner - can you quickly review this (since you seem to use cocoa pods) and let me know if it looks OK?

Comment thread FMDB.podspec Outdated
ss.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DSQLITE_HAS_CODEC -DHAVE_USLEEP=1' }
end

ss.dependency 'FMDB/common'

@stephanheilner stephanheilner Jun 8, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though it wouldn't affect how this functions, the indentation on this is wrong:

ss.dependency 'SQLCipher'
ss.dependency 'FMDB/common'
ss.xcconfig = ...

@stephanheilner

Copy link
Copy Markdown
Contributor

I added some suggestions and made some comments inline.

…ns: standard, standard/FTS, standalone, standalone/FTS, SQLCipher, and SQLCipher/FTS.

Thanks to @stephanheilner for the helpful review.
@evands

evands commented Jun 9, 2016

Copy link
Copy Markdown
Author

@stephanheilner: Please see [300d0fe] and let me know if you have any further suggestions. I think we've got a much cleaner podspec now as a result of these efforts.

@evands

evands commented Jun 9, 2016

Copy link
Copy Markdown
Author

Finally, we'll need to bump the podfile version number and have a corresponding git tag, once this is approved.

@ccgus

ccgus commented Jun 10, 2016

Copy link
Copy Markdown
Owner

So everyone is happy with this now? All I need to do is commit it?

@stephanheilner

Copy link
Copy Markdown
Contributor

We'll need to update the version from 2.6.2 to whatever the next tag version will be, but we can do that right before @ccgus creates a new tag. Just give me a heads up, so I can make sure you bump the version in this file as well first.

@evands

evands commented Jun 12, 2016

Copy link
Copy Markdown
Author

I'm having difficulty with custom tokenizers working in SQLCipher+FTS. Please don't commit yet -- investigating.

@evands

evands commented Jun 12, 2016

Copy link
Copy Markdown
Author

OK, I figured out the problem but don't have an immediate solution. @stephanheilner would love your input.

  • SQLCipher needs to be compiled with -DDSQLITE_ENABLE_FTS3_TOKENIZER for custom tokenizers to work. Adding this in our podspec doesn't change how the dependency is compiled so doesn't fix the problem.
  • Maybe should be done in the SQLCipher podspec file I think but I can't find a source podspec in their github repo to make a pull request

@pleasantnicholasb

Copy link
Copy Markdown

Just wondering if this branch is still being worked on.

@evands

evands commented Feb 12, 2017

Copy link
Copy Markdown
Author

I concluded it probably needs to be fixed at the level of SQLCipher if it is to be properly done and couldn't find anywhere to do that. I've just added this to my Podfile:

post_install do |installer|
 puts "Post-Install: Enabling SQLITE_ENABLE_FTS3_TOKENIZER for SQLCipher..."	
  sqlcipher_targets = installer.pods_project.targets.select { |target| target.name =~ /^SQLCipher$/ }
  sqlcipher_targets.each do |target|
        target.build_configurations.each do |config|
            old_defines = config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] || []
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = old_defines + ['$(inherited) SQLITE_ENABLE_FTS3_TOKENIZER=1']
        end
    end
end

@RishatShamsutdinov

Copy link
Copy Markdown

-DDSQLITE_ENABLE_FTS3_TOKENIZER is not required because you can enable custom tokenizers by following code:
sqlite3_db_config(sqliteHandle, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, 0);

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants