Skip to content

Commit 441c18d

Browse files
committed
loongarch64
1 parent 7b01047 commit 441c18d

File tree

2 files changed

+72
-4
lines changed

2 files changed

+72
-4
lines changed

qbittorrent-nox-static.sh

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ os_version_id="$(get_os_info VERSION_ID)"
102102
[[ "$(wc -w <<< "${os_version_id//\./ }")" -eq "2" ]] && alpine_min_version="310" # Account for variation in the versioning 3.1 or 3.1.0 to make sure the check works correctly
103103
[[ "${os_id}" =~ ^(alpine)$ ]] && os_version_codename="alpine" # If alpine, set the codename to alpine. We check for min v3.10 later with codenames.
104104

105+
if [[ "${os_id}" =~ ^(debian|ubuntu)$ ]]; then
106+
os_arch="$(dpkg --print-architecture)"
107+
elif [[ "${os_id}" =~ ^(alpine)$ ]]; then
108+
os_arch="$(apk info --print-arch)"
109+
fi
110+
105111
# Check against allowed codenames or if the codename is alpine version greater than 3.10
106112
if [[ ! "${os_version_codename}" =~ ^(alpine|bookworm|noble)$ ]] || [[ "${os_version_codename}" =~ ^(alpine)$ && "${os_version_id//\./}" -lt "${alpine_min_version:-3150}" ]]; then
107113
printf '\n%b\n\n' " ${unicode_red_circle} ${color_yellow} This is not a supported OS. There is no reason to continue.${color_end}"
@@ -138,6 +144,7 @@ multi_arch_options["mipsel"]="mipsel"
138144
multi_arch_options["mips64"]="mips64"
139145
multi_arch_options["mips64el"]="mips64el"
140146
multi_arch_options["riscv64"]="riscv64"
147+
multi_arch_options["loongarch64"]="loongarch64"
141148
#######################################################################################################################################################
142149
# This function sets some default values we use but whose values can be overridden by certain flags or exported as variables before running the script
143150
#######################################################################################################################################################
@@ -1448,7 +1455,9 @@ _cmake() {
14481455
_multi_arch() {
14491456
if [[ "${multi_arch_options[${qbt_cross_name:-default}]}" == "${qbt_cross_name}" ]]; then
14501457
if [[ "${os_id}" =~ ^(alpine|debian|ubuntu)$ ]]; then
1451-
[[ "${1}" != "bootstrap" ]] && printf '\n%b\n' " ${unicode_green_circle}${color_yellow_light} Using multiarch - arch: ${qbt_cross_name} host: ${os_id} target: ${qbt_cross_target}${color_end}"
1458+
if [[ "${1}" != "bootstrap" ]]; then
1459+
printf '\n%b\n' " ${unicode_green_circle}${text_bold} Using multiarch:${color_end} ${color_yellow_light}arch:${color_end} ${color_blue_light}${qbt_cross_name}${color_end} ${color_yellow_light}host:${color_end} ${color_blue_light}${os_arch} ${os_id}${color_end} ${color_yellow_light}target:${color_end} ${color_blue_light}${qbt_cross_name} ${qbt_cross_target}${color_end}"
1460+
fi
14521461
case "${qbt_cross_name}" in
14531462
armel)
14541463
case "${qbt_cross_target}" in
@@ -1695,7 +1704,7 @@ _multi_arch() {
16951704
qbt_zlib_arch="riscv64"
16961705
;;&
16971706
debian)
1698-
printf '\n%b\n\n' " ${unicode_red_circle} The arch ${color_yellow_light}${qbt_cross_name}${color_end} can only be cross built on and Alpine OS Host"
1707+
printf '\n%b\n\n' " ${unicode_red_circle} The arch ${color_yellow_light}${qbt_cross_name}${color_end} can only be cross built on an Alpine or Ubuntu OS Host"
16991708
exit 1
17001709
;;
17011710
ubuntu)
@@ -1710,6 +1719,30 @@ _multi_arch() {
17101719
;;
17111720
esac
17121721
;;
1722+
loongarch64)
1723+
case "${qbt_cross_target}" in
1724+
alpine)
1725+
if [[ "${qbt_qt_version}" == '6' ]]; then
1726+
cross_arch="loongarch64"
1727+
qbt_cross_host="loongarch64-linux-musl"
1728+
qbt_zlib_arch="loongarch64"
1729+
else
1730+
printf '\n%b\n\n' " ${unicode_red_circle} The arch ${color_yellow_light}${qbt_cross_name}${color_end} can only be cross built on and Alpine Host with qt6"
1731+
exit 1
1732+
fi
1733+
;;&
1734+
debian | ubuntu)
1735+
printf '\n%b\n\n' " ${unicode_red_circle} The arch ${color_yellow_light}${qbt_cross_name}${color_end} can only be cross built on and Alpine Host with qt6"
1736+
exit 1
1737+
;;&
1738+
*)
1739+
bitness="64"
1740+
qbt_cross_boost="gcc-loongarch64"
1741+
qbt_cross_openssl="linux64-loongarch64"
1742+
qbt_cross_qtbase="linux-g++-64"
1743+
;;
1744+
esac
1745+
;;
17131746
esac
17141747

