1{
2 lib,
3 buildPythonPackage,
4 python,
5 fetchFromGitHub,
6 fetchpatch,
7 cmake,
8 sip4,
9 protobuf,
10}:
11
12buildPythonPackage rec {
13 pname = "libarcus";
14 version = "4.12.0";
15 format = "other";
16
17 src = fetchFromGitHub {
18 owner = "Ultimaker";
19 repo = "libArcus";
20 rev = version;
21 hash = "sha256-X33ptwYj9YkVWqUDPP+Ic+hoIb+rwsLdQXvHLA9z+3w=";
22 };
23
24 patches = [
25 # Fix build against protobuf 3.18+
26 # https://github.com/Ultimaker/libArcus/issues/121
27 (fetchpatch {
28 url = "https://raw.githubusercontent.com/coryan/vcpkg/f69b85aa403b04e7d442c90db3418d484e44024f/ports/arcus/0001-fix-protobuf-deprecated.patch";
29 sha256 = "0bqj7pxzpwsamknd6gadj419x6mwx8wnlfzg4zqn6cax3cmasjb2";
30 })
31 ];
32
33 propagatedBuildInputs = [ sip4 ];
34 nativeBuildInputs = [ cmake ];
35 buildInputs = [ protobuf ];
36
37 postPatch = ''
38 sed -i 's#''${Python3_SITEARCH}#${placeholder "out"}/${python.sitePackages}#' cmake/SIPMacros.cmake
39 '';
40
41 meta = with lib; {
42 broken = true;
43 description = "Communication library between internal components for Ultimaker software";
44 homepage = "https://github.com/Ultimaker/libArcus";
45 license = licenses.lgpl3Plus;
46 platforms = platforms.linux;
47 maintainers = [ ];
48 };
49}