<commit_before>require 'formula'

class Optipng < Formula
  homepage 'http://optipng.sourceforge.net/'
  head 'http://optipng.hg.sourceforge.net/hgweb/optipng/optipng'
  url 'https://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.5/optipng-0.7.5.tar.gz'
  sha1 '30b6c333d74fc0f5dc83004aace252fa3321368b'

  # Fix compilation on 10.10
  # http://sourceforge.net/p/optipng/bugs/47/
  patch :DATA

  def install
    system "./configure", "--with-system-zlib",
                          "--prefix=#{prefix}",
                          "--mandir=#{man}"
    system "make install"
  end
end

__END__
diff --git a/src/optipng/osys.c b/src/optipng/osys.c
index d816ef7..610250b 100644
--- a/src/optipng/osys.c
+++ b/src/optipng/osys.c
@@ -518,7 +518,7 @@ osys_copy_attr(const char *src_path, const char *dest_path)
     if (chmod(dest_path, sbuf.st_mode) != 0)
         result = -1;
 
-#ifdef AT_FDCWD
+#if defined(AT_FDCWD) && !defined(__APPLE__) && !defined(__SVR4) && !defined(__sun)
     {
         struct timespec times[2];<commit_msg>optipng: update head url<commit_after>require 'formula'

class Optipng < Formula
  homepage 'http://optipng.sourceforge.net/'
  head 'http://hg.code.sf.net/p/optipng/mercurial', :using => :hg
  url 'https://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.5/optipng-0.7.5.tar.gz'
  sha1 '30b6c333d74fc0f5dc83004aace252fa3321368b'

  # Fix compilation on 10.10
  # http://sourceforge.net/p/optipng/bugs/47/
  patch :DATA

  def install
    system "./configure", "--with-system-zlib",
                          "--prefix=#{prefix}",
                          "--mandir=#{man}"
    system "make install"
  end
end

__END__
diff --git a/src/optipng/osys.c b/src/optipng/osys.c
index d816ef7..610250b 100644
--- a/src/optipng/osys.c
+++ b/src/optipng/osys.c
@@ -518,7 +518,7 @@ osys_copy_attr(const char *src_path, const char *dest_path)
     if (chmod(dest_path, sbuf.st_mode) != 0)
         result = -1;
 
-#ifdef AT_FDCWD
+#if defined(AT_FDCWD) && !defined(__APPLE__) && !defined(__SVR4) && !defined(__sun)
     {
         struct timespec times[2];
{'fraction_non_alphanumeric': 0.16049382716049382, 'fraction_numerical': 0.06267806267806268, 'mean_word_length': 2.909090909090909, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5728882', 'n_tokens_mistral': 923, 'n_tokens_neox': 833, 'n_words': 136}