Merge branch 'master' of https://github.com/LizardByte/Sunshine
# Conflicts: # .github/workflows/ci-copr.yml # .github/workflows/ci-flatpak.yml # .github/workflows/ci-homebrew.yml # .github/workflows/ci-linux.yml # .github/workflows/ci-windows.yml # .github/workflows/ci.yml # .github/workflows/localize.yml # README.md # scripts/icons/convert_and_pack.sh # src/config.cpp # src/config.h # src/confighttp.cpp # src/logging.cpp # src/video.cpp # src_assets/common/assets/web/config.html # src_assets/common/assets/web/public/assets/locale/en.json # src_assets/common/assets/web/public/assets/locale/it.json # src_assets/windows/misc/gamepad/install-gamepad.bat # third-party/build-deps # third-party/moonlight-common-c # tools/CMakeLists.txt
This commit is contained in:
@@ -1,61 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! [ -x "$(command -v ./go-png2ico)" ]; then
|
||||
echo "./go-png2ico not found"
|
||||
echo "download the executable from https://github.com/J-Siu/go-png2ico"
|
||||
echo "and drop it in this folder"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v ./oxipng)" ]; then
|
||||
echo "./oxipng executable not found"
|
||||
echo "download the executable from https://github.com/shssoichiro/oxipng"
|
||||
echo "and drop it in this folder"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v inkscape)" ]; then
|
||||
echo "inkscape executable not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
icon_base_sizes=(16 64)
|
||||
icon_sizes_keys=() # associative array to prevent duplicates
|
||||
icon_sizes_keys[256]=1
|
||||
|
||||
for icon_base_size in ${icon_base_sizes[@]}; do
|
||||
# increment in 25% till 400%
|
||||
icon_size_increment=$((icon_base_size / 4))
|
||||
for ((i = 0; i <= 12; i++)); do
|
||||
icon_sizes_keys[$((icon_base_size + i * icon_size_increment))]=1
|
||||
done
|
||||
done
|
||||
|
||||
# convert to normal array
|
||||
icon_sizes=${!icon_sizes_keys[@]}
|
||||
|
||||
echo "using icon sizes:"
|
||||
echo ${icon_sizes[@]}
|
||||
|
||||
src_vectors=("../../src_assets/common/assets/web/public/images/apollo-locked.svg"
|
||||
"../../src_assets/common/assets/web/public/images/apollo-pausing.svg"
|
||||
"../../src_assets/common/assets/web/public/images/apollo-playing.svg"
|
||||
"../../apollo.svg")
|
||||
|
||||
echo "using sources vectors:"
|
||||
echo ${src_vectors[@]}
|
||||
|
||||
for src_vector in ${src_vectors[@]}; do
|
||||
file_name=`basename "$src_vector" .svg`
|
||||
png_files=()
|
||||
for icon_size in ${icon_sizes[@]}; do
|
||||
png_file="${file_name}${icon_size}.png"
|
||||
echo "converting ${png_file}"
|
||||
inkscape -w $icon_size -h $icon_size "$src_vector" --export-filename "${png_file}" &&
|
||||
./oxipng -o max --strip safe --alpha "${png_file}" &&
|
||||
png_files+=("${png_file}")
|
||||
done
|
||||
|
||||
echo "packing ${file_name}.ico"
|
||||
./go-png2ico "${png_files[@]}" "${file_name}.ico"
|
||||
done
|
||||
#!/bin/bash
|
||||
|
||||
if ! [ -x "$(command -v ./go-png2ico)" ]; then
|
||||
echo "./go-png2ico not found"
|
||||
echo "download the executable from https://github.com/J-Siu/go-png2ico"
|
||||
echo "and drop it in this folder"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v ./oxipng)" ]; then
|
||||
echo "./oxipng executable not found"
|
||||
echo "download the executable from https://github.com/shssoichiro/oxipng"
|
||||
echo "and drop it in this folder"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v inkscape)" ]; then
|
||||
echo "inkscape executable not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
icon_base_sizes=(16 64)
|
||||
icon_sizes_keys=() # associative array to prevent duplicates
|
||||
icon_sizes_keys[256]=1
|
||||
|
||||
for icon_base_size in "${icon_base_sizes[@]}"; do
|
||||
# increment in 25% till 400%
|
||||
icon_size_increment=$((icon_base_size / 4))
|
||||
for ((i = 0; i <= 12; i++)); do
|
||||
icon_sizes_keys[icon_base_size + i * icon_size_increment]=1
|
||||
done
|
||||
done
|
||||
|
||||
# convert to normal array
|
||||
icon_sizes=("${!icon_sizes_keys[@]}")
|
||||
|
||||
echo "using icon sizes:"
|
||||
# shellcheck disable=SC2068 # intentionally word split
|
||||
echo ${icon_sizes[@]}
|
||||
|
||||
src_vectors=("../../src_assets/common/assets/web/public/images/apollo-locked.svg"
|
||||
"../../src_assets/common/assets/web/public/images/apollo-pausing.svg"
|
||||
"../../src_assets/common/assets/web/public/images/apollo-playing.svg"
|
||||
"../../apollo.svg")
|
||||
|
||||
echo "using sources vectors:"
|
||||
# shellcheck disable=SC2068 # intentionally word split
|
||||
echo ${src_vectors[@]}
|
||||
|
||||
for src_vector in "${src_vectors[@]}"; do
|
||||
file_name=$(basename "${src_vector}" .svg)
|
||||
png_files=()
|
||||
for icon_size in "${icon_sizes[@]}"; do
|
||||
png_file="${file_name}${icon_size}.png"
|
||||
echo "converting ${png_file}"
|
||||
inkscape -w "${icon_size}" -h "${icon_size}" "${src_vector}" --export-filename "${png_file}" &&
|
||||
./oxipng -o max --strip safe --alpha "${png_file}" &&
|
||||
png_files+=("${png_file}")
|
||||
done
|
||||
|
||||
echo "packing ${file_name}.ico"
|
||||
./go-png2ico "${png_files[@]}" "${file_name}.ico"
|
||||
done
|
||||
|
||||
@@ -96,9 +96,11 @@ function add_arch_deps() {
|
||||
'base-devel'
|
||||
'cmake'
|
||||
'curl'
|
||||
'doxygen'
|
||||
"gcc${gcc_version}"
|
||||
"gcc${gcc_version}-libs"
|
||||
'git'
|
||||
'graphviz'
|
||||
'libayatana-appindicator'
|
||||
'libcap'
|
||||
'libdrm'
|
||||
@@ -406,7 +408,7 @@ function run_install() {
|
||||
for file in "${gcc_alternative_files[@]}"; do
|
||||
file_path="/etc/alternatives/$file"
|
||||
if [ -e "$file_path" ]; then
|
||||
mv "$file_path" "$file_path.bak"
|
||||
${sudo_cmd} mv "$file_path" "$file_path.bak"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -445,12 +447,14 @@ function run_install() {
|
||||
echo "Compiling doxygen"
|
||||
doxygen_url="https://github.com/doxygen/doxygen/releases/download/Release_${_doxygen_min}/doxygen-${doxygen_min}.src.tar.gz"
|
||||
echo "doxygen url: ${doxygen_url}"
|
||||
wget "$doxygen_url" --progress=bar:force:noscroll -q --show-progress -O "${build_dir}/doxygen.tar.gz"
|
||||
tar -xzf "${build_dir}/doxygen.tar.gz"
|
||||
cd "doxygen-${doxygen_min}"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -G="Ninja" -B="build" -S="."
|
||||
ninja -C "build" -j"${num_processors}"
|
||||
ninja -C "build" install
|
||||
pushd "${build_dir}"
|
||||
wget "$doxygen_url" --progress=bar:force:noscroll -q --show-progress -O "doxygen.tar.gz"
|
||||
tar -xzf "doxygen.tar.gz"
|
||||
cd "doxygen-${doxygen_min}"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -G="Ninja" -B="build" -S="."
|
||||
ninja -C "build" -j"${num_processors}"
|
||||
${sudo_cmd} ninja -C "build" install
|
||||
popd
|
||||
else
|
||||
echo "Doxygen version not in range, skipping docs"
|
||||
cmake_args+=("-DBUILD_DOCS=OFF")
|
||||
@@ -462,6 +466,8 @@ function run_install() {
|
||||
nvm_url="https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh"
|
||||
echo "nvm url: ${nvm_url}"
|
||||
wget -qO- ${nvm_url} | bash
|
||||
|
||||
# shellcheck source=/dev/null # we don't care that shellcheck cannot find nvm.sh
|
||||
source "$HOME/.nvm/nvm.sh"
|
||||
nvm install node
|
||||
nvm use node
|
||||
|
||||
Reference in New Issue
Block a user