Skip to content

Commit

Permalink
material-maker: init at 1.3 (NixOS#315483)
Browse files Browse the repository at this point in the history
  • Loading branch information
FliegendeWurst authored Dec 19, 2024
2 parents b737b28 + a9763f6 commit b05a52c
Showing 1 changed file with 96 additions and 0 deletions.
96 changes: 96 additions & 0 deletions pkgs/by-name/ma/material-maker/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
lib,
stdenv,
fetchFromGitHub,
godot3-headless,
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
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 ];
};
})

0 comments on commit b05a52c

Please sign in to comment.