Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

108 lines
2.4 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
godot3-headless,
godot3-export-templates,
libglvnd,
libX11,
libXcursor,
libXext,
libXfixes,
libXi,
libXinerama,
libXrandr,
libXrender,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "material-maker";
version = "1.3";
src = fetchFromGitHub {
owner = "RodZill4";
repo = "material-maker";
rev = finalAttrs.version;
hash = "sha256-vyagu7xL4ITt+xyoYyCcF8qq6L9sR6Ltdl6NwfrbZdA=";
};
nativeBuildInputs = [ godot3-headless ];
buildInputs = [
libglvnd
libXinerama
libXcursor
libXext
libXrandr
libXrender
libX11
libXi
libXfixes
];
buildPhase = ''
runHook preBuild
export HOME=$TMPDIR
# Link the export-templates to the expected location. The --export commands
# expects the template-file at .../templates/{godot-version}.stable/linux_x11_64_release
mkdir -p $HOME/.local/share/godot
ln -s ${godot3-export-templates}/share/godot/templates $HOME/.local/share/godot
# Don't use the included export template, which might use a mismatched version of godot.
rm ./material_maker/misc/linux/godot.x11.opt.64
substituteInPlace ./export_presets.cfg \
--replace-fail '"material_maker/misc/linux/godot.x11.opt.64"' '""'
mkdir -vp build
godot3-headless -v --export 'Linux/X11' build/material-maker
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -vp $out/share/material-maker
cp -vr \
./build/* \
./addons/material_maker/nodes \
./material_maker/environments \
./material_maker/examples \
./material_maker/library \
./material_maker/meshes \
./material_maker/misc/export \
$out/share/material-maker
mkdir -vp $out/bin
ln -vs $out/share/material-maker/material-maker $out/bin/material-maker
runHook postInstall
'';
fixupPhase = ''
runHook preFixup
patchelf \
--set-interpreter '${stdenv.cc.bintools.dynamicLinker}' \
--set-rpath ${lib.makeLibraryPath finalAttrs.buildInputs} \
$out/share/material-maker/material-maker
runHook postFixup
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Procedural materials authoring tool";
mainProgram = "material-maker";
homepage = "https://www.materialmaker.org";
license = lib.licenses.mit;
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ lelgenio ];
};
})