Skip to content

Instantly share code, notes, and snippets.

@SebastienElet
Last active October 12, 2015 12:07
Show Gist options
  • Save SebastienElet/4024217 to your computer and use it in GitHub Desktop.
Save SebastienElet/4024217 to your computer and use it in GitHub Desktop.
Homebrew php54-excel (using libxl)
require 'formula'
class Libxl < Formula
homepage 'http://www.libxl.com/'
url 'ftp://xlware.com/libxl-mac-3.6.0.tar.gz'
sha1 '52da78f73e4a8e727c8c73c99435f4136e3774c2'
def install
lib.install 'lib/libxl.dylib'
include.install Dir["include_c/*.h"]
end
def caveats; <<-EOS
LibXl will write a banner in the first row of each spreadsheet and it will be able to
read only 100 cells (first row is unavailable). Buy a license key to remove banner and reading restriction:
http://libxl.com/purchase.html
EOS
end
end
require File.expand_path("../../Taps/homebrew/homebrew-php/Abstract/abstract-php-extension", __FILE__)
class Php56Excel < AbstractPhp56Extension
init
homepage 'https://github.com/iliaal/php_excel'
url 'https://github.com/iliaal/php_excel/archive/1.0.tar.gz'
sha1 '3995b754117952290f0f56a8c2f8653e29a025ea'
head 'https://github.com/iliaal/php_excel.git'
depends_on 'autoconf' => :build
depends_on 'php56' unless build.include?('without-homebrew-php')
depends_on 'libxl'
def install
ENV.universal_binary if build.universal?
safe_phpize
system "./configure", "--prefix=#{prefix}",
"--with-libxl-incdir=#{Formula['libxl'].opt_prefix}/include_c/",
"--with-libxl-libdir=#{Formula['libxl'].opt_prefix}/lib/",
phpconfig
system "make"
prefix.install "modules/excel.so"
write_config_file if build.with? "config-file"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment