diff --git a/Dockerfile b/Dockerfile index 04f7351..07c4910 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,47 +1,31 @@ -FROM --platform="linux/arm64/v8" ubuntu:20.04 +FROM --platform=linux/arm64/v8 debian@sha256:55cd39723a057f730e9c33487fea9fe151bbe86dce51e92a73ccfd12206a1f43 MAINTAINER simon987 + RUN apt update RUN DEBIAN_FRONTEND="noninteractive" apt install -y pkg-config python3 python3-pip \ 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 bison \ + libxml2-dev libxinerama-dev libcurl4-openssl-dev gettext nasm \ + gcc g++ git make bison ninja-build \ && apt clean -# 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 && \ - cd ninja && git checkout release && \ - cmake -Bbuild-cmake -H. && cmake --build build-cmake && \ - mv build-cmake/ninja /usr/bin/ && rm -rf /ninja/ - # Meson RUN python3 -m pip install meson -# vcpkg -RUN git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && git checkout 16c865ef9805b886ebae97964d45b3b52598aab7 -RUN cd vcpkg && ./bootstrap-vcpkg.sh +# cmake +RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3-linux-aarch64.tar.gz | tar -xzf - --strip-components=1 -C /usr/ -ADD patches/* / -RUN cd /vcpkg; patch -p1 < ../mupdf-curl-dep.patch -RUN cd /vcpkg; patch -p1 < ../mongoose-master.patch -RUN cd /vcpkg; patch -p1 < ../mongoose-nolog.patch -RUN cd /vcpkg; patch -p1 < ../libraw.patch +# vcpkg +RUN git clone --depth 1 https://github.com/simon987/vcpkg.git && cd vcpkg +RUN cd /vcpkg/ && ./bootstrap-vcpkg.sh RUN VCPKG_FORCE_SYSTEM_BINARIES=true ./vcpkg/vcpkg install \ - curl[core,openssl] \ + curl[core,openssl] sqlite3 cpp-jwt pcre cjson brotli libarchive[core,bzip2,libxml2,lz4,lzma,lzo] pthread tesseract libxml2 libmupdf gtest mongoose libmagic libraw gumbo ffmpeg[core,avcodec,avformat,swscale,swresample] \ && rm -rf /root/.cache/vcpkg /vcpkg/downloads /vcpkg/buildtrees /vcpkg/downloads -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 +COPY patches/* ./ +RUN cd /vcpkg/ && patch -p1 < /fix-libraw.patch -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 deleted file mode 100644 index b22d3d1..0000000 --- a/patches/glib-meson-fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- 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) - -- if(MACHINE MATCHES "arm64") -+ if(MACHINE MATCHES "arm64|aarch64") - set(BUILD_CPU_FAM aarch64) - set(BUILD_CPU armv8) - elseif(MACHINE MATCHES "x86_64|amd64") diff --git a/patches/libraw.patch b/patches/libraw.patch deleted file mode 100644 index 8291e51..0000000 --- a/patches/libraw.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- 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 deleted file mode 100644 index 0872777..0000000 --- a/patches/mongoose-master.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- 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 - REPO cesanta/mongoose -- REF 8e520756366ca5739f13dc6ad65fcf269dbbc994 #v7.1 -- SHA512 a966a8b4e47e36da0f630c3cf343c85a1c1138508a82e506b21e4b8bd72573d0e0145318f97b32a67f423e033b348de76a00b780430e4e69d1a98bd7494a3e0a -+ REF 9173034b96cc312c3184f5d10324a0964132ab67 # master -+ SHA512 355095feb9b86f2df1d7942823892b24b761b0021731112ab69382c5decb2c22a67e77893dc09d5e7cf7bd2cd633433e8c10c667df8421802a23fc8e1bd7c1ac - HEAD_REF master - ) diff --git a/patches/mongoose-nolog.patch b/patches/mongoose-nolog.patch deleted file mode 100644 index d0a7e81..0000000 --- a/patches/mongoose-nolog.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/ports/mongoose/CMakeLists.txt -+++ b/ports/mongoose/CMakeLists.txt -@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.14) - - project(mongoose C) - -+add_compile_definitions("MG_ENABLE_LOG=0") -+ - include(GNUInstallDirs) - diff --git a/patches/mupdf-curl-dep.patch b/patches/mupdf-curl-dep.patch deleted file mode 100644 index 147f000..0000000 --- a/patches/mupdf-curl-dep.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- 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", -