Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding libraries needed to build Krita #11861

Merged
merged 31 commits into from
Aug 7, 2020

Conversation

hellozee
Copy link
Contributor

@hellozee hellozee commented Jun 9, 2020

  • What does your PR fix?
    This PR tries to package the libraries into vcpkg that we use to build Krita. I am still pretty new to packaging libraries for vcpkg, so still learning. I took the KF5 portfiles from More KF5 ports added #4652 and [kf5] recover from #4652 #7075.

  • Which triplets are supported/not supported? Have you updated the CI baseline?
    For now I am testing this on x64-windows but I have to check on other systems for compatibility. Yes I have updated the CI baseline.

  • Does your PR follow the maintainer guide?
    Yes

@ghost
Copy link

ghost commented Jun 9, 2020

CLA assistant check
All CLA requirements met.

@hellozee hellozee changed the title Adding libraries needed to build Krita [WIP] Adding libraries needed to build Krita Jun 9, 2020
@JackBoosY JackBoosY added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Jun 12, 2020
@hellozee hellozee force-pushed the krita-tools branch 2 times, most recently from 5a9eba6 to 104e047 Compare June 13, 2020 11:03
@hellozee hellozee marked this pull request as ready for review June 14, 2020 20:33
@hellozee hellozee changed the title [WIP] Adding libraries needed to build Krita Adding libraries needed to build Krita Jun 15, 2020
ports/kf5archive/portfile.cmake Outdated Show resolved Hide resolved
ports/kf5completion/CONTROL Show resolved Hide resolved
ports/kf5completion/portfile.cmake Outdated Show resolved Hide resolved
ports/kf5completion/portfile.cmake Outdated Show resolved Hide resolved
ports/kf5completion/portfile.cmake Outdated Show resolved Hide resolved
ports/vc/portfile.cmake Outdated Show resolved Hide resolved
ports/vc/portfile.cmake Outdated Show resolved Hide resolved
ports/kf5coreaddons/portfile.cmake Outdated Show resolved Hide resolved
ports/kf5config/portfile.cmake Outdated Show resolved Hide resolved
ports/kf5completion/portfile.cmake Outdated Show resolved Hide resolved
@NancyLi1013
Copy link
Contributor

@hellozee
Thanks for your update.
It seems that there are still some other review suggestions that haven't done yet.
Could you please address them again? Such as adding homepage, update the deprecated functions or variables and so on.

Also need to look into the failures on CI tests.

@hellozee
Copy link
Contributor Author

@NancyLi1013 ahh yes, I was working on that too, it is just the number of ports is a bit hard to keep track of. Could I get a look in error logs? Cause on my side they build fine on both Windows and Linux, unfortunately I don't have a Mac to test it out.

@NancyLi1013
Copy link
Contributor

@hellozee
Thanks for your efforts for this PR. It's really a huge project.

quazip failed on x64-windows-static, due to this:

   Creating library quazip5d.lib and object quazip5d.exp
