spacedrive/scripts/setup.sh

248 lines
7.2 KiB
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
set -euo pipefail
if [ "${CI:-}" = "true" ]; then
set -x
fi
err() {
for _line in "$@"; do
echo "$_line" >&2
done
exit 1
}
has() {
for prog in "$@"; do
if ! command -v "$prog" 1>/dev/null 2>&1; then
return 1
fi
done
}
[ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685) * Almost working * Downgrade libplacebo - FFMpeg 6.0 uses some now removed deprecated functions * Use -Oz for zimg * Fix CI script to run the new ffmpeg build script * Fix heif step name + Ignore docker cache while building in CI * Fix Opencl build on linux * Fix adding incorrect -target argument to linker - Update zig for windows target * Disable opengl for ffmpeg, it only uses it as an outdev, not for processing - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage - Fix 99-heif.sh incorrect bsdtar flag * Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build - Fix Dockerfile step for cleaning up the out dir - Improve licensing handling * x86_64 windows and linux builds are working * Fix aarch64 build for windows and linux * Fix symbol visibility in linux builds - Fix soxr failing to download due to sourcefourge - Only patch zimg on windows targets - Tell cmake to hide libheif symbols * Fix Linux .so rpath - Add lzo dependency - Publish source for the built libs - Add warning for missing nasm in tauri.mjs - Remove ffmpeg install from setup.sh - Add download logic for our linux ffmpeg bundle in preprep.mjs * Remove jobs, docker doesn't support this * Fix typing * Change ffmpeg references to native deps - Rename FFMpeg.framework to Spacedrive.framework - Centralize the macOS native deps build with the windows and linux one - Change the preprep script to only download our native deps - Remove old macOS ffmpeg build scripts * Compress native deps before creating github artifact - The zip implementation for github artifact does not mantain symlinks and permissions - Remove conditional protoc, it is now always included * Don't strip dylibs, it was breaking them - Only download macOS Framework for darwin targets - Fix preprep script - Improve README.md for native-deps - Fix not finding native-deps src * Attempt to fix macOS dylib * Fix macOS dylibs - Replace lld.ld64 with apple's own linker - Add stages for building apple's compiler tools to use instead of LLVM ones * Ensure sourced file exists * All targets should build now - Fix environment sourcing in build.sh - Some minor improvements to cc.sh - Fix incorrect flag in zlib.sh - Improve how -f[...] flags are passed to compiler and linker - Add more stack hardening flags * We now can support macOS 11.0 on arm64 * Improve macOS Framework generation - Remove installed unused deps - Improve cleanup and organization logic in Dockerfile last step - Move libav* .dll.a to .lib to fix missing files in windows target - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps - Create all the necessary symlinks for the macOS targets while building - Remove symlink logic for macOS target from preprep.mjs * Remove native-deps from spacedrive repo - It now resides in https://github.com/spacedriveapp/native-deps - Modify preprep script to dowload native-deps from new location - Remove Github API code from scripts (not needed anymore) - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux * Handle flock not present in system - Allow macOS to try using flock * Fix preprep on macOS * Add script that patch deb to fix errors and warnings raised by lintian * Fix ctrl+c/ctrl+v typo * Remove gstreamer1.0-gtk3 from deb dependencies * eval is evil * Handle tauri build release with an explicit target in fix-deb.sh * Preserve environment variables when re-executing fix-deb with sudo * Only execute fix-deb.sh when building a deb bundle * Improvements fix-deb.sh * Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
sudo() {
if [ "$(id -u)" -eq 0 ]; then
"$@"
else
env sudo "$@"
fi
}
script_failure() {
if [ -n "${1:-}" ]; then
_line="on line $1"
else
_line="(unknown)"
fi
err "An error occurred $_line." "Setup failed."
}
trap 'script_failure ${LINENO:-}' ERR
[ENG-927, ENG-735, ENG-766] Fix Updater & Tauri 1.5 (#1361) * custom updater with toasts * new state management + updated router route * tauri-specific update route * ref * update in prod only * change 'Install' to 'Update' * fix tsconfig * desktop tauri * remove tauri patch * tauri 1.5 * tauri 1.5 * use tauri script * native-deps * Rework preprep and tauri script to better support tauri 1.5 * Update to tauri 1.5.1 - Update workspace and apps/desktop dependencies - Fix mustache import, @types/mustache is not compatible with ES imports - Replace arm64 with aarch64 in machineID, they should be treated the same and this simplyfies the code * Fix tauri updater not building due to missing key - Fix dmg background not being found - Generate an adhoc key for tauri updater with it is enabled and the user is doing a prod build * Fix ctrl+c/ctrl+v typo * Normalie @tanstack/react-query version through workspace - Use undici in scripts instead of global fetch - Fix typecheck * Fix linux prod and dev builds - Improve error handling in tauri.mjs * Normalize dev deps in workspace - Improve linux shared libs setup * Fix CI and server docker * Fix windows - Remove superfluous envvar * Attempt to fix server, mobile, deb and release updater * Attempt to fix deb and mobile again - Fix type on deb dependency - Enable release deb for aarch64-unknown-linux-gnu * Github doesn't have arm runners - Fix typo in server Dockerfile * Publish deb and updater artifacts * remove version from asset name * update commands * log release * Some logs on updater errors * show updater errors on frontend * fix desktop ui caching --------- Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com> Co-authored-by: Ericson Fogo Soares <ericson.ds999@gmail.com>
2023-10-10 07:30:56 +00:00
case "${OSTYPE:-}" in
'msys' | 'mingw' | 'cygwin')
err 'Bash for windows is not supported, please interact with this repo from Powershell or CMD'
;;
esac
if [ "${CI:-}" != "true" ]; then
echo 'Spacedrive Development Environment Setup'
echo 'To set up your machine for Spacedrive development, this script will install some required dependencies with your system package manager'
echo
echo 'Press Enter to continue'
read -r
if ! has pnpm; then
err 'pnpm was not found.' \
"Ensure the 'pnpm' command is in your \$PATH." \
'You must use pnpm for this project; yarn and npm are not allowed.' \
'https://pnpm.io/installation'
fi
if ! has rustc cargo; then
err 'Rust was not found.' \
"Ensure the 'rustc' and 'cargo' binaries are in your \$PATH." \
'https://rustup.rs'
fi
echo
fi
# Install rust deps for android
if [ "${1:-}" = "mobile" ]; then
MOBILE=1
# Android requires python
if ! { has python3 || { has python && python -c 'import sys; exit(0 if sys.version_info[0] == 3 else 1)'; }; }; then
err 'python3 was not found.' \
'This is required for Android mobile development.' \
"Ensure 'python3' is available in your \$PATH and try again."
fi
if ! has rustup; then
err 'Rustup was not found. It is required for cross-compiling rust to mobile targets.' \
"Ensure the 'rustup' binary is in your \$PATH." \
'https://rustup.rs'
fi
# Android targets
echo "Installing Android targets for Rust..."
if [ "${CI:-}" = "true" ]; then
# TODO: This need to be adjusted for future mobile release CI
rustup target add x86_64-linux-android
else
rustup target add \
aarch64-linux-android \
armv7-linux-androideabi \
x86_64-linux-android
fi
echo
else
MOBILE=0
fi
# Install system deps
case "$(uname)" in
"Darwin")
if [ "$(uname -m)" = 'x86_64' ] && ! [ "${CI:-}" = "true" ]; then
brew install nasm
fi
# Install rust deps for iOS
if [ $MOBILE -eq 1 ]; then
echo "Checking for Xcode..."
if ! /usr/bin/xcodebuild -version >/dev/null; then
err "Xcode was not detected." \
"Please ensure Xcode is installed and try again."
fi
echo "Installing iOS targets for Rust..."
case "$(uname -m)" in
"arm64" | "aarch64") # M series
rustup target add aarch64-apple-ios aarch64-apple-ios-sim
;;
"x86_64") # Intel
rustup target add x86_64-apple-ios aarch64-apple-ios
;;
*)
err 'Unsupported architecture for CI build.'
;;
esac
echo
fi
;;
"Linux")
# https://github.com/tauri-apps/tauri-docs/blob/dev/docs/guides/getting-started/prerequisites.md#setting-up-linux
if has apt-get; then
echo "Detected apt!"
echo "Installing dependencies with apt..."
# Tauri dependencies
Port AppImage build to use appimage-builder (#1785) * Initial port to appimage-builder * Almost * Fix appimage build on arm64 * Custom patch for external binaries run under appimage - Disable bubblewrap sandbox when running under appimage - Change cwd to APPDIR when running under appimage * AppImage Works (for the first lunch, then it crashes with Stack Smash 😭) * Fix stack smashing, now AppImage almos fully works \o/ (gstreamer is still broken) - Temporarily disable the volume watcher when running under appimage (Workaround for the stack smash error) - Wrap gnu lic version check for appimage under conditional compile for glibc targets - Add error handling for the justUpdatedCheck - Fix VITE_LANDING_ORIGIN being undefined * On non glibc systems default to runtime/compat * Use glibc version 2.8 instead of 0 for non-gnu systems * Fix video playback not working due to broken GstRegistry * Build and publish new AppImage release artifact - Fix model location when building deb - Improve model path resolution logic - Remove patchelf dependency from setup script - Fix incorrectly ignore gstreamer dependency in AppImage recipe * Fix clippy complaining about `get_path_relative_to_exe` - Read GLIBC_FAKE_VERSION or use 2.8 for musl in appimage (while the code is there, this is not really supported for now) * Remove appimage tauri target from release CI * Remove setup-buildx-action, not relly needed * typo fix * Fix git describe command running on cwd instead of the repo root dir * Attempt fix weird git permissions errors in CI+docker * Pass CI env to docker appimage * Only use git after installing it * Pass target to appimage build script * Fix permission after creating appimage * -_- * Swap envvar with github ci var * Format * Add instruction on how to manually build an AppImage * Fix typos * docs: add note about running podman with `--privileged` if there's a permission denied error * docs: fix typo and link directly to appimage-building `README.md` * refactor: streamline code and make it a bit cleaner --------- Co-authored-by: jake <77554505+brxken128@users.noreply.github.com>
2024-01-22 10:52:26 +00:00
set -- build-essential curl wget file openssl libssl-dev libgtk-3-dev librsvg2-dev \
libwebkit2gtk-4.1-dev libayatana-appindicator3-dev libxdo-dev libdbus-1-dev
# Webkit2gtk requires gstreamer plugins for video playback to work
[ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685) * Almost working * Downgrade libplacebo - FFMpeg 6.0 uses some now removed deprecated functions * Use -Oz for zimg * Fix CI script to run the new ffmpeg build script * Fix heif step name + Ignore docker cache while building in CI * Fix Opencl build on linux * Fix adding incorrect -target argument to linker - Update zig for windows target * Disable opengl for ffmpeg, it only uses it as an outdev, not for processing - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage - Fix 99-heif.sh incorrect bsdtar flag * Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build - Fix Dockerfile step for cleaning up the out dir - Improve licensing handling * x86_64 windows and linux builds are working * Fix aarch64 build for windows and linux * Fix symbol visibility in linux builds - Fix soxr failing to download due to sourcefourge - Only patch zimg on windows targets - Tell cmake to hide libheif symbols * Fix Linux .so rpath - Add lzo dependency - Publish source for the built libs - Add warning for missing nasm in tauri.mjs - Remove ffmpeg install from setup.sh - Add download logic for our linux ffmpeg bundle in preprep.mjs * Remove jobs, docker doesn't support this * Fix typing * Change ffmpeg references to native deps - Rename FFMpeg.framework to Spacedrive.framework - Centralize the macOS native deps build with the windows and linux one - Change the preprep script to only download our native deps - Remove old macOS ffmpeg build scripts * Compress native deps before creating github artifact - The zip implementation for github artifact does not mantain symlinks and permissions - Remove conditional protoc, it is now always included * Don't strip dylibs, it was breaking them - Only download macOS Framework for darwin targets - Fix preprep script - Improve README.md for native-deps - Fix not finding native-deps src * Attempt to fix macOS dylib * Fix macOS dylibs - Replace lld.ld64 with apple's own linker - Add stages for building apple's compiler tools to use instead of LLVM ones * Ensure sourced file exists * All targets should build now - Fix environment sourcing in build.sh - Some minor improvements to cc.sh - Fix incorrect flag in zlib.sh - Improve how -f[...] flags are passed to compiler and linker - Add more stack hardening flags * We now can support macOS 11.0 on arm64 * Improve macOS Framework generation - Remove installed unused deps - Improve cleanup and organization logic in Dockerfile last step - Move libav* .dll.a to .lib to fix missing files in windows target - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps - Create all the necessary symlinks for the macOS targets while building - Remove symlink logic for macOS target from preprep.mjs * Remove native-deps from spacedrive repo - It now resides in https://github.com/spacedriveapp/native-deps - Modify preprep script to dowload native-deps from new location - Remove Github API code from scripts (not needed anymore) - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux * Handle flock not present in system - Allow macOS to try using flock * Fix preprep on macOS * Add script that patch deb to fix errors and warnings raised by lintian * Fix ctrl+c/ctrl+v typo * Remove gstreamer1.0-gtk3 from deb dependencies * eval is evil * Handle tauri build release with an explicit target in fix-deb.sh * Preserve environment variables when re-executing fix-deb with sudo * Only execute fix-deb.sh when building a deb bundle * Improvements fix-deb.sh * Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
set -- "$@" gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
# C/C++ build dependencies, required to build some *-sys crates
[ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685) * Almost working * Downgrade libplacebo - FFMpeg 6.0 uses some now removed deprecated functions * Use -Oz for zimg * Fix CI script to run the new ffmpeg build script * Fix heif step name + Ignore docker cache while building in CI * Fix Opencl build on linux * Fix adding incorrect -target argument to linker - Update zig for windows target * Disable opengl for ffmpeg, it only uses it as an outdev, not for processing - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage - Fix 99-heif.sh incorrect bsdtar flag * Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build - Fix Dockerfile step for cleaning up the out dir - Improve licensing handling * x86_64 windows and linux builds are working * Fix aarch64 build for windows and linux * Fix symbol visibility in linux builds - Fix soxr failing to download due to sourcefourge - Only patch zimg on windows targets - Tell cmake to hide libheif symbols * Fix Linux .so rpath - Add lzo dependency - Publish source for the built libs - Add warning for missing nasm in tauri.mjs - Remove ffmpeg install from setup.sh - Add download logic for our linux ffmpeg bundle in preprep.mjs * Remove jobs, docker doesn't support this * Fix typing * Change ffmpeg references to native deps - Rename FFMpeg.framework to Spacedrive.framework - Centralize the macOS native deps build with the windows and linux one - Change the preprep script to only download our native deps - Remove old macOS ffmpeg build scripts * Compress native deps before creating github artifact - The zip implementation for github artifact does not mantain symlinks and permissions - Remove conditional protoc, it is now always included * Don't strip dylibs, it was breaking them - Only download macOS Framework for darwin targets - Fix preprep script - Improve README.md for native-deps - Fix not finding native-deps src * Attempt to fix macOS dylib * Fix macOS dylibs - Replace lld.ld64 with apple's own linker - Add stages for building apple's compiler tools to use instead of LLVM ones * Ensure sourced file exists * All targets should build now - Fix environment sourcing in build.sh - Some minor improvements to cc.sh - Fix incorrect flag in zlib.sh - Improve how -f[...] flags are passed to compiler and linker - Add more stack hardening flags * We now can support macOS 11.0 on arm64 * Improve macOS Framework generation - Remove installed unused deps - Improve cleanup and organization logic in Dockerfile last step - Move libav* .dll.a to .lib to fix missing files in windows target - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps - Create all the necessary symlinks for the macOS targets while building - Remove symlink logic for macOS target from preprep.mjs * Remove native-deps from spacedrive repo - It now resides in https://github.com/spacedriveapp/native-deps - Modify preprep script to dowload native-deps from new location - Remove Github API code from scripts (not needed anymore) - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux * Handle flock not present in system - Allow macOS to try using flock * Fix preprep on macOS * Add script that patch deb to fix errors and warnings raised by lintian * Fix ctrl+c/ctrl+v typo * Remove gstreamer1.0-gtk3 from deb dependencies * eval is evil * Handle tauri build release with an explicit target in fix-deb.sh * Preserve environment variables when re-executing fix-deb with sudo * Only execute fix-deb.sh when building a deb bundle * Improvements fix-deb.sh * Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
set -- "$@" llvm-dev libclang-dev clang nasm perl
# React dependencies
set -- "$@" libvips42
sudo apt-get -y update
sudo apt-get -y install "$@"
elif has pacman; then
echo "Detected pacman!"
echo "Installing dependencies with pacman..."
# Tauri dependencies
set -- base-devel curl wget file openssl gtk3 librsvg webkit2gtk-4.1 libayatana-appindicator xdotool dbus
# Webkit2gtk requires gstreamer plugins for video playback to work
[ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685) * Almost working * Downgrade libplacebo - FFMpeg 6.0 uses some now removed deprecated functions * Use -Oz for zimg * Fix CI script to run the new ffmpeg build script * Fix heif step name + Ignore docker cache while building in CI * Fix Opencl build on linux * Fix adding incorrect -target argument to linker - Update zig for windows target * Disable opengl for ffmpeg, it only uses it as an outdev, not for processing - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage - Fix 99-heif.sh incorrect bsdtar flag * Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build - Fix Dockerfile step for cleaning up the out dir - Improve licensing handling * x86_64 windows and linux builds are working * Fix aarch64 build for windows and linux * Fix symbol visibility in linux builds - Fix soxr failing to download due to sourcefourge - Only patch zimg on windows targets - Tell cmake to hide libheif symbols * Fix Linux .so rpath - Add lzo dependency - Publish source for the built libs - Add warning for missing nasm in tauri.mjs - Remove ffmpeg install from setup.sh - Add download logic for our linux ffmpeg bundle in preprep.mjs * Remove jobs, docker doesn't support this * Fix typing * Change ffmpeg references to native deps - Rename FFMpeg.framework to Spacedrive.framework - Centralize the macOS native deps build with the windows and linux one - Change the preprep script to only download our native deps - Remove old macOS ffmpeg build scripts * Compress native deps before creating github artifact - The zip implementation for github artifact does not mantain symlinks and permissions - Remove conditional protoc, it is now always included * Don't strip dylibs, it was breaking them - Only download macOS Framework for darwin targets - Fix preprep script - Improve README.md for native-deps - Fix not finding native-deps src * Attempt to fix macOS dylib * Fix macOS dylibs - Replace lld.ld64 with apple's own linker - Add stages for building apple's compiler tools to use instead of LLVM ones * Ensure sourced file exists * All targets should build now - Fix environment sourcing in build.sh - Some minor improvements to cc.sh - Fix incorrect flag in zlib.sh - Improve how -f[...] flags are passed to compiler and linker - Add more stack hardening flags * We now can support macOS 11.0 on arm64 * Improve macOS Framework generation - Remove installed unused deps - Improve cleanup and organization logic in Dockerfile last step - Move libav* .dll.a to .lib to fix missing files in windows target - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps - Create all the necessary symlinks for the macOS targets while building - Remove symlink logic for macOS target from preprep.mjs * Remove native-deps from spacedrive repo - It now resides in https://github.com/spacedriveapp/native-deps - Modify preprep script to dowload native-deps from new location - Remove Github API code from scripts (not needed anymore) - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux * Handle flock not present in system - Allow macOS to try using flock * Fix preprep on macOS * Add script that patch deb to fix errors and warnings raised by lintian * Fix ctrl+c/ctrl+v typo * Remove gstreamer1.0-gtk3 from deb dependencies * eval is evil * Handle tauri build release with an explicit target in fix-deb.sh * Preserve environment variables when re-executing fix-deb with sudo * Only execute fix-deb.sh when building a deb bundle * Improvements fix-deb.sh * Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
set -- "$@" gst-plugins-base gst-plugins-good gst-plugins-ugly
# C/C++ build dependencies, required to build some *-sys crates
[ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685) * Almost working * Downgrade libplacebo - FFMpeg 6.0 uses some now removed deprecated functions * Use -Oz for zimg * Fix CI script to run the new ffmpeg build script * Fix heif step name + Ignore docker cache while building in CI * Fix Opencl build on linux * Fix adding incorrect -target argument to linker - Update zig for windows target * Disable opengl for ffmpeg, it only uses it as an outdev, not for processing - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage - Fix 99-heif.sh incorrect bsdtar flag * Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build - Fix Dockerfile step for cleaning up the out dir - Improve licensing handling * x86_64 windows and linux builds are working * Fix aarch64 build for windows and linux * Fix symbol visibility in linux builds - Fix soxr failing to download due to sourcefourge - Only patch zimg on windows targets - Tell cmake to hide libheif symbols * Fix Linux .so rpath - Add lzo dependency - Publish source for the built libs - Add warning for missing nasm in tauri.mjs - Remove ffmpeg install from setup.sh - Add download logic for our linux ffmpeg bundle in preprep.mjs * Remove jobs, docker doesn't support this * Fix typing * Change ffmpeg references to native deps - Rename FFMpeg.framework to Spacedrive.framework - Centralize the macOS native deps build with the windows and linux one - Change the preprep script to only download our native deps - Remove old macOS ffmpeg build scripts * Compress native deps before creating github artifact - The zip implementation for github artifact does not mantain symlinks and permissions - Remove conditional protoc, it is now always included * Don't strip dylibs, it was breaking them - Only download macOS Framework for darwin targets - Fix preprep script - Improve README.md for native-deps - Fix not finding native-deps src * Attempt to fix macOS dylib * Fix macOS dylibs - Replace lld.ld64 with apple's own linker - Add stages for building apple's compiler tools to use instead of LLVM ones * Ensure sourced file exists * All targets should build now - Fix environment sourcing in build.sh - Some minor improvements to cc.sh - Fix incorrect flag in zlib.sh - Improve how -f[...] flags are passed to compiler and linker - Add more stack hardening flags * We now can support macOS 11.0 on arm64 * Improve macOS Framework generation - Remove installed unused deps - Improve cleanup and organization logic in Dockerfile last step - Move libav* .dll.a to .lib to fix missing files in windows target - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps - Create all the necessary symlinks for the macOS targets while building - Remove symlink logic for macOS target from preprep.mjs * Remove native-deps from spacedrive repo - It now resides in https://github.com/spacedriveapp/native-deps - Modify preprep script to dowload native-deps from new location - Remove Github API code from scripts (not needed anymore) - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux * Handle flock not present in system - Allow macOS to try using flock * Fix preprep on macOS * Add script that patch deb to fix errors and warnings raised by lintian * Fix ctrl+c/ctrl+v typo * Remove gstreamer1.0-gtk3 from deb dependencies * eval is evil * Handle tauri build release with an explicit target in fix-deb.sh * Preserve environment variables when re-executing fix-deb with sudo * Only execute fix-deb.sh when building a deb bundle * Improvements fix-deb.sh * Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
set -- "$@" clang nasm perl
# React dependencies
set -- "$@" libvips
sudo pacman -Sy --needed "$@"
elif has dnf; then
echo "Detected dnf!"
echo "Installing dependencies with dnf..."
# For Enterprise Linux, you also need "Development Tools" instead of "C Development Tools and Libraries"
[ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685) * Almost working * Downgrade libplacebo - FFMpeg 6.0 uses some now removed deprecated functions * Use -Oz for zimg * Fix CI script to run the new ffmpeg build script * Fix heif step name + Ignore docker cache while building in CI * Fix Opencl build on linux * Fix adding incorrect -target argument to linker - Update zig for windows target * Disable opengl for ffmpeg, it only uses it as an outdev, not for processing - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage - Fix 99-heif.sh incorrect bsdtar flag * Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build - Fix Dockerfile step for cleaning up the out dir - Improve licensing handling * x86_64 windows and linux builds are working * Fix aarch64 build for windows and linux * Fix symbol visibility in linux builds - Fix soxr failing to download due to sourcefourge - Only patch zimg on windows targets - Tell cmake to hide libheif symbols * Fix Linux .so rpath - Add lzo dependency - Publish source for the built libs - Add warning for missing nasm in tauri.mjs - Remove ffmpeg install from setup.sh - Add download logic for our linux ffmpeg bundle in preprep.mjs * Remove jobs, docker doesn't support this * Fix typing * Change ffmpeg references to native deps - Rename FFMpeg.framework to Spacedrive.framework - Centralize the macOS native deps build with the windows and linux one - Change the preprep script to only download our native deps - Remove old macOS ffmpeg build scripts * Compress native deps before creating github artifact - The zip implementation for github artifact does not mantain symlinks and permissions - Remove conditional protoc, it is now always included * Don't strip dylibs, it was breaking them - Only download macOS Framework for darwin targets - Fix preprep script - Improve README.md for native-deps - Fix not finding native-deps src * Attempt to fix macOS dylib * Fix macOS dylibs - Replace lld.ld64 with apple's own linker - Add stages for building apple's compiler tools to use instead of LLVM ones * Ensure sourced file exists * All targets should build now - Fix environment sourcing in build.sh - Some minor improvements to cc.sh - Fix incorrect flag in zlib.sh - Improve how -f[...] flags are passed to compiler and linker - Add more stack hardening flags * We now can support macOS 11.0 on arm64 * Improve macOS Framework generation - Remove installed unused deps - Improve cleanup and organization logic in Dockerfile last step - Move libav* .dll.a to .lib to fix missing files in windows target - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps - Create all the necessary symlinks for the macOS targets while building - Remove symlink logic for macOS target from preprep.mjs * Remove native-deps from spacedrive repo - It now resides in https://github.com/spacedriveapp/native-deps - Modify preprep script to dowload native-deps from new location - Remove Github API code from scripts (not needed anymore) - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux * Handle flock not present in system - Allow macOS to try using flock * Fix preprep on macOS * Add script that patch deb to fix errors and warnings raised by lintian * Fix ctrl+c/ctrl+v typo * Remove gstreamer1.0-gtk3 from deb dependencies * eval is evil * Handle tauri build release with an explicit target in fix-deb.sh * Preserve environment variables when re-executing fix-deb with sudo * Only execute fix-deb.sh when building a deb bundle * Improvements fix-deb.sh * Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
if ! { sudo dnf group install "C Development Tools and Libraries" || sudo dnf group install "Development Tools"; }; then
err 'We were unable to install the "C Development Tools and Libraries"/"Development Tools" package.' \
'Please open an issue if you feel that this is incorrect.' \
'https://github.com/spacedriveapp/spacedrive/issues'
fi
# Tauri dependencies
set -- openssl webkit2gtk4.1-devel openssl-dev curl wget file libappindicator-gtk3-devel librsvg2-devel libxdo-devel dbus-devel
# Webkit2gtk requires gstreamer plugins for video playback to work
[ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685) * Almost working * Downgrade libplacebo - FFMpeg 6.0 uses some now removed deprecated functions * Use -Oz for zimg * Fix CI script to run the new ffmpeg build script * Fix heif step name + Ignore docker cache while building in CI * Fix Opencl build on linux * Fix adding incorrect -target argument to linker - Update zig for windows target * Disable opengl for ffmpeg, it only uses it as an outdev, not for processing - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage - Fix 99-heif.sh incorrect bsdtar flag * Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build - Fix Dockerfile step for cleaning up the out dir - Improve licensing handling * x86_64 windows and linux builds are working * Fix aarch64 build for windows and linux * Fix symbol visibility in linux builds - Fix soxr failing to download due to sourcefourge - Only patch zimg on windows targets - Tell cmake to hide libheif symbols * Fix Linux .so rpath - Add lzo dependency - Publish source for the built libs - Add warning for missing nasm in tauri.mjs - Remove ffmpeg install from setup.sh - Add download logic for our linux ffmpeg bundle in preprep.mjs * Remove jobs, docker doesn't support this * Fix typing * Change ffmpeg references to native deps - Rename FFMpeg.framework to Spacedrive.framework - Centralize the macOS native deps build with the windows and linux one - Change the preprep script to only download our native deps - Remove old macOS ffmpeg build scripts * Compress native deps before creating github artifact - The zip implementation for github artifact does not mantain symlinks and permissions - Remove conditional protoc, it is now always included * Don't strip dylibs, it was breaking them - Only download macOS Framework for darwin targets - Fix preprep script - Improve README.md for native-deps - Fix not finding native-deps src * Attempt to fix macOS dylib * Fix macOS dylibs - Replace lld.ld64 with apple's own linker - Add stages for building apple's compiler tools to use instead of LLVM ones * Ensure sourced file exists * All targets should build now - Fix environment sourcing in build.sh - Some minor improvements to cc.sh - Fix incorrect flag in zlib.sh - Improve how -f[...] flags are passed to compiler and linker - Add more stack hardening flags * We now can support macOS 11.0 on arm64 * Improve macOS Framework generation - Remove installed unused deps - Improve cleanup and organization logic in Dockerfile last step - Move libav* .dll.a to .lib to fix missing files in windows target - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps - Create all the necessary symlinks for the macOS targets while building - Remove symlink logic for macOS target from preprep.mjs * Remove native-deps from spacedrive repo - It now resides in https://github.com/spacedriveapp/native-deps - Modify preprep script to dowload native-deps from new location - Remove Github API code from scripts (not needed anymore) - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux * Handle flock not present in system - Allow macOS to try using flock * Fix preprep on macOS * Add script that patch deb to fix errors and warnings raised by lintian * Fix ctrl+c/ctrl+v typo * Remove gstreamer1.0-gtk3 from deb dependencies * eval is evil * Handle tauri build release with an explicit target in fix-deb.sh * Preserve environment variables when re-executing fix-deb with sudo * Only execute fix-deb.sh when building a deb bundle * Improvements fix-deb.sh * Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
set -- "$@" gstreamer1-devel gstreamer1-plugins-base-devel gstreamer1-plugins-good \
gstreamer1-plugins-good-extras gstreamer1-plugins-ugly-free
# C/C++ build dependencies, required to build some *-sys crates
[ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685) * Almost working * Downgrade libplacebo - FFMpeg 6.0 uses some now removed deprecated functions * Use -Oz for zimg * Fix CI script to run the new ffmpeg build script * Fix heif step name + Ignore docker cache while building in CI * Fix Opencl build on linux * Fix adding incorrect -target argument to linker - Update zig for windows target * Disable opengl for ffmpeg, it only uses it as an outdev, not for processing - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage - Fix 99-heif.sh incorrect bsdtar flag * Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build - Fix Dockerfile step for cleaning up the out dir - Improve licensing handling * x86_64 windows and linux builds are working * Fix aarch64 build for windows and linux * Fix symbol visibility in linux builds - Fix soxr failing to download due to sourcefourge - Only patch zimg on windows targets - Tell cmake to hide libheif symbols * Fix Linux .so rpath - Add lzo dependency - Publish source for the built libs - Add warning for missing nasm in tauri.mjs - Remove ffmpeg install from setup.sh - Add download logic for our linux ffmpeg bundle in preprep.mjs * Remove jobs, docker doesn't support this * Fix typing * Change ffmpeg references to native deps - Rename FFMpeg.framework to Spacedrive.framework - Centralize the macOS native deps build with the windows and linux one - Change the preprep script to only download our native deps - Remove old macOS ffmpeg build scripts * Compress native deps before creating github artifact - The zip implementation for github artifact does not mantain symlinks and permissions - Remove conditional protoc, it is now always included * Don't strip dylibs, it was breaking them - Only download macOS Framework for darwin targets - Fix preprep script - Improve README.md for native-deps - Fix not finding native-deps src * Attempt to fix macOS dylib * Fix macOS dylibs - Replace lld.ld64 with apple's own linker - Add stages for building apple's compiler tools to use instead of LLVM ones * Ensure sourced file exists * All targets should build now - Fix environment sourcing in build.sh - Some minor improvements to cc.sh - Fix incorrect flag in zlib.sh - Improve how -f[...] flags are passed to compiler and linker - Add more stack hardening flags * We now can support macOS 11.0 on arm64 * Improve macOS Framework generation - Remove installed unused deps - Improve cleanup and organization logic in Dockerfile last step - Move libav* .dll.a to .lib to fix missing files in windows target - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps - Create all the necessary symlinks for the macOS targets while building - Remove symlink logic for macOS target from preprep.mjs * Remove native-deps from spacedrive repo - It now resides in https://github.com/spacedriveapp/native-deps - Modify preprep script to dowload native-deps from new location - Remove Github API code from scripts (not needed anymore) - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux * Handle flock not present in system - Allow macOS to try using flock * Fix preprep on macOS * Add script that patch deb to fix errors and warnings raised by lintian * Fix ctrl+c/ctrl+v typo * Remove gstreamer1.0-gtk3 from deb dependencies * eval is evil * Handle tauri build release with an explicit target in fix-deb.sh * Preserve environment variables when re-executing fix-deb with sudo * Only execute fix-deb.sh when building a deb bundle * Improvements fix-deb.sh * Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
set -- "$@" clang clang-devel nasm perl-core
# React dependencies
set -- "$@" vips
sudo dnf install "$@"
[ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685) * Almost working * Downgrade libplacebo - FFMpeg 6.0 uses some now removed deprecated functions * Use -Oz for zimg * Fix CI script to run the new ffmpeg build script * Fix heif step name + Ignore docker cache while building in CI * Fix Opencl build on linux * Fix adding incorrect -target argument to linker - Update zig for windows target * Disable opengl for ffmpeg, it only uses it as an outdev, not for processing - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage - Fix 99-heif.sh incorrect bsdtar flag * Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build - Fix Dockerfile step for cleaning up the out dir - Improve licensing handling * x86_64 windows and linux builds are working * Fix aarch64 build for windows and linux * Fix symbol visibility in linux builds - Fix soxr failing to download due to sourcefourge - Only patch zimg on windows targets - Tell cmake to hide libheif symbols * Fix Linux .so rpath - Add lzo dependency - Publish source for the built libs - Add warning for missing nasm in tauri.mjs - Remove ffmpeg install from setup.sh - Add download logic for our linux ffmpeg bundle in preprep.mjs * Remove jobs, docker doesn't support this * Fix typing * Change ffmpeg references to native deps - Rename FFMpeg.framework to Spacedrive.framework - Centralize the macOS native deps build with the windows and linux one - Change the preprep script to only download our native deps - Remove old macOS ffmpeg build scripts * Compress native deps before creating github artifact - The zip implementation for github artifact does not mantain symlinks and permissions - Remove conditional protoc, it is now always included * Don't strip dylibs, it was breaking them - Only download macOS Framework for darwin targets - Fix preprep script - Improve README.md for native-deps - Fix not finding native-deps src * Attempt to fix macOS dylib * Fix macOS dylibs - Replace lld.ld64 with apple's own linker - Add stages for building apple's compiler tools to use instead of LLVM ones * Ensure sourced file exists * All targets should build now - Fix environment sourcing in build.sh - Some minor improvements to cc.sh - Fix incorrect flag in zlib.sh - Improve how -f[...] flags are passed to compiler and linker - Add more stack hardening flags * We now can support macOS 11.0 on arm64 * Improve macOS Framework generation - Remove installed unused deps - Improve cleanup and organization logic in Dockerfile last step - Move libav* .dll.a to .lib to fix missing files in windows target - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps - Create all the necessary symlinks for the macOS targets while building - Remove symlink logic for macOS target from preprep.mjs * Remove native-deps from spacedrive repo - It now resides in https://github.com/spacedriveapp/native-deps - Modify preprep script to dowload native-deps from new location - Remove Github API code from scripts (not needed anymore) - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux * Handle flock not present in system - Allow macOS to try using flock * Fix preprep on macOS * Add script that patch deb to fix errors and warnings raised by lintian * Fix ctrl+c/ctrl+v typo * Remove gstreamer1.0-gtk3 from deb dependencies * eval is evil * Handle tauri build release with an explicit target in fix-deb.sh * Preserve environment variables when re-executing fix-deb with sudo * Only execute fix-deb.sh when building a deb bundle * Improvements fix-deb.sh * Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
elif has apk; then
echo "Detected apk!"
echo "Installing dependencies with apk..."
echo "Alpine suport is experimental" >&2
[ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685) * Almost working * Downgrade libplacebo - FFMpeg 6.0 uses some now removed deprecated functions * Use -Oz for zimg * Fix CI script to run the new ffmpeg build script * Fix heif step name + Ignore docker cache while building in CI * Fix Opencl build on linux * Fix adding incorrect -target argument to linker - Update zig for windows target * Disable opengl for ffmpeg, it only uses it as an outdev, not for processing - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage - Fix 99-heif.sh incorrect bsdtar flag * Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build - Fix Dockerfile step for cleaning up the out dir - Improve licensing handling * x86_64 windows and linux builds are working * Fix aarch64 build for windows and linux * Fix symbol visibility in linux builds - Fix soxr failing to download due to sourcefourge - Only patch zimg on windows targets - Tell cmake to hide libheif symbols * Fix Linux .so rpath - Add lzo dependency - Publish source for the built libs - Add warning for missing nasm in tauri.mjs - Remove ffmpeg install from setup.sh - Add download logic for our linux ffmpeg bundle in preprep.mjs * Remove jobs, docker doesn't support this * Fix typing * Change ffmpeg references to native deps - Rename FFMpeg.framework to Spacedrive.framework - Centralize the macOS native deps build with the windows and linux one - Change the preprep script to only download our native deps - Remove old macOS ffmpeg build scripts * Compress native deps before creating github artifact - The zip implementation for github artifact does not mantain symlinks and permissions - Remove conditional protoc, it is now always included * Don't strip dylibs, it was breaking them - Only download macOS Framework for darwin targets - Fix preprep script - Improve README.md for native-deps - Fix not finding native-deps src * Attempt to fix macOS dylib * Fix macOS dylibs - Replace lld.ld64 with apple's own linker - Add stages for building apple's compiler tools to use instead of LLVM ones * Ensure sourced file exists * All targets should build now - Fix environment sourcing in build.sh - Some minor improvements to cc.sh - Fix incorrect flag in zlib.sh - Improve how -f[...] flags are passed to compiler and linker - Add more stack hardening flags * We now can support macOS 11.0 on arm64 * Improve macOS Framework generation - Remove installed unused deps - Improve cleanup and organization logic in Dockerfile last step - Move libav* .dll.a to .lib to fix missing files in windows target - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps - Create all the necessary symlinks for the macOS targets while building - Remove symlink logic for macOS target from preprep.mjs * Remove native-deps from spacedrive repo - It now resides in https://github.com/spacedriveapp/native-deps - Modify preprep script to dowload native-deps from new location - Remove Github API code from scripts (not needed anymore) - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux * Handle flock not present in system - Allow macOS to try using flock * Fix preprep on macOS * Add script that patch deb to fix errors and warnings raised by lintian * Fix ctrl+c/ctrl+v typo * Remove gstreamer1.0-gtk3 from deb dependencies * eval is evil * Handle tauri build release with an explicit target in fix-deb.sh * Preserve environment variables when re-executing fix-deb with sudo * Only execute fix-deb.sh when building a deb bundle * Improvements fix-deb.sh * Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
# Tauri dependencies
Port AppImage build to use appimage-builder (#1785) * Initial port to appimage-builder * Almost * Fix appimage build on arm64 * Custom patch for external binaries run under appimage - Disable bubblewrap sandbox when running under appimage - Change cwd to APPDIR when running under appimage * AppImage Works (for the first lunch, then it crashes with Stack Smash 😭) * Fix stack smashing, now AppImage almos fully works \o/ (gstreamer is still broken) - Temporarily disable the volume watcher when running under appimage (Workaround for the stack smash error) - Wrap gnu lic version check for appimage under conditional compile for glibc targets - Add error handling for the justUpdatedCheck - Fix VITE_LANDING_ORIGIN being undefined * On non glibc systems default to runtime/compat * Use glibc version 2.8 instead of 0 for non-gnu systems * Fix video playback not working due to broken GstRegistry * Build and publish new AppImage release artifact - Fix model location when building deb - Improve model path resolution logic - Remove patchelf dependency from setup script - Fix incorrectly ignore gstreamer dependency in AppImage recipe * Fix clippy complaining about `get_path_relative_to_exe` - Read GLIBC_FAKE_VERSION or use 2.8 for musl in appimage (while the code is there, this is not really supported for now) * Remove appimage tauri target from release CI * Remove setup-buildx-action, not relly needed * typo fix * Fix git describe command running on cwd instead of the repo root dir * Attempt fix weird git permissions errors in CI+docker * Pass CI env to docker appimage * Only use git after installing it * Pass target to appimage build script * Fix permission after creating appimage * -_- * Swap envvar with github ci var * Format * Add instruction on how to manually build an AppImage * Fix typos * docs: add note about running podman with `--privileged` if there's a permission denied error * docs: fix typo and link directly to appimage-building `README.md` * refactor: streamline code and make it a bit cleaner --------- Co-authored-by: jake <77554505+brxken128@users.noreply.github.com>
2024-01-22 10:52:26 +00:00
set -- build-base curl wget file openssl-dev gtk+3.0-dev librsvg-dev \
webkit2gtk-4.1-dev libayatana-indicator-dev xdotool-dev dbus-dev
[ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685) * Almost working * Downgrade libplacebo - FFMpeg 6.0 uses some now removed deprecated functions * Use -Oz for zimg * Fix CI script to run the new ffmpeg build script * Fix heif step name + Ignore docker cache while building in CI * Fix Opencl build on linux * Fix adding incorrect -target argument to linker - Update zig for windows target * Disable opengl for ffmpeg, it only uses it as an outdev, not for processing - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage - Fix 99-heif.sh incorrect bsdtar flag * Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build - Fix Dockerfile step for cleaning up the out dir - Improve licensing handling * x86_64 windows and linux builds are working * Fix aarch64 build for windows and linux * Fix symbol visibility in linux builds - Fix soxr failing to download due to sourcefourge - Only patch zimg on windows targets - Tell cmake to hide libheif symbols * Fix Linux .so rpath - Add lzo dependency - Publish source for the built libs - Add warning for missing nasm in tauri.mjs - Remove ffmpeg install from setup.sh - Add download logic for our linux ffmpeg bundle in preprep.mjs * Remove jobs, docker doesn't support this * Fix typing * Change ffmpeg references to native deps - Rename FFMpeg.framework to Spacedrive.framework - Centralize the macOS native deps build with the windows and linux one - Change the preprep script to only download our native deps - Remove old macOS ffmpeg build scripts * Compress native deps before creating github artifact - The zip implementation for github artifact does not mantain symlinks and permissions - Remove conditional protoc, it is now always included * Don't strip dylibs, it was breaking them - Only download macOS Framework for darwin targets - Fix preprep script - Improve README.md for native-deps - Fix not finding native-deps src * Attempt to fix macOS dylib * Fix macOS dylibs - Replace lld.ld64 with apple's own linker - Add stages for building apple's compiler tools to use instead of LLVM ones * Ensure sourced file exists * All targets should build now - Fix environment sourcing in build.sh - Some minor improvements to cc.sh - Fix incorrect flag in zlib.sh - Improve how -f[...] flags are passed to compiler and linker - Add more stack hardening flags * We now can support macOS 11.0 on arm64 * Improve macOS Framework generation - Remove installed unused deps - Improve cleanup and organization logic in Dockerfile last step - Move libav* .dll.a to .lib to fix missing files in windows target - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps - Create all the necessary symlinks for the macOS targets while building - Remove symlink logic for macOS target from preprep.mjs * Remove native-deps from spacedrive repo - It now resides in https://github.com/spacedriveapp/native-deps - Modify preprep script to dowload native-deps from new location - Remove Github API code from scripts (not needed anymore) - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux * Handle flock not present in system - Allow macOS to try using flock * Fix preprep on macOS * Add script that patch deb to fix errors and warnings raised by lintian * Fix ctrl+c/ctrl+v typo * Remove gstreamer1.0-gtk3 from deb dependencies * eval is evil * Handle tauri build release with an explicit target in fix-deb.sh * Preserve environment variables when re-executing fix-deb with sudo * Only execute fix-deb.sh when building a deb bundle * Improvements fix-deb.sh * Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
# Webkit2gtk requires gstreamer plugins for video playback to work
set -- "$@" gst-plugins-base-dev gst-plugins-good gst-plugins-ugly
# C/C++ build dependencies, required to build some *-sys crates
set -- "$@" llvm16-dev clang16 nasm perl
# React dependencies
set -- "$@" vips
sudo apk add "$@"
else
if has lsb_release; then
_distro="'$(lsb_release -s -d)' "
fi
err "Your Linux distro ${_distro:-}is not supported by this script." \
'We would welcome a PR or some help adding your OS to this script:' \
'https://github.com/spacedriveapp/spacedrive/issues'
fi
;;
*)
err "Your OS ($(uname)) is not supported by this script." \
'We would welcome a PR or some help adding your OS to this script.' \
'https://github.com/spacedriveapp/spacedrive/issues'
;;
esac
if [ "${CI:-}" != "true" ]; then
echo "Installing Rust tools..."
_tools="cargo-watch"
if [ $MOBILE -eq 1 ]; then
_tools="$_tools cargo-ndk" # For building Android
fi
echo "$_tools" | xargs cargo install
fi
[ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685) * Almost working * Downgrade libplacebo - FFMpeg 6.0 uses some now removed deprecated functions * Use -Oz for zimg * Fix CI script to run the new ffmpeg build script * Fix heif step name + Ignore docker cache while building in CI * Fix Opencl build on linux * Fix adding incorrect -target argument to linker - Update zig for windows target * Disable opengl for ffmpeg, it only uses it as an outdev, not for processing - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage - Fix 99-heif.sh incorrect bsdtar flag * Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build - Fix Dockerfile step for cleaning up the out dir - Improve licensing handling * x86_64 windows and linux builds are working * Fix aarch64 build for windows and linux * Fix symbol visibility in linux builds - Fix soxr failing to download due to sourcefourge - Only patch zimg on windows targets - Tell cmake to hide libheif symbols * Fix Linux .so rpath - Add lzo dependency - Publish source for the built libs - Add warning for missing nasm in tauri.mjs - Remove ffmpeg install from setup.sh - Add download logic for our linux ffmpeg bundle in preprep.mjs * Remove jobs, docker doesn't support this * Fix typing * Change ffmpeg references to native deps - Rename FFMpeg.framework to Spacedrive.framework - Centralize the macOS native deps build with the windows and linux one - Change the preprep script to only download our native deps - Remove old macOS ffmpeg build scripts * Compress native deps before creating github artifact - The zip implementation for github artifact does not mantain symlinks and permissions - Remove conditional protoc, it is now always included * Don't strip dylibs, it was breaking them - Only download macOS Framework for darwin targets - Fix preprep script - Improve README.md for native-deps - Fix not finding native-deps src * Attempt to fix macOS dylib * Fix macOS dylibs - Replace lld.ld64 with apple's own linker - Add stages for building apple's compiler tools to use instead of LLVM ones * Ensure sourced file exists * All targets should build now - Fix environment sourcing in build.sh - Some minor improvements to cc.sh - Fix incorrect flag in zlib.sh - Improve how -f[...] flags are passed to compiler and linker - Add more stack hardening flags * We now can support macOS 11.0 on arm64 * Improve macOS Framework generation - Remove installed unused deps - Improve cleanup and organization logic in Dockerfile last step - Move libav* .dll.a to .lib to fix missing files in windows target - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps - Create all the necessary symlinks for the macOS targets while building - Remove symlink logic for macOS target from preprep.mjs * Remove native-deps from spacedrive repo - It now resides in https://github.com/spacedriveapp/native-deps - Modify preprep script to dowload native-deps from new location - Remove Github API code from scripts (not needed anymore) - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux * Handle flock not present in system - Allow macOS to try using flock * Fix preprep on macOS * Add script that patch deb to fix errors and warnings raised by lintian * Fix ctrl+c/ctrl+v typo * Remove gstreamer1.0-gtk3 from deb dependencies * eval is evil * Handle tauri build release with an explicit target in fix-deb.sh * Preserve environment variables when re-executing fix-deb with sudo * Only execute fix-deb.sh when building a deb bundle * Improvements fix-deb.sh * Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
echo 'Your machine has been setup for Spacedrive development!'