Closed stepheneb closed 13 years ago
Off the top of my head something like:
def lock_folder
return var+"lock/sane"
end
And then add a "skip_clean lock_folder" to prevent the empty dir from being removed and a "lock_folder.mkpath" in the def install. I could whip up a patch, but only have a CanoScan scanner (and bought VueScan when I bought a house and needed to scan a bunch of stuff.)
I just have a CanoScan LiDE 30.
Here's a diff that works:
diff --git a/Library/Formula/sane-backends.rb b/Library/Formula/sane-backends.rb
index 4d85d32..d38eb13 100644
--- a/Library/Formula/sane-backends.rb
+++ b/Library/Formula/sane-backends.rb
@@ -9,9 +9,12 @@ class SaneBackends <Formula
depends_on 'libtiff'
depends_on 'libusb-compat'
+ skip_clean "var/lock/sane"
+
def install
+ ENV.j1 # Needed for Mac Pro compilation
system "./configure", "--disable-dependency-tracking",
- "--disable-debug",
+ # "--disable-debug",
"--prefix=#{prefix}",
"--without-gphoto2",
"--enable-local-backends",
@@ -19,5 +22,11 @@ class SaneBackends <Formula
"--disable-latex"
system "make"
system "make install"
+ lock_folder.mkpath
+ end
+
+ def lock_folder
+ return var+"lock/sane"
end
+
end
After installing with this brew I could run this successfully:
scanimage --format tiff > test.tiff
What is strange however is that installing the TWAIN-SANE interface by downloading and running the package from this page: http://www.ellert.se/twain-sane/
... doesn't end up working. The TWAIN-SANE package is nice because it lets apps like Graphic Converter and Image Capture work with the scanner.
If I use brew and uninstall sane-backends, libusb-compat, and libusb
and then install these packages manually from http://www.ellert.se/twain-sane
Then I can use the scanner with Graphic Convertor.
I'm not sure why TWAIN-SANE doesn't work with sane-backends installed by homebrew.
The version of sane-backends installed by homebrew is a bit newer.
There are two incompatible versions of libusb:
brew installs 1.0.8
the TWAIN-SANE page installs 0.1.13 beta 2009-09-10
???
Add a lockfile to sane-backends.
Some back-ends require this folder to operate. Closed by e7db80ae1c9a6465e02107cd514e6e8b46f72ab3
I was getting an error using the plustek sane backend because it expected the following directory to exist for a lock file when accessing my scanner.
After I created I also the following directory and set the permissions the lock file error stopped.
I wasn't sure of the best way to add this to the brew.