Packaging CuraEngine 5.4.0

Hello everyone!

I’m trying to update the curaengine package: right now I see version 4.13 on nixpkgs and I’d like to build v5.4 The problem is that since the major bump CuraEngine is using conan as build tool and I have no idea how to handle that.

I’ve tried to simply run conan as stated in their docs, but I’ve got some errors and I also suspect it would be a better idea to use nix dependencies.

So I’m trying to work around conan with the following (inglorious) attempt:

{ stdenv
, callPackage
, fetchFromGitHub
, cmake
, zlib
, clipper
, boost
, rapidjson
, stb
, spdlog
, range-v3
, fmt
}:

let
  standardprojectsettings = stdenv.mkDerivation {
    name = "standardprojectsettings";

    src = fetchFromGitHub {
      owner = "Ultimaker";
      repo = "conan-ultimaker-index";
      rev = "1a97d7b0aaa19b492065ae0f893e076a49cd1eaa";
      hash = "sha256-99sbG5a8EDeg2Rl1/VRrYVrBnKp2LhXQyzy/DF8IrPY=";
    };

    buildPhase = ''
      mkdir -p $out/lib
      cp -r $src/recipes/standardprojectsettings $out/lib
    '';
  };
in
stdenv.mkDerivation rec {
  pname = "CuraEngine";

  version = "5.4.0";

  src = fetchFromGitHub {
    owner = "Ultimaker";
    repo = "CuraEngine";
    rev = version;
    hash = "sha256-1l3GXBEty/IFrXEhuSa/Due+Vn5OINstsqOI8T9Dnw0=";
  };

  libArcus = fetchFromGitHub {
    owner = "Ultimaker";
    repo = "libArcus";
    rev = "5.3.0";
    hash = "sha256-MZevvZFGBKwHeeCj1TjgagFGTOIzTMKlIESu8yyV/ow=";
  };

  scripta = fetchFromGitHub {
    owner = "Ultimaker";
    repo = "Scripta_public";
    rev = "c378c837eeb505146ab67abe0904bfed2099128f";
    hash = "sha256-KZOxm2VlmOjrNjgHtlphSPvKUbQCjg+OvyvFO7DVmP4=";
  };

  nativeBuildInputs = [ cmake ];

  buildInputs = [
    libArcus
    zlib
    clipper
    boost
    rapidjson
    stb
    spdlog
    range-v3
    scripta
    standardprojectsettings
    fmt
  ];
}

and now the build fails when it tries to find the standardprojectsettings package, because it’s pretty obvious that I have no idea of what I’m doing with both nix and cmake.

So my questions are:

  • is my assumption right and I should avoid mixing conan with nix build or should I try to build the package following the documentation?
  • where can I find some help to understand better cmake and nix tools? do you have some articles/guides/docs or maybe a similar package I could study to understand better the context?

any help will be much appreciated :heart:

Here are some links that may help you:

It looks like @nh2 got curaengine building at 5.2.1. Maybe you can join forces and get cura across the line? Or clean up and merge the dependency upgrades so that work isn’t lost.

1 Like

It does help a lot! I don’t know why I’ve just started trying things without looking for open issues/PRs, thank you for the heads-up. I’ll try to look into building cura as well.

i tried the appimage workaround but cura hangs at “loading UI”. is there any chance for a native cura version 5.4 in nixpkgs?

1 Like

I still only found the draft: Cura 5.2.1 by nh2 · Pull Request #208124 · NixOS/nixpkgs · GitHub