freebsd-ports/emulators/playonbsd/files/patch-lib_scripts.lib

56 lines
2.1 KiB
Text
Raw Normal View History

--- lib/scripts.lib.orig 2016-01-03 22:16:17 UTC
+++ lib/scripts.lib
@@ -382,10 +382,14 @@ POL_Shortcut()
# Menus
if [ ! "$(POL_Config_Read NO_MENU_ICON)" = "TRUE" ]; then
# Do nothing on Mac OS
- if [ -n "$Categories" -a "$POL_OS" = "Linux" ] || [ -n "$Categories" -a "$POL_OS" = "BSD" ]; then
+ if [ -n "$Categories" -a "$POL_OS" = "Linux" ]; then
LOCALAPPS="$HOME/.local/share/applications"
make_desktop_shortcut "$iconPath" "$ICON_FILENAME" "$LOCALAPPS" "$PLAYONLINUX/playonlinux --run \"$ICON_FILENAME\"" "$binary_name" "$Categories" "playonlinux-"
fi
+ if [ -n "$Categories" -a "$POL_OS" = "FreeBSD" ]; then
+ LOCALAPPS="$HOME/.local/share/applications"
+ make_desktop_shortcut "$iconPath" "$ICON_FILENAME" "$LOCALAPPS" "$PLAYONLINUX/playonfreebsd --run \"$ICON_FILENAME\"" "$binary_name" "$Categories" "playonlinux-"
+ fi
fi
# Desktop
@@ -1002,9 +1006,8 @@ POL_Shortcut_AddProfileLink()
}
POL_LoadVar_Distro ()
{
- if [ "$POL_OS" = "Linux" ] || [ "$POL_OS" == "FreeBSD" ]; then
- export DISTRO="$(lsb_release -d | cut -d':' -f2 | tr -d \\t)"
- else
+ case "$POL_OS" in
+ Mac)
main_kernel="$(uname -r | cut -d '.' -f 1)"
second_kernel="$(uname -r | cut -d '.' -f 2)"
@@ -1015,7 +1018,14 @@ POL_LoadVar_Distro ()
[ "$main_kernel" = "12" ] && MacOS="Mountain Lion"
export DISTRO="$MacOS 10.$(( main_kernel - 4)).$second_kernel ($(uname -r))"
- fi
+ ;;
+ Linux)
+ export DISTRO="$(lsb_release -d | cut -d':' -f2 | tr -d \\t)"
+ ;;
+ FreeBSD)
+ export DISTRO="$(uname -sr) ($(uname -p))"
+ ;;
+ esac
}
POL_Shortcut_MakeDesktopShortcut()
{
@@ -1039,7 +1049,7 @@ POL_Shortcut_MakeDesktopShortcut()
# http://stackoverflow.com/questions/8939580/bash-split-a-string-exactly-like-readline-would-split-it
eval set -- $(grep '^POL_Wine ' "$POL_USER_ROOT/shortcuts/$PACKAGE"|tail -n 1)
local binary="$2"
- make_desktop_shortcut "$iconPath" "$PACKAGE" "$DESKTOP" "$PLAYONLINUX/playonlinux --run \"$PACKAGE\"" "$binary" ""
+ make_desktop_shortcut "$iconPath" "$PACKAGE" "$DESKTOP" "$PLAYONLINUX/playonfreebsd --run \"$PACKAGE\"" "$binary" ""
;;
*)