From 62a80b354edae5dbff0ac58db6f97987df622ad1 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Wed, 17 Jan 2024 02:13:02 +0800 Subject: [PATCH] [73_12] Tune packaging and CI for archlinux --- .github/workflows/ci-xmake-archlinux.yml | 11 ++++---- src/Plugins/Freetype/tt_file.cpp | 5 ++++ xmake-requires.lock | 8 ------ xmake/packages.lua | 33 +++++++++++++++++++----- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci-xmake-archlinux.yml b/.github/workflows/ci-xmake-archlinux.yml index 297e3e17bf..db16f9d428 100644 --- a/.github/workflows/ci-xmake-archlinux.yml +++ b/.github/workflows/ci-xmake-archlinux.yml @@ -9,6 +9,7 @@ on: - 'tests/**' - 'xmake/packages.lua' - 'xmake.lua' + - 'xmake-requires.lock' - '.github/workflows/ci-xmake-archlinux.yml' pull_request: branches: [ branch-1.2 ] @@ -19,6 +20,7 @@ on: - 'tests/**' - 'xmake/packages.lua' - 'xmake.lua' + - 'xmake-requires.lock' - '.github/workflows/ci-xmake-archlinux.yml' env: @@ -34,7 +36,9 @@ jobs: - name: Install dependencies run: | sudo pacman -Syyu --noconfirm --needed - sudo pacman -S --noconfirm --needed qt6-base qt6-svg libpng zlib libjpeg curl python libxext xmake unzip noto-fonts-cjk + sudo pacman -S --noconfirm --needed qt6-base qt6-svg libpng zlib \ + libjpeg curl python libxext xmake unzip noto-fonts-cjk \ + fontconfig libgit2 freetype2 openssl git mimalloc - uses: actions/checkout@v3 with: fetch-depth: 1 @@ -43,7 +47,7 @@ jobs: run: echo "XMAKE_GLOBALDIR=/tmp/xmake-global" >> $GITHUB_ENV - name: Xrepo update - run: xmake repo --update --yes + run: xmake repo --update - name: cache packages from xrepo uses: actions/cache@v3 @@ -71,6 +75,3 @@ jobs: - name: Scheme tests run: xmake run --yes -vD --group=scheme_tests - - - name: integration test - run: xmake run --yes -vD --group=integration_tests \ No newline at end of file diff --git a/src/Plugins/Freetype/tt_file.cpp b/src/Plugins/Freetype/tt_file.cpp index 09453105b5..af262fae38 100644 --- a/src/Plugins/Freetype/tt_file.cpp +++ b/src/Plugins/Freetype/tt_file.cpp @@ -142,6 +142,11 @@ tt_font_search_path () { #endif ret= ret | url ("/usr/share/texlive/texmf-dist/fonts/opentype") | url ("/usr/share/texlive/texmf-dist/fonts/truetype"); + // special rules for archlinux + if (exists (url_system ("/usr/share/fonts/noto-cjk"))) { + ret= ret | url_system ("/usr/share/fonts/noto-cjk"); + } + // special rules for uos if (exists (url_system ("/usr/share/fonts/fonts-cesi"))) { ret= ret | url_system ("/usr/share/fonts/fonts-cesi"); } diff --git a/xmake-requires.lock b/xmake-requires.lock index 166533398f..98f927eece 100644 --- a/xmake-requires.lock +++ b/xmake-requires.lock @@ -196,14 +196,6 @@ }, version = "v1.7.1" }, - ["libjpeg#31fecfc4"] = { - repo = { - branch = "master", - commit = "e4a467ab6e25d9afa5324cf536141660a5c1eef4", - url = "https://github.com/xmake-io/xmake-repo.git" - }, - version = "1.5.2" - }, ["libpng#31fecfc4"] = { repo = { branch = "master", diff --git a/xmake/packages.lua b/xmake/packages.lua index fd77b57dda..1df2bade45 100644 --- a/xmake/packages.lua +++ b/xmake/packages.lua @@ -12,6 +12,15 @@ -- -- Dependencies: Platform|Package Manager -- +function using_apt () + return linuxos.name() == "debian" + or linuxos.name() == "ubuntu" + or linuxos.name() == "uos" +end + +function using_pacman () + return linuxos.name() == "archlinux" +end -- The following versions are adopted on macOS/Windows/ArchLinux -- We will use the system provided packages on Ubuntu 22.04/Debian 12/... @@ -20,7 +29,11 @@ local QT6_VERSION = "6.5.3" local QTIFW_VERSION = "4.6.0" local LOLLY_VERSION = "1.3.17" local TBOX_VERSION = "1.7.5" -local CPR_VERSION = "1.8.3" +if is_plat("linux") and using_pacman () then + local CPR_VERSION = "1.10.5" +else + local CPR_VERSION = "1.8.3" +end local CURL_VERSION = "8.4.0" local PDFHUMMUS_VERSION = "4.6.2" local FREETYPE_VERSION = "2.12.1" @@ -58,12 +71,6 @@ package("lolly") end) package_end() -function using_apt () - return linuxos.name() == "debian" - or linuxos.name() == "ubuntu" - or linuxos.name() == "uos" -end - function add_requires_of_mogan() -- package: s7 @@ -88,6 +95,9 @@ function add_requires_of_mogan() if is_plat("linux") and using_apt() then add_requires("apt::libcurl4-openssl-dev", {alias="libcurl"}) add_requireconfs("lolly.cpr.libcurl", {system = true, override=true}) + elseif is_plat("linux") and using_pacman () then + add_requires("pacman::curl", {alias="libcurl"}) + add_requireconfs("lolly.cpr.libcurl", {system = true, override=true}) else add_requireconfs("lolly.cpr.libcurl", {version = CURL_VERSION, system = false, override=true}) add_requireconfs("lolly.cpr.libcurl.cmake", {version = CMAKE_VERSION, system = false, override=true}) @@ -113,6 +123,9 @@ function add_requires_of_mogan() if is_plat("linux") and using_apt() then add_requires("apt::libpng-dev", {alias="libpng"}) add_requireconfs("pdfhummus.libpng", {system = true, override=true}) + elseif is_plat("linux") and using_pacman () then + add_requires("pacman::libpng", {alias="libpng"}) + add_requireconfs("pdfhummus.libpng", {system = true, override=true}) else add_requireconfs("pdfhummus.libpng", {version = LIBPNG_VERSION, system = false, override=true}) end @@ -138,6 +151,8 @@ function add_requires_of_mogan() else add_requires("apt::libfreetype-dev", {alias="freetype"}) end + elseif is_plat("linux") and using_pacman () then + add_requires("pacman::freetype2", {alias="freetype"}) else -- Let xrepo manage the dependencies for macOS and other GNU/Linux distros if not is_plat ("macosx") then @@ -162,4 +177,8 @@ function add_requires_of_mogan() if is_plat ("linux") and using_apt() then add_requires ("apt::libssl-dev", {alias="openssl"}) end + + if is_plat ("linux") and using_pacman() then + add_requires ("pacman::mimalloc", {alias="mimalloc"}) + end end