summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Johnson <glenn-johnson@uiowa.edu>2021-07-26 00:49:58 -0500
committerGitHub <noreply@github.com>2021-07-26 07:49:58 +0200
commit63e04ce220f9ae5a135a1d00bc5fe00872aa1731 (patch)
treee030f9727eb72475d830d7183b958145a1f7ddb5
parentd6432e9718a160bda79afe473adc9630d36a9ce5 (diff)
downloadspack-63e04ce220f9ae5a135a1d00bc5fe00872aa1731.tar.gz
spack-63e04ce220f9ae5a135a1d00bc5fe00872aa1731.tar.bz2
spack-63e04ce220f9ae5a135a1d00bc5fe00872aa1731.tar.xz
spack-63e04ce220f9ae5a135a1d00bc5fe00872aa1731.zip
Fix tesseract package (#24304)
This PR fixes the tesseract package - add missing dependencies - build documentation - build and install java component - build and install training component
-rw-r--r--var/spack/repos/builtin/packages/tesseract/java_Makefile.patch28
-rw-r--r--var/spack/repos/builtin/packages/tesseract/package.py63
2 files changed, 87 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/tesseract/java_Makefile.patch b/var/spack/repos/builtin/packages/tesseract/java_Makefile.patch
new file mode 100644
index 0000000000..aed17e854c
--- /dev/null
+++ b/var/spack/repos/builtin/packages/tesseract/java_Makefile.patch
@@ -0,0 +1,28 @@
+--- a/java/Makefile.am 2019-12-26 08:21:51.000000000 -0600
++++ b/java/Makefile.am 2021-06-11 17:30:44.522469994 -0500
+@@ -36,11 +36,11 @@
+ com/google/scrollview/ScrollView.class
+
+ SCROLLVIEW_LIBS = \
+- piccolo2d-core-3.0.jar \
+- piccolo2d-extras-3.0.jar \
++ piccolo2d-core-3.0.1.jar \
++ piccolo2d-extras-3.0.1.jar \
+ jaxb-api-2.3.1.jar
+
+-CLASSPATH = piccolo2d-core-3.0.jar:piccolo2d-extras-3.0.jar:jaxb-api-2.3.1.jar
++CLASSPATH = piccolo2d-core-3.0.1.jar:piccolo2d-extras-3.0.1.jar:jaxb-api-2.3.1.jar
+
+ ScrollView.jar : $(SCROLLVIEW_CLASSES)
+ $(JAR) cfm $@ $(srcdir)/Manifest.txt com/google/scrollview/*.class \
+@@ -51,8 +51,8 @@
+
+ .PHONY: fetch-jars
+ fetch-jars $(SCROLLVIEW_LIBS):
+- curl -L http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0/piccolo2d-core-3.0.jar > piccolo2d-core-3.0.jar
+- curl -L http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0/piccolo2d-extras-3.0.jar > piccolo2d-extras-3.0.jar
++ curl -L http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0.1/piccolo2d-core-3.0.1.jar > piccolo2d-core-3.0.1.jar
++ curl -L http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0.1/piccolo2d-extras-3.0.1.jar > piccolo2d-extras-3.0.1.jar
+ curl -L http://search.maven.org/remotecontent?filepath=javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar > jaxb-api-2.3.1.jar
+
+ .PHONY: install-jars
diff --git a/var/spack/repos/builtin/packages/tesseract/package.py b/var/spack/repos/builtin/packages/tesseract/package.py
index 165ccc2d07..cee0285c56 100644
--- a/var/spack/repos/builtin/packages/tesseract/package.py
+++ b/var/spack/repos/builtin/packages/tesseract/package.py
@@ -16,14 +16,69 @@ class Tesseract(AutotoolsPackage):
version('4.1.0', sha256='5c5ed5f1a76888dc57a83704f24ae02f8319849f5c4cf19d254296978a1a1961')
version('4.0.0', sha256='a1f5422ca49a32e5f35c54dee5112b11b99928fc9f4ee6695cdc6768d69f61dd')
+ # do not fetch the jar files from Makefile
+ patch('java_Makefile.patch')
+
+ jars = [
+ 'piccolo2d-core-3.0.1',
+ 'piccolo2d-extras-3.0.1',
+ 'jaxb-api-2.3.1'
+ ]
+ resource(
+ name=jars[0],
+ url='https://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0.1/piccolo2d-core-3.0.1.jar',
+ sha256='9acad723136ddb996e96f5d488b9b046753a1d4c60ea639d5e3f9701deaf60ad',
+ placement=jars[0],
+ expand=False,
+ )
+ resource(
+ name=jars[1],
+ url='https://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0.1/piccolo2d-extras-3.0.1.jar',
+ sha256='ba45f343e9ebc06c9b4ce165c8bb539b11cbf59e93d1df48489ab173f74375a8',
+ placement=jars[1],
+ expand=False,
+ )
+ resource(
+ name=jars[2],
+ url='http://search.maven.org/remotecontent?filepath=javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar',
+ sha256='88b955a0df57880a26a74708bc34f74dcaf8ebf4e78843a28b50eae945732b06',
+ placement=jars[2],
+ expand=False,
+ )
+
depends_on('autoconf', type='build')
depends_on('automake', type='build')
depends_on('libtool', type='build')
depends_on('m4', type='build')
+ depends_on('doxygen', type='build')
+ depends_on('asciidoc', type='build')
+ depends_on('libxslt', type='build')
+ depends_on('pkgconfig', type='build')
depends_on('leptonica')
depends_on('libarchive')
+ depends_on('curl')
+ depends_on('icu4c')
+ depends_on('cairo')
+ depends_on('pango')
+ depends_on('java')
+
+ def autoreconf(self, spec, prefix):
+ autogen = Executable(join_path('.', 'autogen.sh'))
+ autogen()
+
+ def setup_run_environment(self, env):
+ env.set('SCROLLVIEW_PATH', prefix.share.tessdata)
+
+ @run_after('install')
+ def training(self):
+ make('training')
+ make('training-install')
+
+ # move the jar files to the java directory
+ for jar in self.jars:
+ src = '{0}/{1}/{2}.jar'.format(self.stage.source_path, jar, jar)
+ dest = '{0}/java/{1}.jar'.format(self.stage.source_path, jar)
+ copy(src, dest)
- @when('@:4.0.0')
- def configure_args(self):
- args = ['LDFLAGS=-lz']
- return args
+ with working_dir('java'):
+ make('install-jars')