Qt5Cored.lib(qglobal.obj) : error LNK2019: unresolved external symbol gethostname referenced in function "public: static class QString __cdecl QSysInfo::machineHostName(void)" (?machineHostName@QSysInfo@@SA?AVQString@@XZ)
Qt5Cored.lib(qglobal.obj) : error LNK2019: unresolved external symbol WSAStartup referenced in function "public: __cdecl QWindowsSockInit::QWindowsSockInit(void)" (??0QWindowsSockInit@@QEAA@XZ)
Qt5Cored.lib(qglobal.obj) : error LNK2019: unresolved external symbol WSACleanup referenced in function "public: __cdecl QWindowsSockInit::~QWindowsSockInit(void)" (??1QWindowsSockInit@@QEAA@XZ)
Qt5Cored.lib(qlocale_tools.obj) : error LNK2019: unresolved external symbol "public: static void __cdecl double_conversion::DoubleToStringConverter::DoubleToAscii(double,enum double_conversion::DoubleToStringConverter::DtoaMode,int,char *,int,bool *,int *,int *)" (?DoubleToAscii@DoubleToStringConverter@double_conversion@@SAXNW4DtoaMode@12@HPEADHPEA_NPEAH3@Z) referenced in function "void __cdecl qt_doubleToAscii(double,enum QLocaleData::DoubleForm,int,char *,int,bool &,int &,int &)" (?qt_doubleToAscii@@YAXNW4DoubleForm@QLocaleData@@HPEADHAEA_NAEAH3@Z)
Qt5Cored.lib(qlocale_tools.obj) : error LNK2019: unresolved external symbol "public: double __cdecl double_conversion::StringToDoubleConverter::StringToDouble(char const *,int,int *)const " (?StringToDouble@StringToDoubleConverter@double_conversion@@QEBANPEBDHPEAH@Z) referenced in function "double __cdecl qt_asciiToDouble(char const *,int,bool &,int &,enum StrayCharacterMode)" (?qt_asciiToDouble@@YANPEBDHAEA_NAEAHW4StrayCharacterMode@@@Z)
Qt5Cored.lib(qregularexpression.obj) : error LNK2019: unresolved external symbol pcre2_config_16 referenced in function "public: void __cdecl QRegularExpressionPrivate::getPatternInfo(void)" (?getPatternInfo@QRegularExpressionPrivate@@QEAAXXZ)
Qt5Cored.lib(qregularexpression.obj) : error LNK2019: unresolved external symbol pcre2_match_context_create_16 referenced in function "public: struct QRegularExpressionMatchPrivate * __cdecl QRegularExpressionPrivate::doMatch(class QString const &,int,int,int,enum QRegularExpression::MatchType,class QFlags<enum QRegularExpression::MatchOption>,enum QRegularExpressionPrivate::CheckSubjectStringOption,struct QRegularExpressionMatchPrivate const *)const " (?doMatch@QRegularExpressionPrivate@@QEBAPEAUQRegularExpressionMatchPrivate@@AEBVQString@@HHHW4MatchType@QRegularExpression@@V?$QFlags@W4MatchOption@QRegularExpression@@@@W4CheckSubjectStringOption@1@PEBU2@@Z)
Qt5Cored.lib(qregularexpression.obj) : error LNK2019: unresolved external symbol pcre2_match_context_free_16 referenced in function "public: struct QRegularExpressionMatchPrivate * __cdecl QRegularExpressionPrivate::doMatch(class QString const &,int,int,int,enum QRegularExpression::MatchType,class QFlags<enum QRegularExpression::MatchOption>,enum QRegularExpressionPrivate::CheckSubjectStringOption,struct QRegularExpressionMatchPrivate const *)const " (?doMatch@QRegularExpressionPrivate@@QEBAPEAUQRegularExpressionMatchPrivate@@AEBVQString@@HHHW4MatchType@QRegularExpression@@V?$QFlags@W4MatchOption@QRegularExpression@@@@W4CheckSubjectStringOption@1@PEBU2@@Z)
Qt5Cored.lib(qregularexpression.obj) : error LNK2019: unresolved external symbol pcre2_compile_16 referenced in function "public: void __cdecl QRegularExpressionPrivate::compilePattern(void)" (?compilePattern@QRegularExpressionPrivate@@QEAAXXZ)
Qt5Cored.lib(qregularexpression.obj) : error LNK2019: unresolved external symbol pcre2_code_free_16 referenced in function "public: void __cdecl QRegularExpressionPrivate::cleanCompiledPattern(void)" (?cleanCompiledPattern@QRegularExpressionPrivate@@QEAAXXZ)
Qt5Cored.lib(qregularexpression.obj) : error LNK2019: unresolved external symbol pcre2_pattern_info_16 referenced in function "public: class QStringList __cdecl QRegularExpression::namedCaptureGroups(void)const " (?namedCaptureGroups@QRegularExpression@@QEBA?AVQStringList@@XZ)
Qt5Cored.lib(qregularexpression.obj) : error LNK2019: unresolved external symbol pcre2_match_data_create_from_pattern_16 referenced in function "public: struct QRegularExpressionMatchPrivate * __cdecl QRegularExpressionPrivate::doMatch(class QString const &,int,int,int,enum QRegularExpression::MatchType,class QFlags<enum QRegularExpression::MatchOption>,enum QRegularExpressionPrivate::CheckSubjectStringOption,struct QRegularExpressionMatchPrivate const *)const " (?doMatch@QRegularExpressionPrivate@@QEBAPEAUQRegularExpressionMatchPrivate@@AEBVQString@@HHHW4MatchType@QRegularExpression@@V?$QFlags@W4MatchOption@QRegularExpression@@@@W4CheckSubjectStringOption@1@PEBU2@@Z)
Qt5Cored.lib(qregularexpression.obj) : error LNK2019: unresolved external symbol pcre2_match_16 referenced in function "int __cdecl safe_pcre2_match_16(struct pcre2_real_code_16 const *,unsigned short const *,int,int,int,struct pcre2_real_match_data_16 *,struct pcre2_real_match_context_16 *)" (?safe_pcre2_match_16@@YAHPEBUpcre2_real_code_16@@PEBGHHHPEAUpcre2_real_match_data_16@@PEAUpcre2_real_match_context_16@@@Z)
Qt5Cored.lib(qregularexpression.obj) : error LNK2019: unresolved external symbol pcre2_match_data_free_16 referenced in function "public: struct QRegularExpressionMatchPrivate * __cdecl QRegularExpressionPrivate::doMatch(class QString const &,int,int,int,enum QRegularExpression::MatchType,class QFlags<enum QRegularExpression::MatchOption>,enum QRegularExpressionPrivate::CheckSubjectStringOption,struct QRegularExpressionMatchPrivate const *)const " (?doMatch@QRegularExpressionPrivate@@QEBAPEAUQRegularExpressionMatchPrivate@@AEBVQString@@HHHW4MatchType@QRegularExpression@@V?$QFlags@W4MatchOption@QRegularExpression@@@@W4CheckSubjectStringOption@1@PEBU2@@Z)

