1{ stdenv
2, autoPatchelfHook
3, curl
4, dpkg
5, fetchurl
6, gcc
7, lib
8, libGLU
9, libcork
10, makeDesktopItem
11, qt5
12, quazip
13, zlib
14}:
15stdenv.mkDerivation rec {
16 pname = "ideamaker";
17 version = "4.0.1";
18
19 src = fetchurl {
20 # N.B. Unfortunately ideamaker adds a number after the patch number in
21 # their release scheme which is not referenced anywhere other than in
22 # the download URL. Because of this, I have chosen to not use ${version}
23 # and just handwrite the correct values in the following URL, hopefully
24 # avoiding surprises for the next person that comes to update this
25 # package.
26 url = "https://download.raise3d.com/ideamaker/release/4.0.1/ideaMaker_4.0.1.4802-ubuntu_amd64.deb";
27 sha256 = "0a1jcakdglcr4kz0kyq692dbjk6aq2yqcp3i6gzni91k791h49hp";
28 };
29
30 nativeBuildInputs = [ autoPatchelfHook dpkg qt5.wrapQtAppsHook ];
31 buildInputs = [
32 curl
33 gcc.cc.lib
34 libGLU
35 libcork
36 qt5.qtbase
37 qt5.qtserialport
38 quazip
39 zlib
40 ];
41
42 unpackPhase = ''
43 runHook preUnpack
44 dpkg-deb -x $src .
45 runHook postUnpack
46 '';
47
48 installPhase = ''
49 runHook preInstall
50
51 mkdir -p $out/{bin,share/pixmaps}
52
53 cp usr/lib/x86_64-linux-gnu/ideamaker/ideamaker $out/bin
54 ln -s "${desktopItem}/share/applications" $out/share/
55 cp usr/share/ideamaker/icons/ideamaker-icon.png $out/share/pixmaps/${pname}.png
56
57 runHook postInstall
58 '';
59
60 desktopItem = makeDesktopItem {
61 name = pname;
62 exec = pname;
63 icon = pname;
64 desktopName = "Ideamaker";
65 genericName = meta.description;
66 categories = "Utility;Viewer;Engineering;";
67 mimeType = "application/sla";
68 };
69
70 meta = with lib; {
71 homepage = "https://www.raise3d.com/ideamaker/";
72 description = "Raise3D's 3D slicer software";
73 license = licenses.unfree;
74 platforms = [ "x86_64-linux" ];
75 maintainers = with maintainers; [ lovesegfault ];
76 broken = true; # Segfaults on startup.
77 };
78}