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

Upgrade muPDF to version 1.22.0 #44

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,5 @@ To build `Orion Viewer` you will need:
```

Pre 0.80 versions are compatible with Android 2.1+ devices

If you will get the errors about absent libtinfo.so.5, please install ncurses-compat-libs.
36 changes: 32 additions & 4 deletions thirdparty_build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,22 @@ buildscript {
/*DJVU CHAIN*/
task downloadDjvu {
doLast {
Copy link
Owner

Choose a reason for hiding this comment

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

Why do you put new exec instuction in doLast and kept

        exec {
            workingDir file(djvu)
            commandLine = ['git', 'checkout', '32ff0948c5bc27c0b7507dba90e726fc941fcc42'/*current master*/]
        }

out of it?

Copy link
Author

@nickolay168 nickolay168 Oct 16, 2023

Choose a reason for hiding this comment

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

Here I am trying to handle the edge case if we are trying to checkout the commit later then the one known by currently checked out repository. So we first move HEAD by fetching the latest master and then switching to the pinned commit. So we either clone or fetch master before switching to detached HEAD.

exec {
commandLine = ['git', 'clone', 'git://git.code.sf.net/p/djvu/djvulibre-git', djvu]
def djvuFolder = new File(djvu)
if (djvuFolder.exists()) {
// Switch to master so we can properly pull if it was
// detached.
exec {
commandLine = ['git', '-C', djvu, 'checkout', '-f', 'master']
}
// Pull
nickolay168 marked this conversation as resolved.
Show resolved Hide resolved
exec {
commandLine = ['git', '-C', djvu, 'fetch', 'origin']
}
}
else {
exec {
commandLine = ['git', 'clone', 'git://git.code.sf.net/p/djvu/djvulibre-git', djvu]
}
}

exec {
Expand Down Expand Up @@ -52,8 +66,22 @@ task downloadMupdf {
def version = "1.23.3"

doLast {
exec {
commandLine = ['git', 'clone', 'git://git.ghostscript.com/mupdf.git', mupdf]
def mupdfFolder = new File(mupdf)
if (mupdfFolder.exists()) {
// Switch to master so we can properly pull if it was
// detached.
exec {
commandLine = ['git', '-C', mupdf, 'checkout', '-f', 'master']
}
// Pull
exec {
commandLine = ['git', '-C', mupdf, 'fetch', 'origin']
}
}
else {
exec {
commandLine = ['git', 'clone', 'git://git.ghostscript.com/mupdf.git', mupdf]
}
}

exec {
Expand Down