17151748
[[ "${1}" == 'info_bootstrap' ]] && return
@@ -1851,6 +1884,7 @@ _release_info() {
18511884
[[ "${multi_arch_options[${qbt_cross_name}]}" == mips64 ]] && printf '%s\n' "| mips64 | mips64-linux-musl | mips64 | --with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64 |"
18521885
[[ "${multi_arch_options[${qbt_cross_name}]}" == mips64el ]] && printf '%s\n' "| mips64el | mips64el-linux-musl | mips64 | --with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64 |"
18531886
[[ "${multi_arch_options[${qbt_cross_name}]}" == riscv64 ]] && printf '%s\n' "| riscv64 | riscv64-linux-musl | rv64gc | --with-arch=rv64gc --with-abi=lp64d --enable-autolink-libatomic |"
1887+
[[ "${multi_arch_options[${qbt_cross_name}]}" == loongarch64 ]] && printf '%s\n' "| loongarch64 | loongarch64-linux-musl | la64v1.0 | --with-arch=la64v1.0 --with-abi=lp64d |"
18541888
printf '\n'
18551889
} >> "${release_info_dir}/qt${qt_version_short_array[0]}-${qbt_cross_name}-release.md"
18561890

qbt-nox-static.bash

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ os_version_id="$(get_os_info VERSION_ID)"
106106
[[ "$(wc -w <<< "${os_version_id//\./ }")" -eq "2" ]] && alpine_min_version="310" # Account for variation in the versioning 3.1 or 3.1.0 to make sure the check works correctly
107107
[[ "${os_id}" =~ ^(alpine)$ ]] && os_version_codename="alpine" # If alpine, set the codename to alpine. We check for min v3.10 later with codenames.
108108

109+
if [[ "${os_id}" =~ ^(debian|ubuntu)$ ]]; then
110+
os_arch="$(dpkg --print-architecture)"
111+
elif [[ "${os_id}" =~ ^(alpine)$ ]]; then
112+
os_arch="$(apk info --print-arch)"
113+
fi
114+
109115
# Check against allowed codenames or if the codename is alpine version greater than 3.10
110116
if [[ ! "${os_version_codename}" =~ ^(alpine|bookworm|noble)$ ]] || [[ "${os_version_codename}" =~ ^(alpine)$ && "${os_version_id//\./}" -lt "${alpine_min_version:-3150}" ]]; then
111117
printf '\n%b\n\n' " ${unicode_red_circle} ${color_yellow} This is not a supported OS. There is no reason to continue.${color_end}"
@@ -142,6 +148,7 @@ multi_arch_options["mipsel"]="mipsel"
142148
multi_arch_options["mips64"]="mips64"
143149
multi_arch_options["mips64el"]="mips64el"
144150
multi_arch_options["riscv64"]="riscv64"
151+
multi_arch_options["loongarch64"]="loongarch64"
145152
#######################################################################################################################################################
146153
# This function sets some default values we use but whose values can be overridden by certain flags or exported as variables before running the script
147154
#######################################################################################################################################################
@@ -1672,7 +1679,9 @@ _cmake() {
16721679
_multi_arch() {
16731680
if [[ "${multi_arch_options[${qbt_cross_name:-default}]}" == "${qbt_cross_name}" ]]; then
16741681
if [[ "${os_id}" =~ ^(alpine|debian|ubuntu)$ ]]; then
1675-
[[ "${1}" != "bootstrap" ]] && printf '\n%b\n' " ${unicode_green_circle}${color_yellow_light} Using multiarch - arch: ${qbt_cross_name} host: ${os_id} target: ${qbt_cross_target}${color_end}"
1682+
if [[ "${1}" != "bootstrap" ]]; then
1683+
printf '\n%b\n' " ${unicode_green_circle}${text_bold} Using multiarch:${color_end} ${color_yellow_light}arch:${color_end} ${color_blue_light}${qbt_cross_name}${color_end} ${color_yellow_light}host:${color_end} ${color_blue_light}${os_arch} ${os_id}${color_end} ${color_yellow_light}target:${color_end} ${color_blue_light}${qbt_cross_name} ${qbt_cross_target}${color_end}"
1684+
fi
16761685
case "${qbt_cross_name}" in
16771686
armel)
16781687
case "${qbt_cross_target}" in
@@ -1919,7 +1928,7 @@ _multi_arch() {
19191928
qbt_zlib_arch="riscv64"
19201929
;;&
19211930
debian)
1922-
printf '\n%b\n\n' " ${unicode_red_circle} The arch ${color_yellow_light}${qbt_cross_name}${color_end} can only be cross built on and Alpine OS Host"
1931+
printf '\n%b\n\n' " ${unicode_red_circle} The arch ${color_yellow_light}${qbt_cross_name}${color_end} can only be cross built on an Alpine or Ubuntu OS Host"
19231932
exit 1
19241933
;;
19251934
ubuntu)
@@ -1934,6 +1943,30 @@ _multi_arch() {
19341943
;;
19351944
esac
19361945
;;
1946+
loongarch64)
1947+
case "${qbt_cross_target}" in
1948+
alpine)
1949+
if [[ "${qbt_qt_version}" == '6' ]]; then
1950+
cross_arch="loongarch64"
1951+
qbt_cross_host="loongarch64-linux-musl"
1952+
qbt_zlib_arch="loongarch64"
1953+
else
1954+
printf '\n%b\n\n' " ${unicode_red_circle} The arch ${color_yellow_light}${qbt_cross_name}${color_end} can only be cross built on and Alpine Host with qt6"
1955+
exit 1
1956+
fi
1957+
;;&
1958+
debian | ubuntu)
1959+
printf '\n%b\n\n' " ${unicode_red_circle} The arch ${color_yellow_light}${qbt_cross_name}${color_end} can only be cross built on and Alpine Host with qt6"
1960+
exit 1
1961+
;;&
1962+
*)
1963+
bitness="64"
1964+
qbt_cross_boost="gcc-loongarch64"
1965+
qbt_cross_openssl="linux64-loongarch64"
1966+
qbt_cross_qtbase="linux-g++-64"
1967+
;;
1968+
esac
1969+
;;
19371970
esac
19381971

