Created
July 15, 2013 03:56
-
-
Save dinhvh/5997408 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pod::Spec.new do |s| | |
s.name = 'icu4c' | |
s.version = '0.1' | |
s.source = { :http => 'http://localhost/pub/icu4c-51_1-src.tgz' } | |
# s.header_dir = 'unicode' | |
s.source_files = 'source/common/**/*.{c,h,cpp}', 'source/i18n/**/*.{c,h,cpp}', 'source/io/**/*.{c,h,cpp}', | |
'source/layout/**/*.{c,h,cpp}', 'source/layoutex/**/*.{c,h,cpp}', 'source/config.h' | |
# s.exclude_files = 'src/tests/**/*', 'src/windows/**/*' | |
s.compiler_flags = '-DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DU_IO_IMPLEMENTATION' | |
s.public_header_files = '**/ucnv.h' | |
s.xcconfig = { | |
# Use GNU C++ standard | |
'CLANG_CXX_LANGUAGE_STANDARD' => 'gnu++0x', | |
'CLANG_CXX_LIBRARY' => 'libstdc++', | |
'GCC_PREPROCESSOR_DEFINITIONS' => '' | |
} | |
def s.pre_install (pod, lib) | |
Dir.chdir(pod.root.to_s + "/source") do | |
`sed 's/#ifdef DEBUG$/#ifdef DEBUG_ICU/' < i18n/rbnf.cpp > i18n/rbnf.cpp.tmp` | |
`mv i18n/rbnf.cpp.tmp i18n/rbnf.cpp` | |
toolchain = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin" | |
cflags = "" | |
cxxflags = "#{cflags} -stdlib=libstdc++ -std=gnu++11" | |
ldflags = "-lstdc++ -stdlib=libstdc++" | |
`CFLAGS="#{cflags}" CXXFLAGS="#{cxxflags}" CC="#{toolchain}/clang" CXX="#{toolchain}/clang++" LDFLAGS="#{ldflags}" ./configure` | |
`cd common ; make install-headers includedir="#{lib.sandbox_dir}/Headers/icu4c"` | |
`cd i18n ; make install-headers includedir="#{lib.sandbox_dir}/Headers/icu4c"` | |
`cd io ; make install-headers includedir="#{lib.sandbox_dir}/Headers/icu4c"` | |
`cd layout ; make install-headers includedir="#{lib.sandbox_dir}/Headers/icu4c"` | |
`cd layoutex ; make install-headers includedir="#{lib.sandbox_dir}/Headers/icu4c"` | |
`cd common ; make install-headers includedir="#{lib.sandbox_dir}/BuildHeaders/icu4c"` | |
`cd i18n ; make install-headers includedir="#{lib.sandbox_dir}/BuildHeaders/icu4c"` | |
`cd io ; make install-headers includedir="#{lib.sandbox_dir}/BuildHeaders/icu4c"` | |
`cd layout ; make install-headers includedir="#{lib.sandbox_dir}/BuildHeaders/icu4c"` | |
`cd layoutex ; make install-headers includedir="#{lib.sandbox_dir}/BuildHeaders/icu4c"` | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment