ghostscript: add tesseract variant (#23794)
This commit is contained in:
parent
63ea0c8865
commit
2d69f63a9c
@ -24,6 +24,9 @@ class Ghostscript(AutotoolsPackage):
|
|||||||
version('9.21', sha256='02bceadbc4dddeb6f2eec9c8b1623d945d355ca11b8b4df035332b217d58ce85')
|
version('9.21', sha256='02bceadbc4dddeb6f2eec9c8b1623d945d355ca11b8b4df035332b217d58ce85')
|
||||||
version('9.18', sha256='5fc93079749a250be5404c465943850e3ed5ffbc0d5c07e10c7c5ee8afbbdb1b')
|
version('9.18', sha256='5fc93079749a250be5404c465943850e3ed5ffbc0d5c07e10c7c5ee8afbbdb1b')
|
||||||
|
|
||||||
|
# https://www.ghostscript.com/ocr.html
|
||||||
|
variant('tesseract', default=False, description='Use the Tesseract library for OCR')
|
||||||
|
|
||||||
depends_on('pkgconfig', type='build')
|
depends_on('pkgconfig', type='build')
|
||||||
depends_on('krb5', type='link')
|
depends_on('krb5', type='link')
|
||||||
|
|
||||||
@ -36,6 +39,12 @@ class Ghostscript(AutotoolsPackage):
|
|||||||
depends_on('libxext')
|
depends_on('libxext')
|
||||||
depends_on('gtkplus')
|
depends_on('gtkplus')
|
||||||
|
|
||||||
|
# https://www.ghostscript.com/doc/9.53.0/News.htm
|
||||||
|
conflicts('+tesseract', when='@:9.52', msg='Tesseract OCR engine added in 9.53.0')
|
||||||
|
|
||||||
|
# https://trac.macports.org/ticket/62832
|
||||||
|
conflicts('+tesseract', when='platform=darwin', msg='Tesseract does not build correctly on macOS')
|
||||||
|
|
||||||
patch('nogoto.patch', when='%fj@:4.1.0')
|
patch('nogoto.patch', when='%fj@:4.1.0')
|
||||||
|
|
||||||
# Related bug report: https://bugs.ghostscript.com/show_bug.cgi?id=702985
|
# Related bug report: https://bugs.ghostscript.com/show_bug.cgi?id=702985
|
||||||
@ -69,12 +78,17 @@ def patch(self):
|
|||||||
string=True)
|
string=True)
|
||||||
|
|
||||||
def configure_args(self):
|
def configure_args(self):
|
||||||
return [
|
args = [
|
||||||
'--disable-compile-inits',
|
'--disable-compile-inits',
|
||||||
'--enable-dynamic',
|
'--enable-dynamic',
|
||||||
'--with-system-libtiff',
|
'--with-system-libtiff',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if self.spec.satisfies('@9.53:'):
|
||||||
|
args.extend(self.with_or_without('tesseract'))
|
||||||
|
|
||||||
|
return args
|
||||||
|
|
||||||
def build(self, spec, prefix):
|
def build(self, spec, prefix):
|
||||||
make()
|
make()
|
||||||
make('so')
|
make('so')
|
||||||
|
Loading…
Reference in New Issue
Block a user