diff --git a/Dockerfile b/Dockerfile index bcc0bae..92629f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM --platform="linux/arm64/v8" ubuntu:20.04 MAINTAINER simon987 @@ -8,12 +8,11 @@ RUN DEBIAN_FRONTEND="noninteractive" apt install -y pkg-config python3 python3-p yasm ragel automake autotools-dev wget libtool libssl-dev \ curl zip unzip tar xorg-dev libglu1-mesa-dev libxcursor-dev \ libxml2-dev libxinerama-dev libcurl4-openssl-dev gettext \ - gcc g++ git make \ + gcc g++ git make bison \ && apt clean # cmake -RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2.tar.gz && \ - tar -xzf cmake-*.tar.gz && cd cmake-* && ./bootstrap && make -j4 && make install && rm -rf /cmake-* +RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-aarch64.tar.gz | tar -xzf - --strip-components=1 -C /usr/ # Ninja RUN git clone git://github.com/ninja-build/ninja.git && \ @@ -25,13 +24,13 @@ RUN git clone git://github.com/ninja-build/ninja.git && \ RUN python3 -m pip install meson # vcpkg -RUN git clone --depth 1 https://github.com/microsoft/vcpkg.git +RUN git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 16c865ef9805b886ebae97964d45b3b52598aab7 RUN cd vcpkg && ./bootstrap-vcpkg.sh ADD patches/* / -RUN patch -p0 < mupdf-curl-dep.patch -RUN patch -p0 < mongoose-master.patch -RUN patch -p0 < glib-meson-fix.patch +RUN cd /vcpkg; patch -p1 < ../mupdf-curl-dep.patch +RUN cd /vcpkg; patch -p1 < ../mongoose-master.patch +RUN cd /vcpkg; patch -p1 < ../libraw.patch RUN VCPKG_FORCE_SYSTEM_BINARIES=true ./vcpkg/vcpkg install \ curl[core,openssl] \ @@ -40,3 +39,8 @@ RUN VCPKG_FORCE_SYSTEM_BINARIES=true ./vcpkg/vcpkg install \ RUN mkdir /vcpkg/downloads; VCPKG_FORCE_SYSTEM_BINARIES=true ./vcpkg/vcpkg install \ lmdb cjson glib brotli libarchive[core,bzip2,libxml2,lz4,lzma,lzo] pthread tesseract libxml2 libmupdf gtest mongoose libuuid libmagic libraw jasper lcms gumbo \ && rm -rf /root/.cache/vcpkg /vcpkg/downloads /vcpkg/buildtrees /vcpkg/downloads + +RUN mkdir -p /debug/lib/ && mkdir -p /include && \ + cp -r /vcpkg/installed/arm64-linux/include/cjson/ /include/ && \ + cp /vcpkg/installed/arm64-linux/debug/lib/libcjson.a /debug/lib/ && \ + cp /vcpkg/installed/arm64-linux/lib/libcjson.a /lib/ diff --git a/patches/glib-meson-fix.patch b/patches/glib-meson-fix.patch index 0e6be18..b22d3d1 100644 --- a/patches/glib-meson-fix.patch +++ b/patches/glib-meson-fix.patch @@ -1,5 +1,5 @@ ---- /vcpkg/scripts/cmake/vcpkg_configure_meson.cmake -+++ /vcpkg/scripts/cmake/vcpkg_configure_meson.cmake +--- a/scripts/cmake/vcpkg_configure_meson.cmake ++++ b/scripts/cmake/vcpkg_configure_meson.cmake @@ -220,7 +220,7 @@ function(vcpkg_internal_meson_generate_cross_file _additional_binaries) #https:/ OUTPUT_VARIABLE MACHINE COMMAND_ERROR_IS_FATAL ANY) diff --git a/patches/libraw.patch b/patches/libraw.patch new file mode 100644 index 0000000..8291e51 --- /dev/null +++ b/patches/libraw.patch @@ -0,0 +1,31 @@ +--- a/ports/libraw/portfile.cmake ++++ b/ports/libraw/portfile.cmake +@@ -1,23 +1,23 @@ + vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO LibRaw/LibRaw +- REF d4f05dd1b9b2d44c8f7e82043cbad3c724db2416 +- SHA512 5794521f535163afd7815ad005295301c5e0e2f8b2f34ef0a911d9dd1572c1f456b292777548203f9767957a55782b5bc9041c033190d25d1e9b4240d7df32b9 ++ REF 52b2fc52e93a566e7e05eaa44cada58e3360b6ad ++ SHA512 f30ed1bd99df6d0759d9d820c586cd019a78cd7817a1a547565aeb6c53607c32ca19820e0aaf2f3270d4916abbaa892a70a27e6a6f71175fb226bb7d5bd22bf7 + HEAD_REF master + ) + + vcpkg_from_github( + OUT_SOURCE_PATH LIBRAW_CMAKE_SOURCE_PATH + REPO LibRaw/LibRaw-cmake +- REF a71f3b83ee3dccd7be32f9a2f410df4d9bdbde0a +- SHA512 607e6f76bcb57534da4f0c864b7a421f1ed49244468b1b52abe77f65aa599cae80715520b3a951294321b812deffd4f163757c9949f337571aa54f414ccc58a5 ++ REF b82a1b0101b1e7264eb3113f1e6c1ba2372ebb7f ++ SHA512 b3f9807a902937db101c6e42b4275817420deed8774a05a68bca5a985cda688f27da3f473f55f2460af58bf1a2bf02578499e5401c8b7b677f46ca9f8f5faf9f + HEAD_REF master + PATCHES +- findlibraw_debug_fix.patch ++ #findlibraw_debug_fix.patch + lcms2_debug_fix.patch + # Move the non-thread-safe library to manual-link. This is unfortunately needed + # because otherwise libraries that build on top of libraw have to choose. +- fix-install.patch ++ # fix-install.patch + ) + diff --git a/patches/mongoose-master.patch b/patches/mongoose-master.patch index e28572c..0872777 100644 --- a/patches/mongoose-master.patch +++ b/patches/mongoose-master.patch @@ -1,5 +1,5 @@ ---- /vcpkg/ports/mongoose/portfile.cmake -+++ /vcpkg/ports/mongoose/portfile.cmake +--- a/ports/mongoose/portfile.cmake ++++ b/ports/mongoose/portfile.cmake @@ -5,8 +5,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH diff --git a/patches/mupdf-curl-dep.patch b/patches/mupdf-curl-dep.patch index 4a2eef8..147f000 100644 --- a/patches/mupdf-curl-dep.patch +++ b/patches/mupdf-curl-dep.patch @@ -1,10 +1,18 @@ ---- /vcpkg/ports/libmupdf/CONTROL 2021-04-13 00:31:01.000000000 +0000 -+++ /vcpkg/ports/libmupdf/CONTROL_ 2021-04-13 00:42:40.805239545 +0000 -@@ -1,6 +1,6 @@ - Source: libmupdf - Version: 1.18.0 --Build-Depends: freetype, libjpeg-turbo, harfbuzz, zlib, curl, glfw3, openjpeg, jbig2dec, gumbo -+Build-Depends: freetype, libjpeg-turbo, harfbuzz, zlib, curl[core,openssl], glfw3, openjpeg, jbig2dec, gumbo - Homepage: https://github.com/ArtifexSoftware/mupdf - Description: a lightweight PDF, XPS, and E-book library - Supports: !osx +--- a/ports/libmupdf/vcpkg.json 2021-09-22 09:11:22.598136284 -0400 ++++ b/ports/libmupdf/vcpkg.json 2021-11-07 10:14:38.039574071 -0500 +@@ -5,7 +5,13 @@ + "homepage": "https://github.com/ArtifexSoftware/mupdf", + "supports": "!osx", + "dependencies": [ +- "curl", ++ { ++ "name": "curl", ++ "default-features": false, ++ "features": [ ++ "openssl" ++ ] ++ }, + "freetype", + "glfw3", + "gumbo", +