27 August 2009

Building MyPaint in Windows


mypaint_build_env (both 32bit and 64bit) last update: June 02, 2012 [BROKEN]
older build environment  for 0.8-0.9.1 version

Consider this as very minimal (patched and precompiled) package to build MyPaint. As long as Mypaint doesn't introduce new dependencies this should be future-proof.

Extract it [somewhere], directory's name may not contain space.
Read the included README.txt

MyPaint source:
http://gitorious.org/mypaint/mypaint
June 02, 2012: temporary workaround for windows

Note: while you may try other than main branch, I do not support them. Do not report error of other than main branch.
To create an installer, just execute nsis.bat. Mostly you would edit some of first lines in mypaint.nsi like version or other info that need to be updated otherwise there mostly no need to modify.

If mypaint.exe didn't run successfully check C:\Documents and Settings\[username]\Local Settings\Application Data\mypaint\mypaint_error.log for errors

good luck!
note : 
vista/7 users might need to run bat file as admin...


Below are the instruction for advanced users only who already familiar with compiling. It's not continuation of above part.

The hard way:


Requirements:
Grab MyPaint Sources here. Extract to somewhere
Python 2.6 [download]
MinGW [download] (I use version 4.4). Install to e.g C:\Mingw
Scons  [download]
SWIG [download] Install to e.g C:\swig

Python Dependencies:
Numpy [download] --> This is Numerical Python not the older Numerics
Install All...

Enter Environment Setting: Win+break > Advanced > Environment Variables
Add additional path...
PATH: "C:\MinGW\bin;C:\GTK\bin;C:\swig;C:\Python26;C:\Python26\Scripts;"...
For ex. if your current PATH: "C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem"
After added, now it should be: "C:\MinGW\bin;C:\GTK\bin;C:\swig;C:\Python26;C:\Python26\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Python26\Scripts"
PKG_CONFIG_PATH = "C:\GTK\lib\pkgconfig"
note: please refer to all your installation path in our first step 

Now lets build! open cmd in MyPaint Source folder (where mypaint.py reside), and type: scons
Tell me if you succeed!

If you have py2exe, you could create portable distribution of MyPaint

