Files
turkanime-gui/docs/build-win.bat
Barış Keser c7c26b2ba8 fix(belge): olculdugunde yanlis cikan iddialar duzeltildi; site surum notunu artik bulabiliyor
Surum oncesi denetimin kalan bulgulari. Hepsi olculerek dogrulandi.

SITE SURUM NOTUNU HIC GOSTERMEYECEKTI. `docs/index.html` sürüm notu dosyasını
`V10.0.0.md` olarak SABIT kodluyordu. Yani `docs/V10.1.0.md` depoda dursa da
indirme sitesinde hicbir zaman gorunmeyecekti — ve her yeni surumde ayni sey
tekrarlanacakti. Ad artik `version.json`den turetiliyor; o dosyayi yayin akisi
zaten her etikette guncelliyor. Yerelde tarayicida dogrulandi: `version.json`
10.1.0 iken sayfa `V10.1.0.md`yi cozup icerigi yukluyor, `version.json`
okunamadiginda `V10.0.0.md` yedegine dusuyor (bos bolum gostermektense var
oldugu kesin bir belgeyi gostermek daha iyi).

OLCULUP YANLIS CIKAN IDDIALAR:

  * "pip ile kurulan surumde cloudscraper gelmez, CF zinciri 5 yerine 4
    kademe" -> `cloudscraper` HEM `pyproject.toml:52` HEM `requirements.txt:10`
    icinde ZORUNLU bagimlilik. Her kurulum bicimi bes kademenin tamamini
    tasiyor. Iddia yanlis olmakla kalmiyor, kullaniciyi gereksiz yere hazir
    pakete yonlendiriyordu.
  * "723 otomatik test" -> gercek sayi 992. Sayi sessizce eskimis.
  * "PyYAML yoksa 15 test calismaz" -> dosyada 20 test fonksiyonu var ve
    parametreli olanlarla daha fazlasina cikiyor. Sayidan vazgecildi; sayi
    tutmak zorunda olan her cumle eskimeye mahkum.

KENDI KODUNU YALANLAYAN YORUMLAR: `turkanime-gui.spec`in bas yorumu "bu spec
onedir uretir" diyordu — ayni dosyanin 187. satirindaki varsayilan onefile.
`gui/README.md` ve `docs/build-win.bat` de onedir cikti yolu tarif ediyordu.
Ucu de duzeltildi ve olculen bedel (acilis ~9 sn, CF duvari basina ~9 sn,
zorla sonlandirmada ~550 MB artik) yazildi.

`tests/test_belge_esligi.py`ye iki kapi eklendi: README'nin verdigi test
sayisi gercekten toplanandan FAZLA olamaz (esitlik degil ust sinir — test
eklemek testi kirmasin, olduğundan cok gostermek kirsin) ve cloudscraper
zorunlu bagimlilik oldugu surece "pip'te gelmez" yazamaz.

992 test gecti, pylint -E temiz.
2026-08-16 12:13:36 +03:00

