Merge pull request #27734 from jfrankenau/add-desktop-entries

Add desktop entry files for FreeCAD and ddccontrol
This commit is contained in:
Michael Raskin 2018-02-06 21:21:04 +00:00 committed by GitHub
commit 1137ba5a73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 53 additions and 2 deletions

View File

@ -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 = https://www.freecadweb.org/;

View File

@ -1,9 +1,10 @@
{ stdenv, fetchurl, autoreconfHook, intltool, perl, perlPackages, libxml2
, pciutils, pkgconfig, gtk2, ddccontrol-db
, makeDesktopItem
}:
let version = "0.4.2"; in
stdenv.mkDerivation {
stdenv.mkDerivation rec {
name = "ddccontrol-${version}";
src = fetchurl {
@ -32,6 +33,24 @@ stdenv.mkDerivation {
sed -e "s/chmod 4711/chmod 0711/" -i src/ddcpci/Makefile*
'';
postInstall = ''
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 = "gddccontrol";
desktopName = "gddccontrol";
genericName = "DDC/CI control";
comment = meta.description;
exec = "@out@/bin/gddccontrol";
icon = "gddccontrol";
categories = "Settings;HardwareSettings;";
};
meta = with stdenv.lib; {
description = "A program used to control monitor parameters by software";
homepage = http://ddccontrol.sourceforge.net/;