Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
grace: fix compiliation against libpng 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
adamv committed Jun 12, 2012
1 parent 8c9d78a commit f7903a2
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions Library/Formula/grace.rb
@@ -1,22 +1,50 @@
require 'formula'

class Grace < Formula
url 'ftp://plasma-gate.weizmann.ac.il/pub/grace/src/grace5/grace-5.1.22.tar.gz'
homepage 'http://plasma-gate.weizmann.ac.il/Grace/'
md5 '672356466f18fe59ed21a8fb44f9851d'
url 'ftp://plasma-gate.weizmann.ac.il/pub/grace/src/grace5/grace-5.1.22.tar.gz'
sha1 '3ce88c7c264d2de73b8935f835a1c1f8e368c78f'

depends_on 'pdflib-lite'
depends_on 'jpeg'
depends_on 'fftw'
depends_on 'lesstif'

# Upstream development has stopped, but we provide a minimal patch that
# allows compilation against libpng 1.5.
def patches
DATA
end

def install
ENV.x11

system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}", "--with-zlib",
"--enable-grace-home=#{prefix}"
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-zlib",
"--enable-grace-home=#{prefix}"

system "make install"
end
end

__END__
--- a/src/rstdrv.c
+++ b/src/rstdrv.c
@@ -54,6 +54,7 @@

#ifdef HAVE_LIBPNG
# include <png.h>
+# include <zlib.h>
#endif

#ifndef NONE_GUI
@@ -885,7 +886,7 @@ static void rstImagePng(gdImagePtr ihandle, FILE *prstream)
return;
}

- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_write_struct(&png_ptr, &info_ptr);
return;
}

0 comments on commit f7903a2

Please sign in to comment.