97 comments:

  1. thanks.
    how do you set this:
    Environment Setting: Win+break > Advanced > Environment Variables
    Add additional path...
    PATH: "C:\MinGW\bin;C:\GTK\bin;C:\swig;C:\Python25;C:\Python25\Scripts;"... ??

    ReplyDelete
  2. You can do that by copy that additional path (inside quotes) and paste it before your current PATH (I've added an example in this post)

    ReplyDelete
  3. thanks! I was able to do it. I get this error, what happens here??


    scons: Reading SConscript files ...
    Building for python2.6
    swig -o mypaintlib_wrap.cpp -noproxydel -python -c++ mypaintlib.i
    python generate.py
    Checked brushsettings.hpp
    scons: done reading SConscript files.
    scons: Building targets ...
    cl /Folib\mypaintlib_wrap.obj /c lib\mypaintlib_wrap.cpp /nologo -mms-bitfields
    /TP -Wall -Wno-sign-compare -Wno-write-strings /nologo -mms-bitfields /IC:\GTK\i
    nclude\glib-2.0 /IC:\GTK\lib\glib-2.0\include /IC:\Python26\lib\site-packages\nu
    mpy\core\include /IC:\Python25\include /IC:\Python25\Lib\site-packages\numpy\cor
    e\include
    "cl" no se reconoce como un comando interno o externo,
    programa o archivo por lotes ejecutable.
    scons: *** [lib\mypaintlib_wrap.obj] Error 1
    scons: building terminated because of errors.

    ReplyDelete
  4. 1. If you use Python 2.6 then you should change enviroment path accordingly

    2. I recommend to use Python 2.5, if you still on 2.6, you need to install my unofficial pygtk:
    http://dl.dropbox.com/u/2554170/pygtk-2.16.0.win32-py26.exe
    http://dl.dropbox.com/u/2554170/pygobject-2.20.0.win32-py26.exe
    http://dl.dropbox.com/u/2554170/pycairo-1.8.2.win32-py26.exe

    3. "cl" means you're have Visual Studio. please look at my additional note in this post

    ReplyDelete
  5. guess what? another error :P

    protoc --python_out=. lib/strokemap.proto
    "protoc" no se reconoce como un comando interno o externo,
    programa o archivo por lotes ejecutable.
    scons: *** [lib\strokemap_pb2.py] Error 1
    scons: building terminated because of errors.

    ReplyDelete
  6. have you download both protobuf's packages as I told? one contain protoc.exe (compiler) and another one is python packages that you need installed it first.

    then copy protoc in same folder as python.exe

    I hope that works ;)

    ReplyDelete
  7. If you could make it done, I will put this post in mypaint's wiki! :)

    Thanks for giving it a try...

    ReplyDelete
  8. Thanks! I done that, now i got another error, it seems that a file is missing that is responsible of translations(po files), this file is "msgfmt", you tell in your post that the file in included in the gtk package, but isn't there, look:

    msgfmt po\cs.po -o po\cs\LC_MESSAGES\mypaint.mo
    "msgfmt" no se reconoce como un comando interno o externo,
    programa o archivo por lotes ejecutable.
    scons: *** [po\cs\LC_MESSAGES\mypaint.mo] Error 1
    scons: building terminated because of errors.

    i find the requested file in GNU, from the gettext package, putting in C\GTK\bin does make another error:

    msgfmt po\cs.po -o po\cs\LC_MESSAGES\mypaint.mo
    scons: *** [po\cs\LC_MESSAGES\mypaint.mo] Error -1073741515
    scons: building terminated because of errors.


    so, what i have to do??

    ReplyDelete
  9. Are you sure have follow my download link as posted?
    My installed version is gtk+-bundle_2.16.6-20090911_win32.zip

    I have no idea if they shave it off in latter version (haven't checked that yet)

    BTW please avoid 2.18 they are sucks and full bugs in windows

    ReplyDelete
  10. yes, i followed the link, i redownload it and unzip it under the right directory, and the error is the same(msgfmt is missing)

    ReplyDelete
  11. Hmm.. but msgfmt.exe (and its friends) does exist in GTK\bin right?

    And you have add that GTK\bin in PATH as explained earlier right? a.k.a if you open command prompt you can execute msgfmt anywhere...

    Then I have no clue how that could be happened..

    ReplyDelete
  12. the file is not in the directory. And i did put it in the PATH.

    ReplyDelete
  13. Man.. they really shave it. I update the link several times, cause gnome keep update the files and the last gtk+ bundle that works is http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.16/gtk+-bundle_2.16.6-20090911_win32.zip (26.7MB). Months later I saw the link didn't work again, so I quick check the site and change it. But you right, msgfmt is gone now. And I cannot find that particular gtk+-bundle anymore...

    Anyway you could try gettext and skip the errorneous .po files by moving it somewhere. It most likely caused by unrecognized characters or invalid string

    ReplyDelete
  14. ah I got it .. here you go
    http://ns1.regex.com/gnome/binaries/win32/gtk+/2.16/gtk+-bundle_2.16.6-20090911_win32.zip

    I will update the post.. thanks for checking that

    ReplyDelete
  15. ok, building was done correctly, but it seems that the .exe doesn't work!. It shows a CMD prompt too fast and then it closes, that all i get when i run mypaint.exe

    ReplyDelete
  16. instead of mypaint.exe try open command prompt and execute mypaint.py then report the error..

    ReplyDelete
  17. no error shows up. :S really weird.

    ReplyDelete
  18. well, guess we need vorbose mode
    try execute:
    SET PYTHONVERBOSE=1
    before running mypaint.py

    ReplyDelete
  19. nothing happens either

    ReplyDelete
  20. I'm in the same boat. I'm trying to compile the master using the mypaint.exe.c from .91 (it isn't in the git) it does fine, but the exe doesn't run. Any ideas?

    and thanks for providing this awesome tool for us noobs. :D

    ReplyDelete
  21. ....and to pick up where anon left off...I get these errors:

    We are not correctly installed or compiled!
    Traceback (most recent call last):
    File "C:\Mypaint\src\mypaint.py", line 148, in
    datapath, confpath, localepath = get_paths()
    File "C:\Mypaint\src\mypaint.py", line 97, in get_paths
    print 'script: "%s"' % arg0
    NameError: global name 'arg0' is not defined

    ReplyDelete
  22. Hi flynsk,

    When I reread the whole comments things has become redundant :p

    About the mypaint_exe.c you shouldn't need it anymore though I haven't tried the latest git. Instead use mypaint.exe from [somewhere]\win32 folder

    ReplyDelete
  23. When I run build without mypaint_exe.c i get an error:


    scons: *** [mypaint_exe.o]Source 'mypaint_exe.c' not found, needed by target 'mypaint_exe.o'

    thank you,
    Flynn

    ReplyDelete
  24. hmm.. maybe it's not yet updated to reflex the removal.
    But after you get mypaint_exe.c from 0.9 do you get win32 folder with mypaint.exe there? or there is an error? note: the one you should run isn't from src folder.

    ReplyDelete
  25. Correct. I was using the .c from .091 source. With a .c file tt builds to something\Win32, buts when I try to execute mypaint (the exe in the win32 folder) it crashes. No error.

    Task manager shows it start to load up memory, then it just disappears.

    ReplyDelete
  26. I just tried xsheet-mypaint repo, apparently the code still broken...

    To see an error log, open command prompt and navigate to win32 folder, then use this command:
    mypaint --logfile=mypaint_error.log

    open the log file.

    ReplyDelete
  27. Done. Hope this helps :)

    http://pastebin.com/TJHjimyP

    ReplyDelete
  28. thanks, that attribute is from gtk-2.18 which tablet with pressure support is broken (only in windows) from 2.18 upward, mypaint stuck at 2.16 for while :(

    http://opensourcepack.blogspot.com/2010/11/new-pygtk-for-mypaint.html

    ReplyDelete
  29. Aaah, I see.

    Thank you very much!

    ReplyDelete
  30. Thanks for providing the build environment.

    I also got the "instant exit" which was due to not having icons (only figured it out with the --logfile option). The build did not copy over the icons. There was a share/icons/hicolor/index.theme but none of the 16x16 etc directories. I copied them by hand and it launched. There's a clear directive in the SConstruct but I know nothing about scons to debug it.

    After launching (with v0.9.0-265-g2157d3f) the tablet input was crazy. Debug shows it knows pressure but it has a large offset and it jumps around. The windows installer from the mypaint website worked much better.

    ReplyDelete
  31. I only provide this "only" to give users impression of mypaint's new GUI.
    If you read the bugreport I linked above, tablet issue is deep (inside GDK mechanism), it's one of gtkwin32 problem that heven't fixed for years ago and I'm fully aware of this. But as mypaint progressed we must decide wether to ditch 2.16 and wait gtk+3.x which future is uncertain for the mean time or to provide whole backported of missing functions for win32.

    I think 16x16 icons isn't the problem here as they are embedded as resources inside libgtk*.dll, so it might be other thing. Those message you see in logging mode is unrelated.

    ReplyDelete
  32. BTW FYI I'm the same the person who provide the official mypaint installer

    ReplyDelete
  33. ahh so there is new icons.. updated the build.bat

    ReplyDelete
  34. I receive:

    "pkg-config is not recognized as an internal or external command, operable program or batch file.
    OSError: pkg-config --cflags --libs glib-2.0"

    ReplyDelete
  35. Do you have runtime\GTK\bin\pkg-config.exe in the folder you extract mypaint_buildenv2?

    ReplyDelete
  36. @TumaGonx Zakkum
    OK Thanks a lot .
    Now it gives me another error, not an error:
    Package glib 2.0 not found.
    Perhaps should add the directory containing Glib-2.0.pc to the PKG_CONFIG_PATH environment variable.

    Where i can find this glib2.0??

    ReplyDelete
  37. Marcos,

    It seems you try follow the hardway?
    if you're not familiar with compiler and such, all you need is run build.bat after extracting build_env2.7z, and you're done :)

    If you're indeed try the hard way I suggest you read MSYS and MinGW manual (it's for advanced user only), and it's very lengthy process involving patching, also only particular GTK and PyGTK are usable for Mypaint.

    ReplyDelete
  38. @thanks

    Yeah i will try the easy way.

    ReplyDelete
  39. It works cool... thanks...
    i use the easy way

    ReplyDelete
  40. I used the easy way. I hard-coded my paths into build.bat and the build failed right away with "no such command as python2.6"

    I copied python.exe to python2.6.exe and all built fine. I paused the build mid-stream to change the python exe filename, and form then on the build progressed fine, which tells me there are multiple references in the scons files to "python2.6.exe" or just "python2.6" when it should be "pythonw.exe"

    I've not used scons before so I assume it's some kind of build guidance system like make on steroids...? In any case build appeared to succeed but at the very end :

    "file not found - nn_NO"

    and the resulting build did not run. I will check logs and the icon issue noted above...

    ReplyDelete
  41. Dave, as you can see the build_env is being worked to support 64-bit compilation too. To help its progress see http://opensourcepack.blogspot.com/2011/11/call-to-mypaint-64-bit-users.html

    The one you used is the old one

    ReplyDelete
  42. Thank you so much for this. I built the xsheet version successfully using the easy way, however I want to run it side by side with the main stable version. Can I define where the preferences of the xsheet version are written so they don't go in the same folder (C:\Users\user\AppData\Local\mypaint) as the regular install? (like in linux where you would run "mypaint %f -c /home/user/.mypaint-version")
    thanks again

    ReplyDelete
  43. @Jon

    Yes you can, but you do this via shortcut creation not from command prompt

    1. Create shortcut of mypaint exe for.ex. in your desktop, name it MyPaint X-Sheet
    2. modify its properties and append target box with for ex. --config D:\somewhere\data
    so it may looks like:
    D:\somewhere\x-sheet\mypaint.exe --config D:\somewhere\data

    Regards

    ReplyDelete
  44. Thanks for the quick reply, works great. I guess there's no option to build a portable version (without using shortcuts after the fact) using the "easy" way?

    ReplyDelete
  45. Not really, you could use command line mypaint --config d:\somewhere as well
    but I just think it's not convenient isn't it? :p

    ReplyDelete
  46. No :-)
    You once did a portable version (0.9.1) so I was hoping maybe it's possible using the build_env although I guessed it wouldn't be that easy ;)
    anyway thanks again for all your hard work, cheers

    ReplyDelete
  47. Here is the portable loader http://dl.dropbox.com/u/2554170/mypaint.bat

    and these the modified build.bat to make portable one
    http://dl.dropbox.com/u/2554170/build64_portable.bat
    http://dl.dropbox.com/u/2554170/build_portable.bat

    Put them in the root of mypaint build environment, and run either build_portable or build64_portable

    good luck

    ReplyDelete
  48. Ahh no it's not hard to do portable one

    It is just that I want to wait for inkscape 0.49 and make AIO packages for gimp, inkscape and mypaint as portable suite with extras

    ReplyDelete
  49. Thanks.
    With the 0.9.1 portable version, I just ran the .exe and it was already configured to use ./UserData for everything.

    Here I still need to manually configure the scraps to ./data/scraps/
    Also, even when starting mypaint with with --config "./data" I still get a "C:\Users\user\AppData\Local\mypaint\thumbnails" directory, which I can't figure out how to change.

    Not complaining, just wish I understood better what's going on :)

    ReplyDelete
  50. Aww I guess it has been a while... I forgot those details
    But don't worry there always be a last resort way to forcibly most application into portable mode: the %USERPROFILE% trick!

    I've update mypaint.bat above, please redownload

    if you want to know more the article is here http://opensourcepack.blogspot.com/2009/09/create-your-own-gimp-portable-with.html
    my english is messy though, hope you understand

    ReplyDelete
  51. This is what I get when trying to run with the updated mypaint.bat (MyPaint will not run)

    Traceback (most recent call last):
    File "mypaint.py", line 164, in
    File "C:\mypaintbuild\win32\library.zip\gui\main.py", line 75, in main
    File "C:\mypaintbuild\win32\library.zip\gui\main.py", line 50, in run
    File "C:\mypaintbuild\win32\library.zip\gui\application.py", line 84, in __init__
    File "C:\mypaintbuild\win32\library.zip\gui\application.py", line 200, in load_settings
    AttributeError: 'NoneType' object has no attribute 'decode'

    ReplyDelete
  52. Strange

    Can't reproduce that
    Works fine here on XP mypaint 1.0 release
    are you running win7?

    I remove unnecessary backslash from mypaint.bat just in case that make different on Win7... if you want to try again

    But I don't have access to Win7 at time being

    ReplyDelete
  53. No difference, same error.
    Testing with x-sheet version and optigon-mypaint:rj/lines_curves_ellipses versions.
    Testing on win7 32 bits on VirtualBox on a mac. I can also try on a pc win7 64 bits laptop, but everything is working fine other than mypaint.bat on current setup. don't have access to xp right now :)

    ReplyDelete
  54. I think I remembered now, in that application.py I decide to use glib.USER_DIRECTORY_DOCUMENTS (equal to My Documents) since that location is visible and easy to reach by users, otherwise unicode path wont works. However in portable mode while XP seems run happily with it Win7 did not.

    the solution is to replace glib.get_user_special_dir(glib.USER_DIRECTORY_DOCUMENTS) with glib.get_user_config_dir()

    ReplyDelete
  55. FYI to hack mypaint sources (library.zip) refer to http://opensourcepack.blogspot.com/2009/08/mypaint-git-build-for-win32.html in Troubleshoot section

    I haven't test that though, hope you could try it. It is not that hard :)

    ReplyDelete
  56. funny... in x-sheet version it seems to work fine (yay!!!thanx) but in optigon version (which is from feb 17) I now get this error:

    Traceback (most recent call last):
    File "mypaint.py", line 164, in
    File "C:\Test\MyPaint-Optigon\library.zip\gui\main.py", line 75, in main
    File "C:\Test\MyPaint-Optigon\library.zip\gui\main.py", line 50, in run
    TypeError: __init__() takes exactly 4 arguments (5 given)

    ReplyDelete
  57. I'm using the sources from the current git repo. I get an error about a missing libintl.h. Here's the full log:

    Starting scons...
    Building for python2.6
    python generate.py
    Checked mypaint-brush-settings-gen.h
    Checked brushsettings-gen.h
    application SConscript
    swig -o mypaintlib_wrap.cpp -noproxydel -python -c++ mypaintlib.i
    set umask to 0022 (was 0000)
    Removed brushlib\brushmodes.o
    Removed brushlib\helpers.o
    Removed brushlib\mapping.o
    Removed brushlib\mypaint-brush-settings-gen.h
    Removed brushlib\brushsettings.pyc
    Removed lib\mypaintlib_wrap.cpp
    Removed lib\mypaintlib.py
    scons: Reading SConscript files ...
    Building for python2.6
    python generate.py
    Writing mypaint-brush-settings-gen.h
    Checked brushsettings-gen.h
    application SConscript
    swig -o mypaintlib_wrap.cpp -noproxydel -python -c++ mypaintlib.i
    set umask to 0022 (was 0000)
    scons: done reading SConscript files.
    scons: Building targets ...
    gcc -o brushlib\brushmodes.o -c -Wall -mms-bitfields -Ibrushlib -IC:\KefCode\app
    s\mypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture
    \runtime\GTK\lib\glib-2.0\include brushlib\brushmodes.c
    gcc -o brushlib\helpers.o -c -Wall -mms-bitfields -Ibrushlib -IC:\KefCode\apps\m
    ypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture\ru
    ntime\GTK\lib\glib-2.0\include brushlib\helpers.c
    gcc -o brushlib\mapping.o -c -Wall -mms-bitfields -Ibrushlib -IC:\KefCode\apps\m
    ypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture\ru
    ntime\GTK\lib\glib-2.0\include brushlib\mapping.c
    gcc -o brushlib\mypaint-brush-settings.o -c -Wall -mms-bitfields -Ibrushlib -IC:
    \KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\myp
    aint-texture\runtime\GTK\lib\glib-2.0\include brushlib\mypaint-brush-settings.c
    In file included from brushlib\mypaint-brush-settings.c:7:0:
    C:\KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0/glib/gi18n-lib.h:25
    :21: fatal error: libintl.h: No such file or directory
    compilation terminated.
    scons: *** [brushlib\mypaint-brush-settings.o] Error 1
    scons: building terminated because of errors.
    scons failed...
    Press any key to continue . . .

    ReplyDelete
  58. It looks like two files (probably identical) called libintl.h are provided in the distro, but both of them can be found only in folders for 64-bit libraries. I'm on a 32-bit system.

    ReplyDelete
  59. OK, now I have a libintl.h in \runtime\GTK\include, but I still got the same error. I copied this file to \compiler\MinGW\i686-pc-mingw32\include (since there seemed to be one in the corresponding folder for the 64-bit mingw). Now ld is complaining about a -z flag. The build goes like this (I snipped most of it until the end for brevity and because the comment field has a 4096 char limit):

    gcc -o brushlib\mypaint-tiled-surface.o -c -Wall -mms-bitfields -Ibrushlib -IC:\
    KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypa
    int-texture\runtime\GTK\lib\glib-2.0\include brushlib\mypaint-tiled-surface.c
    gcc -o brushlib\mypaint.o -c -Wall -mms-bitfields -Ibrushlib -IC:\KefCode\apps\m
    ypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture\ru
    ntime\GTK\lib\glib-2.0\include brushlib\mypaint.c
    g++ -o lib\mypaintlib_wrap.o -c -Wall -Wno-sign-compare -Wno-write-strings -Wall
    -mms-bitfields -IC:\KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0 -
    IC:\KefCode\apps\mypaint-texture\runtime\GTK\lib\glib-2.0\include -IC:\KefCode\a
    pps\mypaint-texture\runtime\GTK\include\libpng15 -IC:\KefCode\apps\mypaint-textu
    re\runtime\GTK\include -IC:\KefCode\apps\mypaint-texture\runtime\Python\lib\site
    -packages\numpy\core\include -IC:\KefCode\apps\mypaint-texture\runtime\Python\in
    clude -Ibrushlib lib\mypaintlib_wrap.cpp
    In file included from lib\/mypaintlib.hpp:13:0,
    from lib\mypaintlib_wrap.cpp:2799:
    lib\/fastpng.hpp: In function 'PyObject* save_png_fast_progressive(char*, int, i
    nt, bool, PyObject*, bool)':
    lib\/fastpng.hpp:141:6: warning: suggest explicit braces to avoid ambiguous 'els
    e' [-Wparentheses]
    gcc -z origin -shared -o mypaint-brushlib.dll brushlib\brushmodes.o brushlib\hel
    pers.o brushlib\mapping.o brushlib\mypaint-brush-settings.o brushlib\mypaint-bru
    sh.o brushlib\mypaint-surface.o brushlib\mypaint-tiled-surface.o brushlib\mypain
    t.o -LC:\KefCode\apps\mypaint-texture\runtime\GTK\lib -lglib-2.0 -lintl -Wl,--ou
    t-implib,libmypaint-brushlib.a
    c:/kefcode/apps/mypaint-texture/compiler/mingw/bin/../lib/gcc/i686-pc-mingw32/4.
    6.2/../../../../i686-pc-mingw32/bin/ld.exe: unrecognized option '-z'
    c:/kefcode/apps/mypaint-texture/compiler/mingw/bin/../lib/gcc/i686-pc-mingw32/4.
    6.2/../../../../i686-pc-mingw32/bin/ld.exe: use the --help option for usage info
    rmation
    collect2: ld returned 1 exit status
    scons: *** [mypaint-brushlib.dll] Error 1
    scons: building terminated because of errors.
    scons failed...
    Press any key to continue . . .

    ReplyDelete
  60. because -z is indeed not a valid ld's option...
    I suggest to report this Sconstruct issue to mypaint's bugtracker

    OTOH you may want to try remove line 47 of Sconstruct:
    ...
    env.Append(LINKFLAGS = Split('-z origin'))
    ...

    about the libintl.h, based on your log, this flag: "-IC:\KefCode\apps\mypaint-textu
    re\runtime\GTK\include" should find it, dunno why it failed, maybe you can post full log to pastebin.com

    ReplyDelete
  61. Well, if you look at the first log I'd posted earlier, where I had the libintl.h problem in the first place, it didn't have the -IC:\KefCode\apps\mypaint-textu
    re\runtime\GTK\include flag. It included some other directories, but not that one. That's still the case with this newer copy. Looking at the second log, it isn't always there either. There are two calls to gcc that don't have it, before a call to g++ that does.

    After copying the libintl.h file (but before applying the fix for the -z issue), the log from stdout looks like this:

    scons: Building targets ...
    gcc -o brushlib\brushmodes.o -c -Wall -mms-bitfields -Ibrushlib -IC:\KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture\runtime\GTK\lib\glib-2.0\include brushlib\brushmodes.c
    gcc -o brushlib\helpers.o -c -Wall -mms-bitfields -Ibrushlib -IC:\KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture\runtime\GTK\lib\glib-2.0\include brushlib\helpers.c
    gcc -o brushlib\mapping.o -c -Wall -mms-bitfields -Ibrushlib -IC:\KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture\runtime\GTK\lib\glib-2.0\include brushlib\mapping.c
    gcc -o brushlib\mypaint-brush-settings.o -c -Wall -mms-bitfields -Ibrushlib -IC:\KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture\runtime\GTK\lib\glib-2.0\include brushlib\mypaint-brush-settings.c
    gcc -o brushlib\mypaint-brush.o -c -Wall -mms-bitfields -Ibrushlib -IC:\KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture\runtime\GTK\lib\glib-2.0\include brushlib\mypaint-brush.c
    gcc -o brushlib\mypaint-surface.o -c -Wall -mms-bitfields -Ibrushlib -IC:\KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture\runtime\GTK\lib\glib-2.0\include brushlib\mypaint-surface.c
    gcc -o brushlib\mypaint-tiled-surface.o -c -Wall -mms-bitfields -Ibrushlib -IC:\KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture\runtime\GTK\lib\glib-2.0\include brushlib\mypaint-tiled-surface.c
    gcc -o brushlib\mypaint.o -c -Wall -mms-bitfields -Ibrushlib -IC:\KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture\runtime\GTK\lib\glib-2.0\include brushlib\mypaint.c
    g++ -o lib\mypaintlib_wrap.o -c -Wall -Wno-sign-compare -Wno-write-strings -Wall -mms-bitfields -IC:\KefCode\apps\mypaint-texture\runtime\GTK\include\glib-2.0 -IC:\KefCode\apps\mypaint-texture\runtime\GTK\lib\glib-2.0\include -IC:\KefCode\apps\mypaint-texture\runtime\GTK\include\libpng15 -IC:\KefCode\apps\mypaint-texture\runtime\GTK\include -IC:\KefCode\apps\mypaint-texture\runtime\Python\lib\site-packages\numpy\core\include -IC:\KefCode\apps\mypaint-texture\runtime\Python\include -Ibrushlib lib\mypaintlib_wrap.cpp
    gcc -z origin -shared -o mypaint-brushlib.dll brushlib\brushmodes.o brushlib\helpers.o brushlib\mapping.o brushlib\mypaint-brush-settings.o brushlib\mypaint-brush.o brushlib\mypaint-surface.o brushlib\mypaint-tiled-surface.o brushlib\mypaint.o -LC:\KefCode\apps\mypaint-texture\runtime\GTK\lib -lglib-2.0 -lintl -Wl,--out-implib,libmypaint-brushlib.a

    So, as you see, only the g++ call contains that directory.


    After this, I commented out the env.Append(LINKFLAGS = Split('-z origin')) line as you suggested. Unfortunately, the build still fails. The batch file expects the _mypaintlib.pyd file to be in a folder called "lib", but it was created in the "src" folder. The culprit appears to be this line:

    Creating library file: libmypaint-brushlib.a
    g++ -shared -o _mypaintlib.pyd lib\mypaintlib_wrap.o -LC:\KefCode\apps\mypaint-t
    exture\runtime\GTK\lib -LC:\KefCode\apps\mypaint-texture\runtime\Python\libs -L.
    -lglib-2.0 -lintl -lpng15 -lz -llcms2 -lpython26 -lmypaint-brushlib -Wl,--out-i
    mplib,lib_mypaintlib.a

    ReplyDelete
  62. Correct, the culprit is in glib-2.0.pc, I'll add the proper includes (add -I${includedir} in cflags) and commenting _mypaintlib.pyd check in the bat file as this is bad idea anyway.

    sorry that I can't test this myself yet and upload with takes some time too...

    regards

    ReplyDelete
  63. hi,

    geting compile errors:
    c:/users/blueeagle/downloads/mypaint_buildenv3/compiler/mingw64/bin/../lib/gcc/x
    86_64-w64-mingw32/4.6.2/../../../../x86_64-w64-mingw32/bin/ld.exe: unrecognized
    option '-z'
    c:/users/blueeagle/downloads/mypaint_buildenv3/compiler/mingw64/bin/../lib/gcc/x
    86_64-w64-mingw32/4.6.2/../../../../x86_64-w64-mingw32/bin/ld.exe: use the --hel
    p option for usage information
    collect2: ld returned 1 exit status
    scons: *** [mypaint-brushlib.dll] Error 1
    scons: building terminated because of errors.
    py2exe failed...

    Tried your latest build-env. :(

    ReplyDelete
  64. @Anon

    I believe that error is mypaint's sconstruct bug. AFAIK there is no such of "-z" option for ld nor linker flags.

    read my previous comment to skip the error.

    ReplyDelete
  65. @TumaGonx

    Thanks..that works for scons b ut now I'm getting following error:

    ...
    msgfmt po\ru.po -o po\ru\LC_MESSAGES\mypaint.mo
    msgfmt po\sl.po -o po\sl\LC_MESSAGES\mypaint.mo
    msgfmt po\sv.po -o po\sv\LC_MESSAGES\mypaint.mo
    msgfmt po\uk.po -o po\uk\LC_MESSAGES\mypaint.mo
    msgfmt po\zh_CN.po -o po\zh_CN\LC_MESSAGES\mypaint.mo
    msgfmt po\zh_TW.po -o po\zh_TW\LC_MESSAGES\mypaint.mo
    scons: done building targets.
    py2exe failed...

    Any help?

    ReplyDelete
  66. ok :)

    ...next py2exe error. But a win64 folder was created!

    *** binary dependencies ***
    Your executable(s) also depend on these dlls which are not included,
    you may or may not need to distribute them.

    Make sure you have the license if you distribute any of them, and
    make sure you don't distribute files belonging to the operating system.

    OLEAUT32.dll - C:\Windows\system32\OLEAUT32.dll
    USER32.dll - C:\Windows\system32\USER32.dll
    IMM32.dll - C:\Windows\system32\IMM32.dll
    SHELL32.dll - C:\Windows\system32\SHELL32.dll
    ole32.dll - C:\Windows\system32\ole32.dll
    comdlg32.dll - C:\Windows\system32\comdlg32.dll
    WSOCK32.dll - C:\Windows\system32\WSOCK32.dll
    COMCTL32.dll - C:\Windows\system32\COMCTL32.dll
    ADVAPI32.dll - C:\Windows\system32\ADVAPI32.dll
    SHLWAPI.dll - C:\Windows\system32\SHLWAPI.dll
    msvcrt.dll - C:\Windows\system32\msvcrt.dll
    WS2_32.dll - C:\Windows\system32\WS2_32.dll
    WINSPOOL.DRV - C:\Windows\system32\WINSPOOL.DRV
    GDI32.dll - C:\Windows\system32\GDI32.dll
    KERNEL32.dll - C:\Windows\system32\KERNEL32.dll
    ntdll.dll - C:\Windows\system32\ntdll.dll
    py2exe failed...

    ReplyDelete
  67. looks like the file location been moving around eh..

    ok. try again

    ReplyDelete
  68. Finally!

    It builds except a little thing! (In the end it says nn_NO not found) :)

    But MyPaint doesn't start. I can click the MyPaint.exe but nothing happens.

    ReplyDelete
  69. hmm.. not good. I'll give it a try but maybe not until this weekend.

    ReplyDelete
  70. Thx. I hope you get it to work! Otherwise I have to switch Linux.^^

    ReplyDelete
  71. Quick update: Latest Git compiles fine without modifing Sconstruct but mypaint doesn't start after clicking the exe-file. :(

    ReplyDelete
  72. Hey! Tried your newest upload and getting following errors:

    Make sure you have the license if you distribute any of them, and
    make sure you don't distribute files belonging to the operating system.

    OLEAUT32.dll - C:\Windows\system32\OLEAUT32.dll
    USER32.dll - C:\Windows\system32\USER32.dll
    IMM32.dll - C:\Windows\system32\IMM32.dll
    SHELL32.dll - C:\Windows\system32\SHELL32.dll
    KERNEL32.dll - C:\Windows\system32\KERNEL32.dll
    comdlg32.dll - C:\Windows\system32\comdlg32.dll
    WSOCK32.dll - C:\Windows\system32\WSOCK32.dll
    COMCTL32.dll - C:\Windows\system32\COMCTL32.dll
    ADVAPI32.dll - C:\Windows\system32\ADVAPI32.dll
    SHLWAPI.dll - C:\Windows\system32\SHLWAPI.dll
    msvcrt.dll - C:\Windows\system32\msvcrt.dll
    WS2_32.dll - C:\Windows\system32\WS2_32.dll
    WINSPOOL.DRV - C:\Windows\system32\WINSPOOL.DRV
    GDI32.dll - C:\Windows\system32\GDI32.dll
    ole32.dll - C:\Windows\system32\ole32.dll
    ntdll.dll - C:\Windows\system32\ntdll.dll
    Copying missing files...
    Das System kann den angegebenen Pfad nicht finden.
    (English: System can't find the path)
    Copying language files...

    And mypaint.exe doesn't start.

    Greetings!

    ReplyDelete
  73. Hi, you need this patch http://dl.dropbox.com/u/33728474/patches/brushsettings_path_py2exe.patch
    open with notepad and edit the file mentioned as suggested before building

    I have inform mypaint dev via irc, hope it get merged. however i have tested the new mypaint and really slower/unresponsive now, so i think there is some issues (if this problem only occurred under windows)

    ReplyDelete
  74. Thx!

    Sounds good...but I'm a really noob! Can you explain it a little more detailed,PLEASE! :)

    ReplyDelete
  75. assuming you have mypaint source in src folder of build_env
    open src\brushlib\brushsettings.py with notepad

    then paste these lines:
    if not os.path.isfile(definition_path):
    import sys
    #On windows, py2exe only allow py files bundled (library.zip) hence above path pointing inside the zip file
    #which brushsettings.json can't be there, in that case use sys.executable to guess the relative path
    if sys.platform == 'win32':
    definition_path = os.path.join (os.path.split(sys.executable)[0],"brushlib","brushsettings.json")


    right after the line of :
    definition_path = os.path.join(dir_of_this_file, "brushsettings.json")

    save it, and rebuild

    ReplyDelete
  76. Oops the blog comment ruin the indentation :(

    ignore above, open
    http://dl.dropbox.com/u/33728474/patches/brushsettings_path_py2exe.patch with notepad

    open src\brushlib\brushsettings.py with notepad
    copy lines that have + in the front of (brushsettings_path_py2exe.patch)
    then paste into brushsettings.py after the line of:
    definition_path = os.path.join(dir_of_this_file, "brushsettings.json")

    save brushsettings.py and rebuild

    ReplyDelete
  77. Hey...thanks for your effort.! But it doesn't work and I'm not experienced enough to play with the .py files. :)

    Will install a Ubuntu as a second sys on my laptop now...

    Maybe we should wait until that refactoring stuff is finished.^^

    ReplyDelete
  78. Forgot to mention, after pasting those "+" sign in the front must be removed (dont accidentally remove any blank space)

    yes i think we 'd better wait ;)

    ReplyDelete
  79. It's been a few weekss i didn't do a new build to see if there are improvement on how MyPaint manages symmetry, so i downloaded the latest build environment, downloaded the latest mypaint master on the gitorious website, and after extracting in the src folder, launched one of the bat, to get a win32 folder.

    And the mypaint.exe does nothing when trying to launch it, looks like the problem i see mentionned in the comments from the end of may is not corrected in the source code.
    Oh well, i'll continue to use my old build from the 17 may, even if the usefull symmetry is not yet in a nice state as at least it works. I just hope that refactor thing you mention will be working soon.

    ReplyDelete
    Replies
    1. I just take a peek on the latest git, I think at the moment MyPaint is undergone even bigger changes. It use GObject Introspection (PyGI/gir thats not even supported)and others on Windows...

      The build_env shouldn't even work, I think in your case mypaint doesn't cleaned up properly.

      Delete
  80. Now the big "color" change is in the MyPaint-Git can you please give your build-env. an another try please? :D Or can you managa to upload an actual build for windows?

    ReplyDelete
    Replies
    1. Thanks for the head up, I place it here man: http://osspack32.googlecode.com/files/MyPaint_140712git.7z

      it need a little patches to build but I don't have time ATM to update the build_env.

      Delete
    2. Thank you so much! XD

      Delete
  81. How is mypaint_build_env application and my paint for windows coming along?

    You talked about mypaint wasn't very responsive under windows lately.

    ReplyDelete
    Replies
    1. Yes.Please give us a new build_env.!!! That would be great. :)

      Delete
    2. I've been trying to build it on windows, couldn't do it with cygwin, will try with mingw

      Delete
    3. Mypaint build_env is a collection of software required to build MyPaint for Windows (oficial and non-oficials) but currently broken/need update.

      the responsiveness issue is reported here http://gna.org/bugs/?19948 I think there will be a workaround for that.

      Delete
  82. hi,

    can you please provide us with a new windows build? :D

    ReplyDelete
  83. Dude, you have to come to the rescue. No one else wants to build a windows version of this thing. I've tried countless times with little success. I think they are freezing the string now so no new changes are going to happen anytime soon. Now would be a great time, (if you have the time) to attempt another windows auto build. I would love to use mypaint without having to install ubuntu again.

    ReplyDelete
    Replies
    1. here you go man, today build:
      http://osspack32.googlecode.com/files/MyPaint_011212git.7z

      if you use tablet, it will be ultra slow, use mice instead (no pressure)

      good luck and report bugs :)

      Delete
  84. Oh man, THANK YOU! I will report to help more windows users.

    ReplyDelete
  85. so far-no good:
    C:\Mypaint>scons
    scons: Reading SConscript files ...
    building for 'python' (use scons python_binary=xxx to ch
    using 'python-config' (use scons python_config=xxx to ch
    python generate.py
    Checked mypaint-brush-settings-gen.h
    Checked brushsettings-gen.h
    OSError: 'pkg-config --cflags --libs json' exited 1:
    File "C:\Mypaint\SConstruct", line 169:
    brushlib = SConscript('./brushlib/SConscript')
    File "C:\Python26\Lib\site-packages\scons-2.2.0\SCons\
    ine 614:
    return method(*args, **kw)
    File "C:\Python26\Lib\site-packages\scons-2.2.0\SCons\
    ine 551:
    return _SConscript(self.fs, *files, **subst_kw)
    File "C:\Python26\Lib\site-packages\scons-2.2.0\SCons\
    ine 260:
    exec _file_ in call_stack[-1].globals
    File "C:\Mypaint\brushlib\SConscript", line 105:
    env.ParseConfig('pkg-config --cflags --libs %s' % '
    File "C:\Python26\Lib\site-packages\scons-2.2.0\SCons\
    54:
    return function(self, self.backtick(command))
    File "C:\Python26\Lib\site-packages\scons-2.2.0\SCons\
    6:
    raise OSError("'%s' exited %d" % (command, status))

    ???

    ReplyDelete
  86. you are doing the lord's work! I am rooting for you. I cannot wait to open mypaint in windows and play with those new features. I belive in you man!

    ReplyDelete
  87. I want to follow the easy way. When I click the link, it says:
    "This account's public links are generating too much traffic and have been temporarily disabled!" =(

    ReplyDelete