Commit 98fe608f authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play: add unigine-valley support

parent b0f14035
#!/bin/sh
PKGNAME=unigine-valley
OPKGNAME=Unigine_Valley
SUPPORTEDARCHES="x86_64"
DESCRIPTION="Unigine Valley 2013 (Unigine Benchmark) from the official site"
. $(dirname $0)/common.sh
convert_makeself_to_tar()
{
offset=`head -n 403 "$1" | wc -c | tr -d " "`
dd if="$1" ibs=$offset skip=1 obs=1024 conv=sync | gzip -cd > "$(basename "$1" .run).tar"
}
PKGDIR=$(mktemp -d)
trap "rm -fr $PKGDIR" EXIT
cd $PKGDIR || fatal
# https://assets.unigine.com/d/Unigine_valley-4.0.run
eget --latest https://benchmark.unigine.com/valley "$OPKGNAME*.run"
mv $OPKGNAME*.run $(echo $OPKGNAME*.run | tr "[A-Z_]" "[a-z-]")
convert_makeself_to_tar $PKGNAME*.run
epm install $PKGNAME*.tar
#!/bin/sh -x
# It will be run with two args: buildroot spec
BUILDROOT="$1"
SPEC="$2"
PRODUCT=unigine-valley
PRODUCTDIR=/opt/unigine-valley
. $(dirname $0)/common.sh
subst "s|^Group:.*|Group: Graphics|" $SPEC
subst "s|^License: unknown$|License: Proprietary|" $SPEC
subst "s|^URL:.*|URL: https://benchmark.unigine.com/valley|" $SPEC
subst "s|^Summary:.*|Summary: Unigine Valley (Unigine Benchmark)|" $SPEC
mkdir -p $BUILDROOT$PRODUCTDIR/
for i in bin data documentation ; do
mv $BUILDROOT/$i $BUILDROOT$PRODUCTDIR/$i
subst "s|\"/$i/|\"$PRODUCTDIR/$i/|" $SPEC
done
remove_file /valley
# support only x86_64
cd $BUILDROOT/$PRODUCTDIR/bin || fatal
for i in *x86* ; do
[ -d $i ] && remove_dir $PRODUCTDIR/bin/$i && continue
remove_file $PRODUCTDIR/bin/$i
done
add_bin_link_command $PRODUCT /usr/bin/valley
epm assure patchelf || exit
for i in *_x64 lib*_x64.so* ; do
a= patchelf --set-rpath '$ORIGIN' $i
done
mkdir -p $BUILDROOT/usr/bin
cat <<EOF >$BUILDROOT/usr/bin/valley
#!/bin/sh
cd $PRODUCTDIR/bin
export LD_LIBRARY_PATH=./x64:\$LD_LIBRARY_PATH
./browser_x64 -config ../data/launcher/launcher.xml
EOF
chmod a+x $BUILDROOT/usr/bin/valley
pack_file /usr/bin/valley
install_file $PRODUCTDIR/data/launcher/icon.png /usr/share/pixmaps/$PRODUCT.png
# create desktop file
mkdir -p $BUILDROOT/usr/share/applications/
cat <<EOF >$BUILDROOT/usr/share/applications/$PRODUCT.desktop
[Desktop Entry]
Version=1.0
Name=Unigine Valley 2013
Type=Application
Icon=$PRODUCT
Exec=valley
Terminal=false
EOF
pack_file /usr/share/applications/$PRODUCT.desktop
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment