diff --git a/pkgs/applications/graphics/freecad/default.nix b/pkgs/applications/graphics/freecad/default.nix index c58d9e0bda13..94953e8f094f 100644 --- a/pkgs/applications/graphics/freecad/default.nix +++ b/pkgs/applications/graphics/freecad/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, cmake, coin3d, xercesc, ode, eigen, qt4, opencascade, gts -, boost, zlib, python27Packages, swig, gfortran, soqt, libf2c, makeWrapper }: +, boost, zlib, python27Packages, swig, gfortran, soqt, libf2c, makeWrapper, makeDesktopItem }: let pythonPackages = python27Packages; @@ -32,8 +32,40 @@ in stdenv.mkDerivation rec { postInstall = '' wrapProgram $out/bin/FreeCAD --prefix PYTHONPATH : $PYTHONPATH \ --set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1 + + mkdir -p $out/share/mime/packages + cat << EOF > $out/share/mime/packages/freecad.xml + + + + + FreeCAD Document + + + + EOF + + mkdir -p $out/share/applications + cp $desktopItem/share/applications/* $out/share/applications/ + for entry in $out/share/applications/*.desktop; do + substituteAllInPlace $entry + done ''; + desktopItem = makeDesktopItem { + name = "freecad"; + desktopName = "FreeCAD"; + genericName = "CAD Application"; + comment = meta.description; + exec = "@out@/bin/FreeCAD %F"; + categories = "Science;Education;Engineering;"; + startupNotify = "true"; + mimeType = "application/x-extension-fcstd;"; + extraEntries = '' + Path=@out@/share/freecad + ''; + }; + meta = with stdenv.lib; { description = "General purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler"; homepage = http://www.freecadweb.org/;