View | Details | Raw Unified | Return to bug 158936 | Differences between
and this patch

Collapse All | Expand All

(-)bsd.port.mk (-3 / +106 lines)
Lines 1046-1052 Link Here
1046
# DESKTOP_ENTRIES
1046
# DESKTOP_ENTRIES
1047
#				- List of desktop entry files to generate and install in
1047
#				- List of desktop entry files to generate and install in
1048
#				  ${DESKTOPDIR}. The format is
1048
#				  ${DESKTOPDIR}. The format is
1049
#
1049
#				  "Name" "Comment" "Icon" "Exec" "Categories" StartupNotify
1050
#				  "Name" "Comment" "Icon" "Exec" "Categories" StartupNotify
1051
#
1052
#				  Notes:
1053
#					* Exec will also be used to name the .desktop file.
1054
#					  If you need to use arguments in your .desktop file, then
1055
#					  use the DESKTOP_ENTRIESv2 format.
1056
#				- See DESKTOP_ENTRIESv2 for additional info.
1057
# DESKTOP_ENTRIESv2
1058
#				- List of desktop entry files to generate and install in
1059
#				  ${DESKTOPDIR}. The format is
1060
#
1061
#				  "Filename" "Name" "Comment" "Icon" "Exec" "Categories" StartupNotify
1062
#
1050
#				  Rules:
1063
#				  Rules:
1051
#					* Only add desktop entries for applications which do not
1064
#					* Only add desktop entries for applications which do not
1052
#					  require a terminal (ie. X applications).
1065
#					  require a terminal (ie. X applications).
Lines 1064-1072 Link Here
1064
#					  If the deduction fails, you will have to set Categories
1077
#					  If the deduction fails, you will have to set Categories
1065
#					  manually. You should check the generated value using
1078
#					  manually. You should check the generated value using
1066
#					  "make desktop-categories", and override it if necessary.
1079
#					  "make desktop-categories", and override it if necessary.
1067
#					* Exec will also be used to name the .desktop file.
1080
#					* Exec can also include arguments (DESKTOP_ENTRIESv2 Only).
1068
#					* The files will be automatically added to ${PLIST}.
1081
#					* The files will be automatically added to ${PLIST}.
1069
#				  Example:
1082
#				  Example:
1083
#					"wininfo" \
1070
#					"X Window Information" \
1084
#					"X Window Information" \
1071
#					"Get information about X windows" \
1085
#					"Get information about X windows" \
1072
#					"wininfo.png" \
1086
#					"wininfo.png" \
Lines 6368-6374 Link Here
6368
	GNOME GTK Qt Motif Java ConsoleOnly AdvancedSettings
6382
	GNOME GTK Qt Motif Java ConsoleOnly AdvancedSettings
6369
6383
6370
check-desktop-entries:
6384
check-desktop-entries:
6371
.if defined(DESKTOP_ENTRIES)
6385
.if defined(DESKTOP_ENTRIESv2)
6386
	@set -- ${DESKTOP_ENTRIESv2} XXX; \
6387
	if [ `${EXPR} \( $$# - 1 \) % 7` -ne 0 ]; then \
6388
		${ECHO_MSG} "${PKGNAME}: Makefile error: the DESKTOP_ENTRIES list must contain one or more groups of 7 elements"; \
6389
		exit 1; \
6390
	fi; \
6391
	num=1; \
