<div dir="ltr">Hello,<br><br>I've been trying out emerge for the first time with varying rates of success, so I thought I'd document my progress. I use master branch (22.7.2015 [dmy]) as it seems to be recommended judging by discussion on the web, and by the fact that I was unable to run any other branch that I tried (python errors or errors during kdeenv setup). My final goal is to build Krita with mingw-w64 (against all recommendations, apparently), but in this instance I'm happy to just get the dependencies compiled. I have yet to actually run anything, so even if these fixes make the compiler happy, there's no guarantee that they actually work. If some other branch is supposed to be more functional, I may have just messed up the initial setup with them.<br><br>----kdeenv----<br>I got some problems with the powershell script, and the guide I was using failed to mention that the powershell bits are actually optional. There's also a bat version. I managed to run the ps1 script once but later it just kept crashing during the env setup. I didn't look into it further after discovering the bat. Just a heads-up that the bat may be a comfier option.<br><br>----emerge qt----<br>1.  A lot of the sourceforge links are no longer valid. Most links are forwarded automatically to new location, but some return 404. Easy to fix manually, but somewhat confusing initially.<br>2.  Websites may be down momentarily, causing some confusion whether a link is dead or not. I wasted some time trying to sort out activeperl, when it wasn't really broken.<br>3.  Openssl-1.0.2c is no longer available. Apparently emerge is happy if the new version number is added to the list and default target changed.<br>4.  Mysql download fails. <a href="http://cdn.mysql.com">cdn.mysql.com</a> does not work anymore. Changed basepath to <a href="http://dev.mysql.com">dev.mysql.com</a><br>5.  qt defaults to ANGLE+directx sdk. Failing that, it disables angle with a warning that build will most likely fail; continue? Added "-opengl desktop" to download\git\qtbase\configure.bat to force full opengl.<br>6.  Apparently building qtwebkit can randomly fail with "No such file or directory" errors. Simply trying again fixes this. It's also possible that the installation can fail silently. See point 9 further down.<br><br>I also found it strange that msys gave a big framed warning that shell must be restarted before continuing after first run. Then there was a prompt for continue yes/no. I was not present at the time so it happily defaulted to yes and soon crashed with some cryptic error (which I forgot to note down). This apparently left msys dysfunctional and it had to be reinstalled manually*1) [1]<br><br>----emerge frameworks----<br>(calligra guide [2] suggests emerging kdelibs, but this doesn't seem to exist anymore. I'm assuming there's something equivalent in frameworks)<br>7.  Building kdoctools fails. Added colon ':' to the list of escaped characters in download\git\kdoctools\cmake\uriencode.cmake [3]<br>8.  win32libs/gpg-error fails with a whole bunch of errors such as this:<br>R:/build/win32libs/gpg-error/work/mingw-w64-RelWithDebInfo-1.12/mkerrcodes.h:9:5: error: expected expression before ',' token<br>   { , "GPG_ERR_E2BIG" },<br>     ^<br>This is apparently caused by differing behaviour in gcc-5 compared to earlier versions. Suggested fix [4] is to add compiler flag -P via libgpg-error-x.xx\src\Makefile.am. This stumped me for  some time, because I didn't realize that this is an automake file which is not used by cmake. In our case the flags go to emerge\portage\win32libs\gpg-error\libgpg-error-cmake-1.12.diff to the generation calls for mkerrcodes.h and mkw32errmap.tab.h at lines 113 and 115 after the -E flags *2). There is a similar recent fix to this on this mailing list, but that didn't show up in searches while I was dealing with this.<br>9.   kdewebkit build failed, claiming that qtwebkit is not installed (missing cmake files in lib\cmake). This may relate to the random build fail of qtwebkit at point 6. I did a full rebuild with "emerge -i qtwebkit". After this, kdewebkit built successfully.<br>10.  khtml fails with "conflicting declarations" errors. There are two time.h files visible in include\mingw and mingw64\x86_64-w64-mingw32\include. I couldn't figure this one out, so I just removed the include\mingw one while building khtml, and then put it back. Probably not the best of ideas.<br>11.  Kross fails with errors:<br>CMakeFiles\metafunctiontest.dir/objects.a(metafunctiontest.cpp.obj): In function `Kross::MetaFunction::~MetaFunction()':<br>q:/kross/src/core/metafunction.h:128: undefined reference to `__imp__ZTVN5Kross12MetaFunctionE'<br>q:/kross/src/core/metafunction.h:128: undefined reference to `__imp__ZTVN5Kross12MetaFunctionE'<br>CMakeFiles\metafunctiontest.dir/objects.a(metafunctiontest.cpp.obj): In function `Kross::MetaFunction::MetaFunction(QObject*, QByteArray const&)':<br>q:/kross/src/core/metafunction.h:60: undefined reference to `__imp__ZTVN5Kross12MetaFunctionE'<br>collect2.exe: error: ld returned 1 exit status<br>Resulting from the call:<br>r:\mingw64\bin\g++.exe   -std=c++0x -fno-exceptions -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -O2 -g -DNDEBUG  -mwindows -Wl,--whole-archive CMakeFiles\metafunctiontest.dir/objects.a -Wl,--no-whole-archive  -o ..\bin\metafunctiontest.exe -Wl,--out-implib,..\lib\libmetafunctiontest.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\metafunctiontest.dir\linklibs.rsp<br>(I understand this is not enough debugging information, but hopefully someone already has a solution off the cuff)<br><br>And this is where I'm stumped. I tried to debug this over a couple of days, and this goes a bit over my head. This was a fun excursion, and I'm going to leave it at that for now. I'll post a part2 if I ever get around the last one and the ones that inevitably emerge after it. Do tell me if some other branch is more functional and mingw friendly. I may have done something wrong to start with.<br>____________________________<br>*1) msys fix for the error: make: command not found [1]<br>run msys.bat (in \emerge\portage\dev-util\msys)<br>call pacman -Syu<br>confirm all prompts<br>run autorebase.bat (in \msys )<br>call pacman -S base-devel<br>select all whem prompted<br>start a new command prompt for kdeenv. The bats add some env variables that may mess up emerge<br><br>*2) example fix for libgpg-error-cmake-1.12.diff  (don't copypaste, may mess up the patch)<br>+add_custom_command(OUTPUT ${BIN_DIR}/mkerrcodes.h  COMMAND ${AWK_EXECUTABLE} -f ${SRC_DIR}/mkerrcodes1.awk ${SRC_DIR}/<a href="http://errnos.in">errnos.in</a> > ${BIN_DIR}/_mkerrcodes.h<br>+                                                   #COMMAND set INCLUDE="\"${INCLUDE_STRING}\""<br>+                                                   COMMAND ${ERR_COMPILER} -E -P ${BIN_DIR}/_mkerrcodes.h ${NULL_DEVICE} | "\"${GREP_EXECUTABLE}\"" GPG_ERR_ | <br>+                                                       "\"${AWK_EXECUTABLE}\"" -f ${SRC_DIR}/mkerrcodes.awk > ${BIN_DIR}/mkerrcodes.h)<br>+add_custom_command(OUTPUT ${BIN_DIR}/mkw32errmap.tab.h COMMAND ${ERR_COMPILER} -E -P -DRESOLVE_MACROS ${SRC_DIR}/mkw32errmap.c ${NULL_DEVICE} | "\"${GREP_EXECUTABLE}\"" \"{&mkw32errmap_marker\" > ${BIN_DIR}/mkw32errmap.tab.h)<br><br>references:<br>[1] <a href="https://bugs.kde.org/show_bug.cgi?id=329856">https://bugs.kde.org/show_bug.cgi?id=329856</a> (msys)<br>[2] <a href="https://community.kde.org/Calligra/Building_Calligra_on_Windows">https://community.kde.org/Calligra/Building_Calligra_on_Windows</a><br>[3] <a href="https://bugs.kde.org/show_bug.cgi?id=348061">https://bugs.kde.org/show_bug.cgi?id=348061</a> (doctools)<br>[4] <a href="http://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=commitdiff;h=c01c8f0c4f55d76b037c7f6aa44ad25ede18d38a">http://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=commitdiff;h=c01c8f0c4f55d76b037c7f6aa44ad25ede18d38a</a><br></div>