Skip to content

Instantly share code, notes, and snippets.

@steipete
Last active December 16, 2015 17:00
Show Gist options
  • Save steipete/5467684 to your computer and use it in GitHub Desktop.
Save steipete/5467684 to your computer and use it in GitHub Desktop.
Pod::Spec.new do |s|
s.name = 'PSPDFKit'
s.version = '3.0.8'
s.license = 'Commercial'
s.summary = 'PSPDFKit - The definitive framework for displaying and annotating PDFs in your iOS apps.'
s.homepage = 'http://PSPDFKit.com'
s.author = { 'PSPDFKit GmbH' => 'support@pspdfkit.com' }
s.platform = :ios, '5.0'
s.source = { :git => 'https://github.com/PSPDFKit/PSPDFKit.git' }
s.preserve_path = 'README.md'
s.resource = 'PSPDFKit/PSPDFKit.bundle'
s.source_files = 'PSPDFKit/**/*.{h,c,m}'
s.exclude_files = 'PSPDFKit/Categories/UIViewController+PSPDFKitAdditions.{h,m}', 'PSPDFKit/Helper/PSPDFPatches.{h,m}', 'PSPDFKit/Helper/PSPDFDebugHelper.{h,m}', 'PSPDFKit/Vendor/PSTCollectionView'
s.requires_arc = true
s.library = 'z', 'sqlite3', 'xml2'
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
s.frameworks = 'QuartzCore', 'CoreText', 'CoreMedia', 'MediaPlayer', 'AVFoundation', 'ImageIO', 'MessageUI',
'CoreGraphics', 'Foundation', 'CFNetwork', 'MobileCoreServices', 'SystemConfiguration',
'AssetsLibrary', 'Security', 'UIKit', 'AudioToolbox', 'QuickLook', 'CoreData'
s.dependency 'PSTCollectionView', '>= 1.1.0'
s.subspec 'no-arc' do |sp|
sp.source_files = 'PSPDFKit/Categories/UIViewController+PSPDFKitAdditions.{h,m}', 'PSPDFKit/Helper/PSPDFPatches.{h,m}', 'PSPDFKit/Helper/PSPDFDebugHelper.{h,m}'
sp.requires_arc = false
end
s.prepare_command = "echo '#define GIT_VERSION @\"#{s.version}\"\n#define GIT_COMMIT_COUNT 0' > PSPDFKit/InfoPlist.h"
end
# Thanks to Eloy Durán (@alloy) both for creating CocoaPods and helping out with creating this podspec.
@steipete
Copy link
Author

Just updated the podspec so it works with the latest v3 beta.

@ivanguajana
Copy link

I actually had to change the podspec as follows, in order to prevent ARC-related errors:

Pod::Spec.new do |s|
  s.name         = 'PSPDFKit'
  s.version      = '3.0.3'
  s.license      = 'Commercial'
  s.summary      = 'PSPDFKit - The definitive framework for displaying and annotating PDFs in your iOS apps.'
  s.homepage     = 'http://PSPDFKit.com'
  s.author       = { 'PSPDFKit GmbH' => 'support@pspdfkit.com' }

  s.platform      = :ios, '5.0'
  s.source        = { :git => 'https://github.com/PSPDFKit/PSPDFKit.git' }
  s.preserve_path = 'README'
  s.resource      = 'PSPDFKit/PSPDFKit.bundle'
  s.source_files  = 'PSPDFKit/**/*.{h,c,m}'
  s.exclude_files = 'PSPDFKit/Categories/UIViewController+PSPDFKitAdditions.{h,m}', 'PSPDFKit/Helper/PSPDFPatches.{h,m}', 'PSPDFKit/Helper/PSPDFDebugHelper.{h,m}', 'PSPDFKit/Vendor/PSTCollectionView'

  s.requires_arc  = true
  s.library       = 'z', 'sqlite3', 'xml2'
  s.xcconfig      = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
  s.frameworks    = 'QuartzCore', 'CoreText', 'CoreMedia', 'MediaPlayer', 'AVFoundation', 'ImageIO', 'MessageUI',
                    'CoreGraphics', 'Foundation', 'CFNetwork', 'MobileCoreServices', 'SystemConfiguration',
                    'AssetsLibrary', 'Security', 'UIKit', 'AudioToolbox', 'QuickLook', 'CoreData'

  s.dependency 'PSTCollectionView', '>= 1.1.0'

  s.subspec 'no-arc' do |sp|
    sp.source_files = 'PSPDFKit/Categories/UIViewController+PSPDFKitAdditions.{h,m}', 'PSPDFKit/Helper/PSPDFPatches.{h,m}', 'PSPDFKit/Helper/PSPDFDebugHelper.{h,m}'
    sp.requires_arc = false
  end

  s.prepare_command = "echo '#define GIT_VERSION @\"#{s.version}\"\n#define GIT_COMMIT_COUNT 0' >PSPDFKit/InfoPlist.h"
end

# Thanks to Eloy Durán (@alloy) both for creating CocoaPods and helping out with creating this pods

Note the addition of PSPDFDebugHelper.{h,m} to the exclude_files array and UIViewController+PSPDFKitAdditions.{h,m} to the list of files to be compiled without ARC

@steipete
Copy link
Author

This is now on Cocoapods, starting with 3.1.4: https://github.com/CocoaPods/Specs/tree/master/PSPDFKit

@cyupa
Copy link

cyupa commented Mar 26, 2014

To use the unicode61 tokenizer with PSPDFLibrary we should remove sqlite3 and add the sqlite3 library shipped with the dmg file. Should that library link to our project or to the Pods project? Or it doesn't matter?

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