mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-08 06:28:50 +03:00
freecad: Add desktop entry file and mime xml
This commit is contained in:
parent
00512470ec
commit
776de2556b
@ -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
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
|
||||
<mime-type type="application/x-extension-fcstd">
|
||||
<sub-class-of type="application/zip"/>
|
||||
<comment>FreeCAD Document</comment>
|
||||
<glob pattern="*.fcstd"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
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/;
|
||||
|
Loading…
Reference in New Issue
Block a user