[games-puzzle/limbo]: a puzzle platform video game (wine)
[ I have made a ebuild for game Limbo, the ebuild takes wine as a RDEPEND. This ebuild is more advanced than PlayOnLinux: 1. Installed by root, used by everyone 2. Automatically download installer exe file from www.limbogame.org 3. Directly extract and install files, no installation wizard 4. Can use LANG,LC_ALL to select language on the fly 5. Installs desktop icon, seamlessly integrites with Desktop Environment This ebuild also has some disadvantages: 1. depends on wine, and wine has regression sometimes 2. I think it's legal, but I can't be sure ]
This commit is contained in:
1 parent
049cbf2a9c
commit
4cbaeb58dd
5 files changed
+174
No files matched your search
@@ -0,0 +1,5 @@
|
||||
AUX limbo 2932 SHA256 10a7154067a9ee8515351149108978caf2d0f7d9c8a96a56004616d3173e9e49 SHA512 a0a6b3f928cdfdee946e50490dd96e79c6c1db11388a815729dfbd1c0bc004478cf9fa054245efd16d689bc0e471d4b6ca4bdcbf6c3fcbcb615b6989333e4df3 WHIRLPOOL 064b3ff9ff83aaea3927d6be01db18f82ec168b5f443be50fe4aaee8048374173d0c3e28bcb94f075a52c901c9eb27c8ba683f9a3634ada9bf12b2131d5d3a15
|
||||
AUX limbo.desktop 121 SHA256 c2b7f8346f1c38b963c320f12bd7be3c2fc35e3c6b40177136222b122f36cf40 SHA512 984647f7607488207445fd8facf50a9fde578610f7ad225fff65dc292446c547d7453dcf624bdef57e3f8c9346ebe2b66e2b959d2ad2e68b29e219af822213dd WHIRLPOOL e0fd1981ea8e36115ea512d11331d6727600032df68afb95837c95d01322e173a0d676ebf106af5af3fea71193ba0b90c7e3c00aaad162e90c6cd68fc83328d7
|
||||
AUX limbo.png 6062 SHA256 4029ef1e31c7224816af7aface905c3402ba58965cfb0f2d10a84daf9f606f61 SHA512 e40afccb1bafd8bbcc66cbcd07517263a875aa680d7e30b4709302ea95ecf3af0c053c97c9edcb0b40c689b2732c3381a1c78bd0485c6451f2c936948efdda58 WHIRLPOOL 7b2be13b540599458a9687ee90be1166844253a38609c119c4f8135647d117131e477f52bc7d0f09d00f31b7dd179f94679cd259c57182391828c435848c03b7
|
||||
DIST LIMBOInstaller.exe 81720728 SHA256 99879302799b5d6d05034705c679abf1d2dd823f25bf317078462beadace2812 SHA512 e8bc63eccb8a5df79a848b4ad999ed857085ceb922ee7e930f3b1b60521c363702027e5c1c3f333ac84905650e3f7cb447256717feb954b2357e872df454a82b WHIRLPOOL 879c7b56cacca2273cc155133fda5ebeb018007fec5dec944475b4d3180a15ef31ad08f5eee0da48ab9b812f4c9dbd39e55e2e54c9121d042f2ff2752be4ffd0
|
||||
EBUILD limbo-0.ebuild 1457 SHA256 0aad9833351d765ee70c3e6e6bde6c7cc13900b416d7db87780f2c32dc6e8a83 SHA512 4ae8666819d0b1ff0235b707f2c666e6a0874bc5d7944f6b826c1b1eaec8df19c8b7f8adef0dc1c2bd521933170ce0a9a8ff668476ef97eb14c031be8b1cb270 WHIRLPOOL 63f2bf962a829e7aef2f757f8d7a936c7b0f7f297ea9324e7eaf064bc8de62d9155243bc5f68dc2d148f9350586c416b890d77e627a17985426d9f43ab63e10a
|
||||
@@ -0,0 +1,110 @@
|
||||
#!/bin/sh
|
||||
|
||||
create_wine_dir ()
|
||||
{
|
||||
# get params
|
||||
winedir=${1:?} ; shift # only accept absolute path without trailing slash
|
||||
|
||||
# exec wine command
|
||||
if [ ! -e "$winedir" ] ; then
|
||||
mkdir -p "$winedir"
|
||||
fi
|
||||
WINEPREFIX="$winedir" wineboot
|
||||
|
||||
# change softlink to real directory in user directory
|
||||
userdir="$winedir/drive_c/users/$(id -un)"
|
||||
SAVEIFS=$IFS
|
||||
IFS=$'\n'
|
||||
for f in `find "$userdir" -print`
|
||||
do
|
||||
if [ ! -L "$f" ] ; then continue ; fi
|
||||
|
||||
unlink $f
|
||||
mkdir $f
|
||||
done
|
||||
}
|
||||
|
||||
create_link ()
|
||||
{
|
||||
# get params
|
||||
srcdir=${1:?} ; shift # only accept absolute path without trailing slash
|
||||
dstdir=${1:?} ; shift # same as above
|
||||
dstdir_in="$dstdir/$(basename $srcdir)"
|
||||
|
||||
# make dstdir in srcdir
|
||||
if [ ! -e "$dstdir_in" ] ; then
|
||||
mkdir -p "$dstdir_in"
|
||||
fi
|
||||
|
||||
# do the job
|
||||
SAVEIFS=$IFS
|
||||
IFS=$'\n'
|
||||
for srcf in `find "$srcdir" -print`
|
||||
do
|
||||
# get inner filename
|
||||
f=${srcf:((${#srcdir}+1))}
|
||||
if [ "$f" == "" ] ; then continue ; fi
|
||||
|
||||
# do the job
|
||||
if [[ -d "$srcf" && ! -L "$srcf" ]] ; then
|
||||
# create directory structure
|
||||
mkdir -p "$dstdir_in/$f"
|
||||
else
|
||||
# create softlink
|
||||
ln -s -t `dirname "$dstdir_in/$f"` $srcf
|
||||
fi
|
||||
done
|
||||
IFS=$SAVEIFS
|
||||
}
|
||||
|
||||
get_cur_lang ()
|
||||
{
|
||||
if [ ${LC_ALL:-x} != "x" ] ; then echo "$LC_ALL"
|
||||
elif [ ${LANG:-x} != "x" ] ; then echo "$LANG"
|
||||
elif [ ${LC_LANG:-x} != "x" ] ; then echo "$LC_LANG"
|
||||
else echo ""
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# Variables
|
||||
GAMEDIR= # fill by ebuild
|
||||
DATADIR= # fill by ebuild
|
||||
|
||||
# Create wine directory
|
||||
create_wine_dir "$DATADIR"
|
||||
WINEPREFIX="$DATADIR" winetricks d3dx9_43
|
||||
WINEPREFIX="$DATADIR" winetricks d3dcompiler_43
|
||||
|
||||
# Make links of "$GAMEDIR/*" to "$DATADIR"
|
||||
if [ ! -e "$DATADIR/drive_c/Limbo" ] ; then
|
||||
create_link "$GAMEDIR/Limbo" "$DATADIR/drive_c"
|
||||
|
||||
# Copy default config file
|
||||
cp "$GAMEDIR/default-config/settings.txt" "$DATADIR/drive_c/Limbo/"
|
||||
chmod 664 "$DATADIR/drive_c/Limbo/settings.txt"
|
||||
fi
|
||||
|
||||
# Change language setting
|
||||
langu=$(get_cur_lang)
|
||||
langu=${langu%%.*}
|
||||
case "$langu" in
|
||||
fr) dstlang="fr" ;;
|
||||
zh_CN|zh_HK|zh_TW) dstlang="zh" ;;
|
||||
pt|pt_BR|pt_PT) dstlang="pt" ;;
|
||||
de) dstlang="de" ;;
|
||||
ko) dstlang="ko" ;;
|
||||
it) dstlang="it" ;;
|
||||
es|es_AR|es_CL|es_ES|es_MX) dstlang="es" ;;
|
||||
ja) dstlang="ja" ;;
|
||||
*) dstlang="uk" ;;
|
||||
esac
|
||||
cp "$DATADIR/drive_c/Limbo/settings.txt" "$DATADIR/drive_c/Limbo/settings.txt.last"
|
||||
sed -e "s/^language.*$/language = \"$dstlang\"/g" "$DATADIR/drive_c/Limbo/settings.txt.last" > "$DATADIR/drive_c/Limbo/settings.txt"
|
||||
rm -f "$DATADIR/drive_c/Limbo/settings.txt.last"
|
||||
|
||||
# run the game
|
||||
cd "$DATADIR/drive_c/Limbo"
|
||||
WINEPREFIX="$DATADIR" wine limbo.exe
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
[Desktop Entry]
|
||||
Name=Limbo
|
||||
Type=Application
|
||||
Comment=The game Limbo
|
||||
Exec=limbo
|
||||
TryExec=limbo
|
||||
Icon=limbo
|
||||
Categories=Game;
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.9 KiB |
@@ -0,0 +1,50 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
EAPI=3
|
||||
inherit eutils games
|
||||
|
||||
DESCRIPTION="Limbo"
|
||||
SRC_URI="http://c732102.r2.cf2.rackcdn.com/LIMBOInstaller.exe"
|
||||
HOMEPAGE="http://limbogame.org"
|
||||
LICENSE="unknown"
|
||||
SLOT="0"
|
||||
KEYWORDS="-* amd64 x86"
|
||||
IUSE=""
|
||||
|
||||
DEPEND="app-arch/p7zip"
|
||||
RDEPEND=">=app-emulation/wine-1.5.2[win32]
|
||||
>=app-emulation/winetricks-744"
|
||||
|
||||
src_unpack() {
|
||||
# Multiple settings.txt exist in LIMBOInstaller.exe, we must select the skip option by echoing "s\n"
|
||||
echo "s\n" | 7z x "${DISTDIR}/${A}" -o"${WORKDIR}"
|
||||
|
||||
# Restruct the directory.
|
||||
rm -rf "${WORKDIR}"/$'\x01\x19'
|
||||
rm -rf "${WORKDIR}"/$'\x01\x15'/$'\x01\x1A'
|
||||
mkdir "${WORKDIR}/default-config"
|
||||
mkdir "${WORKDIR}/Limbo"
|
||||
mv "${WORKDIR}"/$'\x01\x15'/settings.txt "${WORKDIR}/default-config"
|
||||
mv "${WORKDIR}"/$'\x01\x15'/* "${WORKDIR}/Limbo"
|
||||
rmdir "${WORKDIR}"/$'\x01\x15'
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
# Prepare the wrapper script
|
||||
sed -e "s/^GAMEDIR=.*$/GAMEDIR=\/opt\/limbo/g" \
|
||||
-e "s/^DATADIR=.*$/DATADIR=~\/.local\/share\/limbo/g" "${FILESDIR}/limbo" > "${WORKDIR}/limbo"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dodir "${GAMES_PREFIX_OPT}/limbo"
|
||||
cp -r "default-config" "${D}/${GAMES_PREFIX_OPT}/limbo"
|
||||
cp -r "Limbo" "${D}/${GAMES_PREFIX_OPT}/limbo"
|
||||
|
||||
dogamesbin "limbo"
|
||||
doicon "${FILESDIR}/limbo.png"
|
||||
domenu "${FILESDIR}/limbo.desktop"
|
||||
|
||||
prepgamesdirs
|
||||
}
|
||||
Reference in new issue
Block a user