2015-08-26 08:20:06 +00:00
|
|
|
{ stdenv, fetchurl, qt4, libpng, lib3ds, freeglut, libXi, libqglviewer
|
2010-07-30 14:47:23 +00:00
|
|
|
, swig, python }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2008-06-08 03:56:32 +00:00
|
|
|
name = "freestyle-2.2.0";
|
|
|
|
|
2010-07-30 14:47:23 +00:00
|
|
|
src = fetchurl {
|
2008-06-08 03:56:32 +00:00
|
|
|
url = mirror://sourceforge/freestyle/freestyle.2.2.0-src.tar.bz2;
|
|
|
|
sha256 = "1h4880fijmfy0x6dbl9hfri071rpj3lnwfzkxi1qyqhy7zyxy7ga";
|
|
|
|
};
|
|
|
|
|
2015-08-26 08:20:06 +00:00
|
|
|
buildInputs = [ qt4 libpng lib3ds freeglut libXi libqglviewer swig ];
|
2010-07-30 14:47:23 +00:00
|
|
|
|
2015-08-26 08:20:06 +00:00
|
|
|
inherit python freeglut libqglviewer lib3ds; # if you want to use another adopt patch and Config.pri
|
2008-06-08 03:56:32 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
export PYTHON_VERSION=2.5
|
|
|
|
cd src/system && qmake -makefile PREFIX=\$out && cd ..
|
|
|
|
cd rendering && qmake -makefile PREFIX=\$out && cd ..
|
|
|
|
qmake -makefile PREFIX=\$out && make
|
|
|
|
cd swig && make -f Makefile
|
|
|
|
cd ../..
|
|
|
|
|
|
|
|
hide=$out/nix-support/hide
|
|
|
|
moddir=$out/share/freestyle
|
|
|
|
mkdir -p $out/bin $moddir $hide
|
|
|
|
cp -r style_modules $moddir
|
|
|
|
cp build/lib/*.so* $hide
|
|
|
|
cp build/Freestyle $hide
|
|
|
|
cp -r build/linux-g++/debug/lib/python $hide/pylib
|
|
|
|
cat > $out/bin/Freestyle << EOF
|
|
|
|
#!/bin/sh
|
|
|
|
echo use export PYTHONPATH to add your py files to the search path
|
|
|
|
echo the style modules can be loded from directory $moddir
|
|
|
|
echo starting Freestyle know - have fun
|
|
|
|
echo -e "\n\n\n\n"
|
|
|
|
export PYTHONPATH=$PYTHONPATH:$moddir/style_modules:$hide/pylib
|
|
|
|
LD_LIBRARY_PATH=$hide
|
|
|
|
$hide/Freestyle
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/Freestyle
|
2010-07-30 14:47:23 +00:00
|
|
|
'';
|
2008-06-08 03:56:32 +00:00
|
|
|
|
|
|
|
patches = ./patch;
|
|
|
|
|
|
|
|
installPhase = ":";
|
|
|
|
|
|
|
|
meta = {
|
2010-07-30 14:47:23 +00:00
|
|
|
description = "Non-Photorealistic Line Drawing rendering from 3D scenes";
|
|
|
|
homepage = http://freestyle.sourceforge.net;
|
2014-06-19 04:19:00 +00:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2008-06-08 03:56:32 +00:00
|
|
|
};
|
|
|
|
}
|