19391972
[[ "${1}" == 'info_bootstrap' ]] && return
@@ -2075,6 +2108,7 @@ _release_info() {
20752108
[[ "${multi_arch_options[${qbt_cross_name}]}" == mips64 ]] && printf '%s\n' "| mips64 | mips64-linux-musl | mips64 | --with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64 |"
20762109
[[ "${multi_arch_options[${qbt_cross_name}]}" == mips64el ]] && printf '%s\n' "| mips64el | mips64el-linux-musl | mips64 | --with-arch=mips3 --with-tune=mips64 --with-mips-plt --with-float=soft --with-abi=64 |"
20772110
[[ "${multi_arch_options[${qbt_cross_name}]}" == riscv64 ]] && printf '%s\n' "| riscv64 | riscv64-linux-musl | rv64gc | --with-arch=rv64gc --with-abi=lp64d --enable-autolink-libatomic |"
2111+
[[ "${multi_arch_options[${qbt_cross_name}]}" == loongarch64 ]] && printf '%s\n' "| loongarch64 | loongarch64-linux-musl | la64v1.0 | --with-arch=la64v1.0 --with-abi=lp64d |"
20782112
printf '\n'
20792113
} >> "${release_info_dir}/qt${qt_version_short_array[0]}-${qbt_cross_name}-release.md"
20802114

0 commit comments

Comments
 (0)