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

Cmake install #3685

Merged
merged 6 commits into from
Dec 22, 2021
Merged

Cmake install #3685

merged 6 commits into from
Dec 22, 2021

Conversation

zdenop
Copy link
Contributor

@zdenop zdenop commented Dec 22, 2021

This is aim to sync with autotools make install to satisfied requests like #3674
Question is if to install also pdf.tff - autotools install it, but it is not needed as there is pdf_ttf.h.

Relevant code is here:

stream.str("");
stream << datadir_.c_str() << "/pdf.ttf";
const uint8_t *font;
std::ifstream input(stream.str().c_str(), std::ios::in | std::ios::binary);
std::vector<unsigned char> buffer(std::istreambuf_iterator<char>(input), {});
auto size = buffer.size();
if (size) {
font = buffer.data();
} else {
#if !defined(NDEBUG)
tprintf("Cannot open file \"%s\"!\nUsing internal glyphless font.\n", stream.str().c_str());
#endif
font = pdf_ttf;
size = sizeof(pdf_ttf);
}

@egorpugin
Copy link
Contributor

There is some x file in PR.

@egorpugin egorpugin merged commit 07e319a into tesseract-ocr:main Dec 22, 2021
@amitdo
Copy link
Collaborator

amitdo commented Dec 22, 2021

Question is if to install also pdf.tff - autotools install it, but it is not needed as there is pdf_ttf.h.

@stweil, should we do the same for autotools, not install pdf.tff?

@stweil
Copy link
Member

stweil commented Dec 22, 2021

That might be an incompatible change and require a new major version, even if the file was unused.

@egorpugin
Copy link
Contributor

@stweil
Please consider making 5.0 branch, so we can push modern c++ or big (and possibly breaking) changes into main.

@amitdo
Copy link
Collaborator

amitdo commented Dec 23, 2021

Egor, your request conflicts with mine from #3673 - to focus on 5.x in 2022.

@zdenop
Copy link
Contributor Author

zdenop commented Dec 23, 2021

That might be an incompatible change and require a new major version, even if the file was unused.

Any guidelines for this? I had a look at https://semver.org/ and IMO such change has no effect on API and the new version would be backward compatible.

@stweil
Copy link
Member

stweil commented Dec 23, 2021

I think that the C / C++ API is only one aspect of compatibility.

Removing a file would break distributions which still have that file in their list of installed files. Users might have used that file for special applications.

Note that it is not necessary to add pdf.tff to the cmake install rules. They never installed it, so nothing breaks if they now install additional files, but not that one.

@zdenop zdenop deleted the cmake_install branch March 10, 2022 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants