ocrmypdf: depend on pillow formula

Closes #80458.

Signed-off-by: Nanda H Krishna <me@nandahkrishna.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
master
Alexander Bayandin 2021-07-02 16:20:25 +01:00 committed by BrewTestBot
parent c531ae1ec2
commit c44911dbcf
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
2 changed files with 10 additions and 45 deletions

View File

@ -6,6 +6,7 @@ class Ocrmypdf < Formula
url "https://files.pythonhosted.org/packages/41/ec/e4159c465406e723eb7f66108344cd49429515469a4c339f143c4d34613f/ocrmypdf-12.2.0.tar.gz"
sha256 "00e5e39d18553c76a26767f02ed228c0f2476836bb81b2fdea71cb0fbfcdc57d"
license "MPL-2.0"
revision 1
bottle do
sha256 cellar: :any, arm64_big_sur: "310585ce97a515f7ee36d32d28e1c48c252d5fb360d004a208ec020a02de2d02"
@ -16,24 +17,21 @@ class Ocrmypdf < Formula
depends_on "pkg-config" => :build
depends_on "rust" => :build
depends_on "freetype"
depends_on "ghostscript"
depends_on "jbig2enc"
depends_on "jpeg"
depends_on "leptonica"
depends_on "libffi"
depends_on "libpng"
depends_on "pillow"
depends_on "pngquant"
depends_on "pybind11"
depends_on "python@3.9"
depends_on "qpdf"
depends_on "tcl-tk"
depends_on "tesseract"
depends_on "unpaper"
uses_from_macos "libxml2"
uses_from_macos "libxslt"
uses_from_macos "zlib"
on_linux do
depends_on "gcc"
@ -82,13 +80,8 @@ class Ocrmypdf < Formula
end
resource "pikepdf" do
url "https://files.pythonhosted.org/packages/b7/df/627c118e0bb5e6da05c308a50ed73b1db9a36cdd69b7e8337b6a18a59499/pikepdf-2.12.2.tar.gz"
sha256 "5ff35499b1ae7b181277f78ce5b1bcc8d3009182bb389917791c5dc811fcc8e4"
end
resource "Pillow" do
url "https://files.pythonhosted.org/packages/21/23/af6bac2a601be6670064a817273d4190b79df6f74d8012926a39bc7aa77f/Pillow-8.2.0.tar.gz"
sha256 "a787ab10d7bb5494e5f76536ac460741788f1fbce851068d73a87ca7c35fc3e1"
url "https://files.pythonhosted.org/packages/2b/55/6a6a82b13dcf181c1c61d51559893c9ed566767e25edc7b6f4cbba85c07f/pikepdf-2.13.0.tar.gz"
sha256 "9484921319aa072f7471b823bd196879f97945e811f9d9bc0a15e52ae05a25b6"
end
resource "pluggy" do
@ -102,8 +95,8 @@ class Ocrmypdf < Formula
end
resource "reportlab" do
url "https://files.pythonhosted.org/packages/2a/02/078c875d81f231fc11ecda3158a2e2cfccc390a534c316e2524db007e245/reportlab-3.5.67.tar.gz"
sha256 "0cf2206c73fbca752c8bd39e12bb9ad7f2d01e6fcb2b25b9eaf94ea042fe86c9"
url "https://files.pythonhosted.org/packages/f8/3b/3684a3414cde1626be5245af21ace0629ceb1e38ff745a84e07349505827/reportlab-3.5.68.tar.gz"
sha256 "efef6a97e3ab49f3f40037dbf9a4166668a17cc6aaba13d5ecbabdf854a9b332"
end
resource "sortedcontainers" do
@ -117,42 +110,11 @@ class Ocrmypdf < Formula
end
def install
venv = virtualenv_create(libexec, Formula["python@3.9"].bin/"python3")
resource("Pillow").stage do
inreplace "setup.py" do |s|
on_macos do
sdkprefix = MacOS.sdk_path_if_needed ? MacOS.sdk_path : ""
s.gsub! "openjpeg.h", "probably_not_a_header_called_this_eh.h"
s.gsub! "xcb.h", "probably_not_a_header_called_this_eh.h"
s.gsub! "ZLIB_ROOT = None",
"ZLIB_ROOT = ('#{sdkprefix}/usr/lib', '#{sdkprefix}/usr/include')"
end
on_linux do
s.gsub! "ZLIB_ROOT = None",
"ZLIB_ROOT = ('#{Formula["zlib"].opt_prefix}/lib', '#{Formula["zlib"].opt_prefix}/include')"
end
s.gsub! "JPEG_ROOT = None",
"JPEG_ROOT = ('#{Formula["jpeg"].opt_prefix}/lib', '#{Formula["jpeg"].opt_prefix}/include')"
s.gsub! "FREETYPE_ROOT = None",
"FREETYPE_ROOT = ('#{Formula["freetype"].opt_prefix}/lib', " \
"'#{Formula["freetype"].opt_prefix}/include')"
end
venv.pip_install Pathname.pwd
end
# Fix "ld: file not found: /usr/lib/system/libsystem_darwin.dylib" for lxml
ENV["SDKROOT"] = MacOS.sdk_path if MacOS.version == :sierra
res = resources.map(&:name).to_set - ["Pillow"]
res.each do |r|
venv.pip_install resource(r)
end
virtualenv_install_with_resources
venv.pip_install_and_link buildpath
bash_completion.install "misc/completion/ocrmypdf.bash" => "ocrmypdf"
fish_completion.install "misc/completion/ocrmypdf.fish"
end

View File

@ -105,6 +105,9 @@
"nox": {
"exclude_packages": ["six"]
},
"ocrmypdf": {
"exclude_packages": ["pillow"]
},
"openstackclient": {
"extra_packages": ["python-heatclient", "python-octaviaclient"]
},