Unverified Commit ba40f8ea authored by Robert Scott's avatar Robert Scott Committed by GitHub
Browse files

Merge pull request #210409 from r-ryantm/auto-update/leptonica

leptonica: 1.82.0 -> 1.83.0
parents 2ac55b53 3caa473d
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -3,15 +3,23 @@

stdenv.mkDerivation rec {
  pname = "tesseract";
  version = "3.05.00";
  version = "3.05.02";

  src = fetchFromGitHub {
    owner = "tesseract-ocr";
    repo = "tesseract";
    rev = version;
    hash = "sha256-YHj00gG/3SW0ILTiQwphiCxuP9OCDya27hyFQB27mYc=";
    hash = "sha256-28osuZnVwkJpNTYkU+5D5PI8xtViFzGCMScHzkS2H20=";
  };

  # leptonica 1.83 made internal structures private. using internal headers isn't
  # great, but tesseract3's days are numbered anyway
  postPatch = ''
    for f in textord/devanagari_processing.cpp cube/cube_line_object.h cube/cube_line_segmenter.h cube/cube_utils.h ; do
      sed -i '/allheaders.h/a#include "pix_internal.h"' "$f"
    done
  '';

  enableParallelBuilding = true;

  nativeBuildInputs = [
+7 −13
Original line number Diff line number Diff line
@@ -3,26 +3,20 @@

stdenv.mkDerivation rec {
  pname = "tesseract";
  version = "4.1.1";
  version = "4.1.3";

  src = fetchFromGitHub {
    owner = "tesseract-ocr";
    repo = "tesseract";
    rev = version;
    hash = "sha256-lu/Y5mlCI8AajhiWaID0fGo5PghEQZdgt2X0K9c/QrE=";
    hash = "sha256-sV3w53ky13ESc0dGPutMGQ4TcmOeWJkvUwBPIyzSTc8=";
  };

  patches = [
    # https://github.com/tesseract-ocr/tesseract/issues/3447
    (fetchpatch {
      url = "https://github.com/tesseract-ocr/tesseract/commit/dbc79b09d195490dfa3f7d338eadac07ad6683f7.patch";
      sha256 = "sha256-lGlg0etuU4RXfdq1QH2bYObdeGrFHKf9O8zMUAbfNIQ=";
    })
    (fetchpatch {
      url = "https://github.com/tesseract-ocr/tesseract/commit/6dc4b184b1ebf2e68461f6b63f63a033bc7245f7.patch";
      sha256 = "sha256-DwIX3r5NmeajI6WgIVHDbkhLH/ygJIjPO5XrbzWQhSw=";
    })
  ];
  # leptonica 1.83 made internal structures private. using internal headers isn't
  # great, but tesseract4's days are numbered anyway
  postPatch = ''
    sed -i '/allheaders.h/a#include "pix_internal.h"' src/textord/devanagari_processing.cpp
  '';

  enableParallelBuilding = true;

+8 −6
Original line number Diff line number Diff line
@@ -10,23 +10,25 @@

mkDerivation {
  pname = "qt-box-editor";
  version = "unstable-2019-07-12";
  version = "unstable-2019-07-14";

  src = fetchFromGitHub {
    owner = "zdenop";
    repo = "qt-box-editor";
    rev = "75a68b466868ba41ba2886caa796057403fe1901";
    sha256 = "0zwsyy7cnbhy5aazwlkhd9y8bnzlgy1gffqa46abajn4809b95k3";
    rev = "cba2929dabc6c715acd1a282ba161fee914c87f6";
    hash = "sha256-3dWnAu0CLO3atjbC1zJEnL3vzsIEecDDDhW3INMfCv4=";
  };

  buildInputs = [ qtbase qtsvg leptonica tesseract ];

  nativeBuildInputs = [ qmake ];

  # remove with next release
  # https://github.com/zdenop/qt-box-editor/pull/78
  # https://github.com/zdenop/qt-box-editor/issues/87
  postPatch = ''
    printf "INSTALLS += target\ntarget.path = $out/bin" >>  qt-box-editor.pro
    sed -i '/allheaders.h/a#include <leptonica/pix_internal.h>' src/TessTools.h

    substituteInPlace qt-box-editor.pro \
      --replace '-llept' '-lleptonica'
  '';

  meta = with lib; {
+4 −1
Original line number Diff line number Diff line
@@ -23,7 +23,10 @@ stdenv.mkDerivation rec {
    sha256 = "sha256-usVAKBkdd8uz9cD5eLd0hnwGonOJLscRdc+iWDlNXVc=";
  };

  postPatch = lib.optionalString stdenv.isDarwin ''
  postPatch = ''
    # https://github.com/CCExtractor/ccextractor/issues/1467
    sed -i '/allheaders.h/a#include <leptonica/pix_internal.h>' src/lib_ccx/ocr.c
  '' + lib.optionalString stdenv.isDarwin ''
    substituteInPlace src/CMakeLists.txt \
    --replace 'add_definitions(-DGPAC_CONFIG_LINUX)' 'add_definitions(-DGPAC_CONFIG_DARWIN)'
  '';
+60 −0
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, leptonica, zlib, libwebp, giflib, libjpeg, libpng, libtiff }:
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, leptonica
, zlib
, libwebp
, giflib
, libjpeg
, libpng
, libtiff
, autoreconfHook
}:

stdenv.mkDerivation rec {
  pname = "jbig2enc";
  version = "0.28";
  version = "0.29";

  src = fetchFromGitHub {
    owner = "agl";
    repo = "jbig2enc";
    rev = "${version}-dist";
    hash = "sha256-Y3IVTjvO5tqn/O076y/llnTyenKpbx1WyT/JFZ/s0VY=";
    rev = version;
    hash = "sha256-IAL4egXgaGmCilzcryjuvOoHhahyrfGWY68GBfXXgAM=";
  };

  propagatedBuildInputs = [ leptonica zlib libwebp giflib libjpeg libpng libtiff ];
  buildInputs = [ autoreconfHook ];
  propagatedBuildInputs = [
    leptonica
    zlib
    libwebp
    giflib
    libjpeg
    libpng
    libtiff
  ];

  patches = [
    # https://github.com/agl/jbig2enc/commit/53ce5fe7e73d7ed95c9e12b52dd4984723f865fa
    ./53ce5fe7e73d7ed95c9e12b52dd4984723f865fa.patch
    (fetchpatch {
      name = "fix-build-leptonica-1.83.patch";
      url = "https://github.com/agl/jbig2enc/commit/ea050190466f5336c69c6a11baa1cb686677fcab.patch";
      hash = "sha256-+kScjFgDEU9F7VOUNAhm2XBjGm49fzAH8hYhmTm8xv8=";
    })
  ];

  # This is necessary, because the resulting library has
@@ -31,5 +55,6 @@ stdenv.mkDerivation rec {
    description = "Encoder for the JBIG2 image compression format";
    license = lib.licenses.asl20;
    platforms = lib.platforms.all;
    homepage = "https://github.com/agl/jbig2enc";
  };
}
Loading