diff --git a/AppVeyorBuild.bat b/AppVeyorBuild.bat index f3c39301e..f501eaec0 100644 --- a/AppVeyorBuild.bat +++ b/AppVeyorBuild.bat @@ -44,83 +44,22 @@ for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set drmingw=%%x goto start :start -if %prg% equ npackdcl goto npackdcl -if %prg% equ clu goto clu +if %prg% equ npackd ( + pushd npackdg + call build64.bat + popd +) +if %prg% equ npackdcl ( + pushd npackdcl + call build64.bat + popd +) +if %prg% equ clu ( + pushd clu + call build64.bat + popd +) -:npackd - -mkdir npackdg\build -if %errorlevel% neq 0 exit /b %errorlevel% - -pushd npackdg\build -set path=%mingw%\bin;%ai%\bin\x86;%sevenzip%;C:\msys64\mingw64\bin -set CMAKE_PREFIX_PATH=%mingw%\%mingw_libs%;%quazip% - -cmake ..\ -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=..\install -DNPACKD_FORCE_STATIC:BOOL=%STATIC% -if %errorlevel% neq 0 exit /b %errorlevel% - -mingw32-make.exe install -if %errorlevel% neq 0 exit /b %errorlevel% - -C:\Windows\System32\xcopy.exe ..\install ..\install-debug /E /I /H /Y -if %errorlevel% neq 0 exit /b %errorlevel% - -strip ..\install\npackdg.exe -if %errorlevel% neq 0 exit /b %errorlevel% - -pushd ..\install-debug - -copy ..\build\npackdg.map . -if %errorlevel% neq 0 exit /b %errorlevel% - -copy "%DRMINGW%\bin\exchndl.dll" . -if %errorlevel% neq 0 exit /b %errorlevel% - -copy "%DRMINGW%\bin\mgwhelp.dll" . -if %errorlevel% neq 0 exit /b %errorlevel% - -copy "%DRMINGW%\bin\dbghelp.dll" . -if %errorlevel% neq 0 exit /b %errorlevel% - -copy "%DRMINGW%\bin\symsrv.dll" . -if %errorlevel% neq 0 exit /b %errorlevel% - -copy "%DRMINGW%\bin\symsrv.yes" . -if %errorlevel% neq 0 exit /b %errorlevel% - -7z a ..\build\Npackd%bits%-debug-%version%.zip * -mx9 -if %errorlevel% neq 0 exit /b %errorlevel% -popd - -pushd ..\install -7z a ..\build\Npackd%bits%-%version%.zip * -mx9 -if %errorlevel% neq 0 exit /b %errorlevel% - -copy ..\src\npackdg%bits%.aip . -if %errorlevel% neq 0 exit /b %errorlevel% - -copy ..\src\app.ico . -if %errorlevel% neq 0 exit /b %errorlevel% - -AdvancedInstaller.com /edit npackdg%bits%.aip /SetVersion %version% -if %errorlevel% neq 0 exit /b %errorlevel% - -AdvancedInstaller.com /build npackdg%bits%.aip -if %errorlevel% neq 0 exit /b %errorlevel% -popd - -popd - -set path=%initial_path% - -appveyor PushArtifact npackdg\build\Npackd%bits%-%version%.zip -if %errorlevel% neq 0 exit /b %errorlevel% - -appveyor PushArtifact npackdg\install\Npackd%bits%-%version%.msi -if %errorlevel% neq 0 exit /b %errorlevel% - -appveyor PushArtifact npackdg\build\Npackd%bits%-debug-%version%.zip -if %errorlevel% neq 0 exit /b %errorlevel% rem Coverity build is too slow goto end @@ -157,16 +96,11 @@ set path=%mingw%\bin;%ai%\bin\x86;%sevenzip%;C:\msys64\mingw64\bin set CMAKE_PREFIX_PATH=%mingw%\%mingw_libs%;%quazip% cmake ..\ -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=..\install -DNPACKD_FORCE_STATIC:BOOL=%STATIC% -rem C:\Windows\System32\notepad.exe - if %errorlevel% neq 0 exit /b %errorlevel% -cmake -LAH - mingw32-make.exe install if %errorlevel% neq 0 exit /b %errorlevel% - "%EXEPROXY%\exeproxy.exe" exeproxy-copy ..\install\ncl.exe npackdcl.exe if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/AppVeyorInstall.bat b/AppVeyorInstall.bat index 975766b48..195c6a3b7 100644 --- a/AppVeyorInstall.bat +++ b/AppVeyorInstall.bat @@ -31,7 +31,7 @@ rem update all packages to the newest versions pacman -Syu --noconfirm pacman -Syu --noconfirm -pacman -S --noconfirm mingw64/mingw-w64-x86_64-cmake mingw64/mingw-w64-x86_64-ninja mingw64/mingw-w64-x86_64-wget +pacman -S --noconfirm mingw64/mingw-w64-x86_64-cmake mingw64/mingw-w64-x86_64-ninja mingw64/mingw-w64-x86_64-wget mingw64/mingw-w64-x86_64-meson if %errorlevel% neq 0 exit /b %errorlevel% if %bits% equ 64 (if %static% equ ON (call :install64static) else (call :install64dynamic)) else (call :install32) diff --git a/clu/meson.build b/clu/meson.build new file mode 100644 index 000000000..2e6f97af2 --- /dev/null +++ b/clu/meson.build @@ -0,0 +1,105 @@ +project('clu', 'c', 'cpp', default_options: ['c_std=c11', 'cpp_std=c++11']) + +fs = import('fs') +qt5_mod = import('qt5') +windows = import('windows') + +deps =[ + dependency('quazip1-qt5'), + dependency('qt5', modules: 'Sql'), + dependency('qt5', modules: 'Xml'), + dependency('qt5', modules: 'Core') +] + +CXX = meson.get_compiler('cpp') +foreach lib_name : ['userenv', 'winmm', 'ole32', 'uuid', 'wininet', 'psapi', 'version', + 'shlwapi', 'msi', 'netapi32', 'Ws2_32', 'taskschd'] + deps += CXX.find_library(lib_name) +endforeach + +version = fs.read('../appveyor.yml').strip().split('\n')[0].replace('version:', '').replace('.{build}', '').strip() +version_parts = version.split('.') + +# -flto does not work (01.01.2020) probably because Qt is not compiled with LTO enabled +# -fno-exceptions -fno-unwind-tables do not reduce the binary size at all (05.01.2020) +add_global_arguments('-DUNICODE', '-D_UNICODE', '-DNOMINMAX', + '-D_WIN32_WINNT=0x0601', # Windows 7 + '-DNPACKD_VERSION="' + version + '"', + '-Wall', '-Wwrite-strings', '-Wextra', '-Wno-unused-parameter', '-Wno-cast-function-type', '-Wduplicated-cond', + '-Wduplicated-branches', '-Wlogical-op', + '-Wno-error=cast-qual', '-Wno-unused-local-typedefs', '-Wno-unused-variable', '-g', + language: 'cpp') + +# TODO static builds +# -static -static-libstdc++ -static-libgcc +# qtpcre2 zstd z +# -D QUAZIP_STATIC=1 + +install_data('../LICENSE.txt') + +conf = configuration_data() +conf.set('NPACKD_VERSION_MAJOR', version_parts.length() > 0 ? version_parts[0] : '0') +conf.set('NPACKD_VERSION_MINOR', version_parts.length() > 1 ? version_parts[1] : '0') +conf.set('NPACKD_VERSION_PATCH', version_parts.length() > 2 ? version_parts[2] : '0') +conf.set('NPACKD_VERSION_TWEAK', version_parts.length() > 3 ? version_parts[3] : '0') +conf.set('OUTPUT_FILE_NAME', meson.project_name() + '.exe') +configure_file(input: 'src/app.rc.in', + output: meson.project_name() + '.rc', + configuration: conf) +configure_file(input: '../npackdg/src/app.ico', + output: 'app.ico', copy: true) +rc = windows.compile_resources(meson.current_build_dir() / meson.project_name() + '.rc') + +add_project_link_arguments('-Wl,-Map,' + meson.project_name() + '.map', language: 'cpp') + +processed = qt5_mod.preprocess( + # Only headers that need moc should be put here + moc_headers : ['../npackdg/src/job.h', + '../npackdg/src/installedpackages.h', + '../npackdg/src/clprogress.h'] +) + +src = ['src/main.cpp', + 'src/app.cpp', + '../npackdg/src/job.cpp', + '../npackdg/src/installedpackages.cpp', + '../npackdg/src/clprogress.cpp', + '../npackdg/src/package.cpp', + '../npackdg/src/license.cpp', + '../npackdg/src/dependency.cpp', + '../npackdg/src/abstractrepository.cpp', + '../npackdg/src/repository.cpp', + '../npackdg/src/packageversion.cpp', + '../npackdg/src/packageversionfile.cpp', + '../npackdg/src/installedpackageversion.cpp', + '../npackdg/src/windowsregistry.cpp', + '../npackdg/src/abstractthirdpartypm.cpp', + '../npackdg/src/controlpanelthirdpartypm.cpp', + '../npackdg/src/commandline.cpp', + '../npackdg/src/wpmutils.cpp', + '../npackdg/src/hrtimer.cpp', + '../npackdg/src/version.cpp', + '../npackdg/src/installoperation.cpp', + '../npackdg/src/dbrepository.cpp', + '../npackdg/src/downloader.cpp', + '../npackdg/src/repositoryxmlhandler.cpp', + '../npackdg/src/installedpackagesthirdpartypm.cpp', + '../npackdg/src/wellknownprogramsthirdpartypm.cpp', + '../npackdg/src/msithirdpartypm.cpp', + '../npackdg/src/mysqlquery.cpp', + '../npackdg/src/packageutils.cpp', + '../npackdg/src/wuathirdpartypm.cpp', + '../npackdg/src/wuapi_i.c', + '../npackdg/src/comobject.cpp', + '../npackdg/src/sqlutils.cpp', + '../npackdg/src/dag.cpp', + '../npackdg/src/lockedfiles.cpp', + '../npackdg/src/threadpool.cpp', + '../npackdg/src/deptask.cpp', + '../npackdcl/src/commandlinemessagehandler.cpp', + processed, rc] + +incdir = include_directories('../npackdg/src', '../npackdcl/src') +executable(meson.project_name(), src, dependencies: deps, include_directories: incdir, + install: true) + diff --git a/npackdcl/ftests/meson.build b/npackdcl/ftests/meson.build new file mode 100644 index 000000000..1a5b5e388 --- /dev/null +++ b/npackdcl/ftests/meson.build @@ -0,0 +1,100 @@ +project('ftests', 'c', 'cpp', default_options: ['c_std=c11', 'cpp_std=c++11']) + +fs = import('fs') +qt5_mod = import('qt5') +windows = import('windows') + +deps =[ + dependency('quazip1-qt5'), + dependency('qt5', modules: 'Sql'), + dependency('qt5', modules: 'Xml'), + dependency('qt5', modules: 'Test'), + dependency('qt5', modules: 'Core') +] + +CXX = meson.get_compiler('cpp') +foreach lib_name : ['userenv', 'winmm', 'ole32', 'uuid', 'wininet', 'psapi', 'version', + 'shlwapi', 'msi', 'netapi32', 'Ws2_32', 'taskschd'] + deps += CXX.find_library(lib_name) +endforeach + +install_data('Rep.xml') + +version = fs.read('../../appveyor.yml').strip().split('\n')[0].replace('version:', '').replace('.{build}', '').strip() +version_parts = version.split('.') + +# -flto does not work (01.01.2020) probably because Qt is not compiled with LTO enabled +# -fno-exceptions -fno-unwind-tables do not reduce the binary size at all (05.01.2020) +add_global_arguments('-DUNICODE', '-D_UNICODE', '-DNOMINMAX', + '-D_WIN32_WINNT=0x0601', # Windows 7 + '-DNPACKD_VERSION="' + version + '"', + '-Wall', '-Wwrite-strings', '-Wextra', '-Wno-unused-parameter', '-Wno-cast-function-type', '-Wduplicated-cond', + '-Wduplicated-branches', '-Wlogical-op', + '-Wno-error=cast-qual', '-Wno-unused-local-typedefs', '-Wno-unused-variable', '-g', + language: 'cpp') + +# TODO static builds +# -static -static-libstdc++ -static-libgcc +# qtpcre2 zstd z +# -D QUAZIP_STATIC=1 + +add_project_link_arguments('-Wl,-Map,' + meson.project_name() + '.map', language: 'cpp') + +processed = qt5_mod.preprocess( + # Only headers that need moc should be put here + moc_headers : ['src/app.h', '../../npackdg/src/job.h', + '../../npackdg/src/installedpackages.h', '../../npackdg/src/visiblejobs.h', + '../../npackdg/src/clprogress.h'] +) + +# TODO option(NPACKD_ADMIN "Force admin right on program" TRUE) +#if(NPACKD_ADMIN) +# target_compile_definitions(npackdcl PRIVATE -D NPACKD_ADMIN=1) +#else() +# target_compile_definitions(npackdcl PRIVATE -D NPACKD_ADMIN=0) +#endif() + +src = ['src/app.cpp', + '../../npackdg/src/downloader.cpp', + '../../npackdg/src/commandline.cpp', + '../../npackdg/src/repositoryxmlhandler.cpp', + '../../npackdg/src/mysqlquery.cpp', + '../../npackdg/src/wellknownprogramsthirdpartypm.cpp', + '../../npackdg/src/abstractthirdpartypm.cpp', + '../../npackdg/src/msithirdpartypm.cpp', + '../../npackdg/src/installedpackagesthirdpartypm.cpp', + '../../npackdg/src/controlpanelthirdpartypm.cpp', + '../../npackdg/src/installoperation.cpp', + '../../npackdg/src/dependency.cpp', + '../../npackdg/src/packageversionfile.cpp', + '../../npackdg/src/dbrepository.cpp', + '../../npackdg/src/license.cpp', + '../../npackdg/src/repository.cpp', + '../../npackdg/src/job.cpp', + '../../npackdg/src/hrtimer.cpp', + '../../npackdg/src/package.cpp', + '../../npackdg/src/installedpackageversion.cpp', + '../../npackdg/src/abstractrepository.cpp', + '../../npackdg/src/version.cpp', + '../../npackdg/src/installedpackages.cpp', + '../../npackdg/src/windowsregistry.cpp', + '../../npackdg/src/packageversion.cpp', + '../../npackdg/src/wpmutils.cpp', + '../../npackdg/src/clprogress.cpp', + '../../npackdg/src/packageutils.cpp', + '../../npackdg/src/wuathirdpartypm.cpp', + '../../npackdg/src/wuapi_i.c', + '../../npackdg/src/comobject.cpp', + '../../npackdg/src/dismthirdpartypm.cpp', + '../../npackdg/src/sqlutils.cpp', + '../../npackdg/src/dag.cpp', + '../../npackdg/src/deptask.cpp', + '../../npackdg/src/threadpool.cpp', + '../../npackdg/src/lockedfiles.cpp', + 'src/main.cpp', + processed] + +incdir = include_directories('../../npackdg/src', 'src') +executable(meson.project_name(), src, dependencies: deps, include_directories: incdir, + install: true) + diff --git a/npackdcl/meson.build b/npackdcl/meson.build new file mode 100644 index 000000000..403f47772 --- /dev/null +++ b/npackdcl/meson.build @@ -0,0 +1,115 @@ +project('npackdcl', 'c', 'cpp', default_options: ['c_std=c11', 'cpp_std=c++11']) + +fs = import('fs') +qt5_mod = import('qt5') +windows = import('windows') + +deps =[ + dependency('quazip1-qt5'), + dependency('qt5', modules: 'Sql'), + dependency('qt5', modules: 'Xml'), + dependency('qt5', modules: 'Core') +] + +CXX = meson.get_compiler('cpp') +foreach lib_name : ['userenv', 'winmm', 'ole32', 'uuid', 'wininet', 'psapi', 'version', + 'shlwapi', 'msi', 'netapi32', 'Ws2_32', 'taskschd'] + deps += CXX.find_library(lib_name) +endforeach + +version = fs.read('../appveyor.yml').strip().split('\n')[0].replace('version:', '').replace('.{build}', '').strip() +version_parts = version.split('.') + +# -flto does not work (01.01.2020) probably because Qt is not compiled with LTO enabled +# -fno-exceptions -fno-unwind-tables do not reduce the binary size at all (05.01.2020) +add_global_arguments('-DUNICODE', '-D_UNICODE', '-DNOMINMAX', + '-D_WIN32_WINNT=0x0601', # Windows 7 + '-DNPACKD_VERSION="' + version + '"', + '-Wall', '-Wwrite-strings', '-Wextra', '-Wno-unused-parameter', '-Wno-cast-function-type', '-Wduplicated-cond', + '-Wduplicated-branches', '-Wlogical-op', + '-Wno-error=cast-qual', '-Wno-unused-local-typedefs', '-Wno-unused-variable', '-g', + language: 'cpp') + +# TODO static builds +# -static -static-libstdc++ -static-libgcc +# qtpcre2 zstd z +# -D QUAZIP_STATIC=1 + +install_data('../LICENSE.txt') +install_data('../CrystalIcons_LICENSE.txt') + +conf = configuration_data() +conf.set('NPACKD_VERSION_MAJOR', version_parts.length() > 0 ? version_parts[0] : '0') +conf.set('NPACKD_VERSION_MINOR', version_parts.length() > 1 ? version_parts[1] : '0') +conf.set('NPACKD_VERSION_PATCH', version_parts.length() > 2 ? version_parts[2] : '0') +conf.set('NPACKD_VERSION_TWEAK', version_parts.length() > 3 ? version_parts[3] : '0') +conf.set('OUTPUT_FILE_NAME', meson.project_name() + '.exe') +configure_file(input: 'src/app.rc.in', + output: meson.project_name() + '.rc', + configuration: conf) +configure_file(input: '../npackdg/src/app.ico', + output: 'app.ico', copy: true) +rc = windows.compile_resources(meson.current_build_dir() / meson.project_name() + '.rc') + +add_project_link_arguments('-Wl,-Map,' + meson.project_name() + '.map', language: 'cpp') + +processed = qt5_mod.preprocess( + # Only headers that need moc should be put here + moc_headers : ['src/app.h', '../npackdg/src/job.h', + '../npackdg/src/installedpackages.h', '../npackdg/src/visiblejobs.h', + '../npackdg/src/clprogress.h'] +) + +# TODO option(NPACKD_ADMIN "Force admin right on program" TRUE) +#if(NPACKD_ADMIN) +# target_compile_definitions(npackdcl PRIVATE -D NPACKD_ADMIN=1) +#else() +# target_compile_definitions(npackdcl PRIVATE -D NPACKD_ADMIN=0) +#endif() + +src = ['../npackdg/src/visiblejobs.cpp', + '../npackdg/src/repository.cpp', + '../npackdg/src/version.cpp', + '../npackdg/src/packageversionfile.cpp', + '../npackdg/src/package.cpp', + '../npackdg/src/packageversion.cpp', + '../npackdg/src/job.cpp', + '../npackdg/src/installoperation.cpp', + '../npackdg/src/dependency.cpp', + '../npackdg/src/wpmutils.cpp', + '../npackdg/src/downloader.cpp', + '../npackdg/src/license.cpp', + '../npackdg/src/windowsregistry.cpp', + '../npackdg/src/commandline.cpp', + '../npackdg/src/installedpackages.cpp', + '../npackdg/src/installedpackageversion.cpp', + '../npackdg/src/clprogress.cpp', + '../npackdg/src/dbrepository.cpp', + '../npackdg/src/abstractrepository.cpp', + '../npackdg/src/abstractthirdpartypm.cpp', + '../npackdg/src/msithirdpartypm.cpp', + '../npackdg/src/controlpanelthirdpartypm.cpp', + '../npackdg/src/wellknownprogramsthirdpartypm.cpp', + '../npackdg/src/hrtimer.cpp', + '../npackdg/src/repositoryxmlhandler.cpp', + '../npackdg/src/mysqlquery.cpp', + '../npackdg/src/installedpackagesthirdpartypm.cpp', + '../npackdg/src/packageutils.cpp', + '../npackdg/src/wuathirdpartypm.cpp', + '../npackdg/src/wuapi_i.c', + '../npackdg/src/comobject.cpp', + '../npackdg/src/dismthirdpartypm.cpp', + '../npackdg/src/sqlutils.cpp', + '../npackdg/src/dag.cpp', + '../npackdg/src/deptask.cpp', + '../npackdg/src/threadpool.cpp', + '../npackdg/src/lockedfiles.cpp', + 'src/commandlinemessagehandler.cpp', + 'src/main.cpp', + 'src/app.cpp', + processed, rc] + +incdir = include_directories('../npackdg/src', 'src') +executable(meson.project_name(), src, dependencies: deps, include_directories: incdir, + install: true) + diff --git a/npackdcl/tests/meson.build b/npackdcl/tests/meson.build new file mode 100644 index 000000000..be69af960 --- /dev/null +++ b/npackdcl/tests/meson.build @@ -0,0 +1,99 @@ +project('tests', 'c', 'cpp', default_options: ['c_std=c11', 'cpp_std=c++11']) + +fs = import('fs') +qt5_mod = import('qt5') +windows = import('windows') + +deps =[ + dependency('quazip1-qt5'), + dependency('qt5', modules: 'Sql'), + dependency('qt5', modules: 'Xml'), + dependency('qt5', modules: 'Test'), + dependency('qt5', modules: 'Core') +] + +CXX = meson.get_compiler('cpp') +foreach lib_name : ['userenv', 'winmm', 'ole32', 'uuid', 'wininet', 'psapi', 'version', + 'shlwapi', 'msi', 'netapi32', 'Ws2_32', 'taskschd'] + deps += CXX.find_library(lib_name) +endforeach + +version = fs.read('../../appveyor.yml').strip().split('\n')[0].replace('version:', '').replace('.{build}', '').strip() +version_parts = version.split('.') + +# -flto does not work (01.01.2020) probably because Qt is not compiled with LTO enabled +# -fno-exceptions -fno-unwind-tables do not reduce the binary size at all (05.01.2020) +add_global_arguments('-DUNICODE', '-D_UNICODE', '-DNOMINMAX', + '-D_WIN32_WINNT=0x0601', # Windows 7 + '-DNPACKD_VERSION="' + version + '"', + '-Wall', '-Wwrite-strings', '-Wextra', '-Wno-unused-parameter', '-Wno-cast-function-type', '-Wduplicated-cond', + '-Wduplicated-branches', '-Wlogical-op', + '-Wno-error=cast-qual', '-Wno-unused-local-typedefs', '-Wno-unused-variable', '-g', + language: 'cpp') + +# TODO static builds +# -static -static-libstdc++ -static-libgcc +# qtpcre2 zstd z +# -D QUAZIP_STATIC=1 + +add_project_link_arguments('-Wl,-Map,' + meson.project_name() + '.map', language: 'cpp') + +processed = qt5_mod.preprocess( + # Only headers that need moc should be put here + moc_headers : ['src/app.h', '../../npackdg/src/job.h', + '../../npackdg/src/installedpackages.h', '../../npackdg/src/visiblejobs.h', + '../../npackdg/src/clprogress.h'] +) + +# TODO option(NPACKD_ADMIN "Force admin right on program" TRUE) +#if(NPACKD_ADMIN) +# target_compile_definitions(npackdcl PRIVATE -D NPACKD_ADMIN=1) +#else() +# target_compile_definitions(npackdcl PRIVATE -D NPACKD_ADMIN=0) +#endif() + +src = ['src/main.cpp', + '../../npackdg/src/visiblejobs.cpp', + '../../npackdg/src/repository.cpp', + '../../npackdg/src/version.cpp', + '../../npackdg/src/packageversionfile.cpp', + '../../npackdg/src/package.cpp', + '../../npackdg/src/packageversion.cpp', + '../../npackdg/src/job.cpp', + '../../npackdg/src/installoperation.cpp', + '../../npackdg/src/dependency.cpp', + '../../npackdg/src/wpmutils.cpp', + '../../npackdg/src/downloader.cpp', + '../../npackdg/src/license.cpp', + '../../npackdg/src/windowsregistry.cpp', + 'src/app.cpp', + '../../npackdg/src/commandline.cpp', + '../../npackdg/src/installedpackages.cpp', + '../../npackdg/src/installedpackageversion.cpp', + '../../npackdg/src/clprogress.cpp', + '../../npackdg/src/dbrepository.cpp', + '../../npackdg/src/abstractrepository.cpp', + '../../npackdg/src/abstractthirdpartypm.cpp', + '../../npackdg/src/msithirdpartypm.cpp', + '../../npackdg/src/controlpanelthirdpartypm.cpp', + '../../npackdg/src/wellknownprogramsthirdpartypm.cpp', + '../../npackdg/src/hrtimer.cpp', + '../../npackdg/src/repositoryxmlhandler.cpp', + '../../npackdg/src/mysqlquery.cpp', + '../../npackdg/src/installedpackagesthirdpartypm.cpp', + '../../npackdg/src/packageutils.cpp', + '../../npackdg/src/wuathirdpartypm.cpp', + '../../npackdg/src/wuapi_i.c', + '../../npackdg/src/comobject.cpp', + '../../npackdg/src/dismthirdpartypm.cpp', + '../../npackdg/src/sqlutils.cpp', + '../../npackdg/src/dag.cpp', + '../../npackdg/src/lockedfiles.cpp', + '../../npackdg/src/threadpool.cpp', + '../../npackdg/src/deptask.cpp', + processed] + +incdir = include_directories('../../npackdg/src', 'src') +executable(meson.project_name(), src, dependencies: deps, include_directories: incdir, + install: true) + diff --git a/npackdg/build32.bat b/npackdg/build32.bat new file mode 100644 index 000000000..9bf9e74cb --- /dev/null +++ b/npackdg/build32.bat @@ -0,0 +1,86 @@ +set version=%APPVEYOR_BUILD_VERSION:~0,-4% +set mingw_libs=i686-w64-mingw32 +set mingw=C:\msys64\mingw32 +SET NPACKD_CL=C:\Program Files\NpackdCL +set path=%mingw%\bin;%ai%\bin\x86;%sevenzip% + +set onecmd="%npackd_cl%\ncl.exe" path -p com.advancedinstaller.AdvancedInstallerFreeware -r [10,100) +for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set ai=%%x + +set onecmd="%npackd_cl%\ncl.exe" path -p org.7-zip.SevenZIP -r [9,100) +for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set SEVENZIP=%%x + +set onecmd="%npackd_cl%\ncl.exe" path -p exeproxy -r [0.2,1) +for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set EXEPROXY=%%x + + +set onecmd="%npackd_cl%\ncl.exe" path -p quazip-dev-i686-w64_dw2_posix_7.2-qt_5.9.2-static -v 0.7.3 +for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set quazip=%%x + +set onecmd="%npackd_cl%\ncl.exe" path -p drmingw -v 0.7.7 +for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set drmingw=%%x + +rem set CMAKE_PREFIX_PATH=%mingw%\%mingw_libs%;%quazip% + +rem TODO -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=..\install -DNPACKD_FORCE_STATIC:BOOL=%STATIC% +meson setup build\meson +if %errorlevel% neq 0 exit /b %errorlevel% + +meson compile -C build\meson +if %errorlevel% neq 0 exit /b %errorlevel% + +mkdir build\dist + +copy build\meson\npackdg.exe build\dist +if %errorlevel% neq 0 exit /b %errorlevel% + +copy src\CrystalIcons_LICENSE.txt build\dist +if %errorlevel% neq 0 exit /b %errorlevel% + +copy src\LICENSE.txt build\dist +if %errorlevel% neq 0 exit /b %errorlevel% + +rem TODO exeproxy + +C:\Windows\System32\xcopy.exe build\dist build\dist-debug /E /I /H /Y +if %errorlevel% neq 0 exit /b %errorlevel% + +strip dist\npackdg.exe +if %errorlevel% neq 0 exit /b %errorlevel% + +copy build\meson\npackdg.map build\dist-debug +if %errorlevel% neq 0 exit /b %errorlevel% + +copy "%DRMINGW%\bin\exchndl.dll" build\dist-debug +if %errorlevel% neq 0 exit /b %errorlevel% + +copy "%DRMINGW%\bin\mgwhelp.dll" build\dist-debug +if %errorlevel% neq 0 exit /b %errorlevel% + +copy "%DRMINGW%\bin\dbghelp.dll" build\dist-debug +if %errorlevel% neq 0 exit /b %errorlevel% + +copy "%DRMINGW%\bin\symsrv.dll" build\dist-debug +if %errorlevel% neq 0 exit /b %errorlevel% + +copy "%DRMINGW%\bin\symsrv.yes" build\dist-debug +if %errorlevel% neq 0 exit /b %errorlevel% + +7z a build\Npackd%bits%-debug-%version%.zip build\dist-debug\* -mx9 +if %errorlevel% neq 0 exit /b %errorlevel% + +7z a build\Npackd%bits%-%version%.zip build\dist\* -mx9 +if %errorlevel% neq 0 exit /b %errorlevel% + +copy src\npackdg%bits%.aip build\dist +if %errorlevel% neq 0 exit /b %errorlevel% + +copy src\app.ico build\dist +if %errorlevel% neq 0 exit /b %errorlevel% + +AdvancedInstaller.com /edit build\dist\npackdg%bits%.aip /SetVersion %version% +if %errorlevel% neq 0 exit /b %errorlevel% + +AdvancedInstaller.com /build build\dist\npackdg%bits%.aip +if %errorlevel% neq 0 exit /b %errorlevel% + diff --git a/npackdg/build64.bat b/npackdg/build64.bat new file mode 100644 index 000000000..06efaf9fe --- /dev/null +++ b/npackdg/build64.bat @@ -0,0 +1,85 @@ +set version=%APPVEYOR_BUILD_VERSION:~0,-4% +SET NPACKD_CL=C:\Program Files\NpackdCL +set mingw=C:\msys64\mingw64 +rem TODO set mingw_libs=x86_64-w64-mingw32 +set path=%mingw%\bin;%ai%\bin\x86;%sevenzip% + +set onecmd="%npackd_cl%\ncl.exe" path -p com.advancedinstaller.AdvancedInstallerFreeware -r [10,100) +for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set ai=%%x + +set onecmd="%npackd_cl%\ncl.exe" path -p org.7-zip.SevenZIP -r [9,100) +for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set SEVENZIP=%%x + +set onecmd="%npackd_cl%\ncl.exe" path -p exeproxy -r [0.2,1) +for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set EXEPROXY=%%x + +set onecmd="%npackd_cl%\ncl.exe" path -p quazip-dev-x86_64-w64_seh_posix_7.2-qt_5.9.2-static -v 0.7.3 +for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set quazip=%%x + +set onecmd="%npackd_cl%\ncl.exe" path -p drmingw64 -v 0.7.7 +for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set drmingw=%%x + +rem set CMAKE_PREFIX_PATH=%mingw%\%mingw_libs%;%quazip% + +rem TODO -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=..\install -DNPACKD_FORCE_STATIC:BOOL=%STATIC% +meson setup build +if %errorlevel% neq 0 exit /b %errorlevel% + +meson compile -C build +if %errorlevel% neq 0 exit /b %errorlevel% + +mkdir build\dist + +copy build\npackdg.exe build\dist +if %errorlevel% neq 0 exit /b %errorlevel% + +copy src\CrystalIcons_LICENSE.txt build\dist +if %errorlevel% neq 0 exit /b %errorlevel% + +copy src\LICENSE.txt build\dist +if %errorlevel% neq 0 exit /b %errorlevel% + +rem TODO exeproxy + +C:\Windows\System32\xcopy.exe build\dist build\dist-debug /E /I /H /Y +if %errorlevel% neq 0 exit /b %errorlevel% + +strip build\dist\npackdg.exe +if %errorlevel% neq 0 exit /b %errorlevel% + +copy build\npackdg.map build\dist-debug +if %errorlevel% neq 0 exit /b %errorlevel% + +copy "%DRMINGW%\bin\exchndl.dll" build\dist-debug +if %errorlevel% neq 0 exit /b %errorlevel% + +copy "%DRMINGW%\bin\mgwhelp.dll" build\dist-debug +if %errorlevel% neq 0 exit /b %errorlevel% + +copy "%DRMINGW%\bin\dbghelp.dll" build\dist-debug +if %errorlevel% neq 0 exit /b %errorlevel% + +copy "%DRMINGW%\bin\symsrv.dll" build\dist-debug +if %errorlevel% neq 0 exit /b %errorlevel% + +copy "%DRMINGW%\bin\symsrv.yes" build\dist-debug +if %errorlevel% neq 0 exit /b %errorlevel% + +7z a build\Npackd%bits%-debug-%version%.zip build\dist-debug\* -mx9 +if %errorlevel% neq 0 exit /b %errorlevel% + +7z a build\Npackd%bits%-%version%.zip build\dist\* -mx9 +if %errorlevel% neq 0 exit /b %errorlevel% + +copy src\npackdg%bits%.aip build\dist +if %errorlevel% neq 0 exit /b %errorlevel% + +copy src\app.ico build\dist +if %errorlevel% neq 0 exit /b %errorlevel% + +AdvancedInstaller.com /edit build\dist\npackdg%bits%.aip /SetVersion %version% +if %errorlevel% neq 0 exit /b %errorlevel% + +AdvancedInstaller.com /build build\dist\npackdg%bits%.aip +if %errorlevel% neq 0 exit /b %errorlevel% + diff --git a/npackdg/meson.build b/npackdg/meson.build new file mode 100644 index 000000000..c80ae836d --- /dev/null +++ b/npackdg/meson.build @@ -0,0 +1,217 @@ +project('npackdg', 'c', 'cpp', default_options: ['c_std=c11', 'cpp_std=c++11']) + +fs = import('fs') +qt5_mod = import('qt5') +windows = import('windows') + +deps =[ + dependency('quazip1-qt5'), + dependency('qt5', modules: 'Gui'), + dependency('qt5', modules: 'Svg'), + dependency('qt5', modules: 'Widgets'), + dependency('qt5', modules: 'WinExtras'), +# TODO dependency('qt5', modules: 'LinguistTools'), +# TODO dependency('qt5', modules: 'FontDatabaseSupport'), +# TODO dependency('qt5', modules: 'QSvgIconPlugin'), +# TODO dependency('qt5', modules: 'QSvgPlugin'), + dependency('qt5', modules: 'Sql'), + dependency('qt5', modules: 'Xml'), + dependency('qt5', modules: 'Core') +] + +CXX = meson.get_compiler('cpp') +foreach lib_name : ['userenv', 'winmm', 'ole32', 'uuid', 'wininet', 'psapi', 'version', + 'shlwapi', 'msi', 'netapi32', 'Ws2_32', 'taskschd'] + deps += CXX.find_library(lib_name) +endforeach + +version = fs.read('../appveyor.yml').strip().split('\n')[0].replace('version:', '').replace('.{build}', '').strip() +version_parts = version.split('.') + +# -flto does not work (01.01.2020) probably because Qt is not compiled with LTO enabled +# -fno-exceptions -fno-unwind-tables do not reduce the binary size at all (05.01.2020) +add_global_arguments('-DUNICODE', '-D_UNICODE', '-DNOMINMAX', + '-D_WIN32_WINNT=0x0601', # Windows 7 + '-DNPACKD_VERSION="' + version + '"', + '-Wall', '-Wwrite-strings', '-Wextra', '-Wno-unused-parameter', '-Wno-cast-function-type', '-Wduplicated-cond', + '-Wduplicated-branches', '-Wlogical-op', + '-Wno-error=cast-qual', '-Wno-unused-local-typedefs', '-Wno-unused-variable', '-g', + language: 'cpp') + +# TODO +# file(GLOB RESOURCE_IMAGES "src/*.png") +# file(COPY ${RESOURCE_IMAGES} src/npackdg.qrc DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + + +# TODO static builds +# -static -static-libstdc++ -static-libgcc +# qtpcre2 zstd z +# -D QUAZIP_STATIC=1 + +# TODO +# if(NPACKD_FORCE_STATIC) +# SET(NPACKDG_LIBRARIES ${NPACKDG_LIBRARIES} qsqlite qicns qico qjpeg qgif qtga qtiff qwbmp qwebp qwindows qwindowsvistastyle) +# SET(NPACKDG_LIBRARIES ${NPACKDG_LIBRARIES} mingwex Qt5ThemeSupport Qt5EventDispatcherSupport Qt5FontDatabaseSupport Qt5PlatformCompositorSupport Qt5WindowsUIAutomationSupport qdirect2d) +# SET(NPACKDG_LIBRARIES ${NPACKDG_LIBRARIES} jasper icuin icuuc icudt icutu qtpcre2 qtharfbuzz qtfreetype qtlibpng jpeg zstd z) +# endif() + +install_data('../LICENSE.txt') +install_data('../CrystalIcons_LICENSE.txt') + +# TODO +# file(TO_CMAKE_PATH "$ENV{EXEPROXY}" EXEPROXY) +# install(FILES ${EXEPROXY}/exeproxy.exe DESTINATION ${CMAKE_INSTALL_PREFIX}) +# if(WIN32 AND NOT NPACKD_FORCE_STATIC) +# install(CODE "execute_process(COMMAND \"${WINDEPLOYQT_EXECUTABLE}\" --compiler-runtime --pdb \"${CMAKE_INSTALL_PREFIX}/npackdg.exe\" WORKING_DIRECTORY \"${_qt_bin_dir}\")") +# endif() + +conf = configuration_data() +conf.set('NPACKD_VERSION_MAJOR', version_parts.length() > 0 ? version_parts[0] : '0') +conf.set('NPACKD_VERSION_MINOR', version_parts.length() > 1 ? version_parts[1] : '0') +conf.set('NPACKD_VERSION_PATCH', version_parts.length() > 2 ? version_parts[2] : '0') +conf.set('NPACKD_VERSION_TWEAK', version_parts.length() > 3 ? version_parts[3] : '0') +conf.set('OUTPUT_FILE_NAME', meson.project_name() + '.exe') +configure_file(input: 'src/app.rc.in', + output: meson.project_name() + '.rc', + configuration: conf) +configure_file(input: 'src/npackdg.manifest', + output: 'npackdg.manifest', copy: true) +configure_file(input: 'src/app.ico', + output: 'app.ico', copy: true) +rc = windows.compile_resources(meson.current_build_dir() / meson.project_name() + '.rc') + +foreach f : ['app.png', + 'update.png', + 'wait.png', + 'uninstall.png', + 'fileissue.png', + 'gotosite.png', + 'install.png', + 'broken.png', + 'add.png'] + configure_file(input: 'src' / f, + output: f, copy: true) +endforeach + + +add_project_link_arguments('-Wl,-Map,' + meson.project_name() + '.map', language: 'cpp') + +qms = qt5_mod.compile_translations(qresource: 'src' / meson.project_name() + '.qrc') + +configure_file(input: 'src' / meson.project_name() + '.qrc', + output: meson.project_name() + '.qrc', copy: true) + +uis = qt5_mod.compile_ui(sources: ['src/packageframe.ui', 'src/exportrepositoryframe.ui', + 'src/licenseform.ui', 'src/mainframe.ui', 'src/mainwindow.ui', + 'src/messageframe.ui', 'src/packageversionform.ui', + 'src/settingsframe.ui']) + +# Only headers that need moc should be put here +mocs = qt5_mod.compile_moc(sources: ['src/job.h', + 'src/installedpackages.h', 'src/visiblejobs.h', + 'src/clprogress.h', + 'src/mainwindow.h', + 'src/fileloader.h', + 'src/packageframe.h', 'src/exportrepositoryframe.h', + 'src/licenseform.h', 'src/mainframe.h', + 'src/messageframe.h', 'src/packageversionform.h', + 'src/settingsframe.h', + 'src/progresstree2.h', + 'src/downloader.h', + 'src/asyncdownloader.h']) + +processed = qt5_mod.compile_resources( + sources: meson.current_build_dir() / meson.project_name() + '.qrc', +) + +# TODO option(NPACKD_ADMIN "Force admin right on program" TRUE) +#if(NPACKD_ADMIN) +# target_compile_definitions(npackdcl PRIVATE -D NPACKD_ADMIN=1) +#else() +# target_compile_definitions(npackdcl PRIVATE -D NPACKD_ADMIN=0) +#endif() + +# TODO /npackdg.qrc + +# TODO +# set(NPACKDG_FORMS +# src/mainwindow.ui +# src/packageversionform.ui +# src/licenseform.ui +# src/messageframe.ui +# src/settingsframe.ui +# src/packageframe.ui +# src/mainframe.ui +# src/exportrepositoryframe.ui +# ) +# set(NPACKDG_TRANSLATIONS +# src/npackdg_es.ts +# src/npackdg_ru.ts +# src/npackdg_fr.ts +# src/npackdg_de.ts +# ) +# QT5_CREATE_TRANSLATION(qm_files src/ ${NPACKDG_TRANSLATIONS} OPTIONS -locations none) +# qt5_add_translation(NPACKDG_TRANSLATIONS_QM ${NPACKDG_TRANSLATIONS}) + +src = ['src/main.cpp', + 'src/mainwindow.cpp', + 'src/packageversion.cpp', + 'src/repository.cpp', + 'src/job.cpp', + 'src/downloader.cpp', + 'src/wpmutils.cpp', + 'src/package.cpp', + 'src/packageversionfile.cpp', + 'src/version.cpp', + 'src/dependency.cpp', + 'src/fileloader.cpp', + 'src/installoperation.cpp', + 'src/packageversionform.cpp', + 'src/license.cpp', + 'src/licenseform.cpp', + 'src/windowsregistry.cpp', + 'src/uiutils.cpp', + 'src/commandline.cpp', + 'src/messageframe.cpp', + 'src/settingsframe.cpp', + 'src/packageframe.cpp', + 'src/selection.cpp', + 'src/hrtimer.cpp', + 'src/clprogress.cpp', + 'src/mainframe.cpp', + 'src/dbrepository.cpp', + 'src/installedpackages.cpp', + 'src/installedpackageversion.cpp', + 'src/abstractrepository.cpp', + 'src/packageitemmodel.cpp', + 'src/abstractthirdpartypm.cpp', + 'src/controlpanelthirdpartypm.cpp', + 'src/msithirdpartypm.cpp', + 'src/wellknownprogramsthirdpartypm.cpp', + 'src/installedpackagesthirdpartypm.cpp', + 'src/flowlayout.cpp', + 'src/mysqlquery.cpp', + 'src/repositoryxmlhandler.cpp', + 'src/visiblejobs.cpp', + 'src/progresstree2.cpp', + 'src/clprocessor.cpp', + 'src/exportrepositoryframe.cpp', + 'src/asyncdownloader.cpp', + 'src/uimessagehandler.cpp', + 'src/packageutils.cpp', + 'src/wuathirdpartypm.cpp', + 'src/wuapi_i.c', + 'src/comobject.cpp', + 'src/repositoriesitemmodel.cpp', + 'src/dismthirdpartypm.cpp', + 'src/sqlutils.cpp', + 'src/threadpool.cpp', + 'src/dag.cpp', + 'src/deptask.cpp', + 'src/lockedfiles.cpp', + mocs, uis, processed, rc] + +incdir = include_directories('src') +executable(meson.project_name(), src, dependencies: deps, include_directories: incdir, + install: true) + pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy