Sha256: 5f706a6ecfc47e7384f79ea42bb59dc54acedd66580e46964acb3645f5dd491b

Contents?: true

Size: 1.59 KB

Versions: 3

Compression:

Stored size: 1.59 KB

Contents

require 'mkmf'
require 'rbconfig'
host_os = RbConfig::CONFIG['host_os']

LASEM_DIR = File.join(File.dirname(__FILE__), 'lasem', 'src')
MTEX_DIR = File.join(File.dirname(__FILE__), 'mtex2MML', 'src')

if host_os =~ /darwin|mac os/
  ENV['PKG_CONFIG_PATH'] = "/opt/X11/lib/pkgconfig:#{ENV['PKG_CONFIG_PATH']}"
end

have_library('xml2')
find_header('libxml/tree.h', '/include/libxml2', '/usr/include/libxml2', '/usr/local/include/libxml2')
find_header('libxml/parser.h', '/include/libxml2', '/usr/include/libxml2', '/usr/local/include/libxml2')
find_header('libxml/xpath.h', '/include/libxml2', '/usr/include/libxml2', '/usr/local/include/libxml2')
find_header('libxml/xpathInternals.h', '/include/libxml2', '/usr/include/libxml2', '/usr/local/include/libxml2')

# TODO: this is so frakkin' stupid. but I can't seem to get subdirs to compile any other way
# the `destroy_copies` task, immediately after `compile`, will destroy these files
FileUtils.cp_r(Dir.glob("#{LASEM_DIR}/*"), File.dirname(__FILE__))
File.delete(File.join(File.dirname(__FILE__), 'lasemrender.c'))

# build mtex2MML Bison files
Dir.chdir(MTEX_DIR) do
  system 'make'
end

FileUtils.cp_r(Dir.glob("#{MTEX_DIR}/*.{c,h,cc}"), File.dirname(__FILE__))
FileUtils.cp_r("#{MTEX_DIR}/deps/.", File.dirname(__FILE__))
FileUtils.cp_r(Dir.glob("#{MTEX_DIR}/deps/**/*"), File.dirname(__FILE__))

have_library('pangocairo-1.0')

$LDFLAGS += " #{`pkg-config --static --libs glib-2.0 gdk-pixbuf-2.0 cairo pango`.chomp}"
$CFLAGS += " #{`pkg-config --cflags glib-2.0 gdk-pixbuf-2.0 cairo pango`.chomp} -I#{LASEM_DIR} -I#{MTEX_DIR}"

create_makefile('mathematical/mathematical')

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mathematical-1.1.1 ext/mathematical/extconf.rb
mathematical-1.1.0 ext/mathematical/extconf.rb
mathematical-1.0.0 ext/mathematical/extconf.rb