Navigation Menu

Skip to content

Commit

Permalink
cad/freecad: fix desktop integration
Browse files Browse the repository at this point in the history
- Install XDG files to the standard path, where DE can find them
- Install freecad-thumbnailer
- Add missing USES

PR:		268094
Approved by:	maintainer timeout (18 days)
  • Loading branch information
MaxBrazhnikov committed Jan 2, 2023
1 parent 1535aee commit 763124b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
16 changes: 12 additions & 4 deletions cad/freecad/Makefile
@@ -1,5 +1,6 @@
PORTNAME= FreeCAD
DISTVERSION= 0.20.2
PORTREVISION= 1
# use these for bugfixes/snapshots
# DISTVERSION= 0.18-16093 # git rev-list --count
# DISTVERSIONSUFFIX= -g690774c0e
Expand Down Expand Up @@ -35,7 +36,8 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pivy>0:graphics/py-pivy@${PY_FLAVOR} \
${PYTHON_SITELIBDIR}/matplotlib/__init__.py:math/py-matplotlib@${PY_FLAVOR}

USES= dos2unix compiler:c++17-lang cmake cpe gl eigen:3 fortran jpeg \
localbase:ldflags mpi:openmpi pkgconfig python:3.7+ localbase qt:5 xorg
localbase:ldflags mpi:openmpi pkgconfig python:3.7+ localbase qt:5 xorg \
desktop-file-utils shared-mime-info shebangfix
USE_GITHUB= yes
USE_XORG= ice sm x11 xext xt
USE_GL= gl glu
Expand All @@ -49,6 +51,7 @@ CPE_VENDOR= freecad_project
VTK_VER= 9.2

DOS2UNIX_GLOB= *.txt *.h *.cpp *.py *.qss *.csv *.pov *.stp *.ui *.wrl *.WRL
SHEBANG_FILES= src/Tools/freecad-thumbnailer

CMAKE_ARGS+= -DOCC_INCLUDE_DIR="${LOCALBASE}/include/OpenCASCADE" \
-DOPENMPI_INCLUDE_DIRS="${LOCALBASE}/mpi/openmpi/include" \
Expand All @@ -68,15 +71,14 @@ CMAKE_ARGS+= -DOCC_INCLUDE_DIR="${LOCALBASE}/include/OpenCASCADE" \
-DBUILD_ENABLE_CXX_STD=C++17

CMAKE_INSTALL_PREFIX= ${PREFIX}/${PORTNAME}
# Install XDG icons and files to the standard path
CMAKE_ARGS+= -DXDG_DATADIR="${PREFIX}/share"

OPTIONS_DEFINE= COLLADA

COLLADA_DESC= Install pycollada for Collada files import
COLLADA_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycollada>0:graphics/py-pycollada@${PY_FLAVOR}

DESKTOP_ENTRIES=${PORTNAME} "" "${PREFIX}/FreeCAD/data/freecad.svg" \
${PORTNAME} "Graphics;Engineering;" false

.include <bsd.port.options.mk>

.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == i386
Expand All @@ -88,9 +90,15 @@ USE_QT+= webkit
post-patch:
@${REINPLACE_CMD} -e '/self\.rev/s/Unknown/${DISTVERSION:C/.*-//}/' \
${WRKSRC}/src/Tools/SubWCRev.py
# Install XDG icons and files to the standard path
@${REINPLACE_CMD} -e 's/CMAKE_INSTALL_DATAROOTDIR/XDG_DATADIR/g' \
${WRKSRC}/src/XDGData/CMakeLists.txt \
${WRKSRC}/src/Gui/CMakeLists.txt

post-install:
${LN} -s ../${PORTNAME}/bin/FreeCAD ${STAGEDIR}${LOCALBASE}/bin/FreeCAD
${LN} -s ../${PORTNAME}/bin/FreeCADCmd ${STAGEDIR}${LOCALBASE}/bin/FreeCADCmd
${INSTALL_SCRIPT} ${WRKSRC}/src/Tools/freecad-thumbnailer \
${STAGEDIR}${PREFIX}/bin/freecad-thumbnailer

.include <bsd.port.mk>
27 changes: 15 additions & 12 deletions cad/freecad/pkg-plist
Expand Up @@ -1959,7 +1959,8 @@ FreeCAD/share/Mod/TechDraw/Templates/zh_CN/portrait/A3_Portrait_CN_CLIP.svg
FreeCAD/share/Mod/TechDraw/Templates/zh_CN/portrait/A4_Portrait_CN_CLIP.svg
FreeCAD/share/Mod/Test/Resources/icons/TestWorkbench.svg
FreeCAD/share/Mod/Web/Resources/icons/WebWorkbench.svg
FreeCAD/share/applications/org.freecadweb.FreeCAD.desktop
@comment FreeCAD/share/doc/FreeCAD/LICENSE.html
@comment FreeCAD/share/doc/FreeCAD/ThirdPartyLibraries.html
FreeCAD/share/examples/ArchDetail.FCStd
FreeCAD/share/examples/EngineBlock.FCStd
FreeCAD/share/examples/FemCalculixCantilever2D.FCStd
Expand All @@ -1969,19 +1970,21 @@ FreeCAD/share/examples/PartDesignExample.FCStd
FreeCAD/share/examples/RobotExample.FCStd
FreeCAD/share/examples/Schenkel.stp
FreeCAD/share/examples/draft_test_objects.FCStd
FreeCAD/share/icons/hicolor/16x16/apps/freecad.png
FreeCAD/share/icons/hicolor/32x32/apps/freecad.png
FreeCAD/share/icons/hicolor/48x48/apps/freecad.png
FreeCAD/share/icons/hicolor/64x64/apps/freecad.png
FreeCAD/share/icons/hicolor/scalable/apps/freecad.svg
FreeCAD/share/icons/hicolor/scalable/apps/org.freecadweb.FreeCAD.svg
FreeCAD/share/icons/hicolor/scalable/mimetypes/application-x-extension-fcstd.svg
FreeCAD/share/metainfo/org.freecadweb.FreeCAD.appdata.xml
FreeCAD/share/mime/packages/org.freecadweb.FreeCAD.xml
FreeCAD/share/pixmaps/freecad.xpm
FreeCAD/share/thumbnailers/FreeCAD.thumbnailer
bin/FreeCAD
bin/FreeCADCmd
bin/freecad-thumbnailer
share/applications/org.freecadweb.FreeCAD.desktop
share/icons/hicolor/16x16/apps/freecad.png
share/icons/hicolor/32x32/apps/freecad.png
share/icons/hicolor/48x48/apps/freecad.png
share/icons/hicolor/64x64/apps/freecad.png
share/icons/hicolor/scalable/apps/freecad.svg
share/icons/hicolor/scalable/apps/org.freecadweb.FreeCAD.svg
share/icons/hicolor/scalable/mimetypes/application-x-extension-fcstd.svg
share/metainfo/org.freecadweb.FreeCAD.appdata.xml
share/mime/packages/org.freecadweb.FreeCAD.xml
share/pixmaps/freecad.xpm
share/thumbnailers/FreeCAD.thumbnailer
@dir FreeCAD
@dir FreeCAD/share
@dir FreeCAD/share/Mod/Material/StandardMaterial/Tools

0 comments on commit 763124b

Please sign in to comment.