Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Remove now unused .cmd packaging scripts for Windows

Dmitry Kazakovdd6299cdfd99
diff --git a/build-tools/ci-scripts/sign-windows-package-at-notary-service.cmd b/build-tools/ci-scripts/sign-windows-package-at-notary-service.cmd
deleted file mode 100644
index 4394f81ce4..0000000000
--- a/build-tools/ci-scripts/sign-windows-package-at-notary-service.cmd
+++ /dev/null
@@ -1,27 +0,0 @@
-@echo off
-setlocal enableextensions enabledelayedexpansion
-
-set pkg_root=%~f1
-
-echo Signing binaries in "%pkg_root%"
-if not exist "%pkg_root%\" (
- echo ERROR: No packaging dir %pkg_root% 1>&2
- exit /b 1
-)
-
-if not exist "%KRITACI_WINDOWS_SIGN_CONFIG%\" (
- echo ERROR: No signing config file found: %KRITACI_WINDOWS_SIGN_CONFIG% 1>&2
- exit /b 1
-)
-
-if exist files-to-sign.txt (
- del /F files-to-sign.txt
-)
-
-for /r "%pkg_root%\" %%F in (*.exe *.com *.dll *.pyd) do (
- echo %%F >> files-to-sign.txt
-)
-
-python.exe -u ci-notary-service/signwindowsbinaries.py --config %KRITACI_WINDOWS_SIGN_CONFIG% --files-from files-to-sign.txt
-
-endlocal
diff --git a/build-tools/windows/build-msvc.cmd b/build-tools/windows/build-msvc.cmd
deleted file mode 100644
index 08c5706cfd..0000000000
--- a/build-tools/windows/build-msvc.cmd
+++ /dev/null
@@ -1,1067 +0,0 @@
-@echo off
-
-setlocal enabledelayedexpansion
-goto begin
-
-
-:: Subroutines
-
-:find_on_path out_variable file_name
-set %1=%~f$PATH:2
-goto :EOF
-
-
-:get_dir_path out_variable file_path
-set %1=%~dp2
-goto :EOF
-
-
-:get_full_path out_variable file_path
-setlocal
-set FULL_PATH=%~f2
-if not exist "%FULL_PATH%" (
- set FULL_PATH=
-) else (
- if exist "%FULL_PATH%\" (
- set FULL_PATH=
- )
-)
-endlocal & set "%1=%FULL_PATH%"
-goto :EOF
-
-
-:get_full_path_dir out_variable file_path
-setlocal
-set FULL_PATH=%~dp2
-if not exist "%FULL_PATH%" (
- set FULL_PATH=
-)
-endlocal & set "%1=%FULL_PATH%"
-goto :EOF
-
-
-:prompt_for_string out_variable prompt
-set /p %1=%~2^>
-goto :EOF
-
-
-:prompt_for_positive_integer out_variable prompt
-setlocal
-call :prompt_for_string USER_INPUT "%~2"
-if "%USER_INPUT%" == "" set USER_INPUT=0
-set /a RESULT=%USER_INPUT%
-if not %RESULT% GTR 0 (
- set RESULT=
-)
-endlocal & set "%1=%RESULT%"
-goto :EOF
-
-
-:prompt_for_file out_variable prompt
-setlocal
-:prompt_for_file__retry
-call :prompt_for_string USER_INPUT "%~2"
-if "%USER_INPUT%" == "" (
- endlocal
- set %1=
- goto :EOF
-)
-call :get_full_path RESULT "%USER_INPUT%"
-if "%RESULT%" == "" (
- echo Input does not point to valid file!
- set USER_INPUT=
- goto prompt_for_file__retry
-)
-endlocal & set "%1=%RESULT%"
-goto :EOF
-
-
-:prompt_for_dir out_variable prompt
-setlocal
-:prompt_for_dir__retry
-call :prompt_for_string USER_INPUT "%~2"
-if "%USER_INPUT%" == "" (
- endlocal
- set %1=
- goto :EOF
-)
-call :get_full_path_dir RESULT "%USER_INPUT%\"
-if "%RESULT%" == "" (
- echo Input does not point to valid dir!
- set USER_INPUT=
- goto prompt_for_dir__retry
-)
-endlocal & set "%1=%RESULT%"
-goto :EOF
-
-
-:has_target out_variable folder
-setlocal
-set RESULT=
-if exist "%~2" (
- set RESULT=1
-)
-endlocal & set "%1=%RESULT%"
-goto :EOF
-
-:usage
-echo Usage:
-echo %~n0 [--no-interactive] [ OPTIONS ... ]
-echo.
-echo Basic options:
-echo --no-interactive Run without interactive prompts
-echo When not specified, the script will prompt
-echo for some of the parameters.
-echo --jobs ^<count^> Set parallel jobs count when building
-echo Defaults to no. of logical cores
-echo --skip-deps Skips (re)building of deps
-echo --skip-krita Skips (re)building of Krita
-echo --cmd Launch a cmd prompt instead of building.
-echo The environment is set up like the build
-echo environment with some helper command macros.
-echo --dev Activate developer options, like 'CodeBlocks'
-echo generator and BUILD_TESTING
-echo.
-echo Path options:
-echo --src-dir ^<dir_path^> Specify Krita source dir
-echo If unspecified, this will be determined from
-echo the script location.
-echo --download-dir ^<dir_path^> Specify deps download dir
-echo Can be omitted if --skip-deps is used
-echo --deps-build-dir ^<dir_path^> Specify deps build dir
-echo Can be omitted if --skip-deps is used
-echo --deps-install-dir ^<dir_path^> Specify deps install dir
-echo --krita-build-dir ^<dir_path^> Specify Krita build dir
-echo Can be omitted if --skip-krita is used
-echo --krita-install-dir ^<dir_path^> Specify Krita install dir
-echo Can be omitted if --skip-krita is used
-echo.
-goto :EOF
-:usage_and_exit
-call :usage
-exit /b
-:usage_and_fail
-call :usage
-exit /b 100
-
-
-:: ----------------------------
-:begin
-
-echo Krita build script for Windows
-echo.
-
-
-:: command-line args parsing
-set ARG_NO_INTERACTIVE=
-set ARG_JOBS=
-set ARG_SKIP_DEPS=
-set ARG_SKIP_KRITA=
-set ARG_SRC_DIR=
-set ARG_DOWNLOAD_DIR=
-set ARG_DEPS_BUILD_DIR=
-set ARG_DEPS_INSTALL_DIR=
-set ARG_KRITA_BUILD_DIR=
-set ARG_KRITA_INSTALL_DIR=
-set ARG_PLUGINS_BUILD_DIR=
-set ARG_CMD=
-set ARG_DEV=
-:args_parsing_loop
-set CURRENT_MATCHED=
-if not "%1" == "" (
- if "%1" == "--no-interactive" (
- set ARG_NO_INTERACTIVE=1
- set CURRENT_MATCHED=1
- )
- if "%1" == "--jobs" (
- if not "%ARG_JOBS%" == "" (
- echo ERROR: Arg --jobs specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- set /a "ARG_JOBS=%2"
- if not !ARG_JOBS! GTR 0 (
- echo ERROR: Arg --jobs is not a positive integer 1>&2
- echo.
- goto usage_and_fail
- )
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--skip-deps" (
- set ARG_SKIP_DEPS=1
- set CURRENT_MATCHED=1
- )
- if "%1" == "--skip-krita" (
- set ARG_SKIP_KRITA=1
- set CURRENT_MATCHED=1
- )
- if "%1" == "--dev" (
- set ARG_DEV=1
- set CURRENT_MATCHED=1
- )
- if "%1" == "--src-dir" (
- if not "%ARG_SRC_DIR%" == "" (
- echo ERROR: Arg --src-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if not exist "%~f2\" (
- echo ERROR: Arg --src-dir does not point to a directory 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_SRC_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--download-dir" (
- if not "%ARG_DOWNLOAD_DIR%" == "" (
- echo ERROR: Arg --download-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --download-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_DOWNLOAD_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--deps-build-dir" (
- if not "%ARG_DEPS_BUILD_DIR%" == "" (
- echo ERROR: Arg --deps-build-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --deps-build-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_DEPS_BUILD_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--deps-install-dir" (
- if not "%ARG_DEPS_INSTALL_DIR%" == "" (
- echo ERROR: Arg --deps-install-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --deps-install-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_DEPS_INSTALL_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--krita-build-dir" (
- if not "%ARG_KRITA_BUILD_DIR%" == "" (
- echo ERROR: Arg --krita-build-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --krita-build-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_KRITA_BUILD_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--krita-install-dir" (
- if not "%ARG_KRITA_INSTALL_DIR%" == "" (
- echo ERROR: Arg --krita-install-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --krita-install-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_KRITA_INSTALL_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--plugins-build-dir" (
- if not "%ARG_PLUGINS_BUILD_DIR%" == "" (
- echo ERROR: Arg --plugins-build-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --plugins-build-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_PLUGINS_BUILD_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--cmd" (
- set ARG_CMD=1
- set CURRENT_MATCHED=1
- )
- if "%1" == "--help" (
- goto usage_and_exit
- )
- if not "!CURRENT_MATCHED!" == "1" (
- echo ERROR: Unknown option %1 1>&2
- echo.
- goto usage_and_fail
- )
- shift /1
- goto args_parsing_loop
-)
-
-if "%ARG_NO_INTERACTIVE%" == "1" (
- echo Non-interactive mode
-) else (
- echo Interactive mode
- :: Trick to pause on exit
- call :real_begin
- pause
- exit /b !ERRORLEVEL!
-)
-:real_begin
-echo.
-
-
-if "%ARG_SKIP_DEPS%" == "1" (
- if "%ARG_SKIP_KRITA%" == "1" (
- echo Both deps and Krita will be skipped.
- ) else (
- echo Building of deps will be skipped.
- )
-) else (
- if "%ARG_SKIP_KRITA%" == "1" (
- echo Building of Krita will be skipped.
- ) else (
- echo Both deps and Krita will be built.
- )
-)
-
-
-:: Check environment config
-
-if "%CMAKE_EXE%" == "" (
- call :find_on_path CMAKE_EXE cmake.exe
- if "!CMAKE_EXE!" == "" (
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- call :prompt_for_file CMAKE_EXE "Provide path to cmake.exe"
- )
- if "!CMAKE_EXE!" == "" (
- echo ERROR: CMake not found! 1>&2
- exit /b 102
- )
- call :get_dir_path CMAKE_BIN_DIR "!CMAKE_EXE!"
- ) else (
- echo Found CMake on PATH: !CMAKE_EXE!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this correct? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_file CMAKE_EXE "Provide path to cmake.exe"
- if "!CMAKE_EXE!" == "" (
- echo ERROR: CMake not found! 1>&2
- exit /b 102
- )
- call :get_dir_path CMAKE_BIN_DIR "!CMAKE_EXE!"
- )
- )
- call :get_dir_path CMAKE_BIN_DIR "!CMAKE_EXE!"
- )
-)
-echo CMake: %CMAKE_BIN_DIR%
-
-if "%SEVENZIP_EXE%" == "" (
- call :find_on_path SEVENZIP_EXE 7z.exe
- if "!SEVENZIP_EXE!" == "" (
- set "SEVENZIP_EXE=%ProgramFiles%\7-Zip\7z.exe"
- if "!SEVENZIP_EXE!" == "" (
- set "SEVENZIP_EXE=%ProgramFiles(x86)%\7-Zip\7z.exe"
- )
- if "!SEVENZIP_EXE!" == "" (
- echo 7-Zip not found
- )
- )
-)
-if "%SEVENZIP_EXE%" == "" (
- echo 7-Zip: %SEVENZIP_EXE%
-)
-
-if "%PYTHON_BIN_DIR%" == "" (
- call :find_on_path PYTHON_BIN_DIR_PYTHON_EXE python.exe
- if "!PYTHON_BIN_DIR_PYTHON_EXE!" == "" (
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- call :prompt_for_file PYTHON_BIN_DIR_PYTHON_EXE "Provide path to python.exe of Python 3.6.2"
- )
- if "!PYTHON_BIN_DIR_PYTHON_EXE!" == "" (
- echo ERROR: Python not found! 1>&2
- exit /b 102
- )
- call :get_dir_path PYTHON_BIN_DIR "!PYTHON_BIN_DIR_PYTHON_EXE!"
- ) else (
- call :get_dir_path PYTHON_BIN_DIR "!PYTHON_BIN_DIR_PYTHON_EXE!"
- echo Found Python on PATH: !PYTHON_BIN_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this correct? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_file PYTHON_BIN_DIR_PYTHON_EXE "Provide path to python.exe of Python 3.6.2"
- if "!PYTHON_BIN_DIR_PYTHON_EXE!" == "" (
- echo ERROR: Python not found! 1>&2
- exit /b 102
- )
- call :get_dir_path PYTHON_BIN_DIR "!PYTHON_BIN_DIR_PYTHON_EXE!"
- )
- )
- )
-)
-echo Python: %PYTHON_BIN_DIR%
-
-@REM Translation tools
-
-if "%KRITA_GIT_DIR%" == "" (
- call :find_on_path KRITA_GIT_EXE_DIR git.exe
- if NOT "!KRITA_GIT_EXE_DIR!" == "" (
- call :get_dir_path KRITA_GIT_DIR "!KRITA_GIT_EXE_DIR!"
- echo Found Git on PATH: !KRITA_GIT_DIR!
- )
-) else echo Git found on %KRITA_GIT_DIR%
-
-if "%KRITA_NINJA_DIR%" == "" (
- call :find_on_path KRITA_NINJA_EXE_DIR ninja.exe
- if NOT "!KRITA_NINJA_EXE_DIR!" == "" (
- call :get_dir_path KRITA_NINJA_DIR "!KRITA_NINJA_EXE_DIR!"
- echo Found Ninja on PATH: !KRITA_NINJA_DIR!
- )
-) else echo Ninja found on %KRITA_NINJA_DIR%
-
-if "%SVN_DIR%" == "" (
- call :find_on_path SVN_EXE_DIR svn.exe
- if NOT "!SVN_EXE_DIR!" == "" (
- call :get_dir_path SVN_DIR "!SVN_EXE_DIR!"
- echo Found SVN on PATH: !SVN_DIR!
- )
-) else echo SVN found on %SVN_DIR%
-
-if "%PERL_DIR%" == "" (
- call :find_on_path PERL_EXE_DIR perl.exe
- if NOT "!PERL_EXE_DIR!" == "" (
- call :get_dir_path PERL_DIR "!PERL_EXE_DIR!"
- echo Found Perl on PATH: !PERL_DIR!
- )
-) else echo Perl found on %PERL_DIR%
-
-if "%ARG_SKIP_DEPS%" == "1" goto skip_windows_sdk_dir_check
-
-if "%WindowsSdkDir%" == "" if not "%ProgramFiles(x86)%" == "" set "WindowsSdkDir=%ProgramFiles(x86)%\Windows Kits\10"
-if "%WindowsSdkDir%" == "" set "WindowsSdkDir=%ProgramFiles(x86)%\Windows Kits\10"
-if exist "%WindowsSdkDir%\" (
- pushd "%WindowsSdkDir%"
- if exist "bin\x64\fxc.exe" (
- set HAVE_FXC_EXE=1
- if "%WindowsSdkVerBinPath%" == "" set "WindowsSdkVerBinPath=%WindowsSdkDir%"
- ) else (
- for /f "delims=" %%a in ('dir /a:d /b "bin\10.*"') do (
- if exist "bin\%%a\x64\fxc.exe" (
- set HAVE_FXC_EXE=1
- if "%WindowsSdkVerBinPath%" == "" set "WindowsSdkVerBinPath=%WindowsSdkDir%\bin\%%a\"
- )
- )
- )
- popd
-)
-set QT_ENABLE_DYNAMIC_OPENGL=ON
-if not "%HAVE_FXC_EXE%" == "1" (
- set WindowsSdkDir=
- echo Windows SDK 10 with fxc.exe not found
- echo Qt will *not* be built with ANGLE ^(dynamic OpenGL^) support.
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- exit /b 102
- )
- )
- set QT_ENABLE_DYNAMIC_OPENGL=OFF
-) else echo Windows SDK 10 with fxc.exe found on %WindowsSdkDir%
-
-:skip_windows_sdk_dir_check
-
-if not "%ARG_JOBS%" == "" (
- set "PARALLEL_JOBS=%ARG_JOBS%"
- set "UseMultiToolTask=true"
- set "EnforceProcessCountAcrossBuilds=true"
-)
-if "%PARALLEL_JOBS%" == "" (
- echo Number of logical CPU cores detected: %NUMBER_OF_PROCESSORS%
- echo Enabling %NUMBER_OF_PROCESSORS% parallel jobs
- set PARALLEL_JOBS=%NUMBER_OF_PROCESSORS%
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this correct? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_positive_integer PARALLEL_JOBS "Provide no. of parallel jobs"
- if "!PARALLEL_JOBS!" == "" (
- echo ERROR: Invalid job count! 1>&2
- exit /b 102
- )
- )
- )
- set "UseMultiToolTask=true"
- set "EnforceProcessCountAcrossBuilds=true"
-)
-set "MultiProcMaxCount=%PARALLEL_JOBS%"
-echo Parallel jobs count: %PARALLEL_JOBS% (MultiProcMaxCount=%MultiProcMaxCount%)
-
-if not "%ARG_SRC_DIR%" == "" (
- set "KRITA_SRC_DIR=%ARG_SRC_DIR%"
-)
-if "%KRITA_SRC_DIR%" == "" (
- :: Check whether this looks like to be in the source tree
- set "_temp=%~dp0"
- if "!_temp:~-21!" == "\build-tools\windows\" (
- if exist "!_temp:~0,-21!\CMakeLists.txt" (
- if exist "!_temp:~0,-21!\3rdparty\CMakeLists.txt" (
- set "KRITA_SRC_DIR=!_temp:~0,-21!\"
- echo Script is running inside Krita src dir
- )
- )
- )
-)
-if "%KRITA_SRC_DIR%" == "" (
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- call :prompt_for_dir KRITA_SRC_DIR "Provide path of Krita src dir"
- )
- if "!KRITA_SRC_DIR!" == "" (
- echo ERROR: Krita src dir not found! 1>&2
- exit /b 102
- )
-)
-echo Krita src: %KRITA_SRC_DIR%
-
-if "%ARG_SKIP_DEPS%" == "1" goto skip_deps_args_check
-
-if not "%ARG_DOWNLOAD_DIR%" == "" (
- set "DEPS_DOWNLOAD_DIR=%ARG_DOWNLOAD_DIR%"
-)
-if "%DEPS_DOWNLOAD_DIR%" == "" (
- set DEPS_DOWNLOAD_DIR=%CD%\d\
- echo Using default deps download dir: !DEPS_DOWNLOAD_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir DEPS_DOWNLOAD_DIR "Provide path of depps download dir"
- )
- )
- if "!DEPS_DOWNLOAD_DIR!" == "" (
- echo ERROR: Deps download dir not set! 1>&2
- exit /b 102
- )
-)
-echo Deps download dir: %DEPS_DOWNLOAD_DIR%
-
-if not "%ARG_DEPS_BUILD_DIR%" == "" (
- set "DEPS_BUILD_DIR=%ARG_DEPS_BUILD_DIR%"
-)
-if "%DEPS_BUILD_DIR%" == "" (
- set DEPS_BUILD_DIR=%CD%\b_deps\
- echo Using default deps build dir: !DEPS_BUILD_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir DEPS_BUILD_DIR "Provide path of deps build dir"
- )
- )
- if "!DEPS_BUILD_DIR!" == "" (
- echo ERROR: Deps build dir not set! 1>&2
- exit /b 102
- )
-)
-echo Deps build dir: %DEPS_BUILD_DIR%
-
-:skip_deps_args_check
-
-if not "%ARG_DEPS_INSTALL_DIR%" == "" (
- set "DEPS_INSTALL_DIR=%ARG_DEPS_INSTALL_DIR%"
-)
-if "%DEPS_INSTALL_DIR%" == "" (
- set DEPS_INSTALL_DIR=%CD%\i_deps\
- echo Using default deps install dir: !DEPS_INSTALL_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir DEPS_INSTALL_DIR "Provide path of deps install dir"
- )
- )
- if "!DEPS_INSTALL_DIR!" == "" (
- echo ERROR: Deps install dir not set! 1>&2
- exit /b 102
- )
-)
-echo Deps install dir: %DEPS_INSTALL_DIR%
-
-if "%ARG_SKIP_KRITA%" == "1" goto skip_krita_args_check
-
-if not "%ARG_KRITA_BUILD_DIR%" == "" (
- set "KRITA_BUILD_DIR=%ARG_KRITA_BUILD_DIR%"
-)
-if "%KRITA_BUILD_DIR%" == "" (
- set KRITA_BUILD_DIR=%CD%\b\
- echo Using default Krita build dir: !KRITA_BUILD_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir KRITA_BUILD_DIR "Provide path of Krita build dir"
- )
- )
- if "!KRITA_BUILD_DIR!" == "" (
- echo ERROR: Krita build dir not set! 1>&2
- exit /b 102
- )
-)
-echo Krita build dir: %KRITA_BUILD_DIR%
-
-@REM Plugins also need the download dir
-if not "%ARG_DOWNLOAD_DIR%" == "" (
- set "PLUGINS_DOWNLOAD_DIR=%ARG_DOWNLOAD_DIR%"
-)
-if "%PLUGINS_DOWNLOAD_DIR%" == "" (
- set PLUGINS_DOWNLOAD_DIR=%CD%\d\
- echo Using default deps download dir: !PLUGINS_DOWNLOAD_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir PLUGINS_DOWNLOAD_DIR "Provide path of plugins download dir"
- )
- )
- if "!PLUGINS_DOWNLOAD_DIR!" == "" (
- echo ERROR: Plugins download dir not set! 1>&2
- exit /b 102
- )
-)
-echo Plugins download dir: %PLUGINS_DOWNLOAD_DIR%
-
-if not "%ARG_PLUGINS_BUILD_DIR%" == "" (
- set "PLUGINS_BUILD_DIR=%ARG_PLUGINS_BUILD_DIR%"
-)
-if "%PLUGINS_BUILD_DIR%" == "" (
- set PLUGINS_BUILD_DIR=%CD%\b_plugins\
- echo Using default plugins build dir: !PLUGINS_BUILD_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir PLUGINS_BUILD_DIR "Provide path of plugins build dir"
- )
- )
- if "!PLUGINS_BUILD_DIR!" == "" (
- echo ERROR: Plugins build dir not set! 1>&2
- exit /b 102
- )
-)
-echo Plugins build dir: %PLUGINS_BUILD_DIR%
-
-if not "%ARG_KRITA_INSTALL_DIR%" == "" (
- set "KRITA_INSTALL_DIR=%ARG_KRITA_INSTALL_DIR%"
-)
-if "%KRITA_INSTALL_DIR%" == "" (
- set KRITA_INSTALL_DIR=%CD%\i\
- echo Using default Krita install dir: !KRITA_INSTALL_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir KRITA_INSTALL_DIR "Provide path of Krita install dir"
- )
- )
- if "!KRITA_INSTALL_DIR!" == "" (
- echo ERROR: Krita install dir not set! 1>&2
- exit /b 102
- )
-)
-echo Krita install dir: %KRITA_INSTALL_DIR%
-
-:skip_krita_args_check
-
-echo.
-
-
-if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is the above ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- exit /b 1
- )
- echo.
-)
-
-:: Initialize clean PATH
-set PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
-:: Set PATH for calling Python scripts
-set PATH=%PYTHON_BIN_DIR%;%PATH%
-:: Set PATH for external tools (Meson/Ninja)
-if NOT "%KRITA_GIT_DIR%" == "" (
- set PATH=%PATH%;%KRITA_GIT_DIR%
-)
-if NOT "%KRITA_NINJA_DIR%" == "" (
- if NOT "%KRITA_NINJA_DIR%" == "%MINGW_BIN_DIR%" (
- set PATH=%PATH%;%KRITA_NINJA_DIR%
- )
-)
-if NOT "%SVN_DIR%" == "" (
- set PATH=%PATH%;%SVN_DIR%
-)
-if NOT "%CMAKE_BIN_DIR%" == "" (
- set PATH=%PATH%;%CMAKE_BIN_DIR%
-)
-
-echo Creating dirs...
-if NOT "%ARG_SKIP_DEPS%" == "1" (
- mkdir %DEPS_DOWNLOAD_DIR%
- if errorlevel 1 (
- if not exist "%DEPS_DOWNLOAD_DIR%\" (
- echo ERROR: Cannot create deps download dir! 1>&2
- exit /b 103
- )
- )
- mkdir %DEPS_BUILD_DIR%
- if errorlevel 1 (
- if not exist "%DEPS_BUILD_DIR%\" (
- echo ERROR: Cannot create deps build dir! 1>&2
- exit /b 103
- )
- )
- mkdir %DEPS_INSTALL_DIR%
- if errorlevel 1 (
- if not exist "%DEPS_INSTALL_DIR%\" (
- echo ERROR: Cannot create deps install dir! 1>&2
- exit /b 103
- )
- )
-)
-if NOT "%ARG_SKIP_KRITA%" == "1" (
- mkdir %KRITA_BUILD_DIR%
- if errorlevel 1 (
- if not exist "%KRITA_BUILD_DIR%\" (
- echo ERROR: Cannot create Krita build dir! 1>&2
- exit /b 103
- )
- )
- mkdir %PLUGINS_DOWNLOAD_DIR%
- if errorlevel 1 (
- if not exist "%PLUGINS_DOWNLOAD_DIR%\" (
- echo ERROR: Cannot create plugins download dir! 1>&2
- exit /b 103
- )
- )
- mkdir %PLUGINS_BUILD_DIR%
- if errorlevel 1 (
- if not exist "%PLUGINS_BUILD_DIR%\" (
- echo ERROR: Cannot create plugins build dir! 1>&2
- exit /b 103
- )
- )
- mkdir %KRITA_INSTALL_DIR%
- if errorlevel 1 (
- if not exist "%KRITA_INSTALL_DIR%\" (
- echo ERROR: Cannot create Krita install dir! 1>&2
- exit /b 103
- )
- )
-)
-
-echo.
-
-
-set CMAKE_BUILD_TYPE=RelWithDebInfo
-set QT_ENABLE_DEBUG_INFO=OFF
-
-set KRITA_GENERATOR=Visual Studio 17 2022
-set KRITA_BUILD_TESTING=OFF
-set KRITA_INSTALL_BENCHMARKS=OFF
-
-if "%ARG_DEV%" == "1" (
- set KRITA_BUILD_TESTING=ON
- set KRITA_INSTALL_BENCHMARKS=ON
-)
-
-if "%KRITA_BRANDING%" == "" (
- rem Check Jenkins job name
- if "%JOB_NAME%" == "Krita_Nightly_Windows_Build" (
- set KRITA_BRANDING=Next
- ) else (
- if "%JOB_NAME%" == "Krita_Stable_Windows_Build" (
- set KRITA_BRANDING=Plus
- )
- )
-)
-
-:: Paths for CMake
-set "BUILDDIR_DOWNLOAD_CMAKE=%DEPS_DOWNLOAD_DIR:\=/%"
-set "BUILDDIR_DOWNLOAD_CMAKE=%BUILDDIR_DOWNLOAD_CMAKE: =\ %"
-set "BUILDDIR_PLUGINS_DOWNLOAD_CMAKE=%PLUGINS_DOWNLOAD_DIR:\=/%"
-set "BUILDDIR_PLUGINS_DOWNLOAD_CMAKE=%BUILDDIR_PLUGINS_DOWNLOAD_CMAKE: =\ %"
-set "BUILDDIR_DEPS_INSTALL_CMAKE=%DEPS_INSTALL_DIR:\=/%"
-set "BUILDDIR_DEPS_INSTALL_CMAKE=%BUILDDIR_DEPS_INSTALL_CMAKE: =\ %"
-set "BUILDDIR_KRITA_INSTALL_CMAKE=%KRITA_INSTALL_DIR:\=/%"
-set "BUILDDIR_KRITA_INSTALL_CMAKE=%BUILDDIR_KRITA_INSTALL_CMAKE: =\ %"
-set "BUILDDIR_PLUGINS_INSTALL_CMAKE=%KRITA_INSTALL_DIR:\=/%"
-set "BUILDDIR_PLUGINS_INSTALL_CMAKE=%BUILDDIR_KRITA_INSTALL_CMAKE: =\ %"
-
-if not "%PERL_DIR%" == "" (
- :: Safety measure for Strawberry Perl injecting pkg-config in the PATH
- call :find_on_path STRAWBERRY_PERL_PKG_CONFIG_EXE_DIR pkg-config.bat
- if exist "%PERL_DIR%\pkg-config.bat" (
- echo Found unpatched Strawberry Perl, ignoring due to its pkg-config introducing external binaries.
- set "PATH=%PATH%;%DEPS_INSTALL_DIR%\Strawberry\perl\bin"
- ) else (
- echo Found patched Strawberry Perl, it is safe to use.
- set "PERL_EXECUTABLE=%PERL_DIR%\perl.exe"
- set "PERL_EXECUTABLE=!PERL_EXECUTABLE:\=/!"
- set "PERL_EXECUTABLE=!PERL_EXECUTABLE: =\ !"
- set "PATH=%PATH%;%PERL_DIR%"
- )
-) else (
- set "PATH=%PATH%;%DEPS_INSTALL_DIR%\Strawberry\perl\bin"
-)
-
-set PATH=%DEPS_INSTALL_DIR%\bin;%PATH%
-
-if not "%GETTEXT_SEARCH_PATH%" == "" (
- set PATH=!PATH!;!GETTEXT_SEARCH_PATH!
-)
-
-:: Prepare the CMake command lines
-set CMDLINE_CMAKE_DEPS="%CMAKE_EXE%" "%KRITA_SRC_DIR%\3rdparty" ^
- -DSUBMAKE_JOBS=%PARALLEL_JOBS% ^
- -DQT_ENABLE_DEBUG_INFO=%QT_ENABLE_DEBUG_INFO% ^
- -DQT_ENABLE_DYNAMIC_OPENGL=%QT_ENABLE_DYNAMIC_OPENGL% ^
- -DPERL_EXECUTABLE=%PERL_EXECUTABLE% ^
- -DEXTERNALS_DOWNLOAD_DIR=%BUILDDIR_DOWNLOAD_CMAKE% ^
- -DINSTALL_ROOT=%BUILDDIR_DEPS_INSTALL_CMAKE% ^
- -G "%KRITA_GENERATOR%" ^
- -A "x64" ^
- -T "host=x64" ^
- -DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%
-
-set CMDLINE_CMAKE_KRITA="%CMAKE_EXE%" "%KRITA_SRC_DIR%\." ^
- -DBoost_DEBUG=OFF ^
- -DBOOST_INCLUDEDIR=%BUILDDIR_DEPS_INSTALL_CMAKE%/include ^
- -DBOOST_ROOT=%BUILDDIR_DEPS_INSTALL_CMAKE% ^
- -DBOOST_LIBRARYDIR=%BUILDDIR_DEPS_INSTALL_CMAKE%/lib ^
- -DCMAKE_PREFIX_PATH=%BUILDDIR_DEPS_INSTALL_CMAKE% ^
- -DCMAKE_INSTALL_PREFIX=%BUILDDIR_KRITA_INSTALL_CMAKE% ^
- -DBUILD_TESTING=%KRITA_BUILD_TESTING% ^
- -DINSTALL_BENCHMARKS=%KRITA_INSTALL_BENCHMARKS% ^
- -DHAVE_MEMORY_LEAK_TRACKER=OFF ^
- -DFOUNDATION_BUILD=ON ^
- -DUSE_QT_TABLET_WINDOWS=ON ^
- -DHIDE_SAFE_ASSERTS=ON ^
- -DBRANDING=%KRITA_BRANDING% ^
- -Wno-dev ^
- -G "%KRITA_GENERATOR%" ^
- -A "x64" ^
- -T "host=x64" ^
- -DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%
-
-set CMDLINE_CMAKE_PLUGINS="%CMAKE_EXE%" "%KRITA_SRC_DIR%\3rdparty_plugins" ^
- -DSUBMAKE_JOBS=%PARALLEL_JOBS% ^
- -DQT_ENABLE_DEBUG_INFO=%QT_ENABLE_DEBUG_INFO% ^
- -DQT_ENABLE_DYNAMIC_OPENGL=%QT_ENABLE_DYNAMIC_OPENGL% ^
- -DEXTERNALS_DOWNLOAD_DIR=%BUILDDIR_PLUGINS_DOWNLOAD_CMAKE% ^
- -DINSTALL_ROOT=%BUILDDIR_PLUGINS_INSTALL_CMAKE% ^
- -G "%KRITA_GENERATOR%" ^
- -A "x64" ^
- -T "host=x64" ^
- -DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%
-
-:: Launch CMD prompt if requested
-if "%ARG_CMD%" == "1" (
- doskey cmake-deps=cmd /c "pushd %DEPS_BUILD_DIR% && %CMDLINE_CMAKE_DEPS%"
- doskey cmake-krita=cmd /c "pushd %KRITA_BUILD_DIR% && %CMDLINE_CMAKE_KRITA%"
- doskey make-deps=cmd /c "pushd %DEPS_BUILD_DIR% && "%CMAKE_EXE%" --build . --config %CMAKE_BUILD_TYPE% --target $* --parallel %PARALLEL_JOBS%"
- doskey make-krita=cmd /c "pushd %KRITA_BUILD_DIR% && "%CMAKE_EXE%" --build . --config %CMAKE_BUILD_TYPE% --target install --parallel %PARALLEL_JOBS%"
- doskey make-plugins=cmd /c "pushd %PLUGINS_BUILD_DIR% && "%CMAKE_EXE%" --build . --config %CMAKE_BUILD_TYPE% --target $* --parallel %PARALLEL_JOBS%"
- echo.
- title Krita build - %KRITA_SRC_DIR% ^(deps: %DEPS_BUILD_DIR%, krita: %KRITA_BUILD_DIR%, plugins: %PLUGINS_BUILD_DIR%^)
- echo You're now in the build environment.
- echo The following macros are available:
- echo cmake-deps
- echo -- Run CMake for the deps.
- echo make-deps ^<deps target^>
- echo -- Run build for the specified deps target. The target name should
- echo include the `ext_` prefix, e.g. `ext_qt`.
- echo make-plugins ^<deps target^>
- echo -- Build the specified plugin target. The target name should
- echo include the `ext_` prefix, e.g. `ext_gmic`.
- echo cmake-krita
- echo -- Run CMake for Krita.
- echo make-krita
- echo -- Run build for Krita's `install` target.
- echo.
- echo For more info, type `doskey /macros` to view the macro commands.
- cmd /k
- exit
-)
-
-
-if "%ARG_SKIP_DEPS%" == "1" goto skip_build_deps
-
-pushd %DEPS_BUILD_DIR%
-if errorlevel 1 (
- echo ERROR: Cannot enter deps build dir! 1>&2
- exit /b 104
-)
-
-echo Running CMake for deps...
-
-@echo on
-%CMDLINE_CMAKE_DEPS%
-@if errorlevel 1 (
- @echo ERROR: CMake configure failed! 1>&2
- @exit /b 104
-)
-@echo off
-echo.
-
-set EXT_TARGETS=patch zlib gettext openssl boost exiv2 fftw3 eigen3 jpeg lcms2
-set EXT_TARGETS=%EXT_TARGETS% ocio openexr png icoutils tiff gsl
-set EXT_TARGETS=%EXT_TARGETS% giflib qt libraw kwindowsystem drmingw
-set EXT_TARGETS=%EXT_TARGETS% python sip pyqt
-set EXT_TARGETS=%EXT_TARGETS% lzma quazip openjpeg libde265 libx265 libheif
-set EXT_TARGETS=%EXT_TARGETS% seexpr mypaint webp jpegxl xsimd
-set EXT_TARGETS=%EXT_TARGETS% freetype fontconfig poppler fribidi unibreak
-set EXT_TARGETS=%EXT_TARGETS% ffmpeg lager
-
-for %%a in (%EXT_TARGETS%) do (
- set TEST_HAS_TARGET=
- call :has_target TEST_HAS_TARGET_SELF "ext_%%a\"
- call :has_target TEST_HAS_KF5_TARGET "ext_frameworks\ext_%%a-prefix\"
- call :has_target TEST_HAS_HEIF_TARGET "ext_heif\ext_%%a-prefix\"
- if "!TEST_HAS_TARGET_SELF!" == "1" set TEST_HAS_TARGET=1
- if "!TEST_HAS_KF5_TARGET!" == "1" set TEST_HAS_TARGET=1
- if "!TEST_HAS_HEIF_TARGET!" == "1" set TEST_HAS_TARGET=1
-
- if defined TEST_HAS_TARGET (
- echo Building ext_%%a...
- "%CMAKE_EXE%" --build . --config %CMAKE_BUILD_TYPE% --target ext_%%a --parallel %PARALLEL_JOBS% -- /p:CL_MPCount=2
- if errorlevel 1 (
- echo ERROR: Building of ext_%%a failed! 1>&2
- exit /b 105
- )
- ) else (
- echo Skipping ext_%%a, using OS package...
- )
-)
-echo.
-
-echo Deploying debug symbols for all dependencies...
-
-python "%KRITA_SRC_DIR%\packaging\windows\deploy-deps-debug-symbols.py" ^
- --no-interactive ^
- --deps-install-dir="%DEPS_INSTALL_DIR%\" ^
- --deps-build-dir="%DEPS_BUILD_DIR%\"
-
-echo.
-
-echo ******** Built deps ********
-popd
-
-:skip_build_deps
-
-if "%ARG_SKIP_KRITA%" == "1" goto skip_build_krita
-
-pushd %KRITA_BUILD_DIR%
-if errorlevel 1 (
- echo ERROR: Cannot enter Krita build dir! 1>&2
- exit /b 104
-)
-
-echo Running CMake for Krita...
-
-@echo on
-%CMDLINE_CMAKE_KRITA%
-@if errorlevel 1 (
- @echo ERROR: CMake configure failed! 1>&2
- @exit /b 104
-)
-@echo off
-echo.
-
-echo Building Krita...
-"%CMAKE_EXE%" --build . --config %CMAKE_BUILD_TYPE% --target install --parallel %PARALLEL_JOBS%
-if errorlevel 1 (
- echo ERROR: Building of Krita failed! 1>&2
- exit /b 105
-)
-echo.
-
-echo Deploying debug symbols for Krita...
-
-python "%KRITA_SRC_DIR%\packaging\windows\deploy-krita-debug-symbols.py" ^
- --no-interactive ^
- --krita-install-dir="%KRITA_INSTALL_DIR%\" ^
- --krita-build-dir="%KRITA_BUILD_DIR%\"
-
-echo.
-
-echo ******** Built Krita ********
-popd
-
-pushd %PLUGINS_BUILD_DIR%
-if errorlevel 1 (
- echo ERROR: Cannot enter plugins build dir! 1>&2
- exit /b 104
-)
-
-echo Running CMake for plugins...
-
-@echo on
-%CMDLINE_CMAKE_PLUGINS%
-@if errorlevel 1 (
- @echo ERROR: CMake configure failed! 1>&2
- @exit /b 104
-)
-@echo off
-echo.
-
-set EXT_TARGETS=gmic
-
-for %%a in (%EXT_TARGETS%) do (
- echo Building ext_%%a...
- "%CMAKE_EXE%" --build . --config %CMAKE_BUILD_TYPE% --target ext_%%a
- if errorlevel 1 (
- echo ERROR: Building of ext_%%a failed! 1>&2
- exit /b 105
- )
-)
-echo.
-
-echo Deploying debug symbols for plugins...
-python "%KRITA_SRC_DIR%\packaging\windows\deploy-deps-debug-symbols.py" ^
- --no-interactive ^
- --deps-install-dir="%KRITA_INSTALL_DIR%\" ^
- --deps-build-dir="%PLUGINS_BUILD_DIR%\"
-echo.
-
-echo ******** Built plugins ********
-popd
-
-:skip_build_krita
-
-echo Krita build completed!
diff --git a/build-tools/windows/build.cmd b/build-tools/windows/build.cmd
deleted file mode 100644
index 30f3e0e68a..0000000000
--- a/build-tools/windows/build.cmd
+++ /dev/null
@@ -1,1064 +0,0 @@
-@echo off
-
-setlocal enabledelayedexpansion
-goto begin
-
-
-:: Subroutines
-
-:find_on_path out_variable file_name
-set %1=%~f$PATH:2
-goto :EOF
-
-
-:get_dir_path out_variable file_path
-set %1=%~dp2
-goto :EOF
-
-
-:get_full_path out_variable file_path
-setlocal
-set FULL_PATH=%~f2
-if not exist "%FULL_PATH%" (
- set FULL_PATH=
-) else (
- if exist "%FULL_PATH%\" (
- set FULL_PATH=
- )
-)
-endlocal & set "%1=%FULL_PATH%"
-goto :EOF
-
-
-:get_full_path_dir out_variable file_path
-setlocal
-set FULL_PATH=%~dp2
-if not exist "%FULL_PATH%" (
- set FULL_PATH=
-)
-endlocal & set "%1=%FULL_PATH%"
-goto :EOF
-
-
-:prompt_for_string out_variable prompt
-set /p %1=%~2^>
-goto :EOF
-
-
-:prompt_for_positive_integer out_variable prompt
-setlocal
-call :prompt_for_string USER_INPUT "%~2"
-if "%USER_INPUT%" == "" set USER_INPUT=0
-set /a RESULT=%USER_INPUT%
-if not %RESULT% GTR 0 (
- set RESULT=
-)
-endlocal & set "%1=%RESULT%"
-goto :EOF
-
-
-:prompt_for_file out_variable prompt
-setlocal
-:prompt_for_file__retry
-call :prompt_for_string USER_INPUT "%~2"
-if "%USER_INPUT%" == "" (
- endlocal
- set %1=
- goto :EOF
-)
-call :get_full_path RESULT "%USER_INPUT%"
-if "%RESULT%" == "" (
- echo Input does not point to valid file!
- set USER_INPUT=
- goto prompt_for_file__retry
-)
-endlocal & set "%1=%RESULT%"
-goto :EOF
-
-
-:prompt_for_dir out_variable prompt
-setlocal
-:prompt_for_dir__retry
-call :prompt_for_string USER_INPUT "%~2"
-if "%USER_INPUT%" == "" (
- endlocal
- set %1=
- goto :EOF
-)
-call :get_full_path_dir RESULT "%USER_INPUT%\"
-if "%RESULT%" == "" (
- echo Input does not point to valid dir!
- set USER_INPUT=
- goto prompt_for_dir__retry
-)
-endlocal & set "%1=%RESULT%"
-goto :EOF
-
-
-:has_target out_variable folder
-setlocal
-set RESULT=
-if exist "%~2" (
- set RESULT=1
-)
-endlocal & set "%1=%RESULT%"
-goto :EOF
-
-:usage
-echo Usage:
-echo %~n0 [--no-interactive] [ OPTIONS ... ]
-echo.
-echo Basic options:
-echo --no-interactive Run without interactive prompts
-echo When not specified, the script will prompt
-echo for some of the parameters.
-echo --jobs ^<count^> Set parallel jobs count when building
-echo Defaults to no. of logical cores
-echo --skip-deps Skips (re)building of deps
-echo --skip-krita Skips (re)building of Krita
-echo --cmd Launch a cmd prompt instead of building.
-echo The environment is set up like the build
-echo environment with some helper command macros.
-echo --dev Activate developer options, like 'CodeBlocks'
-echo generator and BUILD_TESTING
-echo.
-echo Path options:
-echo --src-dir ^<dir_path^> Specify Krita source dir
-echo If unspecified, this will be determined from
-echo the script location.
-echo --download-dir ^<dir_path^> Specify deps download dir
-echo Can be omitted if --skip-deps is used
-echo --deps-build-dir ^<dir_path^> Specify deps build dir
-echo Can be omitted if --skip-deps is used
-echo --deps-install-dir ^<dir_path^> Specify deps install dir
-echo --krita-build-dir ^<dir_path^> Specify Krita build dir
-echo Can be omitted if --skip-krita is used
-echo --krita-install-dir ^<dir_path^> Specify Krita install dir
-echo Can be omitted if --skip-krita is used
-echo.
-goto :EOF
-:usage_and_exit
-call :usage
-exit /b
-:usage_and_fail
-call :usage
-exit /b 100
-
-
-:: ----------------------------
-:begin
-
-echo Krita build script for Windows
-echo.
-
-
-:: command-line args parsing
-set ARG_NO_INTERACTIVE=
-set ARG_JOBS=
-set ARG_SKIP_DEPS=
-set ARG_SKIP_KRITA=
-set ARG_SRC_DIR=
-set ARG_DOWNLOAD_DIR=
-set ARG_DEPS_BUILD_DIR=
-set ARG_DEPS_INSTALL_DIR=
-set ARG_KRITA_BUILD_DIR=
-set ARG_KRITA_INSTALL_DIR=
-set ARG_PLUGINS_BUILD_DIR=
-set ARG_CMD=
-set ARG_DEV=
-:args_parsing_loop
-set CURRENT_MATCHED=
-if not "%1" == "" (
- if "%1" == "--no-interactive" (
- set ARG_NO_INTERACTIVE=1
- set CURRENT_MATCHED=1
- )
- if "%1" == "--jobs" (
- if not "%ARG_JOBS%" == "" (
- echo ERROR: Arg --jobs specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- set /a "ARG_JOBS=%2"
- if not !ARG_JOBS! GTR 0 (
- echo ERROR: Arg --jobs is not a positive integer 1>&2
- echo.
- goto usage_and_fail
- )
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--skip-deps" (
- set ARG_SKIP_DEPS=1
- set CURRENT_MATCHED=1
- )
- if "%1" == "--skip-krita" (
- set ARG_SKIP_KRITA=1
- set CURRENT_MATCHED=1
- )
- if "%1" == "--dev" (
- set ARG_DEV=1
- set CURRENT_MATCHED=1
- )
- if "%1" == "--src-dir" (
- if not "%ARG_SRC_DIR%" == "" (
- echo ERROR: Arg --src-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if not exist "%~f2\" (
- echo ERROR: Arg --src-dir does not point to a directory 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_SRC_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--download-dir" (
- if not "%ARG_DOWNLOAD_DIR%" == "" (
- echo ERROR: Arg --download-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --download-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_DOWNLOAD_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--deps-build-dir" (
- if not "%ARG_DEPS_BUILD_DIR%" == "" (
- echo ERROR: Arg --deps-build-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --deps-build-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_DEPS_BUILD_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--deps-install-dir" (
- if not "%ARG_DEPS_INSTALL_DIR%" == "" (
- echo ERROR: Arg --deps-install-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --deps-install-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_DEPS_INSTALL_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--krita-build-dir" (
- if not "%ARG_KRITA_BUILD_DIR%" == "" (
- echo ERROR: Arg --krita-build-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --krita-build-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_KRITA_BUILD_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--krita-install-dir" (
- if not "%ARG_KRITA_INSTALL_DIR%" == "" (
- echo ERROR: Arg --krita-install-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --krita-install-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_KRITA_INSTALL_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--plugins-build-dir" (
- if not "%ARG_PLUGINS_BUILD_DIR%" == "" (
- echo ERROR: Arg --plugins-build-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --plugins-build-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_PLUGINS_BUILD_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--cmd" (
- set ARG_CMD=1
- set CURRENT_MATCHED=1
- )
- if "%1" == "--help" (
- goto usage_and_exit
- )
- if not "!CURRENT_MATCHED!" == "1" (
- echo ERROR: Unknown option %1 1>&2
- echo.
- goto usage_and_fail
- )
- shift /1
- goto args_parsing_loop
-)
-
-if "%ARG_NO_INTERACTIVE%" == "1" (
- echo Non-interactive mode
-) else (
- echo Interactive mode
- :: Trick to pause on exit
- call :real_begin
- pause
- exit /b !ERRORLEVEL!
-)
-:real_begin
-echo.
-
-
-if "%ARG_SKIP_DEPS%" == "1" (
- if "%ARG_SKIP_KRITA%" == "1" (
- echo Both deps and Krita will be skipped.
- ) else (
- echo Building of deps will be skipped.
- )
-) else (
- if "%ARG_SKIP_KRITA%" == "1" (
- echo Building of Krita will be skipped.
- ) else (
- echo Both deps and Krita will be built.
- )
-)
-
-
-:: Check environment config
-
-if "%CMAKE_EXE%" == "" (
- call :find_on_path CMAKE_EXE cmake.exe
- if "!CMAKE_EXE!" == "" (
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- call :prompt_for_file CMAKE_EXE "Provide path to cmake.exe"
- )
- if "!CMAKE_EXE!" == "" (
- echo ERROR: CMake not found! 1>&2
- exit /b 102
- )
- call :get_dir_path CMAKE_BIN_DIR "!CMAKE_EXE!"
- ) else (
- echo Found CMake on PATH: !CMAKE_EXE!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this correct? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_file CMAKE_EXE "Provide path to cmake.exe"
- if "!CMAKE_EXE!" == "" (
- echo ERROR: CMake not found! 1>&2
- exit /b 102
- )
- call :get_dir_path CMAKE_BIN_DIR "!CMAKE_EXE!"
- )
- )
- call :get_dir_path CMAKE_BIN_DIR "!CMAKE_EXE!"
- )
-)
-echo CMake: %CMAKE_BIN_DIR%
-
-if "%SEVENZIP_EXE%" == "" (
- call :find_on_path SEVENZIP_EXE 7z.exe
- if "!SEVENZIP_EXE!" == "" (
- set "SEVENZIP_EXE=%ProgramFiles%\7-Zip\7z.exe"
- if "!SEVENZIP_EXE!" == "" (
- set "SEVENZIP_EXE=%ProgramFiles(x86)%\7-Zip\7z.exe"
- )
- if "!SEVENZIP_EXE!" == "" (
- echo 7-Zip not found
- )
- )
-)
-if "%SEVENZIP_EXE%" == "" (
- echo 7-Zip: %SEVENZIP_EXE%
-)
-
-if "%MINGW_BIN_DIR%" == "" (
- call :find_on_path MINGW_BIN_DIR_MAKE_EXE mingw32-make.exe
- if "!MINGW_BIN_DIR_MAKE_EXE!" == "" (
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- call :prompt_for_file MINGW_BIN_DIR_MAKE_EXE "Provide path to mingw32-make.exe of mingw-w64"
- )
- if "!MINGW_BIN_DIR_MAKE_EXE!" == "" (
- echo ERROR: mingw-w64 not found! 1>&2
- exit /b 102
- )
- call :get_dir_path MINGW_BIN_DIR "!MINGW_BIN_DIR_MAKE_EXE!"
- ) else (
- call :get_dir_path MINGW_BIN_DIR "!MINGW_BIN_DIR_MAKE_EXE!"
- echo Found mingw on PATH: !MINGW_BIN_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this correct? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_file MINGW_BIN_DIR_MAKE_EXE "Provide path to mingw32-make.exe of mingw-w64"
- if "!MINGW_BIN_DIR_MAKE_EXE!" == "" (
- echo ERROR: mingw-w64 not found! 1>&2
- exit /b 102
- )
- call :get_dir_path MINGW_BIN_DIR "!MINGW_BIN_DIR_MAKE_EXE!"
- )
- )
- )
-)
-echo mingw-w64: %MINGW_BIN_DIR%
-
-if "%PYTHON_BIN_DIR%" == "" (
- call :find_on_path PYTHON_BIN_DIR_PYTHON_EXE python.exe
- if "!PYTHON_BIN_DIR_PYTHON_EXE!" == "" (
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- call :prompt_for_file PYTHON_BIN_DIR_PYTHON_EXE "Provide path to python.exe of Python 3.6.2"
- )
- if "!PYTHON_BIN_DIR_PYTHON_EXE!" == "" (
- echo ERROR: Python not found! 1>&2
- exit /b 102
- )
- call :get_dir_path PYTHON_BIN_DIR "!PYTHON_BIN_DIR_PYTHON_EXE!"
- ) else (
- call :get_dir_path PYTHON_BIN_DIR "!PYTHON_BIN_DIR_PYTHON_EXE!"
- echo Found Python on PATH: !PYTHON_BIN_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this correct? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_file PYTHON_BIN_DIR_PYTHON_EXE "Provide path to python.exe of Python 3.6.2"
- if "!PYTHON_BIN_DIR_PYTHON_EXE!" == "" (
- echo ERROR: Python not found! 1>&2
- exit /b 102
- )
- call :get_dir_path PYTHON_BIN_DIR "!PYTHON_BIN_DIR_PYTHON_EXE!"
- )
- )
- )
-)
-echo Python: %PYTHON_BIN_DIR%
-
-@REM Translation tools
-
-if "%KRITA_GIT_DIR%" == "" (
- call :find_on_path KRITA_GIT_EXE_DIR git.exe
- if NOT "!KRITA_GIT_EXE_DIR!" == "" (
- call :get_dir_path KRITA_GIT_DIR "!KRITA_GIT_EXE_DIR!"
- echo Found Git on PATH: !KRITA_GIT_DIR!
- )
-) else echo Git found on %KRITA_GIT_DIR%
-
-if "%KRITA_NINJA_DIR%" == "" (
- call :find_on_path KRITA_NINJA_EXE_DIR ninja.exe
- if NOT "!KRITA_NINJA_EXE_DIR!" == "" (
- call :get_dir_path KRITA_NINJA_DIR "!KRITA_NINJA_EXE_DIR!"
- echo Found Ninja on PATH: !KRITA_NINJA_DIR!
- )
-) else echo Ninja found on %KRITA_NINJA_DIR%
-
-if "%SVN_DIR%" == "" (
- call :find_on_path SVN_EXE_DIR svn.exe
- if NOT "!SVN_EXE_DIR!" == "" (
- call :get_dir_path SVN_DIR "!SVN_EXE_DIR!"
- echo Found SVN on PATH: !SVN_DIR!
- )
-) else echo SVN found on %SVN_DIR%
-
-if "%PERL_DIR%" == "" (
- call :find_on_path PERL_EXE_DIR perl.exe
- if NOT "!PERL_EXE_DIR!" == "" (
- call :get_dir_path PERL_DIR "!PERL_EXE_DIR!"
- echo Found Perl on PATH: !PERL_DIR!
- )
-) else echo Perl found on %PERL_DIR%
-
-if "%ARG_SKIP_DEPS%" == "1" goto skip_windows_sdk_dir_check
-
-if "%WindowsSdkDir%" == "" if not "%ProgramFiles(x86)%" == "" set "WindowsSdkDir=%ProgramFiles(x86)%\Windows Kits\10"
-if "%WindowsSdkDir%" == "" set "WindowsSdkDir=%ProgramFiles(x86)%\Windows Kits\10"
-if exist "%WindowsSdkDir%\" (
- pushd "%WindowsSdkDir%"
- if exist "bin\x64\fxc.exe" (
- set HAVE_FXC_EXE=1
- if "%WindowsSdkVerBinPath%" == "" set "WindowsSdkVerBinPath=%WindowsSdkDir%"
- ) else (
- for /f "delims=" %%a in ('dir /a:d /b "bin\10.*"') do (
- if exist "bin\%%a\x64\fxc.exe" (
- set HAVE_FXC_EXE=1
- if "%WindowsSdkVerBinPath%" == "" set "WindowsSdkVerBinPath=%WindowsSdkDir%\bin\%%a\"
- )
- )
- )
- popd
-)
-set QT_ENABLE_DYNAMIC_OPENGL=ON
-if not "%HAVE_FXC_EXE%" == "1" (
- set WindowsSdkDir=
- echo Windows SDK 10 with fxc.exe not found
- echo Qt will *not* be built with ANGLE ^(dynamic OpenGL^) support.
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- exit /b 102
- )
- )
- set QT_ENABLE_DYNAMIC_OPENGL=OFF
-) else echo Windows SDK 10 with fxc.exe found on %WindowsSdkDir%
-
-:skip_windows_sdk_dir_check
-
-if not "%ARG_JOBS%" == "" (
- set "PARALLEL_JOBS=%ARG_JOBS%"
-)
-if "%PARALLEL_JOBS%" == "" (
- echo Number of logical CPU cores detected: %NUMBER_OF_PROCESSORS%
- echo Enabling %NUMBER_OF_PROCESSORS% parallel jobs
- set PARALLEL_JOBS=%NUMBER_OF_PROCESSORS%
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this correct? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_positive_integer PARALLEL_JOBS "Provide no. of parallel jobs"
- if "!PARALLEL_JOBS!" == "" (
- echo ERROR: Invalid job count! 1>&2
- exit /b 102
- )
- )
- )
-)
-echo Parallel jobs count: %PARALLEL_JOBS%
-
-if not "%ARG_SRC_DIR%" == "" (
- set "KRITA_SRC_DIR=%ARG_SRC_DIR%"
-)
-if "%KRITA_SRC_DIR%" == "" (
- :: Check whether this looks like to be in the source tree
- set "_temp=%~dp0"
- if "!_temp:~-21!" == "\build-tools\windows\" (
- if exist "!_temp:~0,-21!\CMakeLists.txt" (
- if exist "!_temp:~0,-21!\3rdparty\CMakeLists.txt" (
- set "KRITA_SRC_DIR=!_temp:~0,-21!\"
- echo Script is running inside Krita src dir
- )
- )
- )
-)
-if "%KRITA_SRC_DIR%" == "" (
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- call :prompt_for_dir KRITA_SRC_DIR "Provide path of Krita src dir"
- )
- if "!KRITA_SRC_DIR!" == "" (
- echo ERROR: Krita src dir not found! 1>&2
- exit /b 102
- )
-)
-echo Krita src: %KRITA_SRC_DIR%
-
-if "%ARG_SKIP_DEPS%" == "1" goto skip_deps_args_check
-
-if not "%ARG_DOWNLOAD_DIR%" == "" (
- set "DEPS_DOWNLOAD_DIR=%ARG_DOWNLOAD_DIR%"
-)
-if "%DEPS_DOWNLOAD_DIR%" == "" (
- set DEPS_DOWNLOAD_DIR=%CD%\d\
- echo Using default deps download dir: !DEPS_DOWNLOAD_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir DEPS_DOWNLOAD_DIR "Provide path of depps download dir"
- )
- )
- if "!DEPS_DOWNLOAD_DIR!" == "" (
- echo ERROR: Deps download dir not set! 1>&2
- exit /b 102
- )
-)
-echo Deps download dir: %DEPS_DOWNLOAD_DIR%
-
-if not "%ARG_DEPS_BUILD_DIR%" == "" (
- set "DEPS_BUILD_DIR=%ARG_DEPS_BUILD_DIR%"
-)
-if "%DEPS_BUILD_DIR%" == "" (
- set DEPS_BUILD_DIR=%CD%\b_deps\
- echo Using default deps build dir: !DEPS_BUILD_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir DEPS_BUILD_DIR "Provide path of deps build dir"
- )
- )
- if "!DEPS_BUILD_DIR!" == "" (
- echo ERROR: Deps build dir not set! 1>&2
- exit /b 102
- )
-)
-echo Deps build dir: %DEPS_BUILD_DIR%
-
-:skip_deps_args_check
-
-if not "%ARG_DEPS_INSTALL_DIR%" == "" (
- set "DEPS_INSTALL_DIR=%ARG_DEPS_INSTALL_DIR%"
-)
-if "%DEPS_INSTALL_DIR%" == "" (
- set DEPS_INSTALL_DIR=%CD%\i_deps\
- echo Using default deps install dir: !DEPS_INSTALL_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir DEPS_INSTALL_DIR "Provide path of deps install dir"
- )
- )
- if "!DEPS_INSTALL_DIR!" == "" (
- echo ERROR: Deps install dir not set! 1>&2
- exit /b 102
- )
-)
-echo Deps install dir: %DEPS_INSTALL_DIR%
-
-if "%ARG_SKIP_KRITA%" == "1" goto skip_krita_args_check
-
-if not "%ARG_KRITA_BUILD_DIR%" == "" (
- set "KRITA_BUILD_DIR=%ARG_KRITA_BUILD_DIR%"
-)
-if "%KRITA_BUILD_DIR%" == "" (
- set KRITA_BUILD_DIR=%CD%\b\
- echo Using default Krita build dir: !KRITA_BUILD_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir KRITA_BUILD_DIR "Provide path of Krita build dir"
- )
- )
- if "!KRITA_BUILD_DIR!" == "" (
- echo ERROR: Krita build dir not set! 1>&2
- exit /b 102
- )
-)
-echo Krita build dir: %KRITA_BUILD_DIR%
-
-@REM Plugins also need the download dir
-if not "%ARG_DOWNLOAD_DIR%" == "" (
- set "PLUGINS_DOWNLOAD_DIR=%ARG_DOWNLOAD_DIR%"
-)
-if "%PLUGINS_DOWNLOAD_DIR%" == "" (
- set PLUGINS_DOWNLOAD_DIR=%CD%\d\
- echo Using default deps download dir: !PLUGINS_DOWNLOAD_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir PLUGINS_DOWNLOAD_DIR "Provide path of plugins download dir"
- )
- )
- if "!PLUGINS_DOWNLOAD_DIR!" == "" (
- echo ERROR: Plugins download dir not set! 1>&2
- exit /b 102
- )
-)
-echo Plugins download dir: %PLUGINS_DOWNLOAD_DIR%
-
-if not "%ARG_PLUGINS_BUILD_DIR%" == "" (
- set "PLUGINS_BUILD_DIR=%ARG_PLUGINS_BUILD_DIR%"
-)
-if "%PLUGINS_BUILD_DIR%" == "" (
- set PLUGINS_BUILD_DIR=%CD%\b_plugins\
- echo Using default plugins build dir: !PLUGINS_BUILD_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir PLUGINS_BUILD_DIR "Provide path of plugins build dir"
- )
- )
- if "!PLUGINS_BUILD_DIR!" == "" (
- echo ERROR: Plugins build dir not set! 1>&2
- exit /b 102
- )
-)
-echo Plugins build dir: %PLUGINS_BUILD_DIR%
-
-if not "%ARG_KRITA_INSTALL_DIR%" == "" (
- set "KRITA_INSTALL_DIR=%ARG_KRITA_INSTALL_DIR%"
-)
-if "%KRITA_INSTALL_DIR%" == "" (
- set KRITA_INSTALL_DIR=%CD%\i\
- echo Using default Krita install dir: !KRITA_INSTALL_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir KRITA_INSTALL_DIR "Provide path of Krita install dir"
- )
- )
- if "!KRITA_INSTALL_DIR!" == "" (
- echo ERROR: Krita install dir not set! 1>&2
- exit /b 102
- )
-)
-echo Krita install dir: %KRITA_INSTALL_DIR%
-
-:skip_krita_args_check
-
-echo.
-
-
-if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is the above ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- exit /b 1
- )
- echo.
-)
-
-:: Initialize clean PATH
-set "PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\"
-set "PATH=%PYTHON_BIN_DIR%;%MINGW_BIN_DIR%;%PATH%"
-if NOT "%KRITA_GIT_DIR%" == "" (
- set "PATH=%PATH%;%KRITA_GIT_DIR%"
-)
-if NOT "%KRITA_NINJA_DIR%" == "" (
- if NOT "%KRITA_NINJA_DIR%" == "%MINGW_BIN_DIR%" (
- set "PATH=%PATH%;%KRITA_NINJA_DIR%"
- )
-)
-if NOT "%SVN_DIR%" == "" (
- set "PATH=%PATH%;%SVN_DIR%"
-)
-if NOT "%CMAKE_BIN_DIR%" == "" (
- set PATH=%PATH%;%CMAKE_BIN_DIR%
-)
-
-echo Creating dirs...
-if NOT "%ARG_SKIP_DEPS%" == "1" (
- mkdir %DEPS_DOWNLOAD_DIR%
- if errorlevel 1 (
- if not exist "%DEPS_DOWNLOAD_DIR%\" (
- echo ERROR: Cannot create deps download dir! 1>&2
- exit /b 103
- )
- )
- mkdir %DEPS_BUILD_DIR%
- if errorlevel 1 (
- if not exist "%DEPS_BUILD_DIR%\" (
- echo ERROR: Cannot create deps build dir! 1>&2
- exit /b 103
- )
- )
- mkdir %DEPS_INSTALL_DIR%
- if errorlevel 1 (
- if not exist "%DEPS_INSTALL_DIR%\" (
- echo ERROR: Cannot create deps install dir! 1>&2
- exit /b 103
- )
- )
-)
-if NOT "%ARG_SKIP_KRITA%" == "1" (
- mkdir %KRITA_BUILD_DIR%
- if errorlevel 1 (
- if not exist "%KRITA_BUILD_DIR%\" (
- echo ERROR: Cannot create Krita build dir! 1>&2
- exit /b 103
- )
- )
- mkdir %PLUGINS_DOWNLOAD_DIR%
- if errorlevel 1 (
- if not exist "%PLUGINS_DOWNLOAD_DIR%\" (
- echo ERROR: Cannot create plugins download dir! 1>&2
- exit /b 103
- )
- )
- mkdir %PLUGINS_BUILD_DIR%
- if errorlevel 1 (
- if not exist "%PLUGINS_BUILD_DIR%\" (
- echo ERROR: Cannot create plugins build dir! 1>&2
- exit /b 103
- )
- )
- mkdir %KRITA_INSTALL_DIR%
- if errorlevel 1 (
- if not exist "%KRITA_INSTALL_DIR%\" (
- echo ERROR: Cannot create Krita install dir! 1>&2
- exit /b 103
- )
- )
-)
-
-echo.
-
-
-set CMAKE_BUILD_TYPE=RelWithDebInfo
-set QT_ENABLE_DEBUG_INFO=OFF
-
-set KRITA_GENERATOR=MinGW Makefiles
-set KRITA_BUILD_TESTING=OFF
-set KRITA_INSTALL_BENCHMARKS=OFF
-
-if NOT "%KRITA_NINJA_DIR%" == "" (
- set KRITA_GENERATOR=Ninja
-)
-
-if "%ARG_DEV%" == "1" (
- set KRITA_GENERATOR=CodeBlocks - %KRITA_GENERATOR%
- set KRITA_BUILD_TESTING=ON
- set KRITA_INSTALL_BENCHMARKS=ON
-)
-
-if "%KRITA_BRANDING%" == "" (
- rem Check Jenkins job name
- if "%JOB_NAME%" == "Krita_Nightly_Windows_Build" (
- set KRITA_BRANDING=Next
- ) else (
- if "%JOB_NAME%" == "Krita_Stable_Windows_Build" (
- set KRITA_BRANDING=Plus
- )
- )
-)
-
-:: Paths for CMake
-set "BUILDDIR_DOWNLOAD_CMAKE=%DEPS_DOWNLOAD_DIR:\=/%"
-set "BUILDDIR_DOWNLOAD_CMAKE=%BUILDDIR_DOWNLOAD_CMAKE: =\ %"
-set "BUILDDIR_PLUGINS_DOWNLOAD_CMAKE=%PLUGINS_DOWNLOAD_DIR:\=/%"
-set "BUILDDIR_PLUGINS_DOWNLOAD_CMAKE=%BUILDDIR_PLUGINS_DOWNLOAD_CMAKE: =\ %"
-set "BUILDDIR_DEPS_INSTALL_CMAKE=%DEPS_INSTALL_DIR:\=/%"
-set "BUILDDIR_DEPS_INSTALL_CMAKE=%BUILDDIR_DEPS_INSTALL_CMAKE: =\ %"
-set "BUILDDIR_KRITA_INSTALL_CMAKE=%KRITA_INSTALL_DIR:\=/%"
-set "BUILDDIR_KRITA_INSTALL_CMAKE=%BUILDDIR_KRITA_INSTALL_CMAKE: =\ %"
-set "BUILDDIR_PLUGINS_INSTALL_CMAKE=%KRITA_INSTALL_DIR:\=/%"
-set "BUILDDIR_PLUGINS_INSTALL_CMAKE=%BUILDDIR_KRITA_INSTALL_CMAKE: =\ %"
-
-if not "%PERL_DIR%" == "" (
- :: Safety measure for Strawberry Perl injecting pkg-config in the PATH
- if exist "%PERL_DIR%\pkg-config.bat" (
- echo Found unpatched Strawberry Perl, ignoring due to its pkg-config introducing external binaries.
- set "PATH=%PATH%;%DEPS_INSTALL_DIR%\Strawberry\perl\bin"
- ) else (
- echo Found patched Strawberry Perl, it is safe to use.
- set "PERL_EXECUTABLE=%PERL_DIR%\perl.exe"
- set "PERL_EXECUTABLE=!PERL_EXECUTABLE:\=/!"
- set "PERL_EXECUTABLE=!PERL_EXECUTABLE: =\ !"
- set "PATH=%PATH%;%PERL_DIR%"
- )
-) else (
- set "PATH=%PATH%;%DEPS_INSTALL_DIR%\Strawberry\perl\bin"
-)
-
-set "PATH=%DEPS_INSTALL_DIR%\bin;%PATH%"
-
-if not "%GETTEXT_SEARCH_PATH%" == "" (
- set "PATH=%PATH%;%GETTEXT_SEARCH_PATH%"
-)
-
-:: Prepare the CMake command lines
-set CMDLINE_CMAKE_DEPS="%CMAKE_EXE%" "%KRITA_SRC_DIR%\3rdparty" ^
- -DSUBMAKE_JOBS=%PARALLEL_JOBS% ^
- -DQT_ENABLE_DEBUG_INFO=%QT_ENABLE_DEBUG_INFO% ^
- -DQT_ENABLE_DYNAMIC_OPENGL=%QT_ENABLE_DYNAMIC_OPENGL% ^
- -DPERL_EXECUTABLE=%PERL_EXECUTABLE% ^
- -DEXTERNALS_DOWNLOAD_DIR=%BUILDDIR_DOWNLOAD_CMAKE% ^
- -DINSTALL_ROOT=%BUILDDIR_DEPS_INSTALL_CMAKE% ^
- -G "%KRITA_GENERATOR%" ^
- -DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%
-
-set CMDLINE_CMAKE_KRITA="%CMAKE_EXE%" "%KRITA_SRC_DIR%\." ^
- -DBoost_DEBUG=OFF ^
- -DBOOST_INCLUDEDIR=%BUILDDIR_DEPS_INSTALL_CMAKE%/include ^
- -DBOOST_ROOT=%BUILDDIR_DEPS_INSTALL_CMAKE% ^
- -DBOOST_LIBRARYDIR=%BUILDDIR_DEPS_INSTALL_CMAKE%/lib ^
- -DCMAKE_PREFIX_PATH=%BUILDDIR_DEPS_INSTALL_CMAKE% ^
- -DCMAKE_INSTALL_PREFIX=%BUILDDIR_KRITA_INSTALL_CMAKE% ^
- -DBUILD_TESTING=%KRITA_BUILD_TESTING% ^
- -DINSTALL_BENCHMARKS=%KRITA_INSTALL_BENCHMARKS% ^
- -DHAVE_MEMORY_LEAK_TRACKER=OFF ^
- -DFOUNDATION_BUILD=ON ^
- -DUSE_QT_TABLET_WINDOWS=ON ^
- -DKRITA_ENABLE_PCH=OFF ^
- -DHIDE_SAFE_ASSERTS=ON ^
- -DBRANDING=%KRITA_BRANDING% ^
- -Wno-dev ^
- -G "%KRITA_GENERATOR%" ^
- -DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%
-
-set CMDLINE_CMAKE_PLUGINS="%CMAKE_EXE%" "%KRITA_SRC_DIR%\3rdparty_plugins" ^
- -DSUBMAKE_JOBS=%PARALLEL_JOBS% ^
- -DQT_ENABLE_DEBUG_INFO=%QT_ENABLE_DEBUG_INFO% ^
- -DQT_ENABLE_DYNAMIC_OPENGL=%QT_ENABLE_DYNAMIC_OPENGL% ^
- -DEXTERNALS_DOWNLOAD_DIR=%BUILDDIR_PLUGINS_DOWNLOAD_CMAKE% ^
- -DINSTALL_ROOT=%BUILDDIR_PLUGINS_INSTALL_CMAKE% ^
- -G "%KRITA_GENERATOR%" ^
- -DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%
-
-:: Launch CMD prompt if requested
-if "%ARG_CMD%" == "1" (
- doskey cmake-deps=cmd /c "pushd %DEPS_BUILD_DIR% && %CMDLINE_CMAKE_DEPS%"
- doskey cmake-krita=cmd /c "pushd %KRITA_BUILD_DIR% && %CMDLINE_CMAKE_KRITA%"
- doskey make-deps=cmd /c "pushd %DEPS_BUILD_DIR% && "%CMAKE_EXE%" --build . --config %CMAKE_BUILD_TYPE% --target $*"
- doskey make-krita=cmd /c "pushd %KRITA_BUILD_DIR% && "%CMAKE_EXE%" --build . --config %CMAKE_BUILD_TYPE% --target install -- -j%PARALLEL_JOBS%"
- doskey make-plugins=cmd /c "pushd %PLUGINS_BUILD_DIR% && "%CMAKE_EXE%" --build . --config %CMAKE_BUILD_TYPE% --target $* -- -j%PARALLEL_JOBS%"
- echo.
- title Krita build - %KRITA_SRC_DIR% ^(deps: %DEPS_BUILD_DIR%, krita: %KRITA_BUILD_DIR%, plugins: %PLUGINS_BUILD_DIR%^)
- echo You're now in the build environment.
- echo The following macros are available:
- echo cmake-deps
- echo -- Run CMake for the deps.
- echo make-deps ^<deps target^>
- echo -- Run build for the specified deps target. The target name should
- echo include the `ext_` prefix, e.g. `ext_qt`.
- echo make-plugins ^<deps target^>
- echo -- Build the specified plugin target. The target name should
- echo include the `ext_` prefix, e.g. `ext_gmic`.
- echo cmake-krita
- echo -- Run CMake for Krita.
- echo make-krita
- echo -- Run build for Krita's `install` target.
- echo.
- echo For more info, type `doskey /macros` to view the macro commands.
- cmd /k
- exit
-)
-
-
-if "%ARG_SKIP_DEPS%" == "1" goto skip_build_deps
-
-pushd %DEPS_BUILD_DIR%
-if errorlevel 1 (
- echo ERROR: Cannot enter deps build dir! 1>&2
- exit /b 104
-)
-
-echo Running CMake for deps...
-
-@echo on
-%CMDLINE_CMAKE_DEPS%
-@if errorlevel 1 (
- @echo ERROR: CMake configure failed! 1>&2
- @exit /b 104
-)
-@echo off
-echo.
-
-set EXT_TARGETS=patch zlib gettext openssl boost exiv2 fftw3 eigen3 jpeg lcms2
-set EXT_TARGETS=%EXT_TARGETS% ocio openexr png icoutils tiff gsl
-set EXT_TARGETS=%EXT_TARGETS% giflib qt libraw kwindowsystem drmingw
-set EXT_TARGETS=%EXT_TARGETS% python sip pyqt
-set EXT_TARGETS=%EXT_TARGETS% lzma quazip openjpeg libde265 libx265 libheif
-set EXT_TARGETS=%EXT_TARGETS% seexpr mypaint webp jpegxl xsimd
-set EXT_TARGETS=%EXT_TARGETS% freetype fontconfig poppler fribidi unibreak
-set EXT_TARGETS=%EXT_TARGETS% ffmpeg lager mlt
-
-for %%a in (%EXT_TARGETS%) do (
- set TEST_HAS_TARGET=
- call :has_target TEST_HAS_TARGET_SELF "ext_%%a\"
- call :has_target TEST_HAS_KF5_TARGET "ext_frameworks\ext_%%a-prefix\"
- call :has_target TEST_HAS_HEIF_TARGET "ext_heif\ext_%%a-prefix\"
- if "!TEST_HAS_TARGET_SELF!" == "1" set TEST_HAS_TARGET=1
- if "!TEST_HAS_KF5_TARGET!" == "1" set TEST_HAS_TARGET=1
- if "!TEST_HAS_HEIF_TARGET!" == "1" set TEST_HAS_TARGET=1
-
- if defined TEST_HAS_TARGET (
- echo Building ext_%%a...
- "%CMAKE_EXE%" --build . --config %CMAKE_BUILD_TYPE% -j%PARALLEL_JOBS% --target ext_%%a
- if errorlevel 1 (
- echo ERROR: Building of ext_%%a failed! 1>&2
- exit /b 105
- )
- ) else (
- echo Skipping ext_%%a, using OS package...
- )
-)
-echo.
-
-echo ******** Built deps ********
-popd
-
-:skip_build_deps
-
-if "%ARG_SKIP_KRITA%" == "1" goto skip_build_krita
-
-pushd %KRITA_BUILD_DIR%
-if errorlevel 1 (
- echo ERROR: Cannot enter Krita build dir! 1>&2
- exit /b 104
-)
-
-echo Running CMake for Krita...
-
-@echo on
-%CMDLINE_CMAKE_KRITA%
-@if errorlevel 1 (
- @echo ERROR: CMake configure failed! 1>&2
- @exit /b 104
-)
-@echo off
-echo.
-
-echo Building Krita...
-"%CMAKE_EXE%" --build . --config %CMAKE_BUILD_TYPE% --target install -- -j%PARALLEL_JOBS%
-if errorlevel 1 (
- echo ERROR: Building of Krita failed! 1>&2
- exit /b 105
-)
-echo.
-
-echo ******** Built Krita ********
-popd
-
-pushd %PLUGINS_BUILD_DIR%
-if errorlevel 1 (
- echo ERROR: Cannot enter plugins build dir! 1>&2
- exit /b 104
-)
-
-echo Running CMake for plugins...
-
-@echo on
-%CMDLINE_CMAKE_PLUGINS%
-@if errorlevel 1 (
- @echo ERROR: CMake configure failed! 1>&2
- @exit /b 104
-)
-@echo off
-echo.
-
-set EXT_TARGETS=gmic
-
-for %%a in (%EXT_TARGETS%) do (
- echo Building ext_%%a...
- "%CMAKE_EXE%" --build . --config %CMAKE_BUILD_TYPE% --target ext_%%a
- if errorlevel 1 (
- echo ERROR: Building of ext_%%a failed! 1>&2
- exit /b 105
- )
-)
-echo.
-
-echo ******** Built plugins ********
-popd
-
-:skip_build_krita
-
-echo Krita build completed!
diff --git a/packaging/windows/msix/build_msix.cmd b/packaging/windows/msix/build_msix.cmd
deleted file mode 100644
index 1a2a2eb137..0000000000
--- a/packaging/windows/msix/build_msix.cmd
+++ /dev/null
@@ -1,333 +0,0 @@
-@echo off
-
-setlocal enableextensions enabledelayedexpansion
-
-if not defined OUTPUT_DIR set "OUTPUT_DIR=%CD%\out"
-if not defined KRITA_DIR (
- if not defined KRITA_INSTALLER (
- echo ERROR: KRITA_DIR and KRITA_INSTALLER not specified, one of them must be set.
- exit /b 1
- )
-)
-rem For binary factory, define both KRITA_DIR and KRITA_SHELLEX.
-rem Do not use KRITA_SHELLEX if building outside of binary factory, unless you
-rem don't mind this script modifying the contents of KRITA_DIR.
-if defined KRITA_INSTALLER (
- if defined KRITA_SHELLEX (
- echo ERROR: KRITA_SHELLEX must not be set if using KRITA_INSTALLER.
- exit /b 1
- )
-)
-
-goto begin
-
-
-:: Subroutines
-
-:get_rel_path out_variable file_path base_path
-setlocal enableextensions
-set FULL_PATH=%~f2
-set FULL_BASE=%~f3
-for /L %%n in (1 1 512) do if "!FULL_BASE:~%%n,1!" neq "" set /a "FULL_BASE_len=%%n+1"
-set /a "FULL_BASE_len_plus_one=%FULL_BASE_len%+1"
-if not exist "%FULL_PATH%" (
- set REL_PATH=
-) else (
- if not exist "%FULL_BASE%" (
- set REL_PATH=
- ) else (
- if "!FULL_PATH:~0,%FULL_BASE_len%!" == "%FULL_BASE%" (
- set REL_PATH=!FULL_PATH:~%FULL_BASE_len_plus_one%!
- ) else (
- set REl_PATH=
- )
- )
-)
-endlocal & set "%1=%REL_PATH%"
-goto :EOF
-
-
-:get_temp_file out_variable
-setlocal enableextensions
-set "uniqueFileName=%tmp%\bat~%RANDOM%.tmp"
-if exist "%uniqueFileName%" call :get_temp_file uniqueFileName
-endlocal & set "%1=%uniqueFileName%"
-goto :EOF
-
-
-:find_on_path out_variable file_name
-set %1=%~f$PATH:2
-goto :EOF
-
-
-:: ----------------------------
-:begin
-
-
-echo *** Krita MSIX build script ***
-
-if "%WindowsSdkDir%" == "" if not "%ProgramFiles(x86)%" == "" set "WindowsSdkDir=%ProgramFiles(x86)%\Windows Kits\10"
-if "%WindowsSdkDir%" == "" set "WindowsSdkDir=%ProgramFiles(x86)%\Windows Kits\10"
-if exist "%WindowsSdkDir%\" (
- pushd "%WindowsSdkDir%"
- for /f "delims=" %%a in ('dir /a:d /b "bin\10.*"') do (
- if exist "bin\%%a\x64\makeappx.exe" (
- set "MAKEPRI=%WindowsSdkDir%\bin\%%a\x64\makepri.exe"
- )
- if exist "bin\%%a\x64\makeappx.exe" (
- set "MAKEAPPX=%WindowsSdkDir%\bin\%%a\x64\makeappx.exe"
- )
- if exist "bin\%%a\x64\signtool.exe" (
- set "SIGNTOOL=%WindowsSdkDir%\bin\%%a\x64\signtool.exe"
- )
- )
- if "%MAKEPRI%" == "" if exist "bin\x64\makepri.exe" (
- set "MAKEPRI=%WindowsSdkDir%\bin\x64\makepri.exe"
- )
- if "%MAKEAPPX%" == "" if exist "bin\x64\makeappx.exe" (
- set "MAKEAPPX=%WindowsSdkDir%\bin\x64\makeappx.exe"
- )
- if "%SIGNTOOL%" == "" if exist "bin\x64\signtool.exe" (
- set "SIGNTOOL=%WindowsSdkDir%\bin\x64\signtool.exe"
- )
- popd
-)
-if "%MAKEPRI%" == "" (
- echo ERROR: makepri not found 1>&2
- exit /b 1
-)
-if "%MAKEAPPX%" == "" (
- echo ERROR: makeappx not found 1>&2
- exit /b 1
-)
-if "%SIGNTOOL%" == "" (
- echo ERROR: signtool not found 1>&2
- exit /b 1
-)
-
-set SCRIPT_DIR=%~dp0
-mkdir "%OUTPUT_DIR%"
-
-
-if defined KRITA_DIR goto skip_extract_installer
-
-echo.
-echo === Step 0: Extract files from installer
-
-if "%SEVENZIP_EXE%" == "" (
- call :find_on_path SEVENZIP_EXE 7z.exe
-)
-if "%SEVENZIP_EXE%" == "" (
- call :find_on_path SEVENZIP_EXE 7za.exe
-)
-if "!SEVENZIP_EXE!" == "" (
- set "SEVENZIP_EXE=%ProgramFiles%\7-Zip\7z.exe"
- if not exist "!SEVENZIP_EXE!" (
- set "SEVENZIP_EXE=%ProgramFiles(x86)%\7-Zip\7z.exe"
- )
- if not exist "!SEVENZIP_EXE!" (
- echo 7-Zip not found! 1>&2
- exit /b 102
- )
-)
-
-pushd %OUTPUT_DIR%
-if errorlevel 1 (
- echo ERROR entering "%OUTPUT_DIR%" 1>&2
- exit /B 1
-)
-
-mkdir installer_content
-cd installer_content
-"%SEVENZIP_EXE%" x "%KRITA_INSTALLER%"
-if errorlevel 1 (
- echo ERROR failed to extract installer "%KRITA_INSTALLER%" 1>&2
- exit /B 1
-)
-rmdir /s /q $PLUGINSDIR
-del /q uninstall.exe.nsis uninstall.exe
-set KRITA_DIR=%CD%
-
-popd
-
-echo === Step 0 done. ===
-
-
-:skip_extract_installer
-
-if not defined KRITA_SHELLEX goto skip_copy_shellex_files
-
-echo.
-echo === Step 0: Copy files for shell extension
-
-pushd "%KRITA_DIR%"
-if errorlevel 1 (
- echo ERROR entering "%KRITA_DIR%" 1>&2
- exit /B 1
-)
-mkdir shellex
-if errorlevel 1 (
- echo ERROR mkdir shellex failed 1>&2
- exit /B 1
-)
-copy "%KRITA_SHELLEX%\krita.ico" shellex
-if errorlevel 1 (
- echo ERROR copying krita.ico failed 1>&2
- exit /B 1
-)
-copy "%KRITA_SHELLEX%\kritafile.ico" shellex
-if errorlevel 1 (
- echo ERROR copying kritafile.ico failed 1>&2
- exit /B 1
-)
-copy "%KRITA_SHELLEX%\kritashellex32.dll" shellex
-if errorlevel 1 (
- echo ERROR copying kritashellex32.dll failed 1>&2
- exit /B 1
-)
-copy "%KRITA_SHELLEX%\kritashellex64.dll" shellex
-if errorlevel 1 (
- echo ERROR copying kritashellex64.dll failed 1>&2
- exit /B 1
-)
-:: Optional files:
-copy "%KRITA_SHELLEX%\kritashellex32.pdb" shellex
-copy "%KRITA_SHELLEX%\kritashellex64.pdb" shellex
-
-popd
-
-echo === Step 0 done. ===
-
-
-:skip_copy_shellex_files
-
-rem Sanity checks:
-if not exist "%KRITA_DIR%\bin\krita.exe" (
- echo ERROR: KRITA_DIR is set to "%KRITA_DIR%" but "%KRITA_DIR%\bin\krita.exe" does not exist! 1>&2
- exit /B 1
-)
-if not exist "%KRITA_DIR%\shellex\kritashellex64.dll" (
- echo ERROR: "%KRITA_DIR%\shellex\kritashellex64.dll" does not exist! 1>&2
- exit /B 1
-)
-if exist "%KRITA_DIR%\bin\.debug" (
- echo ERROR: Package dir seems to contain debug symbols [gcc/mingw].
- exit /B 1
-)
-if exist "%KRITA_DIR%\bin\*.pdb" (
- echo ERROR: Package dir seems to contain debug symbols [msvc].
- exit /B 1
-)
-if exist "%KRITA_DIR%\$PLUGINSDIR" (
- echo ERROR: You did not remove "$PLUGINSDIR".
- exit /B 1
-)
-if exist "%KRITA_DIR%\uninstall.exe.nsis" (
- echo ERROR: You did not remove "uninstall.exe.nsis".
- exit /B 1
-)
-if exist "%KRITA_DIR%\uninstall.exe*" (
- echo ERROR: You did not remove "uninstall.exe*".
- exit /B 1
-)
-
-
-echo.
-echo === Step 1: Generate resources.pri ===
-
-"%MAKEPRI%" new /pr "%SCRIPT_DIR%pkg" /mn "%SCRIPT_DIR%manifest.xml" /cf "%SCRIPT_DIR%priconfig.xml" /o /of "%OUTPUT_DIR%\resources.pri"
-if errorlevel 1 (
- echo ERROR running makepri 1>&2
- exit /B 1
-)
-
-echo === Step 1 done. ===
-
-
-echo.
-echo === Step 2: Generate file mapping list ===
-
-set "ASSETS_DIR=%SCRIPT_DIR%pkg\Assets"
-set "MAPPING_OUT=%OUTPUT_DIR%\mapping.txt"
-
-
-call :get_temp_file OUT_TEMP
-echo Writing list to temporary file "%OUT_TEMP%"
-
-echo [Files] > %OUT_TEMP%
-echo "%SCRIPT_DIR%manifest.xml" "AppxManifest.xml" >> %OUT_TEMP%
-echo "%OUTPUT_DIR%\resources.pri" "Resources.pri" >> %OUT_TEMP%
-
-rem Krita application files:
-pushd "%KRITA_DIR%"
-for /r %%a in (*) do (
- call :get_rel_path rel "%%a" "%CD%"
- echo "%%a" "krita\!rel!" >> %OUT_TEMP%
-)
-popd
-
-rem Assets:
-pushd "%ASSETS_DIR%"
-for /r %%a in (*) do (
- call :get_rel_path rel "%%a" "%CD%"
- echo "%%a" "Assets\!rel!" >> %OUT_TEMP%
-)
-popd
-
-copy "%OUT_TEMP%" "%MAPPING_OUT%"
-del "%OUT_TEMP%"
-
-echo Written mapping file to "%MAPPING_OUT%"
-echo === Step 2 done. ===
-
-
-echo.
-echo === Step 3: Make MSIX with makeappx.exe ===
-
-goto step3_begin
-
-:: ----------------------------
-(this is a comment block...)
-
-For reference, the MSIX Packaging tool uses the following command arguments:
- pack /v /o /l /nv /nfv /f "%UserProfile%\AppData\Local\Packages\Microsoft.MsixPackagingTool_8wekyb3d8bbwe\LocalState\DiagOutputDir\Logs\wox1ifkc.h0i.txt" /p "D:\dev\krita\msix\Krita-testing_4.3.0.0_x64__svcxxs8w6n55m.msix"
-
-The arguments stands for:
- pack: Creates a package.
- /v: Enable verbose logging output to the console.
- /o: Overwrites the output file if it exists. If you don't specify this option or the /no option, the user is asked whether they want to overwrite the file.
- /l: Used for localized packages. The default validation trips on localized packages. This options disables only that specific validation, without requiring that all validation be disabled.
- /nv: Skips semantic validation. If you don't specify this option, the tool performs a full validation of the package.
- /nfv: ???
- /f <mapping file>: Specifies the mapping file.
- /p <output package name>: Specifies the app package or bundle.
-:: ----------------------------
-
-:step3_begin
-
-
-"%MAKEAPPX%" pack /v /f "%OUTPUT_DIR%\mapping.txt" /p "%OUTPUT_DIR%\krita.msix" /o
-if errorlevel 1 (
- echo ERROR running makeappx 1>&2
- exit /B 1
-)
-
-echo.
-echo MSIX generated as "%OUTPUT_DIR%\krita.msix".
-
-if "%SIGNTOOL_SIGN_FLAGS%" == "" goto skip_signing
-
-echo Signing MSIX...
-"%SIGNTOOL%" sign %SIGNTOOL_SIGN_FLAGS% /fd sha256 "%OUTPUT_DIR%\krita.msix"
-if errorlevel 1 (
- echo ERROR running signtool 1>&2
- echo If you need to specify a PFX keyfile and its password, run:
- echo set SIGNTOOL_SIGN_FLAGS=/f "absolute_path_to_keyfile.pfx" /p password
- exit /B 1
-)
-
-:skip_signing
-
-echo === Step 3 done. ===
-
-echo *** Script completed ***
diff --git a/packaging/windows/package-complete.cmd b/packaging/windows/package-complete.cmd
deleted file mode 100644
index 4c79178b00..0000000000
--- a/packaging/windows/package-complete.cmd
+++ /dev/null
@@ -1,918 +0,0 @@
-@echo off
-:: This batch script is meant to prepare a Krita package folder to be zipped or
-:: to be a base for the installer.
-
-:: --------
-
-setlocal enabledelayedexpansion
-goto begin
-
-
-:: Subroutines
-
-:find_on_path out_variable file_name
-set %1=%~f$PATH:2
-goto :EOF
-
-
-:get_dir_path out_variable file_path
-set %1=%~dp2
-goto :EOF
-
-
-:get_full_path out_variable file_path
-setlocal
-set FULL_PATH=%~f2
-if not exist "%FULL_PATH%" (
- set FULL_PATH=
-)
-:: else (
- :: TODO: do NOT use this way of checking! On Windows Server with docker,
- :: this check triggers for normal files as well!
- :: if exist "%FULL_PATH%\" (
- :: set FULL_PATH=
- :: )
-:: )
-endlocal & set "%1=%FULL_PATH%"
-goto :EOF
-
-
-:get_full_path_dir out_variable file_path
-setlocal
-set FULL_PATH=%~dp2
-if not exist "%FULL_PATH%" (
- set FULL_PATH=
-)
-endlocal & set "%1=%FULL_PATH%"
-goto :EOF
-
-
-:prompt_for_string out_variable prompt
-set /p %1=%~2^>
-goto :EOF
-
-
-:prompt_for_positive_integer out_variable prompt
-setlocal
-call :prompt_for_string USER_INPUT "%~2"
-if "%USER_INPUT%" == "" set USER_INPUT=0
-set /a RESULT=%USER_INPUT%
-if not %RESULT% GTR 0 (
- set RESULT=
-)
-endlocal & set "%1=%RESULT%"
-goto :EOF
-
-
-:prompt_for_file out_variable prompt
-setlocal
-:prompt_for_file__retry
-call :prompt_for_string USER_INPUT "%~2"
-if "%USER_INPUT%" == "" (
- endlocal
- set %1=
- goto :EOF
-)
-call :get_full_path RESULT "%USER_INPUT%"
-if "%RESULT%" == "" (
- echo Input does not point to valid file!
- set USER_INPUT=
- goto prompt_for_file__retry
-)
-endlocal & set "%1=%RESULT%"
-goto :EOF
-
-
-:prompt_for_dir out_variable prompt
-setlocal
-:prompt_for_dir__retry
-call :prompt_for_string USER_INPUT "%~2"
-if "%USER_INPUT%" == "" (
- endlocal
- set %1=
- goto :EOF
-)
-call :get_full_path_dir RESULT "%USER_INPUT%\"
-if "%RESULT%" == "" (
- echo Input does not point to valid dir!
- set USER_INPUT=
- goto prompt_for_dir__retry
-)
-endlocal & set "%1=%RESULT%"
-goto :EOF
-
-
-:usage
-echo Usage:
-echo %~n0 [--no-interactive --package-name ^<name^>] [ OPTIONS ... ]
-echo.
-echo Basic options:
-echo --no-interactive Run without interactive prompts
-echo When not specified, the script will prompt
-echo for some of the parameters.
-echo --package-name ^<name^> Specify the package name
-echo.
-echo Path options:
-echo --src-dir ^<dir_path^> Specify Krita source dir
-echo If unspecified, this will be determined from
-echo the script location
-echo --deps-install-dir ^<dir_path^> Specify deps install dir
-echo --krita-install-dir ^<dir_path^> Specify Krita install dir
-echo.
-echo Special options:
-echo --pre-zip-hook ^<script_path^> Specify a script to be called before
-echo packaging the zip archive, can be used to
-echo sign the binaries
-echo.
-goto :EOF
-:usage_and_exit
-call :usage
-exit /b
-:usage_and_fail
-call :usage
-exit /b 100
-
-
-:: ----------------------------
-:begin
-
-echo Krita Windows packaging script
-echo.
-
-
-:: command-line args parsing
-set ARG_NO_INTERACTIVE=
-set ARG_PACKAGE_NAME=
-set ARG_SRC_DIR=
-set ARG_DEPS_INSTALL_DIR=
-set ARG_KRITA_INSTALL_DIR=
-set ARG_PRE_ZIP_HOOK=
-:args_parsing_loop
-set CURRENT_MATCHED=
-if not "%1" == "" (
- if "%1" == "--no-interactive" (
- set ARG_NO_INTERACTIVE=1
- set CURRENT_MATCHED=1
- )
- if "%1" == "--package-name" (
- if not "%ARG_PACKAGE_NAME%" == "" (
- echo ERROR: Arg --package-name specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~2" == "" (
- echo ERROR: Arg --package-name is empty 1>&2
- echo.
- goto usage_and_fail
- )
- set "ARG_PACKAGE_NAME=%~2"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--src-dir" (
- if not "%ARG_SRC_DIR%" == "" (
- echo ERROR: Arg --src-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if not exist "%~f2\" (
- echo ERROR: Arg --src-dir does not point to a directory 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_SRC_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--deps-install-dir" (
- if not "%ARG_DEPS_INSTALL_DIR%" == "" (
- echo ERROR: Arg --deps-install-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --deps-install-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_DEPS_INSTALL_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--krita-install-dir" (
- if not "%ARG_KRITA_INSTALL_DIR%" == "" (
- echo ERROR: Arg --krita-install-dir specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --krita-install-dir does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_dir_path ARG_KRITA_INSTALL_DIR "%~f2\"
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--pre-zip-hook" (
- if not "%ARG_PRE_ZIP_HOOK%" == "" (
- echo ERROR: Arg --pre-zip-hook specified more than once 1>&2
- echo.
- goto usage_and_fail
- )
- if "%~f2" == "" (
- echo ERROR: Arg --pre-zip-hook does not point to a valid path 1>&2
- echo.
- goto usage_and_fail
- )
- call :get_full_path ARG_PRE_ZIP_HOOK "%~f2"
- if "!ARG_PRE_ZIP_HOOK!" == "" (
- echo ERROR: Arg --pre-zip-hook does not point to a valid file 1>&2
- echo.
- goto usage_and_fail
- )
- shift /2
- set CURRENT_MATCHED=1
- )
- if "%1" == "--help" (
- goto usage_and_exit
- )
- if not "!CURRENT_MATCHED!" == "1" (
- echo ERROR: Unknown option %1 1>&2
- echo.
- goto usage_and_fail
- )
- shift /1
- goto args_parsing_loop
-)
-
-if "%ARG_NO_INTERACTIVE%" == "1" (
- if "%ARG_PACKAGE_NAME%" == "" (
- echo ERROR: Required arg --package-name not specified! 1>&2
- echo.
- goto usage_and_fail
- )
-)
-
-if "%ARG_NO_INTERACTIVE%" == "1" (
- echo Non-interactive mode
-) else (
- echo Interactive mode
- :: Trick to pause on exit
- call :real_begin
- pause
- exit /b !ERRORLEVEL!
-)
-:real_begin
-echo.
-
-
-if "%ARG_PACKAGE_NAME%" == "" (
- call :prompt_for_string ARG_PACKAGE_NAME "Provide package name"
- if "ARG_PACKAGE_NAME" == "" (
- echo ERROR: Package name not set! 1>&2
- exit /b 102
- )
-)
-
-
-:: Check environment config
-
-if "%SEVENZIP_EXE%" == "" (
- call :find_on_path SEVENZIP_EXE 7z.exe
-)
-if "%SEVENZIP_EXE%" == "" (
- call :find_on_path SEVENZIP_EXE 7za.exe
-)
-if "!SEVENZIP_EXE!" == "" (
- set "SEVENZIP_EXE=%ProgramFiles%\7-Zip\7z.exe"
- if not exist "!SEVENZIP_EXE!" (
- set "SEVENZIP_EXE=%ProgramFiles(x86)%\7-Zip\7z.exe"
- )
- if not exist "!SEVENZIP_EXE!" (
- echo 7-Zip not found! 1>&2
- exit /b 102
- )
-)
-echo 7-Zip: %SEVENZIP_EXE%
-
-if "%MINGW_BIN_DIR%" == "" (
- call :find_on_path MINGW_BIN_DIR_MAKE_EXE mingw32-make.exe
- if "!MINGW_BIN_DIR_MAKE_EXE!" == "" (
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- call :prompt_for_file MINGW_BIN_DIR_MAKE_EXE "Provide path to mingw32-make.exe of mingw-w64"
- )
- if "!MINGW_BIN_DIR_MAKE_EXE!" == "" (
- echo ERROR: mingw-w64 not found! 1>&2
- exit /b 102
- )
- call :get_dir_path MINGW_BIN_DIR "!MINGW_BIN_DIR_MAKE_EXE!"
- ) else (
- call :get_dir_path MINGW_BIN_DIR "!MINGW_BIN_DIR_MAKE_EXE!"
- echo Found mingw on PATH: !MINGW_BIN_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this correct? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_file MINGW_BIN_DIR_MAKE_EXE "Provide path to mingw32-make.exe of mingw-w64"
- if "!MINGW_BIN_DIR_MAKE_EXE!" == "" (
- echo ERROR: mingw-w64 not found! 1>&2
- exit /b 102
- )
- call :get_dir_path MINGW_BIN_DIR "!MINGW_BIN_DIR_MAKE_EXE!"
- )
- )
- )
-)
-echo mingw-w64: %MINGW_BIN_DIR%
-
-if "%PYTHON_BIN_DIR%" == "" (
- call :find_on_path PYTHON_BIN_DIR_PYTHON_EXE python.exe
- if "!PYTHON_BIN_DIR_PYTHON_EXE!" == "" (
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- call :prompt_for_file PYTHON_BIN_DIR_PYTHON_EXE "Provide path to python.exe"
- )
- if "!PYTHON_BIN_DIR_PYTHON_EXE!" == "" (
- echo ERROR: python.exe not found! 1>&2
- exit /b 102
- )
- call :get_dir_path PYTHON_BIN_DIR "!PYTHON_BIN_DIR_PYTHON_EXE!"
- ) else (
- call :get_dir_path PYTHON_BIN_DIR "!PYTHON_BIN_DIR_PYTHON_EXE!"
- echo Found python.exe on PATH: !PYTHON_BIN_DIR!
- )
-)
-echo "Python path found: %PYTHON_BIN_DIR%"
-
-:: Windows SDK is needed for windeployqt to get d3dcompiler_xx.dll
-if "%WindowsSdkDir%" == "" if not "%ProgramFiles(x86)%" == "" set "WindowsSdkDir=%ProgramFiles(x86)%\Windows Kits\10"
-if "%WindowsSdkDir%" == "" set "WindowsSdkDir=%ProgramFiles(x86)%\Windows Kits\10"
-if exist "%WindowsSdkDir%\" (
- pushd "%WindowsSdkDir%"
- if exist "bin\x64\fxc.exe" (
- set HAVE_FXC_EXE=1
- ) else (
- for /f "delims=" %%a in ('dir /a:d /b "bin\10.*"') do (
- if exist "bin\%%a\x64\fxc.exe" (
- set HAVE_FXC_EXE=1
- )
- )
- )
- popd
-)
-if not "%HAVE_FXC_EXE%" == "1" (
- set WindowsSdkDir=
- echo Windows SDK 10 with fxc.exe not found
- echo If Qt was built with ANGLE ^(dynamic OpenGL^) support, the package might not work properly on some systems!
-) else echo Windows SDK 10 with fxc.exe found on %WindowsSdkDir%
-
-if not "%ARG_SRC_DIR%" == "" (
- set "KRITA_SRC_DIR=%ARG_SRC_DIR%"
-)
-if "%KRITA_SRC_DIR%" == "" (
- :: Check whether this looks like to be in the source tree
- set "_temp=%~dp0"
- if "!_temp:~-19!" == "\packaging\windows\" (
- if exist "!_temp:~0,-19!\CMakeLists.txt" (
- if exist "!_temp:~0,-19!\3rdparty\CMakeLists.txt" (
- set "KRITA_SRC_DIR=!_temp:~0,-19!\"
- echo Script is running inside Krita src dir
- )
- )
- )
-)
-if "%KRITA_SRC_DIR%" == "" (
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- call :prompt_for_dir KRITA_SRC_DIR "Provide path of Krita src dir"
- )
- if "!KRITA_SRC_DIR!" == "" (
- echo ERROR: Krita src dir not found! 1>&2
- exit /b 102
- )
-)
-echo Krita src: %KRITA_SRC_DIR%
-
-if not "%ARG_DEPS_INSTALL_DIR%" == "" (
- set "DEPS_INSTALL_DIR=%ARG_DEPS_INSTALL_DIR%"
-)
-if "%DEPS_INSTALL_DIR%" == "" (
- set DEPS_INSTALL_DIR=%CD%\i_deps\
- echo Using default deps install dir: !DEPS_INSTALL_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir DEPS_INSTALL_DIR "Provide path of deps install dir"
- )
- )
- if "!DEPS_INSTALL_DIR!" == "" (
- echo ERROR: Deps install dir not set! 1>&2
- exit /b 102
- )
-)
-echo Deps install dir: %DEPS_INSTALL_DIR%
-
-if not "%ARG_KRITA_INSTALL_DIR%" == "" (
- set "KRITA_INSTALL_DIR=%ARG_KRITA_INSTALL_DIR%"
-)
-if "%KRITA_INSTALL_DIR%" == "" (
- set KRITA_INSTALL_DIR=%CD%\i\
- echo Using default Krita install dir: !KRITA_INSTALL_DIR!
- if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is this ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- call :prompt_for_dir KRITA_INSTALL_DIR "Provide path of Krita install dir"
- )
- )
- if "!KRITA_INSTALL_DIR!" == "" (
- echo ERROR: Krita install dir not set! 1>&2
- exit /b 102
- )
-)
-echo Krita install dir: %KRITA_INSTALL_DIR%
-
-
-:: Simple checking
-if not exist "%DEPS_INSTALL_DIR%\" (
- echo ERROR: Cannot find the deps install folder! 1>&2
- exit /B 1
-)
-if not exist "%KRITA_INSTALL_DIR%\" (
- echo ERROR: Cannot find the krita install folder! 1>&2
- exit /B 1
-)
-if not "%DEPS_INSTALL_DIR: =%" == "%DEPS_INSTALL_DIR%" (
- echo ERROR: Deps install path contains space, which will not work properly! 1>&2
- exit /B 1
-)
-if not "%KRITA_INSTALL_DIR: =%" == "%KRITA_INSTALL_DIR%" (
- echo ERROR: Krita install path contains space, which will not work properly! 1>&2
- exit /B 1
-)
-
-set pkg_name=%ARG_PACKAGE_NAME%
-echo Package name is "%pkg_name%"
-
-set pkg_root=%CD%\%pkg_name%
-echo Packaging dir is %pkg_root%
-echo.
-if exist %pkg_root% (
- echo ERROR: Packaging dir already exists! Please remove or rename it first.
- exit /B 1
-)
-if exist %pkg_root%.zip (
- echo ERROR: Packaging zip already exists! Please remove or rename it first.
- exit /B 1
-)
-if exist %pkg_root%-dbg.zip (
- echo ERROR: Packaging debug zip already exists! Please remove or rename it first.
- exit /B 1
-)
-
-echo.
-
-
-if not "%ARG_NO_INTERACTIVE%" == "1" (
- choice /c ny /n /m "Is the above ok? [y/n] "
- if errorlevel 3 exit 255
- if not errorlevel 2 (
- exit /b 1
- )
- echo.
-)
-
-
-:: Initialize clean PATH
-set "PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\"
-set "PATH=%MINGW_BIN_DIR%;%DEPS_INSTALL_DIR%\bin;%PATH%"
-
-
-echo.
-echo Trying to guess compiler version...
-for %%a in (g++ clang++) do (
- %%a --version > NUL
- if not errorlevel 1 (
- set CC=%%a
- )
-)
-if "%CC%" == "" (
- echo ERROR: No working compiler.
- exit /B 1
-)
-%CC% --version > NUL
-for /f "delims=" %%a in ('%CC% --version ^| find "g++"') do set GCC_VERSION_LINE=%%a
-:: The space in "clang " is essential to detect
-:: the version line and not the InstalledDir
-if "%GCC_VERSION_LINE%" == "" (
- for /f "delims=" %%a in ('%CC% --version ^| find "clang "') do set GCC_VERSION_LINE=%%a
-)
-if "%GCC_VERSION_LINE%" == "" (
- echo ERROR: Failed to get version of g++.
- exit /B 1
-)
-echo -- %GCC_VERSION_LINE%
-set IS_TDM=
-set IS_MSYS=
-set IS_CLANG=
-if not "%GCC_VERSION_LINE:tdm64=%" == "%GCC_VERSION_LINE%" (
- echo Compiler looks like TDM64-GCC
- set IS_TDM=1
-) else if not "%GCC_VERSION_LINE:MSYS=%" == "%GCC_VERSION_LINE%" (
- echo Compiler looks like MSYS GCC
- set IS_MSYS=1
-) else if not "%GCC_VERSION_LINE:clang=%" == "%GCC_VERSION_LINE%" (
- echo Compiler looks like Clang
- set IS_CLANG=1
-) else (
- echo Compiler looks like plain old MinGW64
-)
-set IS_LLVM_MINGW=
-set IS_MSYS_CLANG=
-if not x%IS_CLANG% == x (
- rem Look for the multiarch target binary dirs. Unfortunately there is
- rem no surefire way to detect a llvm-mingw toolchain.
- if exist "%MINGW_BIN_DIR%\..\i686-w64-mingw32\bin\" (
- if exist "%MINGW_BIN_DIR%\..\x86_64-w64-mingw32\bin\" (
- echo Toolchain looks like llvm-mingw
- set IS_LLVM_MINGW=1
- )
- )
- if "!IS_LLVM_MINGW!" == "" (
- echo Toolchain does not look like llvm-mingw, assuming MSYS Clang
- set IS_MSYS_CLANG=1
- )
-)
-
-echo.
-echo Trying to guess target architecture...
-set OBJDUMP=
-for %%a in (objdump llvm-objdump) do (
- %%a --version > NUL
- if not errorlevel 1 (
- set OBJDUMP=%%a
- )
-)
-if "%OBJDUMP%" == "" (
- echo ERROR: objdump is not working.
- exit /B 1
-)
-for /f "delims=, tokens=1" %%a in ('%OBJDUMP% -f %KRITA_INSTALL_DIR%\bin\krita.exe ^| find "i386"') do set TARGET_ARCH_LINE=%%a
-if "%TARGET_ARCH_LINE%" == "" (
- echo Possible LLVM objdump, trying to detect architecture...
- for /f "delims=" %%a in ('%OBJDUMP% -f %KRITA_INSTALL_DIR%\bin\krita.exe ^| find "coff"') do set TARGET_ARCH_LINE=%%a
-)
-echo -- %TARGET_ARCH_LINE%
-if "%TARGET_ARCH_LINE:x86-64=%" == "%TARGET_ARCH_LINE%" (
- echo Target looks like x86
- set IS_X64=
-) else (
- echo Target looks like x64
- set IS_x64=1
-)
-
-echo.
-echo Testing for objcopy...
-objcopy --version > NUL
-if errorlevel 1 (
- echo ERROR: objcopy is not working.
- exit /B 1
-)
-
-echo.
-echo Testing for strip...
-strip --version > NUL
-if errorlevel 1 (
- echo ERROR: strip is not working.
- exit /B 1
-)
-
-echo.
-echo Creating base directories...
-mkdir %pkg_root% && ^
-mkdir %pkg_root%\bin && ^
-mkdir %pkg_root%\etc && ^
-mkdir %pkg_root%\lib && ^
-mkdir %pkg_root%\share
-if errorlevel 1 (
- echo ERROR: Cannot create packaging dir tree!
- %PAUSE%
- exit /B 1
-)
-
-echo.
-echo Copying GCC libraries...
-set "STDLIBS_DIR=%MINGW_BIN_DIR%"
-if not x%IS_TDM% == x (
- if x%is_x64% == x (
- :: TDM-GCC x86
- set "STDLIBS=libgomp-1"
- ) else (
- :: TDM-GCC x64
- set "STDLIBS=libgomp_64-1"
- )
-) else if not x%IS_MSYS% == x (
- if x%is_x64% == x (
- :: msys-mingw-w64 x86
- set "STDLIBS=libgcc_s_dw2-1 libgomp-1 libstdc++-6 libwinpthread-1 libatomic-1 libiconv-2 zlib1 libexpat-1 libintl-8 libssl-1_1 libcrypto-1_1"
- ) else (
- :: msys-mingw-w64 x64
- set "STDLIBS=libgcc_s_seh-1 libgomp-1 libstdc++-6 libwinpthread-1 libatomic-1 libiconv-2 zlib1 libexpat-1 libintl-8 libssl-1_1-x64 libcrypto-1_1-x64"
- )
-) else if not x%IS_MSYS_CLANG% == x (
- if x%is_x64% == x (
- :: msys-mingw-w64-clang64 x86
- set "STDLIBS=libomp libssp-0 libunwind libc++ libwinpthread-1 libiconv-2 zlib1 libexpat-1 libintl-8 libssl-1_1 libcrypto-1_1"
- ) else (
- :: msys-mingw-w64-clang64 x64
- set "STDLIBS=libomp libssp-0 libunwind libc++ libwinpthread-1 libiconv-2 zlib1 libexpat-1 libintl-8 libssl-1_1-x64 libcrypto-1_1-x64"
- )
-) else if not x%IS_LLVM_MINGW% == x (
- :: llvm-mingw
- set "STDLIBS=libc++ libomp libssp-0 libunwind libwinpthread-1"
- rem The toolchain does not include all of the DLLs in the compiler bin dir,
- rem so we need to copy them from the cross target bin dir.
- if x%is_x64% == x (
- set "STDLIBS_DIR=%MINGW_BIN_DIR%\..\i686-w64-mingw32\bin"
- ) else (
- set "STDLIBS_DIR=%MINGW_BIN_DIR%\..\x86_64-w64-mingw32\bin"
- )
-) else (
- if x%is_x64% == x (
- :: mingw-w64 x86
- set "STDLIBS=libgcc_s_dw2-1 libgomp-1 libstdc++-6 libwinpthread-1"
- ) else (
- :: mingw-w64 x64
- set "STDLIBS=libgcc_s_seh-1 libgomp-1 libstdc++-6 libwinpthread-1"
- )
-)
-
-for %%L in (%STDLIBS%) do copy "%STDLIBS_DIR%\%%L.dll" %pkg_root%\bin
-
-echo.
-echo Copying files...
-:: krita.exe
-copy %KRITA_INSTALL_DIR%\bin\krita.exe %pkg_root%\bin
-copy %KRITA_INSTALL_DIR%\bin\krita.com %pkg_root%\bin
-:: kritarunner.exe
-copy %KRITA_INSTALL_DIR%\bin\kritarunner.exe %pkg_root%\bin
-copy %KRITA_INSTALL_DIR%\bin\kritarunner.com %pkg_root%\bin
-
-if exist %KRITA_INSTALL_DIR%\bin\FreehandStrokeBenchmark.exe (
- :: FreehandStrokeBenchmark.exe
- copy %KRITA_INSTALL_DIR%\bin\FreehandStrokeBenchmark.exe %pkg_root%\bin
- xcopy /S /Y /I %DEPS_INSTALL_DIR%\bin\data %pkg_root%\bin\data
-)
-
-:: qt.conf -- to specify the location to Qt translations
-copy %KRITA_SRC_DIR%\packaging\windows\qt.conf %pkg_root%\bin
-:: DLLs from bin/
-echo INFO: Copying all DLLs except Qt5* from bin/
-setlocal enableextensions enabledelayedexpansion
-for /f "delims=" %%F in ('dir /b "%KRITA_INSTALL_DIR%\bin\*.dll"') do (
- set file=%%F
- set file=!file:~0,3!
- if not x!file! == xQt5 copy "%KRITA_INSTALL_DIR%\bin\%%F" %pkg_root%\bin
-)
-for /f "delims=" %%F in ('dir /b "%DEPS_INSTALL_DIR%\bin\*.dll"') do (
- set file=%%F
- set file=!file:~0,3!
- if not x!file! == xQt5 copy "%DEPS_INSTALL_DIR%\bin\%%F" %pkg_root%\bin
-)
-endlocal
-:: symsrv.yes for Dr. Mingw
-copy %DEPS_INSTALL_DIR%\bin\symsrv.yes %pkg_root%\bin
-:: DLLs from lib/
-echo INFO: Copying all DLLs from lib/ (deps)
-copy %DEPS_INSTALL_DIR%\lib\*.dll %pkg_root%\bin
-:: Boost, there might be more than one leftover but we can't really do much
-copy %DEPS_INSTALL_DIR%\bin\libboost_system-*.dll %pkg_root%\bin
-:: KF5 plugins may be placed at different locations depending on how Qt is built
-xcopy /S /Y /I %DEPS_INSTALL_DIR%\lib\plugins\imageformats %pkg_root%\bin\imageformats
-xcopy /S /Y /I %DEPS_INSTALL_DIR%\plugins\imageformats %pkg_root%\bin\imageformats
-xcopy /S /Y /I %DEPS_INSTALL_DIR%\lib\plugins\kf5 %pkg_root%\bin\kf5
-xcopy /S /Y /I %DEPS_INSTALL_DIR%\plugins\kf5 %pkg_root%\bin\kf5
-
-:: Copy the sql drivers explicitly
-xcopy /S /Y /I %DEPS_INSTALL_DIR%\plugins\sqldrivers %pkg_root%\bin\sqldrivers
-
-:: Qt Translations
-:: it seems that windeployqt does these, but only *some* of these???
-mkdir %pkg_root%\bin\translations
-setlocal enableextensions enabledelayedexpansion
-for /f "delims=" %%F in ('dir /b "%DEPS_INSTALL_DIR%\translations\qt_*.qm"') do (
- :: Exclude qt_help_*.qm
- set temp=%%F
- set temp2=!temp:_help=!
- if x!temp2! == x!temp! copy %DEPS_INSTALL_DIR%\translations\!temp! %pkg_root%\bin\translations\!temp!
-)
-endlocal
-:: Krita plugins
-xcopy /Y %KRITA_INSTALL_DIR%\lib\kritaplugins\*.dll %pkg_root%\lib\kritaplugins\
-xcopy /Y /S /I %DEPS_INSTALL_DIR%\lib\krita-python-libs %pkg_root%\lib\krita-python-libs
-xcopy /Y /S /I %KRITA_INSTALL_DIR%\lib\krita-python-libs %pkg_root%\lib\krita-python-libs
-
-:: MLT plugins and their data
-xcopy /S /Y /I %DEPS_INSTALL_DIR%\lib\mlt %pkg_root%\lib\mlt
-xcopy /S /Y /I %DEPS_INSTALL_DIR%\share\mlt %pkg_root%\share\mlt
-
-:: Fontconfig
-xcopy /Y /S /I %DEPS_INSTALL_DIR%\etc\fonts %pkg_root%\etc\fonts
-
-:: Share
-xcopy /Y /S /I %KRITA_INSTALL_DIR%\share\color %pkg_root%\share\color
-xcopy /Y /S /I %KRITA_INSTALL_DIR%\share\color-schemes %pkg_root%\share\color-schemes
-xcopy /Y /S /I %KRITA_INSTALL_DIR%\share\icons %pkg_root%\share\icons
-xcopy /Y /S /I %KRITA_INSTALL_DIR%\share\krita %pkg_root%\share\krita
-xcopy /Y /S /I %KRITA_INSTALL_DIR%\share\kritaplugins %pkg_root%\share\kritaplugins
-xcopy /Y /S /I %DEPS_INSTALL_DIR%\share\kf5 %pkg_root%\share\kf5
-xcopy /Y /S /I %DEPS_INSTALL_DIR%\share\mime %pkg_root%\share\mime
-:: Python libs
-xcopy /Y /S /I %DEPS_INSTALL_DIR%\share\krita\pykrita %pkg_root%\share\krita\pykrita
-robocopy %DEPS_INSTALL_DIR%\lib\site-packages %pkg_root%\lib\site-packages /S /E ^
- /XF "setuptools.pth" "easy-install.pth" ^
- /XD "packaging*" "pip*" "ply*" "pyparsing*" "PyQt_builder*" "sip*" "toml*" "meson*"
-:: Not useful on Windows it seems
-rem xcopy /Y /S /I %KRITA_INSTALL_DIR%\share\appdata %pkg_root%\share\appdata
-rem xcopy /Y /S /I %KRITA_INSTALL_DIR%\share\applications %pkg_root%\share\applications
-rem xcopy /Y /S /I %DEPS_INSTALL_DIR%\share\doc %pkg_root%\share\doc
-rem xcopy /Y /S /I %DEPS_INSTALL_DIR%\share\kservices5 %pkg_root%\share\kservices5
-rem xcopy /Y /S /I %DEPS_INSTALL_DIR%\share\man %pkg_root%\share\man
-rem xcopy /Y /S /I %DEPS_INSTALL_DIR%\share\ocio %pkg_root%\share\ocio
-
-:: Copy locale to bin
-xcopy /Y /S /I %KRITA_INSTALL_DIR%\share\locale %pkg_root%\bin\locale
-xcopy /Y /S /I %DEPS_INSTALL_DIR%\share\locale %pkg_root%\bin\locale
-
-:: Copy shortcut link from source (can't create it dynamically)
-copy %KRITA_SRC_DIR%\packaging\windows\krita.lnk %pkg_root%
-copy %KRITA_SRC_DIR%\packaging\windows\krita-minimal.lnk %pkg_root%
-copy %KRITA_SRC_DIR%\packaging\windows\krita-animation.lnk %pkg_root%
-
-set "QMLDIR_ARGS=--qmldir %DEPS_INSTALL_DIR%\qml"
-if exist "%KRITA_INSTALL_DIR%\lib\qml" (
- xcopy /Y /S /I %KRITA_INSTALL_DIR%\lib\qml %pkg_root%\bin
- :: This doesn't really seem to do anything
- set "QMLDIR_ARGS=%QMLDIR_ARGS% --qmldir %KRITA_INSTALL_DIR%\lib\qml"
-)
-
-:: For some reason windowsdeployqt skips installing Layouts QML plugin,
-:: so we need to copy it manually
-if exist "%DEPS_INSTALL_DIR%\qml\QtQuick\Layouts" (
- xcopy.exe /Y /S /I %DEPS_INSTALL_DIR%\qml\QtQuick\Layouts %pkg_root%\bin\QtQuick\Layouts
-)
-
-
-:: windeployqt
-windeployqt.exe %QMLDIR_ARGS% --release -gui -core -concurrent -network -printsupport -svg -xml -sql -qml -quick -quickwidgets %pkg_root%\bin\krita.exe %pkg_root%\bin\krita.dll
-if errorlevel 1 (
- echo ERROR: WinDeployQt failed! 1>&2
- exit /B 1
-)
-
-:: ffmpeg
-copy %DEPS_INSTALL_DIR%\bin\ffmpeg.exe %pkg_root%\bin
-copy %DEPS_INSTALL_DIR%\bin\ffprobe.exe %pkg_root%\bin
-copy %DEPS_INSTALL_DIR%\bin\ffmpeg_LICENSE.txt %pkg_root%\bin
-copy %DEPS_INSTALL_DIR%\bin\ffmpeg_README.txt %pkg_root%\bin
-
-
-:: Copy embedded Python
-xcopy /Y /S /I %DEPS_INSTALL_DIR%\python %pkg_root%\python
-del /q %pkg_root%\python\python.exe %pkg_root%\python\pythonw.exe
-
-:: For chopping relative path
-:: 512 should be enough
-:: n+2 to also account for a trailing backslash
-setlocal enableextensions enabledelayedexpansion
-for /L %%n in (1 1 512) do if "!pkg_root:~%%n,1!" neq "" set /a "pkg_root_len_plus_one=%%n+2"
-endlocal & set pkg_root_len_plus_one=%pkg_root_len_plus_one%
-
-echo.
-setlocal enableextensions enabledelayedexpansion
-:: Remove Python cache files
-for /d /r "%pkg_root%" %%F in (__pycache__\) do (
- if EXIST "%%F" (
- set relpath=%%F
- set relpath=!relpath:~%pkg_root_len_plus_one%!
- echo Deleting Python cache !relpath!
- rmdir /S /Q "%%F"
- )
-)
-endlocal
-
-echo.
-echo Splitting debug info from binaries...
-call :split-debug "%pkg_root%\bin\krita.exe" bin\krita.exe
-call :split-debug "%pkg_root%\bin\krita.com" bin\krita.com
-call :split-debug "%pkg_root%\bin\kritarunner.exe" bin\kritarunner.exe
-call :split-debug "%pkg_root%\bin\kritarunner.com" bin\kritarunner.com
-setlocal enableextensions enabledelayedexpansion
-:: Find all DLLs
-for /r "%pkg_root%" %%F in (*.dll) do (
- set relpath=%%F
- set relpath=!relpath:~%pkg_root_len_plus_one%!
- call :split-debug "%%F" !relpath!
-)
-endlocal
-setlocal enableextensions enabledelayedexpansion
-:: Find all Python native modules
-for /r "%pkg_root%\share\krita\pykrita\" %%F in (*.pyd) do (
- set relpath=%%F
- set relpath=!relpath:~%pkg_root_len_plus_one%!
- call :split-debug "%%F" !relpath!
-)
-for /r "%pkg_root%\lib\krita-python-libs\" %%F in (*.pyd) do (
- set relpath=%%F
- set relpath=!relpath:~%pkg_root_len_plus_one%!
- call :split-debug "%%F" !relpath!
-)
-for /r "%pkg_root%\lib\site-packages\" %%F in (*.pyd) do (
- set relpath=%%F
- set relpath=!relpath:~%pkg_root_len_plus_one%!
- call :split-debug "%%F" !relpath!
-)
-endlocal
-
-if not "%ARG_PRE_ZIP_HOOK%" == "" (
- echo Running pre-zip-hook...
- setlocal
- :: add python to PATH of the pre-zip hook
- set "PATH=%PYTHON_BIN_DIR%;%PATH%"
- cmd /c ""%ARG_PRE_ZIP_HOOK%" "%pkg_root%\""
- if errorlevel 1 (
- echo ERROR: Got exit code !errorlevel! from pre-zip-hook! 1>&2
- exit /b 1
- )
- endlocal
-)
-
-echo.
-echo Packaging stripped binaries...
-"%SEVENZIP_EXE%" a -tzip %pkg_name%.zip %pkg_root%\ "-xr^!.debug"
-echo --------
-
-if "%KRITA_SKIP_DEBUG_PACKAGE%" == "" (
- echo.
- echo Packaging debug info...
- :: (note that the top-level package dir is not included)
- "%SEVENZIP_EXE%" a -tzip %pkg_name%-dbg.zip -r %pkg_root%\*.debug
- echo --------
-)
-
-echo.
-echo.
-echo Krita packaged as %pkg_name%.zip
-if exist %pkg_name%-dbg.zip echo Debug info packaged as %pkg_name%-dbg.zip
-echo Packaging dir is %pkg_root%
-echo NOTE: Do not create installer with packaging dir. Extract from
-echo %pkg_name%.zip instead,
-echo and do _not_ run krita inside the extracted directory because it will
-echo create extra unnecessary files.
-echo.
-echo Please remember to actually test the package before releasing it.
-echo.
-%PAUSE%
-
-exit /b
-
-:split-debug
-echo Splitting debug info of %2
-objcopy --only-keep-debug %~1 %~1.debug
-if ERRORLEVEL 1 exit /b %ERRORLEVEL%
-:: If the debug file is small enough then consider there being no debug info.
-:: Discard these files since they somehow make gdb crash.
-call :getfilesize %~1.debug
-if /i %getfilesize_retval% LEQ 2048 (
- echo Discarding %2.debug
- del %~1.debug
- exit /b 0
-)
-if not exist %~dp1.debug mkdir %~dp1.debug
-move %~1.debug %~dp1.debug\ > NUL
-strip --strip-debug %~1
-:: Add debuglink
-:: FIXME: There is a problem with gdb that cause it to output this warning
-:: FIXME: "warning: section .gnu_debuglink not found in xxx.debug"
-:: FIXME: I tried adding a link to itself but this kills drmingw :(
-objcopy --add-gnu-debuglink="%~dp1.debug\%~nx1.debug" %~1
-exit /b %ERRORLEVEL%
-
-:getfilesize
-set getfilesize_retval=%~z1
-goto :eof
-
-:relpath_dirpath
-call :relpath_dirpath_internal "" "%~1"
-goto :eof
-
-:relpath_dirpath_internal
-for /f "tokens=1* delims=\" %%a in ("%~2") do (
- :: If part 2 is empty, it means part 1 is probably the file name
- if x%%b==x (
- set relpath_dirpath_retval=%~1
- ) else (
- call :relpath_dirpath_internal "%~1%%a\" %%b
- )
-)
-goto :eof
diff --git a/packaging/windows/sign-package.cmd b/packaging/windows/sign-package.cmd
deleted file mode 100644
index e27d954282..0000000000
--- a/packaging/windows/sign-package.cmd
+++ /dev/null
@@ -1,56 +0,0 @@
-@echo off
-setlocal enableextensions enabledelayedexpansion
-
-set pkg_root=%~f1
-
-if not "%SIGNTOOL%" == "" goto skip_find_signtool
-
-:: Find Windows SDK for signtool.exe
-if "%WindowsSdkDir%" == "" if not "%ProgramFiles(x86)%" == "" set "WindowsSdkDir=%ProgramFiles(x86)%\Windows Kits\10"
-if "%WindowsSdkDir%" == "" set "WindowsSdkDir=%ProgramFiles(x86)%\Windows Kits\10"
-if exist "%WindowsSdkDir%\" (
- pushd "%WindowsSdkDir%"
- for /f "delims=" %%a in ('dir /a:d /b "bin\10.*"') do (
- if exist "bin\%%a\x64\signtool.exe" (
- set "SIGNTOOL=%WindowsSdkDir%\bin\%%a\x64\signtool.exe"
- )
- )
- if "%SIGNTOOL%" == "" if exist "bin\x64\signtool.exe" (
- set "SIGNTOOL=%WindowsSdkDir%\bin\x64\signtool.exe"
- )
- popd
-)
-if "%SIGNTOOL%" == "" (
- echo ERROR: signtool not found 1>&2
- exit /b 1
-)
-
-:skip_find_signtool
-
-if "!SIGNTOOL_SIGN_FLAGS!" == "" (
- echo ERROR: Please set environment variable SIGNTOOL_SIGN_FLAGS 1>&2
- exit /b 1
- :: This is what I used for testing:
- :: set "SIGNTOOL_SIGN_FLAGS=/f "C:\Users\Alvin\MySPC.pfx" /t http://timestamp.verisign.com/scripts/timstamp.dll"
-)
-
-echo Signing binaries in "%pkg_root%"
-if not exist "%pkg_root%\" (
- echo ERROR: No packaging dir %pkg_root% 1>&2
- exit /b 1
-)
-for /r "%pkg_root%\" %%F in (*.exe *.com *.dll *.pyd) do (
- :: Check for existing signature
- "%SIGNTOOL%" verify /q /pa "%%F" > NUL
- if errorlevel 1 (
- echo Signing %%F
- "%SIGNTOOL%" sign %SIGNTOOL_SIGN_FLAGS% "%%F"
- if errorlevel 1 (
- echo ERROR: Got exit code !errorlevel! from signtool! 1>&2
- exit /b 1
- )
- ) else (
- echo Not signing %%F - file already signed
- )
-)
-endlocal