Skip to content

Commit

Permalink
[73_12] Tune packaging and CI for archlinux
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii authored Jan 16, 2024
1 parent 2146111 commit 62a80b3
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 20 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/ci-xmake-archlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand All @@ -19,6 +20,7 @@ on:
- 'tests/**'
- 'xmake/packages.lua'
- 'xmake.lua'
- 'xmake-requires.lock'
- '.github/workflows/ci-xmake-archlinux.yml'

env:
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
5 changes: 5 additions & 0 deletions src/Plugins/Freetype/tt_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
8 changes: 0 additions & 8 deletions xmake-requires.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
33 changes: 26 additions & 7 deletions xmake/packages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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/...
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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})
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 62a80b3

Please sign in to comment.