Home » Computing » Free and Open Source » Running Krita on a Mac using WineBottler

Running Krita on a Mac using WineBottler

Screen Shot 2014-03-08 at 16.39.13

Calligra Krita, developed by KO Gmbh, has finally made it onto Windows! It’s a dedicated digital painting application best used with an artist tablet, more specialized than Photoshop or GIMP, with a focus on producing digital painting, options for comic layouts and all manner of tools.

Born in the Free Software community and available initially only on Linux, its Windows port is very welcome… but leaves Mac users out in the cold.

I decided to see if I could get Krita for Windows to work on a Mac, since Macports and Homebrew do not seem to carry it in their repos, and the last version on Fink was updated for OS X 10.6.

It was mostly a success, but unfortunately I was unable to get pressure sensing from my Wacom Bamboo CTL470 in the Krita app. I’m not sure if it’s just my device that doesn’t play well with Wine or if it’s a general issue… For the record, it works fine with Krita in Windows in VirtualBox.

The following are instructions on how to get Krita to run on a Mac using WineBottler. If anybody could determine what the final missing piece is, I’d be very appreciative!

Install Wacom and Krita in WineBottler

1) Install Wine Bottler

Go to http://winebottler.kronenberg.org/ and get the latest stable release of Wine Bottler. Open the DMG which will appear as a hard disk on the desktop, and copy the Wine and WineBottler apps to your applications folder.

WineBottler is a Windows emulation layer that allows Windows applications to run either on Mac or Linux environments, without needing a full copy of Windows in a VM.

2) Download Krita for Windows XP

Also, ensure the drivers for your tablet on your own machine (not in Wine) are installed and working.

Wacom (if that’s your brand) drivers are available here: http://us.wacom.com/en/support/drivers

Krita for Windows is available here: http://kritastudio.com/desktop.html

We need the Windows XP version for technical reasons — Wine’s emulation layer identifies itself to installers as XP x32; the Win7/8 installer will refuse to install.

3) Run WineBottler

You are about to create what is called a “wine prefix.” The following paragraphs are for the technically curious. If you just want to proceed with installation, jump to point a).

Simply put, Wine is an application on non-Windows platforms that provides the Windows-like functionality to a Windows application. If you run Wine on its own, it does nothing. You need to run Wine along with some configuration that points to the Windows sub-environment that you want to run. That configuration is known as a prefix.

Each prefix exists in its own right. A prefix includes the barebones Windows system structure, as well as the installed Windows applications you want to run. You could simply say that a Wine prefix is a “Windows environment for Wine”

Each Wine prefix is a separate Windows sub-environment is used. Two Wine prefixes created independently, even if created on the same computer, are not aware of eachother.

WineBottler is an extra add-on to Wine, which create a separate prefix for each application you install, and wraps that prefix in a Mac OS X application. Each OS X application created by WineBottler is a standalone prefix. To get two applications in the same prefix environment then, we need to chain the prefixes: install on ein a new prefix, then create second prefix based on the first.

Thus ends the technical introduction to WineBottler.

a) Install Krita in WineBottler

In WineBottler, go to the advanced tab and enter the details as follows:

Prefix: new prefix

Installer file: select the installer for Krita

Since it is an installer, select the option accordingly.

Version: if you want…

Identifier: whatever you want it to be. Make it as unique as possible, so that if you need to find message in log files for troubleshooting, you’ll be able to home into message from this specific app.

Click Install. You’ll be asked where to save the prefix — save the prefix in your Applications folder. It will run the installer, you may be asked to accept an EULA and so forth.

When asked which EXE to run, choose krita.exe

A Krita.app (or however you called it) has not been created.

4) Configure Krita

If you ran the Krita app/prefix now, you would be presented with a dialog stating that:

Essential application components could not be found.
This might be an installation issue.
Try restarting, running kbuildsycoca4.exe or reinstalling.

So we need to run kbuildsyscoca4.exe before Krita can be launched. But what is that? Where is it?

Open the Applications folder and right-click the Krita.app that you just created, and select “Show package contents.” What is this? In truth, every Mac application is just a folder containing resources. We’re about to delve into one such Mac application.

a) Define a new program launch

From here, all paths start from inside Krita.app

Edit the [Contents: Info.plist] file in TextEdit

Change the following lines:

<key>WineProgramPath</key>
<string>C:/Program Files/Krita (x86)/bin/krita.exe</string>
<key>WineProgramArguments</key>
<string></string>

to this:

<key>WineProgramPath</key>
<string>C:/windows/system32/cmd.exe</string>
<key>WineProgramArguments</key>
<string>/c mykrita</string>

Instead of running Krita directly, it will run the BAT launcher that should normally be run.

b) Move the Krita launcher

Go to [Contents: Resources: wineprefix: drive_c]. You will see that the next folders will have the structure of a normal Windows install. Because it is one! Inside you will find the core essentials for an application to run on Windows.

Continue to [Contents: Resources: wineprefix: drive_c: Program Files: Krita (x86)]

You will find a env.bat file. Move that file to [Contents: Resources: wineprefix: drive_c: windows: system32] and rename it from env.bat to mykrita.bat

