After a lot of VM’s and a lot of patience(or not), I was able to Craft AtCore on Windows.
Craft is the evolution of Emerge, a tool that KDE developed to cross compile KDE applications to Windows and Mac. Since the goal of Atelier project is to reach all those environments, we need to use it.
So far on my knowledge, Craft is mostly written in Python. A lot of scripts to manage KDE frameworks, Qt, and other dependencies.
Since Atelier isn’t ready, for now just AtCore was craft.
The first step was to write a Recipe for AtCore inside Craft. The recipe is the script that will manage the repository and dependencies that the project needs to be built.
AtCore dependencies are Extra CMake Files, QtBase, QtSerialPort and Solid.
Extra CMake Files is a KDE module to add more features to CMake. QtBase and QtSerialPort are the Qt part of the project and Solid is to manage to connect/disconnect of serial devices on the host. So this is the code:
import info from CraftConfig import * class subinfo( info.infoclass ): def setTargets( self ): self.svnTargets[ 'master' ] = '[git]kde:atcore|master' self.defaultTarget = 'master' self.shortDescription = "the KDE core of Atelier Printer Host" def setDependencies( self ): self.buildDependencies["frameworks/extra-cmake-modules"] = "default" self.dependencies["libs/qtbase"] = "default" self.dependencies["libs/qtserialport"] = "default" self.dependencies["frameworks/solid"] = "default" from Package.CMakePackageBase import * class Package( CMakePackageBase ): def __init__( self ): CMakePackageBase.__init__( self )
After that, we need to setup the Windows environment. So I used an Oracle Virtual Box with a Windows 10 iso. I setup like 6 VM’s until I got success. In the beginning, I had an issue related to some libs missing, but that was my mistake, but since I thought that I screwed up things, I did a new VM. But then I started to have some Python issues, that neither me or Hannah(The maintainer of Craft) could discover why. But for some reason after a new VM configured I was able to install Craft. And after that my dummiest mistake. On Craft manual says: “In order to compile the Qt5 qtbase package with MinGW you will also need to install the Microsoft DirectX SDK, make sure to open a new command line window after the installation.” However, for some reason, I just saw that I need it to install DirectX, forgot totally about the SDK part. When I finally was able to read the output of the error, I saw what I was missing. And then, I left my laptop(4G, I5, 2 cores for the VM) burning for like 3 hours to compile everything.
Those are the steps that I did to be able to Craft AtCore, if you want to test it, please follow the instructions:
- Install DirectX SDK;
- Install Git;
- Install Python(Make sure to add Python to your PATH);
- If you don’t want to install Python, Craft can do it for you;
- Open a PowerShell instance like Administrator;
- Run this command:
- Close the PowerShell instance and open again as a normal user;
- Run this command:
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/KDE/craft/master/setup/install_craft.ps1'))
- The above command will fetch craft and do the initial setup of the tool.
- Follow the instructions that appear to you on the PowerShell
- After the setup is finished run:
- craft runtime
- It will install the base libs that you will need to your project.
- craft atcore
- It will compile all the dependencies of AtCore project. That will take a while based on your hardware configuration.
- craft atcore run install
- This will install AtCore
- craft runtime
After that you should be setup. So on R:/bin you should find the AtCoreTest.exe to run.
I only was able to run the bin with Craft environment active. If you shutdown your PC, when it goes on you need to open the PowerShell again and run:
I was able to make my Arduino Mega a shared device in the VBox and it appeared on AtCore, however we discovered a problem with the path used to install the plugins of the Firmwares, and they weren’t found by AtCoreTest, so I wasn’t able to load a plugin, but I can send unitary commands to the Arduino and worked fine. The Atelier team already discover what was causing the problem, so it will be fixed soon.
Note: If you want to test it, it’s on you. =D
Please join our channel on freenode IRC #kde-atelier or our group at Telegram and give us feedback!