--- lib/wine.lib.orig 2015-05-12 22:33:57 UTC +++ lib/wine.lib @@ -31,7 +31,7 @@ POL_Wine_GetRegValue() [ -z "$WINEPREFIX" ] && POL_Debug_Fatal "WINEPREFIX not set" local value - [ -e "$WINEPREFIX/user.reg" ] && value="$(grep "$1" "$WINEPREFIX/user.reg" | head -n 1 | tr -d '"' | cut -d= -f2)" + [ -e "$WINEPREFIX/user.reg" ] && value="$(grep "$1" "$WINEPREFIX/user.reg" | head -n 1 | tr -d \" | cut -d= -f2)" POL_Debug_Message "Getting registry value $1. Return: $value" echo -n "${value:-default}" } @@ -409,12 +409,19 @@ POL_DetectVideoCards () { # Detect known videocards POL_Debug_Message "Gettings GPU informations" case "$POL_OS" in - Linux|FreeBSD) + Linux) [ -x /usr/sbin/lspci ] && LSPCI=/usr/sbin/lspci || LSPCI=lspci # Device Name|Vendor ID|Device ID\n... # [0300] = VGA compatible controller, [0302] = 3D controller VGA_DEVICES=`$LSPCI -nn | perl -ne 'if (/\[030[02]\]/) { s/.*\]: (.*) \[([0-9a-f]{4}):([0-9a-f]{4})\].*/\1|\2|\3/; print }'` ;; + FreeBSD) + # Device Name|Vendor ID|Device ID\n... + # [0300] = VGA compatible controller, [0302] = 3D controller + # Insert "unk" as dummy vendor name for now + VGA_DEVICES=`/usr/sbin/pciconf -l | \ + perl -ne 'if (/^vga/) { s/^.*chip=0x([0-9a-f]{4})([0-9a-f]{4}).*/unk|\2|\1/; print }'` + ;; Mac) # Device Name|Vendor ID|Device ID\n... VGA_DEVICES=`system_profiler SPDisplaysDataType | perl -ne 's/^\s+//; if(/Chipset Model:/) { chomp; s/^[^:]*: //; print "$_|" } elsif(/Vendor:/) { chomp; s/.*\(0x(.*)\)/\1/; print "$1|" } elsif (/Device ID:/) { s/^[^:]*: 0x//; print }'` @@ -559,7 +566,7 @@ POL_Wine () fi - if [ "$POL_OS" = "Linux" ] || [ "$POL_OS" = "Mac" ]; + if [ "$POL_OS" = "Linux" ] || [ "$POL_OS" = "Mac" ] || [ "POL_OS" = "FreeBSD" ]; then if [ "$LOGFILE" = "/dev/null" ]; then $BEFORE_WINE $(POL_Config_Read BEFORE_WINE) wine "$@" 2> >(grep -v menubuilder --line-buffered | tee -a "$WINEPREFIX/playonlinux.log" >&2) > >(tee -a "$WINEPREFIX/playonlinux.log") @@ -653,6 +660,22 @@ POL_Wine_VersionSignature() fi echo "$WINESIG" } +POL_Wine_LinkFreeBSD() +{ + WINEDIR=$1 + ARCH=$2 + WINEVERSION=$3 + mkdir -p "$WINEDIR/$WINEVERSION" + ln -s /usr/local/bin "$WINEDIR/$WINEVERSION/lib" + if [ -d /usr/local/lib32 ] ; then + ln -s /usr/local/lib32 "$WINEDIR/$WINEVERSION/lib" + else + ln -s /usr/local/lib "$WINEDIR/$WINEVERSION/lib" + fi + mkdir -p "$WINEDIR/$WINEVERSION/share" + ln -s /usr/local/share/wine/gecko/*.msi "$WINEDIR/$WINEVERSION/share/wine/gecko/" #wine_gecko-$WINEVERSION-$ARCH.msi" + ln -s /usr/local/share/wine/mono/*.msi "$WINEDIR/$WINEVERSION/share/wine/mono/" #wine_mono-$WINEVERSION-$ARCH.msi" +} POL_Wine_InstallVersion() { # Install a wineversion @@ -667,6 +690,10 @@ POL_Wine_InstallVersion() OLDPATH="$PWD" WINE_SECTION="$ARCH_PREFIX-$POL_ARCH" WINEDIR="$POL_USER_ROOT/wine/$WINE_SECTION" + if [ "$POL_OS" = "FreeBSD" ] ; then + POL_Wine_LinkFreeBSD $WINEDIR $POL_ARCH $POL_WINEVERSION + return + fi touch "$WINEDIR/installing" if [ ! -e "$WINEDIR/$POL_WINEVERSION" ] then @@ -676,6 +703,7 @@ POL_Wine_InstallVersion() POL_Debug_Warning "Wine $1 amd64 does not exist. Switching to x86" POL_System_SetArch "x86" POL_Wine_InstallVersion "$1" + return else if [ "$WINE_ADDRESS" = "" ] then @@ -706,7 +734,6 @@ POL_Wine_InstallVersion() fi fi rm "$WINEDIR/installing" - } POL_Wine_InstallCDROM() { @@ -743,6 +770,8 @@ POL_Wine_Install_resources() [ "$POL_OS" = "FreeBSD" ] && wos="freebsd" [ "$POL_OS" = "Mac" ] && wos="darwin" + [ "$POL_OS" = "FreeBSD" ] && return # mono and wine-gecko are automatically installed on FreeBSD + if [ ! -L "$POL_USER_ROOT/wine/$wos-$arch/$wine_version/share/wine/$resource" ] then POL_Debug_Message "Linking $resource"