diff options
| -rwxr-xr-x | Library/Contributions/cmd/brew-aspell-dictionaries | 2 | ||||
| -rw-r--r-- | Library/Formula/aspell.rb | 4 | ||||
| -rw-r--r-- | Library/Formula/boost.rb | 11 | ||||
| -rw-r--r-- | Library/Formula/fuse4x-kext.rb | 4 | ||||
| -rw-r--r-- | Library/Formula/gdal.rb | 59 | ||||
| -rw-r--r-- | Library/Formula/graphicsmagick.rb | 16 | ||||
| -rw-r--r-- | Library/Formula/grass.rb | 18 | ||||
| -rw-r--r-- | Library/Formula/pike.rb | 20 | ||||
| -rw-r--r-- | Library/Formula/pyside-tools.rb | 14 | ||||
| -rw-r--r-- | Library/Formula/pyside.rb | 16 | ||||
| -rw-r--r-- | Library/Formula/subversion.rb | 44 | ||||
| -rw-r--r-- | Library/Formula/tesseract.rb | 143 | ||||
| -rw-r--r-- | Library/Formula/tuntap.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 2 |
14 files changed, 146 insertions, 211 deletions
diff --git a/Library/Contributions/cmd/brew-aspell-dictionaries b/Library/Contributions/cmd/brew-aspell-dictionaries index a5cdb1ac3..61a5e085e 100755 --- a/Library/Contributions/cmd/brew-aspell-dictionaries +++ b/Library/Contributions/cmd/brew-aspell-dictionaries @@ -40,7 +40,7 @@ EOF done cat <<EOF >> $brew_formulae_tmp_file -def available_languages +def aspell_available_languages %w(${langs}) end # END generated with `basename $0` diff --git a/Library/Formula/aspell.rb b/Library/Formula/aspell.rb index 033d756c9..27fb7fdf6 100644 --- a/Library/Formula/aspell.rb +++ b/Library/Formula/aspell.rb @@ -465,7 +465,7 @@ class Aspell_zu < AspellLang mirror 'http://ftp.gnu.org/gnu/aspell/dict/zu/aspell-zu-0.50-0.tar.bz2' sha1 '0cba6163d1a1b9f63b1f5eaaeba466cdaf5f0742' end -def available_languages +def aspell_available_languages %w( af am ar ast az be bg bn br ca cs csb cy da de de_alt el en eo es et fa fi fo fr fy ga gd gl grc gu gv he hi hil hr hsb hu hus hy ia id is it kn ku ky la lt lv mg mi mk ml mn mr ms mt nb nds nl nn ny or pa pl pt_BR pt_PT qu ro ru rw sc sk sl sr sv sw ta te tet tk tl tn tr uk uz vi wa yi zu) end # END generated with brew-aspell-dictionaries @@ -482,7 +482,7 @@ class Aspell < Formula end option "all", "Install all available dictionaries" - available_languages.each { |lang| option "with-lang-#{lang}", "Install #{lang} dictionary" } + aspell_available_languages.each { |lang| option "with-lang-#{lang}", "Install #{lang} dictionary" } def install system "./configure", "--prefix=#{prefix}" diff --git a/Library/Formula/boost.rb b/Library/Formula/boost.rb index 2fd3012da..04ceaadbd 100644 --- a/Library/Formula/boost.rb +++ b/Library/Formula/boost.rb @@ -1,13 +1,5 @@ require 'formula' -def needs_universal_python? - build.universal? and not build.include? "without-python" -end - -def boost_layout - (build.include? "use-system-layout") ? "system" : "tagged" -end - class UniversalPython < Requirement satisfy { archs_for_command("python").universal? } @@ -42,7 +34,7 @@ class Boost < Formula option 'with-c++11', 'Compile using Clang, std=c++11 and stdlib=libc++' if MacOS.version >= :lion option 'use-system-layout', 'Use system layout instead of tagged' - depends_on UniversalPython if needs_universal_python? + depends_on UniversalPython if build.universal? and not build.include? "without-python" depends_on "icu4c" if build.include? "with-icu" depends_on MPIDependency.new(:cc, :cxx) if build.include? "with-mpi" @@ -88,6 +80,7 @@ class Boost < Formula bargs << '--without-icu' end + boost_layout = (build.include? "use-system-layout") ? "system" : "tagged" args = ["--prefix=#{prefix}", "--libdir=#{lib}", "-d2", diff --git a/Library/Formula/fuse4x-kext.rb b/Library/Formula/fuse4x-kext.rb index fe237df52..e509aff01 100644 --- a/Library/Formula/fuse4x-kext.rb +++ b/Library/Formula/fuse4x-kext.rb @@ -1,9 +1,5 @@ require 'formula' -def kext_prefix - prefix + 'Library' + 'Extensions' -end - class Fuse4xKext < Formula homepage 'http://fuse4x.github.com' url 'https://github.com/fuse4x/kext/archive/fuse4x_0_9_2.tar.gz' diff --git a/Library/Formula/gdal.rb b/Library/Formula/gdal.rb index 383525018..7d1d6215d 100644 --- a/Library/Formula/gdal.rb +++ b/Library/Formula/gdal.rb @@ -1,34 +1,5 @@ require 'formula' -def complete? - build.include? 'complete' -end - -def postgres? - build.include? 'with-postgres' -end - -def mysql? - build.include? 'with-mysql' -end - -def no_python? - build.include? 'without-python' -end - -def which_python - "python" + `python -c 'import sys;print(sys.version[:3])'`.strip -end - -def opencl? - build.include? 'enable-opencl' -end - -def armadillo? - build.include? 'enable-armadillo' -end - - class Gdal < Formula homepage 'http://www.gdal.org/' url 'http://download.osgeo.org/gdal/gdal-1.9.2.tar.gz' @@ -59,15 +30,15 @@ class Gdal < Formula depends_on 'freexl' depends_on 'libspatialite' - depends_on "postgresql" if postgres? - depends_on "mysql" if mysql? + depends_on "postgresql" if build.include? 'with-postgres' + depends_on "mysql" if build.include? 'with-mysql' # Without Numpy, the Python bindings can't deal with raster data. - depends_on 'numpy' => :python unless no_python? + depends_on 'numpy' => :python unless build.include? 'without-python' - depends_on 'homebrew/science/armadillo' if armadillo? + depends_on 'homebrew/science/armadillo' if build.include? 'enable-armadillo' - if complete? + if build.include? 'complete' # Raster libraries depends_on "netcdf" # Also brings in HDF5 depends_on "jasper" @@ -144,7 +115,7 @@ class Gdal < Formula webp poppler ] - if complete? + if build.include? 'complete' supported_backends.delete 'liblzma' args << '--with-liblzma=yes' args.concat supported_backends.map {|b| '--with-' + b + '=' + HOMEBREW_PREFIX} @@ -184,8 +155,8 @@ class Gdal < Formula args.concat unsupported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported' # Database support. - args << (postgres? ? "--with-pg=#{HOMEBREW_PREFIX}/bin/pg_config" : '--without-pg') - args << (mysql? ? "--with-mysql=#{HOMEBREW_PREFIX}/bin/mysql_config" : '--without-mysql') + args << (build.include? 'with-postgres' ? "--with-pg=#{HOMEBREW_PREFIX}/bin/pg_config" : '--without-pg') + args << (build.include? 'with-mysql' ? "--with-mysql=#{HOMEBREW_PREFIX}/bin/mysql_config" : '--without-mysql') # Python is installed manually to ensure everything is properly sandboxed. args << '--without-python' @@ -202,8 +173,8 @@ class Gdal < Formula args << "--without-php" args << "--without-ruby" - args << (opencl? ? '--with-opencl' : '--without-opencl') - args << (armadillo? ? '--with-armadillo=yes' : '--with-armadillo=no') + args << (build.include? 'enable-opencl' ? '--with-opencl' : '--without-opencl') + args << (build.include? 'enable-armadillo' ? '--with-armadillo=yes' : '--with-armadillo=no') return args end @@ -218,7 +189,7 @@ class Gdal < Formula sqlite = Formula.factory 'sqlite' ENV.append 'LDFLAGS', "-L#{sqlite.opt_prefix}/lib -lsqlite3" # Needed by libdap. - ENV.append 'CPPFLAGS', '-I/usr/include/libxml2' if complete? + ENV.append 'CPPFLAGS', '-I/usr/include/libxml2' if build.include? 'complete' # Reset ARCHFLAGS to match how we build. if MacOS.prefer_64_bit? @@ -231,7 +202,7 @@ class Gdal < Formula system "make" system "make install" - unless no_python? + unless build.include? 'without-python' # If setuptools happens to be installed, setup.py will cowardly refuse to # install to anywhere that is not on the PYTHONPATH. # @@ -263,7 +234,11 @@ class Gdal < Formula Dir[bin + '*.dox'].each { |p| rm p } end - unless no_python? + def which_python + "python" + `python -c 'import sys;print(sys.version[:3])'`.strip + end + + unless build.include? 'without-python' def caveats <<-EOS This version of GDAL was built with Python support. In addition to providing diff --git a/Library/Formula/graphicsmagick.rb b/Library/Formula/graphicsmagick.rb index 22ed3b7b6..057fafb04 100644 --- a/Library/Formula/graphicsmagick.rb +++ b/Library/Formula/graphicsmagick.rb @@ -1,13 +1,5 @@ require 'formula' -def ghostscript_srsly? - build.include? 'with-ghostscript' -end - -def ghostscript_fonts? - File.directory? "#{HOMEBREW_PREFIX}/share/ghostscript/fonts" -end - class Graphicsmagick < Formula homepage 'http://www.graphicsmagick.org/' url 'http://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick/1.3.18/GraphicsMagick-1.3.18.tar.bz2' @@ -32,7 +24,7 @@ class Graphicsmagick < Formula depends_on :libpng depends_on :x11 if build.include? 'with-x' - depends_on 'ghostscript' if ghostscript_srsly? + depends_on 'ghostscript' if build.include? 'with-ghostscript' depends_on 'libtiff' if build.include? 'use-tiff' depends_on 'little-cms2' if build.include? 'use-cms' @@ -46,6 +38,10 @@ class Graphicsmagick < Formula skip_clean :la + def ghostscript_fonts? + File.directory? "#{HOMEBREW_PREFIX}/share/ghostscript/fonts" + end + def install # versioned stuff in main tree is pointless for us inreplace 'configure', '${PACKAGE_NAME}-${PACKAGE_VERSION}', '${PACKAGE_NAME}' @@ -55,7 +51,7 @@ class Graphicsmagick < Formula "--enable-shared", "--disable-static"] args << "--without-magick-plus-plus" if build.include? 'without-magick-plus-plus' args << "--disable-openmp" if MacOS.version == :leopard or not ENV.compiler == :gcc # libgomp unavailable - args << "--with-gslib" if ghostscript_srsly? + args << "--with-gslib" if build.include? 'with-ghostscript' args << "--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts" \ unless ghostscript_fonts? diff --git a/Library/Formula/grass.rb b/Library/Formula/grass.rb index e4aad13c3..68e0d85d6 100644 --- a/Library/Formula/grass.rb +++ b/Library/Formula/grass.rb @@ -1,14 +1,5 @@ require 'formula' -def headless? - # The GRASS GUI is based on WxPython. Unfortunately, Lion does not include - # this module so we have to drop it. - # - # This restriction can be lifted once WxMac hits a stable release that is - # 64-bit capable. - build.include? 'without-gui' or MacOS.version >= :lion -end - class Grass < Formula homepage 'http://grass.osgeo.org/' url 'http://grass.osgeo.org/grass64/source/grass-6.4.2.tar.gz' @@ -38,6 +29,15 @@ class Grass < Formula option "with-mysql", "Specify MySQL as a dependency." option "without-gui", "Build without WxPython interface. Command line tools still available." + def headless? + # The GRASS GUI is based on WxPython. Unfortunately, Lion does not include + # this module so we have to drop it. + # + # This restriction can be lifted once WxMac hits a stable release that is + # 64-bit capable. + build.include? 'without-gui' or MacOS.version >= :lion + end + def install readline = Formula.factory('readline') gettext = Formula.factory('gettext') diff --git a/Library/Formula/pike.rb b/Library/Formula/pike.rb index 3e055e670..431676d39 100644 --- a/Library/Formula/pike.rb +++ b/Library/Formula/pike.rb @@ -1,9 +1,5 @@ require 'formula' -def option? opt - build.include? opt or build.include? 'with-all' -end - class Pike < Formula homepage 'http://pike.lysator.liu.se' url 'http://pike.lysator.liu.se/pub/pike/latest-stable/Pike-v7.8.700.tar.gz' @@ -16,14 +12,14 @@ class Pike < Formula depends_on 'libtiff' => :recommended # optional dependencies - depends_on 'gettext' if option? 'with-gettext' - depends_on 'gdbm' if option? 'with-gdbm' - depends_on 'gtk+' if option? 'with-gtk2' - depends_on 'mysql' if option? 'with-mysql' - depends_on 'sdl' if option? 'with-sdl' - depends_on 'sane-backends' if option? 'with-sane' - depends_on 'pdflib-lite' if option? 'with-pdf' - depends_on 'mesalib-glw' if option? 'with-gl' + depends_on 'gettext' if build.include? 'with-gettext' or build.include? 'with-all' + depends_on 'gdbm' if build.include? 'with-gdbm' or build.include? 'with-all' + depends_on 'gtk+' if build.include? 'with-gtk2' or build.include? 'with-all' + depends_on 'mysql' if build.include? 'with-mysql' or build.include? 'with-all' + depends_on 'sdl' if build.include? 'with-sdl' or build.include? 'with-all' + depends_on 'sane-backends' if build.include? 'with-sane' or build.include? 'with-all' + depends_on 'pdflib-lite' if build.include? 'with-pdf' or build.include? 'with-all' + depends_on 'mesalib-glw' if build.include? 'with-gl' or build.include? 'with-all' option 'with-gettext', 'Include Gettext support' option 'with-gdbm', 'Include Gdbm support' diff --git a/Library/Formula/pyside-tools.rb b/Library/Formula/pyside-tools.rb index c4ab24386..ca1563663 100644 --- a/Library/Formula/pyside-tools.rb +++ b/Library/Formula/pyside-tools.rb @@ -1,13 +1,5 @@ require 'formula' -def which_python - "python" + `python -c 'import sys;print(sys.version[:3])'`.strip -end - -def site_package_dir - "lib/#{which_python}/site-packages" -end - class PysideTools < Formula homepage 'http://www.pyside.org' url 'http://qt-project.org/uploads/pyside/pyside-tools-0.2.14.tar.bz2' @@ -17,8 +9,12 @@ class PysideTools < Formula depends_on 'pyside' + def which_python + "python" + `python -c 'import sys;print(sys.version[:3])'`.strip + end + def install - system "cmake", ".", "-DSITE_PACKAGE=#{site_package_dir}", *std_cmake_args + system "cmake", ".", "-DSITE_PACKAGE=lib/#{which_python}/site-packages", *std_cmake_args system "make install" end end diff --git a/Library/Formula/pyside.rb b/Library/Formula/pyside.rb index 65269a7d2..d3c984dfd 100644 --- a/Library/Formula/pyside.rb +++ b/Library/Formula/pyside.rb @@ -1,13 +1,5 @@ require 'formula' -def which_python - "python" + `python -c 'import sys;print(sys.version[:3])'`.strip -end - -def site_package_dir - "lib/#{which_python}/site-packages" -end - class Pyside < Formula homepage 'http://www.pyside.org' url 'http://qt-project.org/uploads/pyside/pyside-qt4.8+1.1.2.tar.bz2' @@ -17,6 +9,10 @@ class Pyside < Formula depends_on 'cmake' => :build depends_on 'shiboken' + def which_python + "python" + `python -c 'import sys;print(sys.version[:3])'`.strip + end + def install # The build will be unable to find Qt headers buried inside frameworks # unless the folder containing those frameworks is added to the compiler @@ -29,7 +25,7 @@ class Pyside < Formula # out of tree build in shiboken.rb. args = std_cmake_args + %W[ -DALTERNATIVE_QT_INCLUDE_DIR=#{qt.prefix}/Frameworks - -DSITE_PACKAGE=#{site_package_dir} + -DSITE_PACKAGE=lib/#{which_python}/site-packages -DBUILD_TESTS=NO .. ] @@ -43,7 +39,7 @@ class Pyside < Formula def caveats <<-EOS PySide Python modules have been linked to: - #{HOMEBREW_PREFIX}/#{site_package_dir} + #{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages Make sure this folder is on your PYTHONPATH. For PySide development tools, install the `pyside-tools` formula. diff --git a/Library/Formula/subversion.rb b/Library/Formula/subversion.rb index c062fcda4..197858871 100644 --- a/Library/Formula/subversion.rb +++ b/Library/Formula/subversion.rb @@ -1,15 +1,5 @@ require 'formula' -def build_java?; build.include? "java"; end -def build_perl?; build.include? "perl"; end -def build_python?; build.include? "python"; end -def build_ruby?; build.include? "ruby"; end -def with_unicode_path?; build.include? "unicode-path"; end - -def find_interpreters? - build_perl? || build_python? || build_ruby? -end - class Subversion < Formula homepage 'http://subversion.apache.org/' url 'http://www.apache.org/dyn/closer.cgi?path=subversion/subversion-1.7.9.tar.bz2' @@ -30,21 +20,21 @@ class Subversion < Formula depends_on 'serf' # Building Ruby bindings requires libtool - depends_on :libtool if build_ruby? + depends_on :libtool if build.include? 'ruby' # If building bindings, allow non-system interpreters - env :userpaths if find_interpreters? + env :userpaths if (build.include? 'perl') or (build.include? 'python') or (build.include? 'ruby') def patches ps = [] # Patch for Subversion handling of OS X UTF-8-MAC filename. - if with_unicode_path? + if build.include? 'unicode-path' ps << "https://raw.github.com/gist/3044094/1648c28f6133bcbb68b76b42669b0dc237c02dba/patch-path.c.diff" end # Patch to prevent '-arch ppc' from being pulled in from Perl's $Config{ccflags} - if build_perl? + if build.include? 'perl' ps << DATA end @@ -59,7 +49,7 @@ class Subversion < Formula fails_with :clang do build 318 cause "core.c:1: error: bad value (native) for -march= switch" - end if find_interpreters? + end if (build.include? 'perl') or (build.include? 'python') or (build.include? 'ruby') def apr_bin superbin or "/usr/bin" @@ -70,7 +60,7 @@ class Subversion < Formula # https://github.com/mxcl/homebrew/issues/13226 ENV.deparallelize - if build_java? + if build.include? 'java' unless build.universal? opoo "A non-Universal Java build was requested." puts "To use Java bindings with various Java IDEs, you might need a universal build:" @@ -100,9 +90,9 @@ class Subversion < Formula "--without-apache-libexecdir", "--without-berkeley-db"] - args << "--enable-javahl" << "--without-jikes" if build_java? + args << "--enable-javahl" << "--without-jikes" if build.include? 'java' - if build_ruby? + if build.include? 'ruby' args << "--with-ruby-sitedir=#{lib}/ruby" # Peg to system Ruby args << "RUBY=/usr/bin/ruby" @@ -117,12 +107,12 @@ class Subversion < Formula system "make install" (prefix+'etc/bash_completion.d').install 'tools/client-side/bash_completion' => 'subversion' - if build_python? + if build.include? 'python' system "make swig-py" system "make install-swig-py" end - if build_perl? + if build.include? 'perl' # Remove hard-coded ppc target, add appropriate ones if build.universal? arches = "-arch x86_64 -arch i386" @@ -145,12 +135,12 @@ class Subversion < Formula system "make", "install-swig-pl", "DESTDIR=#{prefix}" end - if build_java? + if build.include? 'java' system "make javahl" system "make install-javahl" end - if build_ruby? + if build.include? 'ruby' # Peg to system Ruby system "make swig-rb EXTRA_SWIG_LDFLAGS=-L/usr/lib" system "make install-swig-rb" @@ -160,7 +150,7 @@ class Subversion < Formula def caveats s = "" - if build_python? + if build.include? 'python' s += <<-EOS.undent You may need to add the Python bindings to your PYTHONPATH from: #{HOMEBREW_PREFIX}/lib/svn-python @@ -168,7 +158,7 @@ class Subversion < Formula EOS end - if build_perl? + if build.include? 'perl' s += <<-EOS.undent The perl bindings are located in various subdirectories of: #{prefix}/Library/Perl @@ -176,7 +166,7 @@ class Subversion < Formula EOS end - if build_ruby? + if build.include? 'ruby' s += <<-EOS.undent You may need to add the Ruby bindings to your RUBYLIB from: #{HOMEBREW_PREFIX}/lib/ruby @@ -184,7 +174,7 @@ class Subversion < Formula EOS end - if build_java? + if build.include? 'java' s += <<-EOS.undent You may need to link the Java bindings into the Java Extensions folder: sudo mkdir -p /Library/Java/Extensions @@ -193,7 +183,7 @@ class Subversion < Formula EOS end - if with_unicode_path? + if build.include? 'unicode-path' s += <<-EOS.undent This unicode-path version implements a hack to deal with composed/decomposed unicode handling on Mac OS X which is different from linux and windows. diff --git a/Library/Formula/tesseract.rb b/Library/Formula/tesseract.rb index 8c6fdddb1..7e305642c 100644 --- a/Library/Formula/tesseract.rb +++ b/Library/Formula/tesseract.rb @@ -1,77 +1,5 @@ require 'formula' -def install_language_data - langs = { - 'eng' => '989ed4c3a5b246d7353893e466c353099d8b73a1', - 'heb' => '67e10e616caf62545eacd436e85f89436687e22b', - 'hin' => '4ceef97ffb8b4ab5ac79ee4bad5b5be0885f228f', - 'ara' => 'e15cf6b7a027454db56ecedab0038c7739ab29cc', - 'tha' => '04a35c04585a887662dc668e54f5368dabf31f50' - } - - langs.each do |lang, sha| - klass = Class.new(Formula) do - url "http://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.#{lang}.tar.gz" - version '3.02' - sha1 sha - end - - klass.new.brew { mv Dir['tessdata/*'], "#{share}/tessdata/" } - end - - # pre-3.01 language data uses a different URL format and installs differently - langs_old = { - 'chr' => 'e49b17bb73911926050d45832171a54ab1d1f34c', - 'deu-frak' => '5651562e0d944b5b89cc5977d71482089f12669f', - 'swe-frak' => '22220ad4303ebe290e4e71170e96b488e81a7f1a', - 'chi_tra' => 'a9798de7e068d85613602aa33a153da721aadc82', - 'chi_sim' => '35f0254f159edeed509ec1e0779073bf998b6cdb', - 'ind' => 'f4214ce40c5f6ef92085a8a45e9ff03f7cf7afca', - 'swe' => '55291e8ea664155ad51db867284c11ad1a1c5d00', - 'ron' => 'c20c73a2e17f5fe692de0fe9ac681da3984229ae', - 'slv' => 'fbe464cd49d6a7495e6d95600d421aa2dd0b9d77', - 'srp' => '47afc601b62998e4cc3f7403d846ba861f30b416', - 'tgl' => '153ba1d0ddd209e1581d81d42fe5346f748e2f27', - 'tur' => 'a01da62f3830833b258e2d46ce0f2852571470e6', - 'hun' => '32ecad03877a841fbc0cb31c269214640008d604', - 'fin' => '004d74d13f7b53cbefb86e2ba12bc67dce81d936', - 'ita' => 'c166ba79256f6e7c1b993b2db7403d794131fe05', - 'nld' => 'f7e3d46b1747a19158ac0797e859b65c56b5045f', - 'nor' => 'fb65dede5fbe120823ecdcb0c6cbd1222ae7e245', - 'jpn' => '6d605eee29e76fb841924916bd34095bbbbc45c0', - 'vie' => '9158748a63afe87e4e25b5f32c222555f2ad8417', - 'spa' => '7b30950749e84891fdef5f89409c3cf1b6418cd3', - 'ukr' => '06ceebfd91fa473d6d91f8a2856c66733bea0131', - 'fra' => '8d698bb3b659e862b3274970a57b3214de76f1ff', - 'slk' => '16207e26d53504f98a7b1fadcb873dc4611149ec', - 'kor' => '37bcd8110a426714f54d99f58b30104b3014ce5a', - 'ell' => 'b7a449fc320cc579a729c0352e5cc642f565e64e', - 'rus' => '2740accefc45e4ae004269ccb195948b8037a583', - 'por' => '883e5e1fa1d991ef6d202951ee9d26a71db181dc', - 'bul' => 'a9efae5e347a36ea90bd2ad357e732ad4da47fd3', - 'lav' => 'b4efd308e725d743884f2984f804c82dd5382f63', - 'lit' => '7adbe396a281c0f87c0b95da7e84b5b6029e3dbd', - 'pol' => 'a303fc31b4b60532b01b4ccdc838f02ff0113f27', - 'dan-frak' => 'c0eba6d3ca688a04fd8e3ce45fdbbf20e8e67d45', - 'deu' => 'c4b3ecde18ce9f114faba88cdfd0308f90801266', - 'dan' => 'bfac9c00d28fc4b19034c2098d41087a173084ae', - 'ces' => 'dbec19aa23f42a08e6b195a96e64b443f7519620', - 'cat' => '0301a9c81c1d646bd1b135ca89476fb63bd634f8' - } - - langs_old.each do |lang, sha| - klass = Class.new(Formula) do - url "http://tesseract-ocr.googlecode.com/files/#{lang}.traineddata.gz", - :using => GzipOnlyDownloadStrategy - version '3.00' - sha1 sha - end - - klass.new.brew { mv Dir['*'], "#{share}/tessdata/" } - end - -end - # This stays around for the English-only build option class TesseractEnglishData < Formula url 'http://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz' @@ -117,4 +45,75 @@ class Tesseract < Formula `tesseract terre_input.tif output` EOF end + + def install_language_data + langs = { + 'eng' => '989ed4c3a5b246d7353893e466c353099d8b73a1', + 'heb' => '67e10e616caf62545eacd436e85f89436687e22b', + 'hin' => '4ceef97ffb8b4ab5ac79ee4bad5b5be0885f228f', + 'ara' => 'e15cf6b7a027454db56ecedab0038c7739ab29cc', + 'tha' => '04a35c04585a887662dc668e54f5368dabf31f50' + } + + langs.each do |lang, sha| + klass = Class.new(Formula) do + url "http://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.#{lang}.tar.gz" + version '3.02' + sha1 sha + end + + klass.new.brew { mv Dir['tessdata/*'], "#{share}/tessdata/" } + end + + # pre-3.01 language data uses a different URL format and installs differently + langs_old = { + 'chr' => 'e49b17bb73911926050d45832171a54ab1d1f34c', + 'deu-frak' => '5651562e0d944b5b89cc5977d71482089f12669f', + 'swe-frak' => '22220ad4303ebe290e4e71170e96b488e81a7f1a', + 'chi_tra' => 'a9798de7e068d85613602aa33a153da721aadc82', + 'chi_sim' => '35f0254f159edeed509ec1e0779073bf998b6cdb', + 'ind' => 'f4214ce40c5f6ef92085a8a45e9ff03f7cf7afca', + 'swe' => '55291e8ea664155ad51db867284c11ad1a1c5d00', + 'ron' => 'c20c73a2e17f5fe692de0fe9ac681da3984229ae', + 'slv' => 'fbe464cd49d6a7495e6d95600d421aa2dd0b9d77', + 'srp' => '47afc601b62998e4cc3f7403d846ba861f30b416', + 'tgl' => '153ba1d0ddd209e1581d81d42fe5346f748e2f27', + 'tur' => 'a01da62f3830833b258e2d46ce0f2852571470e6', + 'hun' => '32ecad03877a841fbc0cb31c269214640008d604', + 'fin' => '004d74d13f7b53cbefb86e2ba12bc67dce81d936', + 'ita' => 'c166ba79256f6e7c1b993b2db7403d794131fe05', + 'nld' => 'f7e3d46b1747a19158ac0797e859b65c56b5045f', + 'nor' => 'fb65dede5fbe120823ecdcb0c6cbd1222ae7e245', + 'jpn' => '6d605eee29e76fb841924916bd34095bbbbc45c0', + 'vie' => '9158748a63afe87e4e25b5f32c222555f2ad8417', + 'spa' => '7b30950749e84891fdef5f89409c3cf1b6418cd3', + 'ukr' => '06ceebfd91fa473d6d91f8a2856c66733bea0131', + 'fra' => '8d698bb3b659e862b3274970a57b3214de76f1ff', + 'slk' => '16207e26d53504f98a7b1fadcb873dc4611149ec', + 'kor' => '37bcd8110a426714f54d99f58b30104b3014ce5a', + 'ell' => 'b7a449fc320cc579a729c0352e5cc642f565e64e', + 'rus' => '2740accefc45e4ae004269ccb195948b8037a583', + 'por' => '883e5e1fa1d991ef6d202951ee9d26a71db181dc', + 'bul' => 'a9efae5e347a36ea90bd2ad357e732ad4da47fd3', + 'lav' => 'b4efd308e725d743884f2984f804c82dd5382f63', + 'lit' => '7adbe396a281c0f87c0b95da7e84b5b6029e3dbd', + 'pol' => 'a303fc31b4b60532b01b4ccdc838f02ff0113f27', + 'dan-frak' => 'c0eba6d3ca688a04fd8e3ce45fdbbf20e8e67d45', + 'deu' => 'c4b3ecde18ce9f114faba88cdfd0308f90801266', + 'dan' => 'bfac9c00d28fc4b19034c2098d41087a173084ae', + 'ces' => 'dbec19aa23f42a08e6b195a96e64b443f7519620', + 'cat' => '0301a9c81c1d646bd1b135ca89476fb63bd634f8' + } + + langs_old.each do |lang, sha| + klass = Class.new(Formula) do + url "http://tesseract-ocr.googlecode.com/files/#{lang}.traineddata.gz", + :using => GzipOnlyDownloadStrategy + version '3.00' + sha1 sha + end + + klass.new.brew { mv Dir['*'], "#{share}/tessdata/" } + end + end end diff --git a/Library/Formula/tuntap.rb b/Library/Formula/tuntap.rb index 72680199f..075ebbb6c 100644 --- a/Library/Formula/tuntap.rb +++ b/Library/Formula/tuntap.rb @@ -1,9 +1,5 @@ require 'formula' -def kext_prefix - prefix/'Library/Extensions' -end - class Tuntap < Formula homepage 'http://tuntaposx.sourceforge.net/' url 'git://git.code.sf.net/p/tuntaposx/code', :tag => 'release_20111101' diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 778a9a688..1eb95c273 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -165,6 +165,8 @@ class Formula def sbin; prefix+'sbin' end def share; prefix+'share' end + def kext_prefix; prefix+'Library/Extensions' end + # configuration needs to be preserved past upgrades def etc; HOMEBREW_PREFIX+'etc' end # generally we don't want var stuff inside the keg |
