aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/sane-backends.rb
blob: 9b1a1800d0196306ebc272140d3d505271fadb64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
require "formula"

class SaneBackends < Formula
  homepage "http://www.sane-project.org/"
  url "http://fossies.org/linux/misc/sane-backends-1.0.24.tar.gz"
  mirror "https://mirrors.kernel.org/debian/pool/main/s/sane-backends/sane-backends_1.0.24.orig.tar.gz"
  sha1 "c10bcb30a1b092b2c2fe5a86d6a5efc29123ccf9"
  bottle do
    revision 1
    sha1 "36cbd09583ba8282b149467de09e963d8c2c2a6f" => :yosemite
    sha1 "d12ff8d69dae245177c554c82dbe0acc9c31fd3d" => :mavericks
    sha1 "343224849f6824dba073499bcb0521abd76e9e23" => :mountain_lion
  end

  revision 1

  option :universal

  depends_on "jpeg"
  depends_on "libtiff"
  depends_on "libusb-compat"
  depends_on "openssl"

  # Fixes u_long missing error. Reported upstream:
  # https://github.com/fab1an/homebrew/commit/2a716f1a2b07705aa891e2c7fbb5148506aa5a01
  # When updating this formula, check on the usptream status of this patch.
  patch :DATA

  def install
    ENV.universal_binary if build.universal?
    ENV.j1 # Makefile does not seem to be parallel-safe
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--localstatedir=#{var}",
                          "--without-gphoto2",
                          "--enable-local-backends",
                          "--enable-libusb",
                          "--disable-latex"
    system "make"
    system "make", "install"

    # Some drivers require a lockfile
    (var+"lock/sane").mkpath
  end
end

__END__
diff --git a/include/sane/sane.h.orig b/include/sane/sane.h
index 5320b4a..6cb7090 100644
--- a/include/sane/sane.h.orig
+++ b/include/sane/sane.h
@@ -20,6 +20,9 @@
 extern "C" {
 #endif
 
+// Fixes u_long missing error
+#include <sys/types.h>
+
 /*
  * SANE types and defines
  */