Initial Comicviewer implementation
This commit is contained in:
commit
cb01395612
20 changed files with 4940 additions and 0 deletions
7
packaging/AppRun
Executable file
7
packaging/AppRun
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
app_dir="$(dirname "$(readlink -f "$0")")"
|
||||
export XDG_DATA_DIRS="${app_dir}/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
|
||||
|
||||
exec "${app_dir}/usr/bin/comicviewer" "$@"
|
||||
47
packaging/build-appimage.sh
Executable file
47
packaging/build-appimage.sh
Executable file
|
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
linuxdeploy="${LINUXDEPLOY:-linuxdeploy-x86_64.AppImage}"
|
||||
output_dir="${OUTPUT_DIR:-${root_dir}/dist}"
|
||||
work_dir="$(mktemp -d)"
|
||||
app_dir="${work_dir}/Comicviewer.AppDir"
|
||||
|
||||
cleanup() {
|
||||
rm -rf "${work_dir}"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
cargo build --manifest-path "${root_dir}/Cargo.toml" --release
|
||||
mkdir -p "${output_dir}"
|
||||
mkdir -p "${app_dir}/usr/share/metainfo"
|
||||
install -m 0644 \
|
||||
"${root_dir}/data/io.github.comicviewer.Comicviewer.metainfo.xml" \
|
||||
"${app_dir}/usr/share/metainfo/io.github.comicviewer.Comicviewer.appdata.xml"
|
||||
|
||||
output_path="${output_dir}/Comicviewer-0.1.0-x86_64.AppImage"
|
||||
export LDAI_OUTPUT="${output_path}"
|
||||
export PATH="$(dirname "${linuxdeploy}"):${PATH}"
|
||||
export APPIMAGE_EXTRACT_AND_RUN=1
|
||||
export NO_STRIP=1
|
||||
|
||||
# The GTK plugin assumes this optional module directory exists on every distro.
|
||||
gtk_plugin="$(command -v linuxdeploy-plugin-gtk.sh || true)"
|
||||
if [[ -n "${gtk_plugin}" ]] && [[ ! -d "$(pkg-config --variable=libdir gtk4)/gtk-4.0" ]]; then
|
||||
patched_plugin="${work_dir}/linuxdeploy-plugin-gtk.sh"
|
||||
cp "${gtk_plugin}" "${patched_plugin}"
|
||||
sed -i 's| copy_lib_tree "$gtk4_libdir" "$APPDIR/"| if [ -d "$gtk4_libdir" ]; then copy_lib_tree "$gtk4_libdir" "$APPDIR/"; fi|' "${patched_plugin}"
|
||||
chmod +x "${patched_plugin}"
|
||||
export PATH="${work_dir}:${PATH}"
|
||||
fi
|
||||
|
||||
"${linuxdeploy}" \
|
||||
--appdir "${app_dir}" \
|
||||
--executable "${root_dir}/target/release/comicviewer" \
|
||||
--desktop-file "${root_dir}/data/io.github.comicviewer.Comicviewer.desktop" \
|
||||
--icon-file "${root_dir}/data/io.github.comicviewer.Comicviewer.svg" \
|
||||
--custom-apprun "${root_dir}/packaging/AppRun" \
|
||||
--plugin gtk \
|
||||
--output appimage
|
||||
|
||||
echo "Created ${output_path}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue