[buildout]
extends =
  ../garbage-collector/buildout.cfg
  ../ncurses/buildout.cfg
  ../openssl/buildout.cfg
  ../perl/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../zlib/buildout.cfg

parts =
  w3m

[w3m]
recipe = slapos.recipe.cmmi
md5sum = 1b845a983a50b8dec0169ac48479eacc
url = http://downloads.sourceforge.net/project/w3m/w3m/w3m-0.5.3/w3m-0.5.3.tar.gz
configure-options =
  --with-gc=${garbage-collector:location}
  --with-ssl=${openssl:location}
  --with-termlib=ncurses
  --disable-nls
  --disable-image
  --disable-dict
  --disable-xface
  --disable-mouse
  --disable-nntp
  --disable-help-cgi
  --disable-external-uri-loader
  --disable-w3mmailer

patch-options =
  -p1

# http://lists.opensuse.org/opensuse-commit/2011-09/msg00222.html
# http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/www-client/w3m/files/w3m-0.5.2-gc72.patch
patches =
  ${:_profile_base_location_}/w3m.gcc.forward.compat.patch#75422a6f7f671b3a6d9add6724cc0945
  ${:_profile_base_location_}/w3m-0.5.2-gc72.patch#5a74b6379240c8dd1372efa7926c8bdc

environment =
  PATH=${perl:location}/bin:${pkgconfig:location}/bin:%(PATH)s
  PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig:${garbage-collector:location}/lib/pkgconfig
  CPPFLAGS=-I${ncurses:location}/include/ -I${zlib:location}/include/ -I${garbage-collector:location}/include
  LDFLAGS=-Wl,--as-needed -L${garbage-collector:location}/lib -Wl,-rpath=${garbage-collector:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib