Skip to content

Commit

Permalink
MuPDF bundles its own third-party dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
baskerville committed Oct 15, 2020
1 parent d973c82 commit fd9706b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
15 changes: 6 additions & 9 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,26 @@ FROM rust:1.43-buster
RUN apt-get update && apt-get install -y libtool \
pkg-config \
jq \
libgumbo-dev \
libdjvulibre-dev \
libharfbuzz-dev \
libfreetype6-dev \
libsdl2-dev \
# start mupdf dependencies
libjbig2dec0-dev \
patch
# end mupdf dependencies

# TODO:: Remove when mupdf 1.18.0 is available
# https://packages.debian.org/source/testing/mupdf
# TODO: Remove when MuPDF 1.18.0 is available
# in https://packages.debian.org/source/testing/mupdf.
RUN cd /tmp \
&& wget -q "https://mupdf.com/downloads/archive/mupdf-1.18.0-source.tar.xz" -O - | tar -xJ \
&& cd /tmp/mupdf-1.18.0-source \
&& make build=release libs apps \
&& make build=release libs \
&& make build=release prefix=usr install \
&& find usr/include usr/share usr/lib -type f -exec chmod 0644 {} + \
&& cp -r usr/* /usr/

# Referenced in build.rs for mupdf_wrapper
# Referenced in build.rs for mupdf_wrapper.
ENV CARGO_TARGET_OS=linux

# Build plato
# Build Plato.
WORKDIR /plato

ADD . /plato
Expand Down
16 changes: 7 additions & 9 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ fn main() {
println!("cargo:rustc-link-search=src/mupdf_wrapper/Kobo");
println!("cargo:rustc-link-search=libs");
println!("cargo:rustc-link-lib=dylib=stdc++");
println!("cargo:rustc-link-lib=z");
println!("cargo:rustc-link-lib=bz2");
println!("cargo:rustc-link-lib=jpeg");
println!("cargo:rustc-link-lib=png16");
println!("cargo:rustc-link-lib=gumbo");
println!("cargo:rustc-link-lib=openjp2");
println!("cargo:rustc-link-lib=jbig2dec");
// Handle the Linux and macOS platforms.
} else {
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
Expand All @@ -27,13 +34,4 @@ fn main() {

println!("cargo:rustc-link-lib=mupdf-third");
}

// Needed in all cases.
println!("cargo:rustc-link-lib=z");
println!("cargo:rustc-link-lib=bz2");
println!("cargo:rustc-link-lib=jpeg");
println!("cargo:rustc-link-lib=png16");
println!("cargo:rustc-link-lib=gumbo");
println!("cargo:rustc-link-lib=openjp2");
println!("cargo:rustc-link-lib=jbig2dec");
}
2 changes: 1 addition & 1 deletion doc/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ rustup target add arm-unknown-linux-gnueabihf

## Developer Tools

Install the required dependencies: *MuPDF 1.18.0*, *DjVuLibre*, *HarfBuzz*, *Gumbo*, *OpenJPEG*, *jpeg*, *jbig2dec*, *zlib*.
Install the required dependencies: *MuPDF 1.18.0*, *DjVuLibre*, *FreeType*, *HarfBuzz*.

### Emulator

Expand Down

0 comments on commit fd9706b

Please sign in to comment.