git: eabb1532ca37 - main - cad/digital: Install icons and desktop file provided by the project
Yuri Victorovich
yuri at FreeBSD.org
Fri May 28 01:37:42 UTC 2021
The branch main has been updated by yuri:
URL: https://cgit.FreeBSD.org/ports/commit/?id=eabb1532ca37317952fd79ee8ce3fa91108882eb
commit eabb1532ca37317952fd79ee8ce3fa91108882eb
Author: Yuri Victorovich <yuri at FreeBSD.org>
AuthorDate: 2021-05-28 01:33:26 +0000
Commit: Yuri Victorovich <yuri at FreeBSD.org>
CommitDate: 2021-05-28 01:37:40 +0000
cad/digital: Install icons and desktop file provided by the project
PR: 256210
Reported by: Duane <parakleta at darkreality.org>
---
cad/digital/Makefile | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/cad/digital/Makefile b/cad/digital/Makefile
index 5520c9e0a802..6c4d3b2a0ef9 100644
--- a/cad/digital/Makefile
+++ b/cad/digital/Makefile
@@ -1,6 +1,7 @@
PORTNAME= digital
DISTVERSIONPREFIX= v
DISTVERSION= 0.27
+PORTREVISION= 1
CATEGORIES= cad java
MAINTAINER= yuri at FreeBSD.org
@@ -11,6 +12,8 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= mvn:devel/maven
+USES= desktop-file-utils
+
USE_JAVA= yes
USE_GITHUB= yes
GH_ACCOUNT= hneemann
@@ -37,10 +40,14 @@ DISTFILES+= ${PORTNAME}-${DISTVERSION}-deps${EXTRACT_SUFX}:maven
MVN_ARGS= --offline
.endif
-DESKTOP_ENTRIES= "Digital logic designer" "Digital logic designer and circuit simulator" "" "${PORTNAME}" "Electronics;" ""
+ICON_SIZES= 32 48 64 128
+ICON_NAME= digital-logic-designer
PLIST_FILES= bin/${PORTNAME} \
- ${JAVAJARDIR}/Digital.jar
+ ${JAVAJARDIR}/Digital.jar \
+ ${ICON_SIZES:C/(.*)/share\/icons\/hicolor\/\1x\1\/apps\/${ICON_NAME}.png/} \
+ share/icons/hicolor/scalable/apps/${ICON_NAME}.svg \
+ share/applications/${PORTNAME}.desktop
do-build:
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
@@ -51,11 +58,26 @@ do-build:
-P no-git-rev -Dgit.commit.id.describe=${DISTVERSIONFULL} \
package
do-install:
+ # install jar
${INSTALL_DATA} ${WRKSRC}/target/Digital.jar ${STAGEDIR}${JAVAJARDIR}
+ # install shell wrapper
@(echo "#!/bin/sh"; \
echo ""; \
echo "${JAVA} -jar ${JAVAJARDIR}/Digital.jar \""$$"@\"" \
) > ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
@${CHMOD} +x ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+ # install desktop file
+ ${SED} -e '\
+ s|<EXEC_LOCATION>|${PREFIX}/bin/${PORTNAME}| ; \
+ s|<ICON_LOCATION>|${ICON_NAME}|' \
+ < ${WRKSRC}/distribution/linux/desktop.template \
+ > ${STAGEDIR}${PREFIX}/share/applications/${PORTNAME}.desktop
+ # install icons
+.for SZ in ${ICON_SIZES}
+ ${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${SZ}x${SZ}/apps
+ ${INSTALL_DATA} ${WRKSRC}/src/main/resources/icons/icon${SZ}.png ${STAGEDIR}${PREFIX}/share/icons/hicolor/${SZ}x${SZ}/apps/${ICON_NAME}.png
+.endfor
+ ${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps
+ ${INSTALL_DATA} ${WRKSRC}/src/main/svg/icon.svg ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps/${ICON_NAME}.svg
.include <bsd.port.mk>
More information about the dev-commits-ports-all
mailing list