mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2024-10-01 06:55:46 -04:00
refactor setup
This commit is contained in:
parent
bbde85a134
commit
e8046e9a89
BIN
assets/launcher/icon-square.png
Normal file
BIN
assets/launcher/icon-square.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
BIN
assets/sources/icon-square.afdesign
Normal file
BIN
assets/sources/icon-square.afdesign
Normal file
Binary file not shown.
@ -6,8 +6,11 @@ get_abs_filename() {
|
||||
}
|
||||
|
||||
# Veilid location
|
||||
VEILIDDIR=$(get_abs_filename "$SCRIPTDIR/../veilid")
|
||||
VEILIDDIR=$(get_abs_filename "$SCRIPTDIR/../../veilid")
|
||||
if [ ! -d "$VEILIDDIR" ]; then
|
||||
echo 'Veilid git clone needs to be at $VEILIDDIR'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# VeilidChat location
|
||||
VEILIDCHATDIR=$(get_abs_filename "$SCRIPTDIR/../../veilid")
|
@ -6,12 +6,12 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
source $SCRIPTDIR/_script_common
|
||||
|
||||
# iOS: Set deployment target
|
||||
sed -i '' 's/IPHONEOS_DEPLOYMENT_TARGET = [^;]*/IPHONEOS_DEPLOYMENT_TARGET = 12.4/g' $SCRIPTDIR/ios/Runner.xcodeproj/project.pbxproj
|
||||
sed -i '' "s/platform :ios, '[^']*'/platform :ios, '12.4'/g" $SCRIPTDIR/ios/Podfile
|
||||
sed -i '' 's/IPHONEOS_DEPLOYMENT_TARGET = [^;]*/IPHONEOS_DEPLOYMENT_TARGET = 12.4/g' $VEILIDCHATDIR/ios/Runner.xcodeproj/project.pbxproj
|
||||
sed -i '' "s/platform :ios, '[^']*'/platform :ios, '12.4'/g" $VEILIDCHATDIR/ios/Podfile
|
||||
|
||||
# MacOS: Set deployment target
|
||||
sed -i '' 's/MACOSX_DEPLOYMENT_TARGET = [^;]*/MACOSX_DEPLOYMENT_TARGET = 10.14.6/g' $SCRIPTDIR/macos/Runner.xcodeproj/project.pbxproj
|
||||
sed -i '' "s/platform :osx, '[^']*'/platform :osx, '10.14.6'/g" $SCRIPTDIR/macos/Podfile
|
||||
sed -i '' 's/MACOSX_DEPLOYMENT_TARGET = [^;]*/MACOSX_DEPLOYMENT_TARGET = 10.14.6/g' $VEILIDCHATDIR/macos/Runner.xcodeproj/project.pbxproj
|
||||
sed -i '' "s/platform :osx, '[^']*'/platform :osx, '10.14.6'/g" $VEILIDCHATDIR/macos/Podfile
|
||||
|
||||
# Android: Set NDK version
|
||||
if [[ "$TMPDIR" != "" ]]; then
|
||||
@ -22,14 +22,14 @@ fi
|
||||
cat <<EOF > $ANDTMP
|
||||
ndkVersion '25.1.8937393'
|
||||
EOF
|
||||
sed -i '' -e "/android {/r $ANDTMP" $SCRIPTDIR/android/app/build.gradle
|
||||
sed -i '' -e "/android {/r $ANDTMP" $VEILIDCHATDIR/android/app/build.gradle
|
||||
rm -- $ANDTMP
|
||||
|
||||
# Android: Set min sdk version
|
||||
sed -i '' 's/minSdkVersion .*/minSdkVersion Math.max(flutter.minSdkVersion, 24)/g' $SCRIPTDIR/android/app/build.gradle
|
||||
sed -i '' 's/minSdkVersion .*/minSdkVersion Math.max(flutter.minSdkVersion, 24)/g' $VEILIDCHATDIR/android/app/build.gradle
|
||||
|
||||
# Android: Set gradle plugin version
|
||||
sed -i '' "s/classpath \'com.android.tools.build:gradle:[^\']*\'/classpath 'com.android.tools.build:gradle:7.2.0'/g" $SCRIPTDIR/android/build.gradle
|
||||
sed -i '' "s/classpath \'com.android.tools.build:gradle:[^\']*\'/classpath 'com.android.tools.build:gradle:7.2.0'/g" $VEILIDCHATDIR/android/build.gradle
|
||||
|
||||
# Android: Set gradle version
|
||||
sed -i '' 's/distributionUrl=.*/distributionUrl=https:\/\/services.gradle.org\/distributions\/gradle-7.3.3-all.zip/g' $SCRIPTDIR/android/gradle/wrapper/gradle-wrapper.properties
|
||||
sed -i '' 's/distributionUrl=.*/distributionUrl=https:\/\/services.gradle.org\/distributions\/gradle-7.3.3-all.zip/g' $VEILIDCHATDIR/android/gradle/wrapper/gradle-wrapper.properties
|
37
dev-setup/install_protoc_linux.sh
Executable file
37
dev-setup/install_protoc_linux.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
PROTOC_VERSION="24.3" # Keep in sync with veilid-core/build.rs
|
||||
|
||||
UNAME_M=$(uname -m)
|
||||
if [[ "$UNAME_M" == "x86_64" ]]; then
|
||||
PROTOC_ARCH=x86_64
|
||||
elif [[ "$UNAME_M" == "aarch64" ]]; then
|
||||
PROTOC_ARCH=aarch_64
|
||||
else
|
||||
echo Unsupported build architecture
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir /tmp/protoc-install
|
||||
pushd /tmp/protoc-install
|
||||
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-$PROTOC_ARCH.zip
|
||||
unzip protoc-$PROTOC_VERSION-linux-$PROTOC_ARCH.zip
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
if command -v checkinstall &> /dev/null; then
|
||||
sudo checkinstall --pkgversion=$PROTOC_VERSION -y cp -r bin include /usr/local/
|
||||
cp *.deb ~
|
||||
else
|
||||
sudo cp -r bin include /usr/local/
|
||||
fi
|
||||
popd
|
||||
sudo rm -rf /tmp/protoc-install
|
||||
else
|
||||
if command -v checkinstall &> /dev/null; then
|
||||
checkinstall --pkgversion=$PROTOC_VERSION -y cp -r bin include /usr/local/
|
||||
cp *.deb ~
|
||||
else
|
||||
cp -r bin include /usr/local/
|
||||
fi
|
||||
popd
|
||||
rm -rf /tmp/protoc-install
|
||||
fi
|
@ -15,6 +15,10 @@ fi
|
||||
|
||||
# run setup for veilid
|
||||
$VEILIDDIR/dev-setup/setup_linux.sh
|
||||
|
||||
# Install protoc
|
||||
$SCRIPTDIR/install_protoc_linux.sh
|
||||
|
||||
# run setup for veilid_flutter
|
||||
echo 'If prompted to install Flutter, choose an installation bundle (storage.googleapis.com), not snap.'
|
||||
$VEILIDDIR/veilid-flutter/setup_flutter.sh
|
||||
@ -35,19 +39,3 @@ else
|
||||
echo 'protoc-gen-dart is not available in the path. Add "$HOME/.pub-cache/bin" to your path.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# # ensure rsync is installed
|
||||
# if command -v rsync &> /dev/null; then
|
||||
# echo '[X] rsync is available in the path'
|
||||
# else
|
||||
# echo 'rsync is not available in the path'
|
||||
# exit 1
|
||||
# fi
|
||||
|
||||
# # ensure sed is installed
|
||||
# if command -v sed &> /dev/null; then
|
||||
# echo '[X] sed is available in the path'
|
||||
# else
|
||||
# echo 'sed is not available in the path'
|
||||
# exit 1
|
||||
# fi
|
@ -9,6 +9,22 @@ fi
|
||||
|
||||
# run setup for veilid
|
||||
$VEILIDDIR/dev-setup/setup_macos.sh
|
||||
|
||||
# ensure packages are installed
|
||||
if [ "$BREW_USER" == "" ]; then
|
||||
if [ -d /opt/homebrew ]; then
|
||||
BREW_USER=`ls -lad /opt/homebrew/. | cut -d\ -f4`
|
||||
echo "Must sudo to homebrew user \"$BREW_USER\" to install capnp package:"
|
||||
elif [ -d /usr/local/Homebrew ]; then
|
||||
BREW_USER=`ls -lad /usr/local/Homebrew/. | cut -d\ -f4`
|
||||
echo "Must sudo to homebrew user \"$BREW_USER\" to install capnp package:"
|
||||
else
|
||||
echo "Homebrew is not installed in the normal place. Trying as current user"
|
||||
BREW_USER=`whoami`
|
||||
fi
|
||||
fi
|
||||
sudo -H -u $BREW_USER brew install protobuf
|
||||
|
||||
# run setup for veilid_flutter
|
||||
$VEILIDDIR/veilid-flutter/setup_flutter.sh
|
||||
|
||||
@ -28,19 +44,3 @@ else
|
||||
echo 'protoc-gen-dart is not available in the path. Add "$HOME/.pub-cache/bin" to your path.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# # ensure rsync is installed
|
||||
# if command -v rsync &> /dev/null; then
|
||||
# echo '[X] rsync is available in the path'
|
||||
# else
|
||||
# echo 'rsync is not available in the path'
|
||||
# exit 1
|
||||
# fi
|
||||
|
||||
# # ensure sed is installed
|
||||
# if command -v sed &> /dev/null; then
|
||||
# echo '[X] sed is available in the path'
|
||||
# else
|
||||
# echo 'sed is not available in the path'
|
||||
# exit 1
|
||||
# fi
|
26
dev-setup/setup_windows.bat
Normal file
26
dev-setup/setup_windows.bat
Normal file
@ -0,0 +1,26 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
REM #############################################
|
||||
|
||||
CALL ..\..\veilid\dev-setup\setup_windows.bat
|
||||
|
||||
PUSHD %~dp0\..
|
||||
SET VEILIDCHATDIR=%CD%
|
||||
POPD
|
||||
|
||||
IF NOT DEFINED ProgramFiles(x86) (
|
||||
echo This script requires a 64-bit Windows Installation. Exiting.
|
||||
goto end
|
||||
)
|
||||
|
||||
FOR %%X IN (protoc.exe) DO (SET PROTOC_FOUND=%%~$PATH:X)
|
||||
IF NOT DEFINED PROTOC_FOUND (
|
||||
echo protobuf compiler ^(protoc^) is required but it's not installed. Install protoc 23.2 or higher. Ensure it is in your path. Aborting.
|
||||
echo protoc is available here: https://github.com/protocolbuffers/protobuf/releases/download/v23.2/protoc-23.2-win64.zip
|
||||
goto end
|
||||
)
|
||||
|
||||
echo Setup successful
|
||||
:end
|
||||
ENDLOCAL
|
@ -5,7 +5,7 @@ source $SCRIPTDIR/_script_common
|
||||
pushd $SCRIPTDIR >/dev/null
|
||||
|
||||
# WASM output dir
|
||||
WASMDIR=$SCRIPTDIR/web/wasm
|
||||
WASMDIR=$VEILIDCHATDIR/web/wasm
|
||||
|
||||
# Build veilid-wasm, passing any arguments here to the build script
|
||||
pushd $VEILIDDIR/veilid-wasm >/dev/null
|
Loading…
Reference in New Issue
Block a user