From 122ef11195655fc578f5df41ff608df3fb8b4004 Mon Sep 17 00:00:00 2001 From: Michael Weber Date: Tue, 11 Aug 2015 11:01:49 +0200 Subject: [PATCH] media-gfx/freecad: install the proper icons and file associations (bug 551872, thanks Fat-Zer). Package-Manager: portage-2.2.20 --- .../freecad/files/freecad.sharedmimeinfo | 8 ++++++ media-gfx/freecad/freecad-0.14.3702-r1.ebuild | 26 +++++++++++++++-- media-gfx/freecad/freecad-0.15.4671.ebuild | 28 ++++++++++++++++--- media-gfx/freecad/freecad-9999.ebuild | 27 +++++++++++++++--- 4 files changed, 78 insertions(+), 11 deletions(-) create mode 100644 media-gfx/freecad/files/freecad.sharedmimeinfo diff --git a/media-gfx/freecad/files/freecad.sharedmimeinfo b/media-gfx/freecad/files/freecad.sharedmimeinfo new file mode 100644 index 000000000000..6d5e93e7d13c --- /dev/null +++ b/media-gfx/freecad/files/freecad.sharedmimeinfo @@ -0,0 +1,8 @@ + + + + + FreeCAD document files + + + diff --git a/media-gfx/freecad/freecad-0.14.3702-r1.ebuild b/media-gfx/freecad/freecad-0.14.3702-r1.ebuild index 30df418e8e48..c1158cb385b6 100644 --- a/media-gfx/freecad/freecad-0.14.3702-r1.ebuild +++ b/media-gfx/freecad/freecad-0.14.3702-r1.ebuild @@ -6,7 +6,7 @@ EAPI=5 PYTHON_COMPAT=( python2_7 ) -inherit cmake-utils eutils fortran-2 multilib python-single-r1 +inherit cmake-utils eutils fortran-2 multilib python-single-r1 fdo-mime DESCRIPTION="QT based Computer Aided Design application" HOMEPAGE="http://www.freecadweb.org/" @@ -123,14 +123,34 @@ src_install() { "${EROOT}"usr/$(get_libdir)/${P}/bin/FreeCADCmd \ "" "${EROOT}"usr/$(get_libdir)/${P}/lib - newicon src/Main/icon.ico ${PN}.ico - make_desktop_entry FreeCAD + make_desktop_entry FreeCAD "FreeCAD" "" "" "MimeType=application/x-extension-fcstd;" dodoc README.Linux ChangeLog.txt + # install mimetype for FreeCAD files + insinto /usr/share/mime/packages + newins "${FILESDIR}"/${PN}.sharedmimeinfo "${PN}.xml" + + # install icons to correct place rather than /usr/share/freecad + pushd "${ED}/usr/share/${P}" + for size in 16 32 48 64; do + newicon -s ${size} freecad-icon-${size}.png freecad.png + done + doicon -s scalable freecad.svg + newicon -s 64 -c mimetypes freecad-doc.png application-x-extension-fcstd.png + popd + # disable compression of QT assistant help files >> "${ED}"usr/share/doc/${P}/freecad.qhc.ecompress.skip >> "${ED}"usr/share/doc/${P}/freecad.qch.ecompress.skip python_optimize "${ED}"usr/{$(get_libdir),share}/${P}/Mod/ } + +pkg_postinst() { + fdo-mime_mime_database_update +} + +pkg_postrm() { + fdo-mime_mime_database_update +} diff --git a/media-gfx/freecad/freecad-0.15.4671.ebuild b/media-gfx/freecad/freecad-0.15.4671.ebuild index 63375fb695b5..a0b49547df4f 100644 --- a/media-gfx/freecad/freecad-0.15.4671.ebuild +++ b/media-gfx/freecad/freecad-0.15.4671.ebuild @@ -6,7 +6,7 @@ EAPI=5 PYTHON_COMPAT=( python2_7 ) -inherit cmake-utils eutils fortran-2 multilib python-single-r1 +inherit cmake-utils eutils fortran-2 multilib python-single-r1 fdo-mime DESCRIPTION="QT based Computer Aided Design application" HOMEPAGE="http://www.freecadweb.org/" @@ -111,10 +111,22 @@ src_install() { "${EROOT}"usr/$(get_libdir)/${P}/bin/FreeCADCmd \ "" "${EROOT}"usr/$(get_libdir)/${P}/lib - newicon src/Main/icon.ico ${PN}.ico - make_desktop_entry FreeCAD + make_desktop_entry FreeCAD "FreeCAD" "" "" "MimeType=application/x-extension-fcstd;" - dodoc README.Linux ChangeLog.txt + dodoc README.linux ChangeLog.txt + + # install mimetype for FreeCAD files + insinto /usr/share/mime/packages + newins "${FILESDIR}"/${PN}.sharedmimeinfo "${PN}.xml" + + # install icons to correct place rather than /usr/share/freecad + pushd "${ED}/usr/share/${P}" + for size in 16 32 48 64; do + newicon -s ${size} freecad-icon-${size}.png freecad.png + done + doicon -s scalable freecad.svg + newicon -s 64 -c mimetypes freecad-doc.png application-x-extension-fcstd.png + popd # disable compression of QT assistant help files >> "${ED}"usr/share/doc/${P}/freecad.qhc.ecompress.skip @@ -122,3 +134,11 @@ src_install() { python_optimize "${ED}"usr/{$(get_libdir),share}/${P}/Mod/ } + +pkg_postinst() { + fdo-mime_mime_database_update +} + +pkg_postrm() { + fdo-mime_mime_database_update +} diff --git a/media-gfx/freecad/freecad-9999.ebuild b/media-gfx/freecad/freecad-9999.ebuild index 6b494f999928..5001cf3a2408 100644 --- a/media-gfx/freecad/freecad-9999.ebuild +++ b/media-gfx/freecad/freecad-9999.ebuild @@ -6,7 +6,7 @@ EAPI=5 PYTHON_COMPAT=( python2_7 ) -inherit cmake-utils eutils git-r3 fortran-2 multilib python-single-r1 +inherit cmake-utils eutils git-r3 fortran-2 multilib python-single-r1 fdo-mime DESCRIPTION="QT based Computer Aided Design application" HOMEPAGE="http://www.freecadweb.org/" @@ -17,7 +17,6 @@ SLOT="0" KEYWORDS="" IUSE="" -# sci-libs/opencascade ok: failed: 6.9.0 COMMON_DEPEND="dev-cpp/eigen:3 dev-libs/boost dev-libs/xerces-c[icu] @@ -112,14 +111,34 @@ src_install() { "${EROOT}"usr/$(get_libdir)/${P}/bin/FreeCADCmd \ "" "${EROOT}"usr/$(get_libdir)/${P}/lib - newicon src/Main/icon.ico ${PN}.ico - make_desktop_entry FreeCAD + make_desktop_entry FreeCAD "FreeCAD" "" "" "MimeType=application/x-extension-fcstd;" dodoc README.md ChangeLog.txt + # install mimetype for FreeCAD files + insinto /usr/share/mime/packages + newins "${FILESDIR}"/${PN}.sharedmimeinfo "${PN}.xml" + + # install icons to correct place rather than /usr/share/freecad + pushd "${ED}/usr/share/${P}" + for size in 16 32 48 64; do + newicon -s ${size} freecad-icon-${size}.png freecad.png + done + doicon -s scalable freecad.svg + newicon -s 64 -c mimetypes freecad-doc.png application-x-extension-fcstd.png + popd + # disable compression of QT assistant help files >> "${ED}"usr/share/doc/${P}/freecad.qhc.ecompress.skip >> "${ED}"usr/share/doc/${P}/freecad.qch.ecompress.skip python_optimize "${ED}"usr/{$(get_libdir),share}/${P}/Mod/ } + +pkg_postinst() { + fdo-mime_mime_database_update +} + +pkg_postrm() { + fdo-mime_mime_database_update +} -- 2.26.2