6392
	while [ $$# -gt 7 ]; do \
6393
		entry="#$$num"; \
6394
		if [ -n "$$5" ]; then \
6395
			entry="$$entry ($$4)"; \
6396
		elif [ -n "$$2" ]; then \
6397
			entry="$$entry ($$2)"; \
6398
		fi; \
6399
		if [ -z "$$1" ]; then \
6400
			${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 1 (Filename) is empty"; \
6401
			exit 1; \
6402
		fi
6403
		if [ -z "$$2" ]; then \
6404
			${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 2 (Name) is empty"; \
6405
			exit 1; \
6406
		fi; \
6407
		if [ -z "$$5" ]; then \
6408
			${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Exec) is empty"; \
6409
			exit 1; \
6410
		fi; \
6411
		if [ -n "$$6" ]; then \
6412
			for c in `${ECHO_CMD} "$$6" | ${TR} ';' ' '`; do \
6413
				if ! ${ECHO_CMD} ${VALID_DESKTOP_CATEGORIES} | ${GREP} -wq $$c; then \
6414
					${ECHO_CMD} "${PKGNAME}: Makefile error: in desktop entry $$entry: category $$c is not a valid desktop category"; \
6415
					exit 1; \
6416
				fi; \
6417
			done; \
6418
			if ! ${ECHO_CMD} "$$6" | ${GREP} -q ';$$'; then \
6419
				${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 6 (Categories) does not end with a semicolon"; \
6420
				exit 1; \
6421
			fi; \
6422
		else \
6423
			if [ -z "`cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} desktop-categories`" ]; then \
6424
				${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 6 (Categories) is empty and could not be deduced from the CATEGORIES variable"; \
6425
				exit 1; \
6426
			fi; \
6427
		fi; \
6428
		if [ -z "$$7" ]; then \
6429
			${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 7 (StartupNotify) is empty"; \
6430
			exit 1; \
6431
		fi; \
6432
		if [ "x$$7" != "xtrue" ] && [ "x$$7" != "xfalse" ]; then \
6433
			${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 7 (StartupNotify) is not \"true\" or \"false\""; \
6434
			exit 1; \
6435
		fi; \
6436
		shift 7; \
6437
		num=`${EXPR} $$num + 1`; \
6438
	done
6439
.elif defined(DESKTOP_ENTRIES)
6372
	@set -- ${DESKTOP_ENTRIES} XXX; \
6440
	@set -- ${DESKTOP_ENTRIES} XXX; \
6373
	if [ `${EXPR} \( $$# - 1 \) % 6` -ne 0 ]; then \
6441
	if [ `${EXPR} \( $$# - 1 \) % 6` -ne 0 ]; then \
6374
		${ECHO_MSG} "${PKGNAME}: Makefile error: the DESKTOP_ENTRIES list must contain one or more groups of 6 elements"; \
6442
		${ECHO_MSG} "${PKGNAME}: Makefile error: the DESKTOP_ENTRIES list must contain one or more groups of 6 elements"; \
Lines 6424-6430 Link Here
6424
6492
6425
.if !target(install-desktop-entries)
6493
.if !target(install-desktop-entries)
6426
install-desktop-entries:
6494
install-desktop-entries:
6427
.if defined(DESKTOP_ENTRIES)
6495
.if defined(DESKTOP_ENTRIESv2)
6496
	@(${MKDIR} "${DESKTOPDIR}" 2> /dev/null) || \
6497
		(${ECHO_MSG} "===> Cannot create ${DESKTOPDIR}, check permissions"; exit 1)
6498
	@set -- ${DESKTOP_ENTRIESv2} XXX; \
6499
	if [ -z "${_DESKTOPDIR_REL}" ]; then \
6500
		${ECHO_CMD} "@cwd ${DESKTOPDIR}" >> ${TMPPLIST}; \
6501
	fi; \
6502
	while [ $$# -gt 7 ]; do \
6503
		filename="`${ECHO_CMD} "$$1" | ${SED} -E 's/[[:space:]]+.*//'`.desktop"; \
6504
		pathname="${DESKTOPDIR}/$$filename"; \
6505
		categories="$$6"; \
6506
		if [ -z "$$categories" ]; then \
6507
			categories="`cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} desktop-categories`"; \
6508
		fi; \
6509
		${ECHO_CMD} "${_DESKTOPDIR_REL}$$filename" >> ${TMPPLIST}; \
6510
		${ECHO_CMD} "[Desktop Entry]" > $$pathname; \
6511
		${ECHO_CMD} "Type=Application" >> $$pathname; \
6512
		${ECHO_CMD} "Version=0.9.4" >> $$pathname; \
6513
		${ECHO_CMD} "Encoding=UTF-8" >> $$pathname; \
6514
		${ECHO_CMD} "Name=$$2" >> $$pathname; \
6515
		if [ -n "$$3" ]; then \
6516
			${ECHO_CMD} "Comment=$$3" >> $$pathname; \
6517
		fi; \
6518
		if [ -n "$$4" ]; then \
6519
			${ECHO_CMD} "Icon=$$4" >> $$pathname; \
6520
		fi; \
6521
		${ECHO_CMD} "Exec=$$5" >> $$pathname; \
6522
		${ECHO_CMD} "Categories=$$categories" >> $$pathname; \
6523
		${ECHO_CMD} "StartupNotify=$$7" >> $$pathname; \
6524
		shift 7; \
6525
	done; \
6526
	${ECHO_CMD} "@unexec rmdir ${DESKTOPDIR} 2>/dev/null || true" >> ${TMPPLIST}; \
6527
	if [ -z "${_DESKTOPDIR_REL}" ]; then \
6528
		${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \
6529
	fi
6530
.elif defined(DESKTOP_ENTRIES)
6428
	@(${MKDIR} "${DESKTOPDIR}" 2> /dev/null) || \
6531
	@(${MKDIR} "${DESKTOPDIR}" 2> /dev/null) || \
6429
		(${ECHO_MSG} "===> Cannot create ${DESKTOPDIR}, check permissions"; exit 1)
6532
		(${ECHO_MSG} "===> Cannot create ${DESKTOPDIR}, check permissions"; exit 1)
6430
	@set -- ${DESKTOP_ENTRIES} XXX; \
6533
	@set -- ${DESKTOP_ENTRIES} XXX; \

Return to bug 158936