Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable OCR for ccextractor #76534

Closed
wants to merge 1 commit into from
Closed

Enable OCR for ccextractor #76534

wants to merge 1 commit into from

Conversation

NilsIrl
Copy link
Member

@NilsIrl NilsIrl commented Dec 26, 2019

Motivation for this change

Although tesseract and leptonica are included as buildInputs, they are unused as OCR is disabled. Enabling it.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @titanous

@NilsIrl
Copy link
Member Author

NilsIrl commented Dec 26, 2019

Copy link
Contributor

@titanous titanous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Whoever does this merge, please run a build of the package on CI first, I don't currently have permissions to trigger it.

@NilsIrl
Copy link
Member Author

NilsIrl commented Dec 29, 2019

This could also be added as an option instead of having it for everyone.

@stale
Copy link

stale bot commented Jun 27, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 27, 2020
@NilsIrl
Copy link
Member Author

NilsIrl commented Jun 27, 2020

@titanous

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 7, 2020
@ofborg ofborg bot requested a review from titanous August 21, 2020 19:16
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash all commits together and update the PR title and commit message to ccextractor: enable ocr support

@NilsIrl
Copy link
Member Author

NilsIrl commented Dec 29, 2020

Done, however, there's a problem, ccextractor, is unable to locate the tesseract data. CCExtractor/ccextractor#1170 would fix it. But unfortunately it was rejected.

@@ -1,5 +1,8 @@
{ stdenv, fetchFromGitHub, pkgconfig, cmake
, glew, glfw3, leptonica, libiconv, tesseract3, zlib }:
, glew, glfw3, zlib, libiconv
, ocrSupport ? true, leptonica ? null, tesseract4 ? null }:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
, ocrSupport ? true, leptonica ? null, tesseract4 ? null }:
, ocrSupport ? true, leptonica, tesseract4 }:

pkgs/applications/video/ccextractor/default.nix Outdated Show resolved Hide resolved
pkgs/applications/video/ccextractor/default.nix Outdated Show resolved Hide resolved
@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 76534 run on x86_64-linux 1

1 package built:
  • ccextractor

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 76534 run on x86_64-darwin 1

1 package built:
  • ccextractor

@@ -17,7 +20,11 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ pkgconfig cmake ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nativeBuildInputs = [ pkgconfig cmake ];
nativeBuildInputs = [ pkg-config cmake ];

@@ -1,5 +1,8 @@
{ stdenv, fetchFromGitHub, pkgconfig, cmake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ stdenv, fetchFromGitHub, pkgconfig, cmake
{ stdenv, lib, fetchFromGitHub, pkg-config, cmake

, glew, glfw3, zlib, libiconv
, ocrSupport ? true, leptonica ? null, tesseract4 ? null }:

assert ocrSupport -> leptonica != null && tesseract4 != null;

with stdenv.lib;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
with stdenv.lib;

pkgs/applications/video/ccextractor/default.nix Outdated Show resolved Hide resolved
"-DWITH_OCR=${if ocrSupport then "ON" else "OFF"}"
];

buildInputs = [ glew glfw3 leptonica tesseract4 zlib ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv;

meta = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
meta = {
meta = with lib; {

@@ -29,6 +36,6 @@ stdenv.mkDerivation rec {
'';
platforms = platforms.unix;
license = licenses.gpl2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gpl2Only or gpl2Plus?

@NilsIrl
Copy link
Member Author

NilsIrl commented Jan 15, 2021

Applied suggestions.

I'm ignoring the other suggestions because they belong to another PR

Update to tesseract4

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
@@ -1,5 +1,6 @@
{ lib, stdenv, fetchFromGitHub, pkgconfig, cmake
, glew, glfw3, leptonica, libiconv, tesseract3, zlib }:
, glew, glfw3, zlib, libiconv
, ocrSupport ? true, leptonica ? null, tesseract4 ? null }:

with lib;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
with lib;

Please apply it where it is required.

@siraben
Copy link
Member

siraben commented Jan 16, 2021

Applied suggestions.

I'm ignoring the other suggestions because they belong to another PR

Please apply the changes in a separate commit ccextractor: refactor. They save having to open another PR for trivial fixes.

@stale
Copy link

stale bot commented Jul 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 21, 2021
@Artturin
Copy link
Member

Superseded by #131849

@Artturin Artturin closed this Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants