nixpkgs/pkgs/applications/misc/makehuman/default.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

116 lines
2.2 KiB
Nix

{
stdenv,
lib,
fetchpatch,
fetchFromGitHub,
python3,
qtbase,
git-lfs,
wrapQtAppsHook,
}:
let
pydeps = with python3.pkgs; [
numpy
pyqt5
pyopengl
];
python = python3.withPackages (pkgs: pydeps);
in
stdenv.mkDerivation rec {
pname = "makehuman";
version = "1.3.0";
source = fetchFromGitHub {
owner = "makehumancommunity";
repo = "makehuman";
rev = "v${version}";
hash = "sha256-x0v/SkwtOl1lkVi2TRuIgx2Xgz4JcWD3He7NhU44Js4=";
name = "${pname}-source";
};
assets = fetchFromGitHub {
owner = "makehumancommunity";
repo = "makehuman-assets";
rev = "v${version}";
hash = "sha256-Jd2A0PAHVdFMnDLq4Mu5wsK/E6A4QpKjUyv66ix1Gbo=";
name = "${pname}-assets-source";
};
srcs = [
source
assets
];
sourceRoot = ".";
nativeBuildInputs = [
python
qtbase
git-lfs
wrapQtAppsHook
];
buildInputs = [
python
qtbase
];
propagatedBuildInputs = with python3.pkgs; [
pydeps
];
finalSource = "${pname}-final";
postUnpack = ''
mkdir -p $finalSource
cp -r $source/makehuman $finalSource
chmod u+w $finalSource --recursive
cp -r $assets/base/* $finalSource/makehuman/data
chmod u+w $finalSource --recursive
sourceRoot=$finalSource
'';
configurePhase = ''
runHook preConfigure
pushd ./makehuman
bash ./cleannpz.sh
bash ./cleanpyc.sh
python3 ./compile_targets.py
python3 ./compile_models.py
python3 ./compile_proxies.py
popd
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
mkdir -p $out/opt $out/bin
cp -r * $out/opt
python -m compileall -o 0 -o 2 $out/opt
ln -s $out/opt/makehuman/makehuman.py $out/bin/makehuman
chmod +x $out/bin/makehuman
runHook postBuild
'';
preFixup = ''
wrapQtApp $out/bin/makehuman
'';
meta = {
description = "Software to create realistic humans";
homepage = "http://www.makehumancommunity.org/";
license = with lib.licenses; [
agpl3Plus
cc0
];
longDescription = ''
MakeHuman is a GUI program for procedurally generating
realistic-looking humans.
'';
mainProgram = "makehuman";
maintainers = with lib.maintainers; [ elisesouche ];
platforms = lib.platforms.all;
};
}