nixpkgs/pkgs/applications/graphics/wings/default.nix

46 lines
1.7 KiB
Nix
Raw Normal View History

{ fetchurl, stdenv, erlang, cl, libGL, libGLU, runtimeShell }:
stdenv.mkDerivation rec {
name = "wings-2.2.4";
src = fetchurl {
url = "mirror://sourceforge/wings/${name}.tar.bz2";
sha256 = "1xcmifs4vq2810pqqvsjsm8z3lz24ys4c05xkh82nyppip2s89a3";
};
2018-12-30 14:25:05 +00:00
ERL_LIBS = "${cl}/lib/erlang/lib";
patchPhase = ''
2018-12-30 14:25:05 +00:00
sed -i 's,-Werror ,,' e3d/Makefile
sed -i 's,../../wings/,../,' icons/Makefile
find plugins_src -mindepth 2 -type f -name "*.[eh]rl" -exec sed -i 's,wings/src/,../../src/,' {} \;
find plugins_src -mindepth 2 -type f -name "*.[eh]rl" -exec sed -i 's,wings/e3d/,../../e3d/,' {} \;
find plugins_src -mindepth 2 -type f -name "*.[eh]rl" -exec sed -i 's,wings/intl_tools/,../../intl_tools/,' {} \;
find . -type f -name "*.[eh]rl" -exec sed -i 's,wings/src/,../src/,' {} \;
find . -type f -name "*.[eh]rl" -exec sed -i 's,wings/e3d/,../e3d/,' {} \;
find . -type f -name "*.[eh]rl" -exec sed -i 's,wings/intl_tools/,../intl_tools/,' {} \;
'';
2018-12-30 14:25:05 +00:00
buildInputs = [ erlang cl libGL libGLU ];
# I did not test the *cl* part. I added the -pa just by imitation.
installPhase = ''
mkdir -p $out/bin $out/lib/${name}/ebin
cp ebin/* $out/lib/${name}/ebin
2018-12-30 14:47:32 +00:00
cp -R textures shaders plugins $out/lib/$name
cat << EOF > $out/bin/wings
#!${runtimeShell}
2018-12-30 14:25:05 +00:00
${erlang}/bin/erl \
-pa $out/lib/${name}/ebin -run wings_start start_halt "$@"
EOF
chmod +x $out/bin/wings
'';
meta = {
homepage = http://www.wings3d.com/;
description = "Subdivision modeler inspired by Nendo and Mirai from Izware";
2019-05-05 08:34:08 +00:00
license = stdenv.lib.licenses.tcltk;
maintainers = with stdenv.lib.maintainers; [viric];
platforms = with stdenv.lib.platforms; linux;
};
}