Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d0f3ffde0e
Fetching contributors…

Cannot retrieve contributors at this time

file 46 lines (36 sloc) 1.4 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
# libicu

require 'tmpdir'

namespace :icu do

  desc 'Build libicu'
  task :build => [:known_distro, 'environment:path', ICU_BIN]

  file ICU_BIN do
    src = "#{DEPS}/icu4c-4_4/source"
    Dir.mktmpdir "icu_build" do |dir|
      begin
        Dir.chdir dir do
          flags = nil

          if DISTRO[0] == :solaris
            libs = ['/opt/csw/lib', '/opt/csw/gcc4/lib', "#{BUILD}/lib"]
            ldflags = libs.map{|lib| "-R#{lib} -L#{lib}"}.join(' ')
            flags = "LDFLAGS='#{ldflags}' CXXFLAGS='-R/opt/csw/gcc4/lib'"
          end

          configure = "#{src}/configure --prefix='#{BUILD}'"
          configure = "#{flags} #{configure}" if flags

          show_file('config.log') do
            sh "#{configure}"
          end
          gmake(ENV['icu_makeopts'] || "")
          gmake "install"

          if DISTRO[0] == :osx
            sh "install_name_tool -change libicudata.44.dylib #{BUILD}/lib/libicudata.44.dylib #{BUILD}/lib/libicuuc.44.dylib"
            sh "install_name_tool -change libicudata.44.dylib #{BUILD}/lib/libicudata.44.dylib #{BUILD}/lib/libicui18n.44.dylib"
            sh "install_name_tool -change libicuuc.44.dylib #{BUILD}/lib/libicuuc.44.dylib #{BUILD}/lib/libicui18n.44.dylib"
          end
        end

        record_manifest 'icu'
      ensure
        Dir.chdir(src) { gmake "distclean" if File.exist? 'Makefile' }
      end
    end
  end

end
Something went wrong with that request. Please try again.