132 lines
5.4 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
REM Pure-Batch Windows build helper (no PowerShell)
REM Hem GUI (turkanime-gui.spec, onedir) hem CLI (tek dosya exe) derler.
REM DEPO KOKUNDEN calistirin: docs\build-win.bat
REM (spec, gereksinimler.json ve docs\TurkAnime.ico yollari koke gore.)
echo Preparing build environment...
if not exist bin mkdir bin
echo Downloading 7zr (7-Zip) ...
curl -L -o 7zr.exe https://www.7-zip.org/a/7zr.exe || (
echo Failed to download 7zr.exe & pause & exit /b 1
)
echo Downloading yt-dlp...
curl -L -o bin\yt-dlp.exe "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe" || echo warn: yt-dlp download failed
echo Downloading aria2...
curl -L -o aria2.zip "https://github.com/aria2/aria2/releases/download/release-1.37.0/aria2-1.37.0-win-64bit-build1.zip" || (echo Failed to download aria2.zip & pause & exit /b 1)
echo Extracting aria2...
7zr.exe x aria2.zip -otmp_aria2 -y >nul 2>&1 || (
echo 7z extraction failed, trying PowerShell Expand-Archive...
powershell -NoProfile -Command "Expand-Archive -LiteralPath 'aria2.zip' -DestinationPath 'tmp_aria2' -Force" >nul 2>&1 || (
echo Failed to extract aria2.zip & pause & exit /b 1
)
)
echo Copying aria2 binaries to bin\ ...
set "ARIA2_DIR="
for /r tmp_aria2 %%f in (aria2c.exe) do (
set "ARIA2_DIR=%%~dpf"
goto :after_aria2_find
)
:after_aria2_find
if not defined ARIA2_DIR (
echo aria2c.exe not found in extracted archive & pause & exit /b 1
) else (
xcopy /E /I "%ARIA2_DIR%*" bin\ >nul 2>&1 || echo warn: aria2 copy failed
)
echo Downloading mpv (may be large)...
curl -L -o mpv.7z "https://sourceforge.net/projects/mpv-player-windows/files/64bit/mpv-x86_64-20231231-git-abc2a74.7z/download" || (echo Failed to download mpv.7z & pause & exit /b 1)
echo Extracting mpv...
7zr.exe x mpv.7z -obin -y >nul 2>&1 || (echo Failed to extract mpv.7z & pause & exit /b 1)
echo Locating mpv.exe...
set "MPV_FOUND="
for /r bin %%f in (mpv.exe) do (
set "MPV_FOUND=%%~f"
goto :after_mpv_find
)
:after_mpv_find
if not defined MPV_FOUND (
echo mpv.exe not found after extraction & pause & exit /b 1
) else (
echo mpv found at %MPV_FOUND%
)
echo Downloading ffmpeg...
curl -L -o ffmpeg.zip "https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip" || (echo Failed to download ffmpeg.zip & pause & exit /b 1)
echo Extracting ffmpeg...
7zr.exe x ffmpeg.zip -otmp_ffmpeg -y >nul 2>&1 || (
echo 7z extraction failed, trying PowerShell Expand-Archive...
powershell -NoProfile -Command "Expand-Archive -LiteralPath 'ffmpeg.zip' -DestinationPath 'tmp_ffmpeg' -Force" >nul 2>&1 || (
echo Failed to extract ffmpeg.zip & pause & exit /b 1
)
)
echo Locating ffmpeg.exe...
set "FFMPEG_FOUND="
for /r tmp_ffmpeg %%f in (ffmpeg.exe) do (
set "FFMPEG_FOUND=%%~f"
goto :after_ffmpeg_find
)
:after_ffmpeg_find
if not defined FFMPEG_FOUND (
echo ffmpeg.exe not found after extraction & pause & exit /b 1
) else (
echo Copying ffmpeg to bin\
copy /Y "%FFMPEG_FOUND%" bin\ >nul
)
for /r tmp_ffmpeg %%g in (ffprobe.exe) do (
copy /Y "%%~g" bin\ >nul
goto :after_ffprobe_copy
)
:after_ffprobe_copy
echo Embedded runtime prepared.
echo Installing python deps and building GUI with PyInstaller...
python -m pip install --upgrade pip || (echo pip upgrade failed & pause & exit /b 1)
pip install -r requirements-gui.txt || echo warn: requirements-gui install failed
pip install pyinstaller || echo warn: pyinstaller install failed
:: Faz 9: eski pyinstaller.spec (CustomTkinter) silindi. Tek GUI spec'i bu.
:: Faz 10: spec adi turkanime-qt.spec -> turkanime-gui.spec olarak degisti.
:: Varsayilan ONEFILE -> dist\turkanime-gui.exe (tek dosya, _internal yok).
:: TURKANIME_ONEFILE=0 ile onedir'e doner -> dist\turkanime-gui\
python -m PyInstaller turkanime-gui.spec --noconfirm || echo warn: PyInstaller GUI build failed
echo Building CLI (Windows)...
python -m pip install --upgrade pip
pip install -r requirements.txt || echo warn: requirements install failed
pip install pyinstaller pyinstaller_versionfile || echo warn: pyinstaller_versionfile install failed
echo Generating version_generator.py
>version_generator.py echo import pyinstaller_versionfile
>>version_generator.py echo from turkanime_api.cli.version import __version__
>>version_generator.py echo.
>>version_generator.py echo pyinstaller_versionfile.create_versionfile(
>>version_generator.py echo output_file='versionfile.txt',
>>version_generator.py echo version=__version__,
>>version_generator.py echo company_name='TurkAnime Dev',
>>version_generator.py echo file_description='Anime İndirici ^& Oynatıcı',
>>version_generator.py echo internal_name='TurkAnime',
>>version_generator.py echo legal_copyright='© Barkeser2002, All rights reserved.',
>>version_generator.py echo original_filename='TurkAnime.exe',
>>version_generator.py echo product_name='TurkAnime İndirici'
>>version_generator.py echo )
echo Generating compiled.py
>compiled.py echo from turkanime_api.cli.__main__ import main
>>compiled.py echo if __name__ == "__main__":
>>compiled.py echo main()
echo Running PyInstaller for CLI
pyinstaller --noconfirm --onefile --console --icon "docs\TurkAnime.ico" --name "TurkAnime" --version-file versionfile.txt --hidden-import yt_dlp --hidden-import curl_cffi --hidden-import Crypto --add-data "gereksinimler.json;." compiled.py || echo warn: PyInstaller CLI build failed
echo Build complete. Artifacts are in the dist\ directory.
ENDLOCAL
pause