summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/libsavitar/default.nix
blob: 67119886202825d2b6f61361a0786e1399985815 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
  lib,
  buildPythonPackage,
  python,
  pythonOlder,
  fetchFromGitHub,
  cmake,
  sip4,
  distutils,
}:

buildPythonPackage rec {
  pname = "libsavitar";
  version = "4.12.0";
  pyproject = false;

  src = fetchFromGitHub {
    owner = "Ultimaker";
    repo = "libSavitar";
    rev = version;
    hash = "sha256-MAA1WtGED6lvU6N4BE6wwY1aYaFrCq/gkmQFz3VWqNA=";
  };

  postPatch = ''
    sed -i 's#''${Python3_SITEARCH}#${placeholder "out"}/${python.sitePackages}#' cmake/SIPMacros.cmake

    substituteInPlace pugixml/CMakeLists.txt \
      --replace-fail "cmake_minimum_required(VERSION 2.6)" "cmake_minimum_required(VERSION 3.10)"
  '';

  nativeBuildInputs = [
    cmake
    sip4
  ];

  propagatedBuildInputs = [
    sip4
    distutils
  ];

  strictDeps = true;

  meta = {
    description = "C++ implementation of 3mf loading with SIP python bindings";
    homepage = "https://github.com/Ultimaker/libSavitar";
    license = lib.licenses.lgpl3Plus;
    platforms = lib.platforms.unix;
    maintainers = [ ];
  };
}