vc failed on arm64-windows, due to this:

FAILED: CMakeFiles/Vc.dir/src/support_x86.cpp.obj 
"C:\PROGRA~2\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\bin\Hostx64\arm64\cl.exe"   /TP -D_CRT_SECURE_NO_WARNINGS -D__AVX2__ -D__AVX__ -D__BMI2__ -D__FMA__ -D__SSE2__ -D__SSE3__ -D__SSE4A__ -D__SSE4_1__ -D__SSE4_2__ -D__SSSE3__ -ID:\buildtrees\vc\src\1.4.1-c20f654517 /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP  /wd4290 /wd4800 /wd4996 /wd4244 /wd4146 /wd4227 /wd4722 /wd4748 /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1    -DVc_COMPILE_LIB /showIncludes /FoCMakeFiles\Vc.dir\src\support_x86.cpp.obj /FdCMakeFiles\Vc.dir\Vc.pdb /FS -c D:\buildtrees\vc\src\1.4.1-c20f654517\src\support_x86.cpp
D:\buildtrees\vc\src\1.4.1-c20f654517\src\support_x86.cpp(49): error C2065: '_XCR_XFEATURE_ENABLED_MASK': undeclared identifier
D:\buildtrees\vc\src\1.4.1-c20f654517\src\support_x86.cpp(49): error C3861: '_xgetbv': identifier not found

D:\buildtrees\vc\src\1.4.1-c20f654517\src\cpuid.cpp(140): error C3861: '__cpuid': identifier not found
D:\buildtrees\vc\src\1.4.1-c20f654517\src\cpuid.cpp(143): error C3861: '__cpuid': identifier not found

libheif failed on x64-linux, due to this:

/mnt/vcpkg-ci/buildtrees/libheif/src/v1.7.0-efb1ff6752/libheif/heif_encoder_x265.cc:36:10: fatal error: x265.h: No such file or directory
 #include <x265.h>
          ^~~~~~~~
compilation terminated.

