-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
[libmupdf] add ocr feature #32084
[libmupdf] add ocr feature #32084
Conversation
This port is unusual, it has the usual portfile (CMake script mode) and it adds a CMake build system to the upstream sources (CMake project mode). Keep this in mind. Cf. https://learn.microsoft.com/en-us/vcpkg/contributing/maintainer-guide#portfiles-are-run-in-script-mode In script mode, the features are available in variable So, to the option(ENABLE_OCR "Build with OCR" ON) In the portfile you could use the maintainer functions: vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
ocr ENABLE_OCR
)
...
vcpkg_cmake_configure(
...
OPTIONS
${FEATURE_OPTIONS}
) |
Thanks a lot @dg0yt! |
All features are tested successfully in the following triplet:
|
versions/l-/libmupdf.json
Outdated
"git-tree": "c1684ff15eed2c86ba792de4e92d21b2ea58c188", | ||
"git-tree": "d4ef30a15c2854debf3972dab602df82eb736ee7", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to increase the port-version
in vcpkg.json
and then run vcpkg x-add-version
to correctly update the versions database.
Please mark PR as "Ready for review" once you have fixed this.
@vicroms I was told to delete the |
|
ports/libmupdf/vcpkg.json
Outdated
@@ -1,12 +1,17 @@ | |||
{ | |||
"name": "libmupdf", | |||
"version": "1.22.1", | |||
"port-version": 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This jumps from (implicit) 0
to 2
. But we need 1
now.
fe85b16
to
41563d5
Compare
I see, this makes sense now. Thank you! |
New libmupdf versions have optional support for OCR with
leptonica
andtesseract
. In the upstream project, it is enabled when both libraries are available, using theOCR_DISABLED
flag:https://github.com/ArtifexSoftware/mupdf/blob/c5d3b65c8a3e1923cd816e8cb0eed726937a289d/include/mupdf/fitz/config.h#L216-L220
I added the feature in
ports/libmupdf/vcpkg.json
and updated theports/libmupdf/CMakeLists.txt
file. Changing OCR_FEATURE_IS_ENABLED from 0 to 1 does work on my machine but I can't figure out how to "link" this variable with the[ocr]
feature flag (is there ais_feature_enabled()
function or similar?)../vcpkg x-add-version --all
and committing the result.