(it should now be at [Contents: Resources: wineprefix: drive_c: windows: system32: mykrita.bat])

For the technical persons who are wondering why we’re doing this: Wine.app runs the program arguments to cmd.exe with all quotes and backslashes escaped, so we can’t simply pass BAT path arguments to it with their own arguments in turn. By placing the BAT in system32, we can simply call it as a command for step a).

c) Edit mykrita.bat

Open mykrita.bat in TextEdit

It should look like this

:: Set Calligra variables
::
@echo off
set KDEHOME=%appdata%\krita
set KDESYCOCA=%~dp0sycoca
set XDG_DATA_DIRS=%~dp0share
set KDEDIRS=%~dp0
set KDEDIR=%~dp0
set PATH=%~dp0bin;%~dp0lib;%~dp0lib\kde4;%PATH%
:: Launch application and all additional parameters
%*

Change it to

:: Set Calligra variables
::
set MYKRITA=C:\Program Files\Krita (x86)\
set KDEHOME=%appdata%\krita
set KDESYCOCA=%MYKRITA%sycoca
set XDG_DATA_DIRS=%MYKRITA%share
set KDEDIRS=%MYKRITA%
set KDEDIR=%MYKRITA%
set PATH=%MYKRITA%bin;%MYKRITA%lib;%MYKRITA%lib\kde4;%PATH%
:: Launch application and all additional parameters
kbuildsycoca4

Save it. Now run the Krita.app prefix/application. Instead of running Krita, it will run the kbuildsycoca4 program (because of the last line in mykrita.bat). After a second, Krita.app will quit. This is normal – kbuildsycoca4 has done its job.

c) Edit mykrita.bat again

Finally, change the last line from

kbuildsycoca4

to

start krita

Save and run. We use the “start” command to avoid having two application icons in the dock at once.

Voila Krita!

Missing parts

Krita runs fully in Wine now. The only thing I cannot figure out is how to get it to get the pressure sensitivity working.

I have GIMP installed natively on my Mac and pressure sensitivity works there, so it’s not the device.

Checking the console, I found

08/03/2014 16:19:29.475 [0x0-0xf40f4].com.wine.krita_139423155327084: err:wintab32:LoadTablet LoadTabletInfo(0x2010a) failed

Alas, that error yields very little result thereafter in Googling. So yay for Krita in Wine – but without the tablet support for me.

It may be that my specific tablet (Wacom CTL470) is not supported in Wine, and someone else might have more success. Anybody want to help confirm this?

Posted in Free and Open Source, Linux

6 comments on “Running Krita on a Mac using WineBottler

  • I just recently found krita and really don’t want to have to haul to computers around (though I’m not adverse to it sometimes) and would love to replace my sketchbook pro subscription.

    Found your post while hunting for a winebottle for krita on a Mac – and was wondering if you ever did get this figured out? I have an intuos pro myself – do you know if it’s just the bamboo that’s causing the trouble?

    Thanks for your experimentation on this!

    • Hi – no, I never got round to resolving it in the end. Some forums mention needing Wacom drivers under Linux, but nary a mention of Mac.

      Funnily enough, trying to do a cursory search for a solution leads me to my own answer…

      … maybe I can try doing it on the Mac inside a VM and see what happens…. but that’s far from ideal for an actual production use I’d imagine….!

      That being said, they seem to be making progress with the native Mac port… what’s your experience been with that? https://krita.org/download/krita-desktop/

      • Moderate. While the application seems somewhat stable, there’s some lagging and delay with operations, especially zooming in and out and scrolling.

        You’re right though – they do seem to be making good progress so hopefully it’ll be a good solution soon – thanks!

  • In step 4b at:
    Continue to [Contents: Resources: wineprefix: drive_c: Program Files: Krita (x86)]
    I can’t find the Krita (x86) folder, but it comes up with the folders: Common Files, Internet Explorer, Windows Media Player and Windows NT
    I’ve followed the steps to the t, and I’ve tried several times. Any idea about why it might not be working?

    • Tai Kedzierski

      March 5, 2016 at 13:27

      Reply

      Hi Vari

      Bear in mind that these instructions are now 2 years old and have not been updated since. I’ll give it a go later and see if the new installers have started behaving differently.

      2 scenarios I can imagine:

      1) You have a 64-bit wine environment (is this even possible? not sure…), in which case maybe the application is installed in drive_c : Program Files (x86) ?

      2) The install failed, perhaps silently – you can see you have the regular IE WMP etc folders which indicates that the prefix sems correclty created, but Krita does not seem to have been installed to the prefix.

      What do you get when you try to run Krita.app — do you get the message about kbuildsycoca4.exe or something else?

    • Tai Kedzierski

      March 5, 2016 at 13:34

      Reply

      Also, if you perform step 3a) again, do this first:

      Go to Mac HD : Applications : Utilities and open Console

      During the prefix creation, give the Identifier a very notable string value. When you run the resulting Krita.app you will see lines in the Console window referencing that identifier – helps massively with troubleshooting.

      During prefix creation, you may also want to follow the Console output to see if any failure messages appear there.

Leave a Reply

Your email address will not be published. Required fields are marked *