Permalink
Browse files

-base: patch to make script posix compliant; ebuild improvement; over…

…lay available through layman
  • Loading branch information...
1 parent ec9290c commit 9be9191ce709df3253770fd869c543b101e77933 @anyc committed Jan 11, 2013
View
@@ -6,7 +6,7 @@ Gentoo overlay for Valve's Steam client and Steam-based games. Stable ebuilds ar
Using the overlay
-----------------
-To use this overlay follow the instructions at [Layman with custom git repo](http://samuelololol.blogspot.de/2010/10/layman-with-custom-git-repo-ie-github.html). You can use steam-overlay.xml for convenience.
+To use this overlay either execute `layman -a steam` or follow the instructions at [Layman with custom git repo](http://samuelololol.blogspot.de/2010/10/layman-with-custom-git-repo-ie-github.html). You can use steam-overlay.xml for convenience.
To install, emerge `steam-meta` ebuild.
@@ -1,4 +1,3 @@
DIST steam_1.0.0.18_i386.deb 1549322 SHA256 2c914d87214a7a997869a995cb7ef9f2221a060ba6afd8d9816435c707f4eebf SHA512 18399ec45694288ba68a34005f09fc0aad428288e76ca2f084e770f727660dedea79ce57704c7cc87724578bd090d28cdf884fefae6bd78ced476fafeef898ec WHIRLPOOL 66b4fcf35641334c0753e5b0ecf995044b2fa40de7f7c308033286e256a0506a292107433298794c28dae731cc6b3883f4315eedf26810e44cb0aa3baf8b3204
DIST steam_1.0.0.19_i386.deb 1552358 SHA256 b8e45e56cbea10a17cdd9433365d75d5c1fd2e08537f3b9432979af26434a380 SHA512 655406f7e3e284b5fb8346d68f5cb026a078a10607f33db21441f64a505756755abd82bdc9c1bdae6a1a04547828a8fdaf0e98c7530eb2f5beb4ec0682b84146 WHIRLPOOL ae652b4b3cdbbd006ae17976b016811c2221cae17de316afa41cc9e5c4207884b07b106f696814d207fe4563ab5eb9cec97f9b6e1bee129e4fdfb6b47ecfc31f
DIST steam_1.0.0.20_i386.deb 1554410 SHA256 ede2d68f01d0383da9b6368157c925bb30f8076b8f86eff85c452dbd9ff23c60 SHA512 e2d673a8fc4a23e7fe5c8afe83f0f48d5d9bd25385c4f74c46c5bc2d4ed421a6748d4f64bffd1a8996eca2997e917f7ee8483bcef4859113f2981ef18e32c7bd WHIRLPOOL b4c946c826dcab3e4f1288bc2b893752ed123d708a320be2b2df755b9835d12425c211f3c3a15d0db92d180eb893c9ccd1642371e4e3c0afca077d00ce2aed83
-DIST steam_latest.deb 1554410 SHA256 ede2d68f01d0383da9b6368157c925bb30f8076b8f86eff85c452dbd9ff23c60 SHA512 e2d673a8fc4a23e7fe5c8afe83f0f48d5d9bd25385c4f74c46c5bc2d4ed421a6748d4f64bffd1a8996eca2997e917f7ee8483bcef4859113f2981ef18e32c7bd WHIRLPOOL b4c946c826dcab3e4f1288bc2b893752ed123d708a320be2b2df755b9835d12425c211f3c3a15d0db92d180eb893c9ccd1642371e4e3c0afca077d00ce2aed83
@@ -0,0 +1,215 @@
+--- usr/bin/steam_orig
++++ usr/bin/steam
+@@ -1,10 +1,11 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # This is the Steam script that typically resides in /usr/bin
+ # It will create the Steam bootstrap if necessary and then launch steam.
+
+ # Get the full name of this script
+-export STEAMSCRIPT="$(cd "${0%/*}" && echo "$PWD")/${0##*/}"
++STEAMSCRIPT="$(cd "${0%/*}" && echo "$PWD")/${0##*/}"
++export STEAMSCRIPT
+
+ # This version number is incremented when there is a critical fix that
+ # end users need to pick up immediately.
+@@ -15,44 +16,61 @@
+ # steamrepo@list.valvesoftware.com
+ # You can subscribe to this list at:
+ # https://list.valvesoftware.com/mailman/listinfo/steamrepo
+-export STEAMSCRIPT_VERSION=0
++STEAMSCRIPT_VERSION=0
++export STEAMSCRIPT_VERSION
+
+ # Set up domain for script localization
+-export TEXTDOMAIN=steam
++TEXTDOMAIN=steam
++export TEXTDOMAIN
+
+-function show_message()
++if command -v gettext.sh >/dev/null; then
++ GETTEXT_FOUND=1
++ . gettext.sh
++fi
++
++_gettextecho()
++{
++ if [ $GETTEXT_FOUND = 1 ] ; then
++ echo "$(eval_gettext "$1")"
++ else
++ echo "$1"
++ fi
++}
++
++
++show_message()
+ {
+ style=$1
+ shift
+ if ! zenity "$style" --text="$*" 2>/dev/null; then
+ case "$style" in
+ --error)
+- title=$"Error"
++ title="$(_gettextecho "Error")"
+ ;;
+ --warning)
+- title=$"Warning"
++ title="$(_gettextecho "Warning")"
+ ;;
+ *)
+- title=$"Note"
++ title="$(_gettextecho "Note")"
+ ;;
+ esac
+
+ # Save the prompt in a temporary file because it can have newlines in it
+ tmpfile="$(mktemp || echo "/tmp/steam_message.txt")"
+- echo -e "$*" >"$tmpfile"
+- xterm -T "$title" -e "cat $tmpfile; echo -n 'Press enter to continue: '; read input"
++ printf "%b$*" >"$tmpfile"
++ xterm -T "$title" -e "cat $tmpfile; printf 'Press enter to continue: '; read input"
+ rm -f "$tmpfile"
+ fi
+ }
+
+-function detect_platform()
++detect_platform()
+ {
+ # Maybe be smarter someday
+ # Right now this is the only platform we have a bootstrap for, so hard-code it.
+ echo ubuntu12_32
+ }
+
+-function setup_variables()
++setup_variables()
+ {
+ STEAMPACKAGE="${0##*/}"
+ STEAMCONFIG=~/.steam
+@@ -60,7 +78,8 @@
+ STEAMBOOTSTRAP=steam.sh
+ LAUNCHSTEAMDIR="$(readlink -e -q "$STEAMDATALINK")"
+ LAUNCHSTEAMPLATFORM="$(detect_platform)"
+- LAUNCHSTEAMBOOTSTRAPFILE="/usr/lib/$STEAMPACKAGE/bootstraplinux_$LAUNCHSTEAMPLATFORM.tar.xz"
++ [ -z $LAUNCHSTEAMBOOTSTRAPFILE ] && LAUNCHSTEAMBOOTSTRAPFILE="/usr/lib/$STEAMPACKAGE/bootstraplinux_$LAUNCHSTEAMPLATFORM.tar.xz"
++ [ -z $DESKTOPFILE ] && DESKTOPFILE="/usr/share/applications/$STEAMPACKAGE.desktop"
+
+ # Get the default data path
+ STEAM_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
+@@ -74,18 +93,18 @@
+ DEFAULTSTEAMDIR="$STEAM_DATA_HOME/SteamBeta"
+ ;;
+ *)
+- echo $"Unknown Steam package '$STEAMPACKAGE'"
++ _gettextecho "Unknown Steam package '$STEAMPACKAGE'"
+ exit 1
+ ;;
+ esac
+
+ # Create the config directory if needed
+- if [[ ! -d "$STEAMCONFIG" ]]; then
++ if [ ! -d "$STEAMCONFIG" ]; then
+ mkdir "$STEAMCONFIG"
+ fi
+ }
+
+-function install_bootstrap()
++install_bootstrap()
+ {
+ STEAMDIR="$1"
+
+@@ -93,11 +112,12 @@
+ omask="$(umask)"
+ umask 0077
+
+- echo $"Setting up Steam content in $STEAMDIR"
++ _gettextecho "Setting up Steam content in $STEAMDIR"
++
+ mkdir -p "$STEAMDIR"
+ cd "$STEAMDIR"
+ if ! tar xJf "$LAUNCHSTEAMBOOTSTRAPFILE" ; then
+- echo $"Failed to extract $LAUNCHSTEAMBOOTSTRAPFILE, aborting installation."
++ _gettextecho "Failed to extract $LAUNCHSTEAMBOOTSTRAPFILE, aborting installation."
+ exit 1
+ fi
+ rm -f "$STEAMDATALINK" && ln -s "$STEAMDIR" "$STEAMDATALINK"
+@@ -106,25 +126,27 @@
+ # put the Steam icon on the user's desktop
+ # try to read ~/.config/user-dirs.dirs to get the current desktop configuration
+ # http://www.freedesktop.org/wiki/Software/xdg-user-dirs
+- test -f "${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs" && source "${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs"
++ if test -f "${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs" ; then
++ . "${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs"
++ fi
+ DESKTOP_DIR="${XDG_DESKTOP_DIR:-$HOME/Desktop}"
+
+- cp "/usr/share/applications/$STEAMPACKAGE.desktop" "$DESKTOP_DIR"
++ cp "${DESKTOPFILE}" "$DESKTOP_DIR"
+ chmod +x "$DESKTOP_DIR/$STEAMPACKAGE.desktop"
+
+ # Restore the umask
+ umask "$omask"
+ }
+
+-function repair_bootstrap()
++repair_bootstrap()
+ {
+ rm -f "$STEAMDATALINK" && ln -s "$1" "$STEAMDATALINK"
+ setup_variables
+ }
+
+-function check_bootstrap()
++check_bootstrap()
+ {
+- if [[ -n "$1" && -x "$1/$STEAMBOOTSTRAP" ]]; then
++ if [ -n "$1" ] && [ -x "$1/$STEAMBOOTSTRAP" ]; then
+ # Looks good...
+ return 0
+ else
+@@ -138,23 +160,23 @@
+ if ! check_bootstrap "$LAUNCHSTEAMDIR"; then
+ # See if we just need to recreate the data link
+ if check_bootstrap "$DEFAULTSTEAMDIR"; then
+- echo $"Repairing installation, linking $STEAMDATALINK to $DEFAULTSTEAMDIR"
++ _gettextecho "Repairing installation, linking $STEAMDATALINK to $DEFAULTSTEAMDIR"
+ repair_bootstrap "$DEFAULTSTEAMDIR"
+ elif check_bootstrap "$CLASSICSTEAMDIR"; then
+- echo $"Repairing installation, linking $STEAMDATALINK to $CLASSICSTEAMDIR"
++ _gettextecho "Repairing installation, linking $STEAMDATALINK to $CLASSICSTEAMDIR"
+ repair_bootstrap "$CLASSICSTEAMDIR"
+ fi
+ fi
+
+-if [[ ! -L "$STEAMDATALINK" ]]; then
++if [ ! -L "$STEAMDATALINK" ]; then
+ # We don't have the data link and we couldn't find an existing bootstrap, so just install the bootstrap
+ install_bootstrap "$DEFAULTSTEAMDIR"
+ elif ! check_bootstrap "$LAUNCHSTEAMDIR"; then
+ # We have the data link but we can't find the data, prompt the user
+- if zenity --question --text=$"Couldn't find Steam content, did you move it?" --ok-label=$"Search" --cancel-label=$"Reinstall"; then
++ if zenity --question --text="$(_gettextecho "Could not find Steam content, did you move it?")" --ok-label="$(_gettextecho "Search")" --cancel-label="$(_gettextecho "Reinstall")"; then
+ while true; do
+ STEAMDIR="`zenity --file-selection --directory`"
+- if [[ -z "$STEAMDIR" ]]; then
++ if [ -z "$STEAMDIR" ]; then
+ # User canceled
+ exit 0
+ fi
+@@ -162,7 +184,7 @@
+ repair_bootstrap "$STEAMDIR"
+ break;
+ else
+- show_message --error $"Please pick a valid Steam content directory"
++ show_message --error "$(_gettextecho "Please pick a valid Steam content directory")"
+ fi
+ done
+ else
+@@ -171,7 +193,7 @@
+ fi
+
+ if ! check_bootstrap "$LAUNCHSTEAMDIR"; then
+- show_message --error $"Couldn't set up Steam data - please contact technical support"
++ show_message --error "$(_gettextecho "Could not set up Steam data - please contact technical support")"
+ exit 1
+ fi
+
@@ -0,0 +1,98 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+# Please report bugs/suggestions on: https://github.com/anyc/steam-overlay
+# or come to #gentoo-gamerlay in freenode IRC
+
+inherit eutils unpacker gnome2-utils fdo-mime
+
+DESCRIPTION="Supplementary files for Valve's Steam client for Linux"
+HOMEPAGE="https://steampowered.com"
+
+if [[ "${PV}" == "9999" ]] ; then
+ SRC_URI="http://repo.steampowered.com/steam/archive/precise/steam_latest.deb"
+ KEYWORDS=""
+else
+ SRC_URI="http://repo.steampowered.com/steam/archive/precise/steam_${PV}_i386.deb"
+ KEYWORDS="-* ~amd64 ~x86"
+fi
+
+LICENSE="ValveSteamLicense"
+
+RESTRICT="bindist mirror"
+SLOT="0"
+IUSE=""
+
+RDEPEND="
+ gnome-extra/zenity
+
+ amd64? (
+ >=app-emulation/emul-linux-x86-baselibs-20121028
+ >=app-emulation/emul-linux-x86-xlibs-20121028
+ >=sys-devel/gcc-4.6.0[multilib]
+ >=sys-libs/glibc-2.15[multilib]
+ )
+ x86? (
+ >=sys-devel/gcc-4.6.0
+ >=sys-libs/glibc-2.15
+ >=x11-libs/libX11-1.5
+ x11-libs/libXau
+ x11-libs/libxcb
+ x11-libs/libXdmcp
+ )"
+
+S=${WORKDIR}
+
+src_unpack() {
+ unpack_deb ${A}
+}
+
+src_prepare() {
+ if [[ "${PV}" != "9999" ]] ; then
+ # remove carriage return
+ sed -i "s/\r//g" usr/share/applications/steam.desktop || die "Patching steam.desktop failed"
+
+ epatch "${FILESDIR}/steam-make-posix-${PV}.patch"
+ fi
+}
+
+src_install() {
+ dobin "usr/bin/steam"
+
+ insinto "/usr/lib/"
+ doins -r usr/lib/steam
+
+ dodoc usr/share/doc/steam/changelog.gz
+ doman usr/share/man/man6/steam.6.gz
+
+ domenu usr/share/applications/steam.desktop
+
+ insinto /usr/share/icons/
+ doins -r usr/share/icons/
+
+ doicon usr/share/pixmaps/steam.png
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+
+ elog "Execute /usr/bin/steam to download and install the actual"
+ elog "client into your home folder. After installation, the script"
+ elog "also starts the client from your home folder."
+
+ ewarn "The steam client and the games are _not_ controlled by portage."
+ ewarn "Updates are handled by the client itself."
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}

0 comments on commit 9be9191

Please sign in to comment.