Skip to content

Commit

Permalink
* Add presets for Leptonica 1.71 and Tesseract 3.03-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Jul 19, 2014
1 parent 99543fb commit 132013a
Show file tree
Hide file tree
Showing 20 changed files with 13,854 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -2,7 +2,7 @@
* Upgrade presets for FFmpeg 2.3
* Make the `cppbuild.sh` scripts install native libraries inside the `cppbuild` subdirectories, instead of on the system
* Include new `platform.dependency` and `platform.dependencies` properties to let users depend easily on the artifacts that contain native libraries
* Add presets for FFTW 3.3.4, GSL 1.16, LLVM 3.4.2
* Add presets for FFTW 3.3.4, GSL 1.16, LLVM 3.4.2, Leptonica 1.71, Tesseract 3.03-rc1
* Fix missing `static` keyword on methods annotated with an `@Adapter` ([issue #3](https://github.com/bytedeco/javacpp-presets/issues/3))
* Turn `Mat.createFrom()` into a static factory method, and make `Mat.copyFrom()` call `Mat.create()` as appropriate ([issue #1](https://github.com/bytedeco/javacpp-presets/issues/1))
* Add missing `native_camera` modules of `opencv_highgui` for Android
Expand Down
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -37,15 +37,17 @@ To rebuild the source code on the Java side, please note that the project files
Each child module in turn relies on its corresponding native libraries being already installed in the `cppbuild` subdirectory by a prior execution of the included [CPPBuild Scripts](#cppbuild-scripts), explained below. To use native libraries already installed somewhere else on the system, other installation directories than `cppbuild` can also be specified in the `.java` configuration files directly. The following versions are supported:

* OpenCV 2.4.9 http://opencv.org/downloads.html
* FFmpeg 2.2.x http://ffmpeg.org/download.html
* PGR FlyCapture 1.7 or newer (Windows only) http://www.ptgrey.com/products/pgrflycapture/
* FFmpeg 2.3.x http://ffmpeg.org/download.html
* FlyCapture 1.7 or newer (Windows only) http://ww2.ptgrey.com/sdk/flycap
* libdc1394 2.1.x or 2.2.x http://sourceforge.net/projects/libdc1394/files/
* OpenKinect libfreenect 0.4 https://github.com/OpenKinect/libfreenect
* videoInput 0.200 https://github.com/ofTheo/videoInput/tree/update2013
* ARToolKitPlus 2.3.0 https://launchpad.net/artoolkitplus
* FFTW 3.3.4 http://www.fftw.org/download.html
* GSL 1.16 http://www.gnu.org/software/gsl/
* LLVM 3.4.2 http://llvm.org/releases/download.html
* Leptonica 1.71 http://www.leptonica.org/download.html
* Tesseract 3.03-rc1 https://code.google.com/p/tesseract-ocr/

Once everything installed and configured, simply execute
```bash
Expand Down Expand Up @@ -120,7 +122,7 @@ Contributions of any kind are highly welcome! At the moment, the `Parser` has li
* Improving the `Parser`
* Providing builds for more platforms, most notably `linux-arm`
* Replacing the Bash/Maven build combo by something better (Gradle?)
* Adding new presets as child modules for other C/C++ libraries (LLVM, OpenNI, OpenMesh, PCL, Tesseract, etc.)
* Adding new presets as child modules for other C/C++ libraries (OpenNI, OpenMesh, PCL, etc.)

To contribute, please fork and create pull requests, or post your suggestions [as a new "issue"](https://github.com/bytedeco/javacpp-presets/issues). Thank you very much in advance for your contribution!

Expand Down
2 changes: 1 addition & 1 deletion cppbuild.sh
Expand Up @@ -83,7 +83,7 @@ function download {
}

if [[ -z ${PROJECTS:-} ]]; then
PROJECTS=(opencv ffmpeg flycapture libdc1394 libfreenect videoinput artoolkitplus fftw gsl llvm)
PROJECTS=(opencv ffmpeg flycapture libdc1394 libfreenect videoinput artoolkitplus fftw gsl llvm leptonica tesseract)
fi

for PROJECT in ${PROJECTS[@]}; do
Expand Down
2 changes: 1 addition & 1 deletion fftw/src/main/java/org/bytedeco/javacpp/presets/fftw3.java
Expand Up @@ -42,7 +42,7 @@ public void map(InfoMap infoMap) {
.put(new Info("fftwl_plan_s").pointerTypes("fftwl_plan")).put(new Info("fftwl_plan").valueTypes("fftwl_plan"))
.put(new Info("fftwq_plan_s").pointerTypes("fftwq_plan")).put(new Info("fftwq_plan").valueTypes("fftwq_plan"))
.put(new Info("fftw_version").annotations("@Platform(not=\"windows\")").javaNames("fftw_version"))
.put(new Info("fftw_cc").annotations("@Platform(not=\"windows\")").javaNames("fftw_fftw_cc"))
.put(new Info("fftw_cc").annotations("@Platform(not=\"windows\")").javaNames("fftw_cc"))
.put(new Info("fftw_codelet_optim").annotations("@Platform(not=\"windows\")").javaNames("fftw_codelet_optim"))
.put(new Info("fftwf_version").annotations("@Platform(not=\"windows\")").javaNames("fftwf_version"))
.put(new Info("fftwf_cc").annotations("@Platform(not=\"windows\")").javaNames("fftwf_cc"))
Expand Down
61 changes: 61 additions & 0 deletions leptonica/cppbuild.sh
@@ -0,0 +1,61 @@
if [[ -z "$PLATFORM" ]]; then
echo "This file is meant to be included by the parent cppbuild.sh script"
exit 1
fi

if [[ $PLATFORM == windows* ]]; then
LEPTONICA_VERSION=1.68
[[ $PLATFORM == *64 ]] && BITS=64 || BITS=32
download http://www.leptonica.org/source/leptonica-$LEPTONICA_VERSION-win$BITS-lib-include-dirs.zip leptonica-$LEPTONICA_VERSION-win$BITS-lib-include-dirs.zip

mkdir -p $PLATFORM
cd $PLATFORM
unzip -o ../leptonica-$LEPTONICA_VERSION-win$BITS-lib-include-dirs.zip
cd include
else
LEPTONICA_VERSION=1.71
download http://www.leptonica.org/source/leptonica-$LEPTONICA_VERSION.tar.gz leptonica-$LEPTONICA_VERSION.tar.gz

mkdir -p $PLATFORM
cd $PLATFORM
INSTALL_PATH=`pwd`
tar -xzvf ../leptonica-$LEPTONICA_VERSION.tar.gz
cd leptonica-$LEPTONICA_VERSION
fi

case $PLATFORM in
android-arm)
./configure --prefix=$INSTALL_PATH --host="arm-linux-androideabi" --with-sysroot="$ANDROID_ROOT" CC="$ANDROID_BIN-gcc" STRIP="$ANDROID_BIN-strip" CFLAGS="--sysroot=$ANDROID_ROOT -DANDROID -fPIC -ffunction-sections -funwind-tables -fstack-protector -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300" LDFLAGS="-nostdlib -Wl,--fix-cortex-a8" LIBS="-lgcc -ldl -lz -lm -lc"
make -j4
make install-strip
;;
android-x86)
./configure --prefix=$INSTALL_PATH --host="i686-linux-android" --with-sysroot="$ANDROID_ROOT" CC="$ANDROID_BIN-gcc" STRIP="$ANDROID_BIN-strip" CFLAGS="--sysroot=$ANDROID_ROOT -DANDROID -fPIC -ffunction-sections -funwind-tables -mssse3 -mfpmath=sse -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300" LDFLAGS="-nostdlib" LIBS="-lgcc -ldl -lz -lm -lc"
make -j4
make install-strip
;;
linux-x86)
./configure --prefix=$INSTALL_PATH CC="gcc -m32"
make -j4
make install-strip
;;
linux-x86_64)
./configure --prefix=$INSTALL_PATH CC="gcc -m64"
make -j4
make install-strip
;;
macosx-x86_64)
./configure --prefix=$INSTALL_PATH
make -j4
make install-strip
;;
windows-x86)
;;
windows-x86_64)
;;
*)
echo "Error: Platform \"$PLATFORM\" is not supported"
;;
esac

cd ../..
26 changes: 26 additions & 0 deletions leptonica/leptonica-license.txt
@@ -0,0 +1,26 @@
/*====================================================================*
- Copyright (C) 2001 Leptonica. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*====================================================================*/

52 changes: 52 additions & 0 deletions leptonica/pom.xml
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp-presets</artifactId>
<version>0.8-2-SNAPSHOT</version>
</parent>

<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>leptonica</artifactId>
<version>1.71-${project.parent.version}</version>
<packaging>jar</packaging>
<name>JavaCPP Presets for Leptonica</name>

<dependencies>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>

0 comments on commit 132013a

Please sign in to comment.