nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 python3,
6 qtbase,
7 git-lfs,
8 wrapQtAppsHook,
9}:
10
11let
12 pydeps = with python3.pkgs; [
13 numpy
14 pyqt5
15 pyopengl
16 ];
17 python = python3.withPackages (pkgs: pydeps);
18in
19stdenv.mkDerivation rec {
20 pname = "makehuman";
21 version = "1.3.0";
22
23 source = fetchFromGitHub {
24 owner = "makehumancommunity";
25 repo = "makehuman";
26 rev = "v${version}";
27 hash = "sha256-x0v/SkwtOl1lkVi2TRuIgx2Xgz4JcWD3He7NhU44Js4=";
28 name = "${pname}-source";
29 };
30
31 assets = fetchFromGitHub {
32 owner = "makehumancommunity";
33 repo = "makehuman-assets";
34 rev = "v${version}";
35 hash = "sha256-Jd2A0PAHVdFMnDLq4Mu5wsK/E6A4QpKjUyv66ix1Gbo=";
36 name = "${pname}-assets-source";
37 };
38
39 srcs = [
40 source
41 assets
42 ];
43
44 sourceRoot = ".";
45
46 nativeBuildInputs = [
47 python
48 qtbase
49 git-lfs
50 wrapQtAppsHook
51 ];
52
53 buildInputs = [
54 python
55 qtbase
56 ];
57
58 propagatedBuildInputs = with python3.pkgs; [
59 pydeps
60 ];
61
62 finalSource = "${pname}-final";
63
64 postUnpack = ''
65 mkdir -p $finalSource
66 cp -r $source/makehuman $finalSource
67 chmod u+w $finalSource --recursive
68 cp -r $assets/base/* $finalSource/makehuman/data
69 chmod u+w $finalSource --recursive
70 sourceRoot=$finalSource
71 '';
72
73 configurePhase = ''
74 runHook preConfigure
75 pushd ./makehuman
76 bash ./cleannpz.sh
77 bash ./cleanpyc.sh
78 python3 ./compile_targets.py
79 python3 ./compile_models.py
80 python3 ./compile_proxies.py
81 popd
82 runHook postConfigure
83 '';
84
85 buildPhase = ''
86 runHook preBuild
87 mkdir -p $out/opt $out/bin
88 cp -r * $out/opt
89 python -m compileall -o 0 -o 2 $out/opt
90 ln -s $out/opt/makehuman/makehuman.py $out/bin/makehuman
91 chmod +x $out/bin/makehuman
92 runHook postBuild
93 '';
94
95 preFixup = ''
96 wrapQtApp $out/bin/makehuman
97 '';
98
99 meta = {
100 description = "Software to create realistic humans";
101 homepage = "http://www.makehumancommunity.org/";
102 license = with lib.licenses; [
103 agpl3Plus
104 cc0
105 ];
106 longDescription = ''
107 MakeHuman is a GUI program for procedurally generating
108 realistic-looking humans.
109 '';
110 mainProgram = "makehuman";
111 maintainers = with lib.maintainers; [ elisesouche ];
112 platforms = lib.platforms.all;
113 };
114}