libde265 failed on x64-uwp, due to this:
4>D:\buildtrees\libde265\src\v1.0.5-4449139dc1\libde265\encoder\algo\tb-transform.cc(125): error C4703: potentially uninitialized local pointer variable 'residual' used
libde265 failed on arm64-windows and arm-uwp, due to this:
D:\buildtrees\libde265\src\v1.0.5-4449139dc1\libde265\x86\sse.cc(45): error C3861: '__cpuid': identifier not found

As for the failure on x64-windows-static for libde265, I didn't find any error info from CI test.

@hellozee
Copy link
Contributor Author

@NancyLi1013 ahh thanks a lot, that cleared a lot of doubts for me, though from first look, it might take a bit of time from my side to get them all resolved, feel free to avoid this till I request a review, 😃

@hellozee
Copy link
Contributor Author

@NancyLi1013 so, I couldn't understand why the build for x64-windows-static is failing, I poked around the azure pipelines and found out the artifacts. The windows build is fine, I don't know why it is complaining, nothing fails. For the linux one, I can't reproduce that locally for now.

@NancyLi1013
Copy link
Contributor

As for the failure on x64-windows-static:

-- Performing post-build validation
DLLs should not be present in a static build, but the following DLLs were found:

    D:/packages/libde265_x64-windows-static/bin/libde265.dll
    D:/packages/libde265_x64-windows-static/debug/bin/libde265.dll

There should be no bin\ directory in a static build, but D:\packages\libde265_x64-windows-static\bin is present.
There should be no debug\bin\ directory in a static build, but D:\packages\libde265_x64-windows-static\debug\bin is present.
If the creation of bin\ and/or debug\bin\ cannot be disabled, use this in the portfile to remove them

    if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
        file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
    endif()

We need to add this to portfile.cmake.

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
        file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

@hellozee
Copy link
Contributor Author

Okay, seemingly both linux and osx fail with the same logs. I think would try to replicate that in a clean box then, :)

@hellozee
Copy link
Contributor Author

@NancyLi1013, tried both with a native linux install and the new wsl2, can't reproduce, probably the CI is doing something which I am not quite aware of, 😫

@NancyLi1013
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@NancyLi1013
Copy link
Contributor

Hi @hellozee
I have tested this on my machine and it can be reproduced now.
libheif build failed due to this:

/Users/vagrant/Data/buildtrees/libheif/src/v1.7.0-efb1ff6752/libheif/heif_encoder_x265.cc:36:10: fatal error: 'x265.h' file not found
#include <x265.h>

I checked the source code and found these codes in CMakeLists.txt

if (UNIX)
  find_package(PkgConfig)
  pkg_check_modules(LIBDE265 libde265)
  pkg_check_modules(X265 x265)
  pkg_check_modules(AOM aom)
endif()

Since x265 cannot be found via find_package(PkgConfig) in vcpkg. We need to use find_library() and find_path().

@hellozee
Copy link
Contributor Author

Okay, so probably ubuntu comes with pkg-config preinstalled. Dang, now I feel stupid to not even notice that it calls pkgconfig, nonetheless it seems to be buildling fine now, 😄

ports/kf5completion/portfile.cmake Outdated Show resolved Hide resolved
ports/kf5config/portfile.cmake Outdated Show resolved Hide resolved
ports/kf5config/portfile.cmake Outdated Show resolved Hide resolved
ports/kf5coreaddons/portfile.cmake Outdated Show resolved Hide resolved
ports/kf5crash/portfile.cmake Show resolved Hide resolved
scripts/ci.baseline.txt Outdated Show resolved Hide resolved
scripts/ci.baseline.txt Outdated Show resolved Hide resolved
scripts/ci.baseline.txt Outdated Show resolved Hide resolved
@hellozee
Copy link
Contributor Author

hellozee commented Aug 4, 2020

The osx port still fails to build, but it is something else this time.

@NancyLi1013
Copy link
Contributor

LGTM now. Thanks for your hard work. @hellozee

@NancyLi1013 NancyLi1013 added info:reviewed Pull Request changes follow basic guidelines and removed requires:author-response labels Aug 5, 2020
@strega-nil strega-nil merged commit 9e853cf into microsoft:master Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants