require File.expand_path("../Abstract/abstract-osquery-formula", __FILE__) class Ncurses < AbstractOsqueryFormula desc "Text-based UI library" homepage "https://www.gnu.org/s/ncurses/" license "X11" url "http://ftpmirror.gnu.org/ncurses/ncurses-6.0.tar.gz" mirror "https://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz" sha256 "f551c24b30ce8bfb6e96d9f59b42fbea30fa3a6123384172f9e7284bcf647260" revision 200 bottle do root_url "https://osquery-packages.s3.amazonaws.com/bottles" cellar :any_skip_relocation sha256 "386157fc0984dd0fe8a6c6a0ba4dac08933703e51d76b61a4aa98780d188721d" => :x86_64_linux end def install # Fix the build for GCC 5.1 # error: expected ')' before 'int' in definition of macro 'mouse_trafo' # See https://lists.gnu.org/archive/html/bug-ncurses/2014-07/msg00022.html # and http://trac.sagemath.org/ticket/18301 # Disable linemarker output of cpp ENV.append "CPPFLAGS", "-P" # osquery: Unknown why the legacy environment is preventing configure # from discovering the local include directories. ENV.append "CFLAGS", "-I../ncurses -I../progs" ENV.append "CPPFLAGS", "-I../c++" ENV.deparallelize (lib/"pkgconfig").mkpath system "./configure", "--prefix=#{prefix}", "--enable-pc-files", "--with-pkg-config-libdir=#{lib}/pkgconfig", "--enable-sigwinch", "--enable-symlinks", "--enable-widec", "--mandir=#{man}", "--with-manpage-format=normal", "--with-shared", "--with-gpm=no", "--without-shared", "--with-static" system "make", "install" make_libncurses_symlinks prefix.install "test" (prefix/"test").install "install-sh", "config.sub", "config.guess" end def make_libncurses_symlinks major = version.to_s.split(".")[0] %w[form menu ncurses panel].each do |name| lib.install_symlink "lib#{name}w.a" => "lib#{name}.a" lib.install_symlink "lib#{name}w_g.a" => "lib#{name}_g.a" end lib.install_symlink "libncurses++w.a" => "libncurses++.a" lib.install_symlink "libncurses.a" => "libcurses.a" (lib/"pkgconfig").install_symlink "ncursesw.pc" => "ncurses.pc" bin.install_symlink "ncursesw#{major}-config" => "ncurses#{major}-config" include.install_symlink [ "ncursesw/curses.h", "ncursesw/form.h", "ncursesw/ncurses.h", "ncursesw/term.h", "ncursesw/termcap.h"] end end