update generate_emu_config scripts to support Linux, it worked!
This commit is contained in:
parent
4a7fedecd0
commit
01b8259200
29
scripts/rebuild_linux.sh
Normal file
29
scripts/rebuild_linux.sh
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
|
venv=".env-linux"
|
||||||
|
out_dir="bin/linux"
|
||||||
|
build_temp_dir="build_tmp-linux"
|
||||||
|
tool_name="generate_emu_config"
|
||||||
|
main_file="generate_emu_config.py"
|
||||||
|
|
||||||
|
[[ -d "$out_dir" ]] && rm -r -f "$out_dir"
|
||||||
|
mkdir -p "$out_dir"
|
||||||
|
|
||||||
|
[[ -d "$build_temp_dir" ]] && rm -r -f "$build_temp_dir"
|
||||||
|
|
||||||
|
rm -f *.spec
|
||||||
|
|
||||||
|
chmod 777 "./$venv/bin/activate"
|
||||||
|
source "./$venv/bin/activate"
|
||||||
|
|
||||||
|
pyinstaller "$main_file" --distpath "$out_dir" -y --clean --onedir --name "$tool_name" --noupx --console -i "NONE" --workpath "$build_temp_dir" --collect-submodules "steam" || exit 1
|
||||||
|
|
||||||
|
cp -f "steam_default_icon_locked.jpg" "$out_dir/$tool_name"
|
||||||
|
cp -f "steam_default_icon_unlocked.jpg" "$out_dir/$tool_name"
|
||||||
|
|
||||||
|
echo;
|
||||||
|
echo =============
|
||||||
|
echo Built inside: "$out_dir/"
|
||||||
|
|
||||||
|
deactivate
|
@ -3,16 +3,19 @@
|
|||||||
setlocal
|
setlocal
|
||||||
pushd "%~dp0"
|
pushd "%~dp0"
|
||||||
|
|
||||||
set "venv=.env"
|
set "venv=.env-win"
|
||||||
set "out_dir=bin"
|
set "out_dir=bin\win"
|
||||||
set "build_temp_dir=build_tmp"
|
set "build_temp_dir=build_tmp-win"
|
||||||
set "tool_name=generate_emu_config"
|
set "tool_name=generate_emu_config"
|
||||||
set "icon_file=icon\Froyoshark-Enkel-Steam.ico"
|
set "icon_file=icon\Froyoshark-Enkel-Steam.ico"
|
||||||
set "main_file=generate_emu_config.py"
|
set "main_file=generate_emu_config.py"
|
||||||
|
|
||||||
|
set /a last_code=0
|
||||||
|
|
||||||
if exist "%out_dir%" (
|
if exist "%out_dir%" (
|
||||||
rmdir /s /q "%out_dir%"
|
rmdir /s /q "%out_dir%"
|
||||||
)
|
)
|
||||||
|
mkdir "%out_dir%"
|
||||||
|
|
||||||
if exist "%build_temp_dir%" (
|
if exist "%build_temp_dir%" (
|
||||||
rmdir /s /q "%build_temp_dir%"
|
rmdir /s /q "%build_temp_dir%"
|
||||||
@ -22,7 +25,10 @@ del /f /q "*.spec"
|
|||||||
|
|
||||||
call "%venv%\Scripts\activate.bat"
|
call "%venv%\Scripts\activate.bat"
|
||||||
|
|
||||||
pyinstaller "%main_file%" --distpath "%out_dir%" -y --clean --onedir --name "%tool_name%" --noupx --console -i "%icon_file%" --workpath "%build_temp_dir%" --collect-submodules "steam"
|
pyinstaller "%main_file%" --distpath "%out_dir%" -y --clean --onedir --name "%tool_name%" --noupx --console -i "%icon_file%" --workpath "%build_temp_dir%" --collect-submodules "steam" || (
|
||||||
|
set /a last_code=1
|
||||||
|
goto :script_end
|
||||||
|
)
|
||||||
|
|
||||||
copy /y "steam_default_icon_locked.jpg" "%out_dir%\%tool_name%\"
|
copy /y "steam_default_icon_locked.jpg" "%out_dir%\%tool_name%\"
|
||||||
copy /y "steam_default_icon_unlocked.jpg" "%out_dir%\%tool_name%\"
|
copy /y "steam_default_icon_unlocked.jpg" "%out_dir%\%tool_name%\"
|
||||||
@ -33,5 +39,6 @@ echo Built inside : "%out_dir%\"
|
|||||||
|
|
||||||
:script_end
|
:script_end
|
||||||
popd
|
popd
|
||||||
endlocal
|
endlocal & (
|
||||||
|
exit /b %last_code%
|
||||||
|
)
|
29
scripts/recreate_venv_linux.sh
Normal file
29
scripts/recreate_venv_linux.sh
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
|
echo "Please run as root" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
venv=".env-linux"
|
||||||
|
reqs_file="requirements.txt"
|
||||||
|
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
|
apt update || exit 1
|
||||||
|
apt install "python3.10" -y || exit 1
|
||||||
|
apt install "python3.10-venv" -y || exit 1
|
||||||
|
|
||||||
|
[[ -d "$script_dir/$venv" ]] && rm -r -f "$script_dir/$venv"
|
||||||
|
|
||||||
|
python3.10 -m venv "$script_dir/$venv" || exit 1
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
chmod 777 "$script_dir/$venv/bin/activate"
|
||||||
|
source "$script_dir/$venv/bin/activate"
|
||||||
|
|
||||||
|
pip install -r "$script_dir/$reqs_file"
|
||||||
|
exit_code=$?
|
||||||
|
|
||||||
|
deactivate
|
||||||
|
exit $exit_code
|
@ -2,14 +2,18 @@
|
|||||||
|
|
||||||
cd /d "%~dp0"
|
cd /d "%~dp0"
|
||||||
|
|
||||||
set "venv=.env"
|
set "venv=.env-win"
|
||||||
set "reqs_file=requirements.txt"
|
set "reqs_file=requirements.txt"
|
||||||
|
|
||||||
if exist "%venv%" (
|
if exist "%venv%" (
|
||||||
rmdir /s /q "%venv%"
|
rmdir /s /q "%venv%"
|
||||||
)
|
)
|
||||||
|
|
||||||
python -m venv "%venv%"
|
python -m venv "%venv%" || exit /b 1
|
||||||
timeout /t 1 /nobreak
|
timeout /t 1 /nobreak
|
||||||
call "%venv%\Scripts\activate.bat"
|
call "%venv%\Scripts\activate.bat"
|
||||||
pip install -r "%reqs_file%"
|
pip install -r "%reqs_file%"
|
||||||
|
set /a exit_code=errorlevel
|
||||||
|
|
||||||
|
call "%venv%\Scripts\deactivate.bat"
|
||||||
|
exit /b %exit_code%
|
Loading…
x
Reference in New Issue
Block a user