unigine-superposition.sh 1.72 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/bin/sh -x

# It will be run with two args: buildroot spec
BUILDROOT="$1"
SPEC="$2"

PRODUCT=unigine-superposition
PRODUCTDIR=/opt/unigine-superposition

. $(dirname $0)/common.sh

# move subdirs
mkdir -p $BUILDROOT$PRODUCTDIR/
for i in bin data docs ; do
    mv $BUILDROOT/$i $BUILDROOT$PRODUCTDIR/$i
    subst "s|\"/$i/|\"$PRODUCTDIR/$i/|" $SPEC
done

cd $BUILDROOT/$PRODUCTDIR || fatal
20

21 22 23 24 25
#if epm assure patchelf ; then
#for i in bin/lib*.so bin/qt/lib/lib*.so*; do
#    a= patchelf --set-rpath '$ORIGIN' $i
#done
#fi
26 27 28

# pack icons
for i in 16 24 32 48 64 128 256 ; do
29
    install_file /icons/superposition_icon_$i.png /usr/share/icons/hicolor/${i}x${i}/apps/$PRODUCT.png
30 31 32 33 34 35 36 37 38 39 40
done
remove_dir /icons

# FIXME:
install_file /Superposition $PRODUCTDIR/Superposition
remove_file /Superposition
remove_file /Superposition.png
remove_file /postinstall.sh
remove_file /uninstall.sh
remove_file /version

41 42 43
pack_dir $PRODUCTDIR
pack_dir $PRODUCTDIR/bin

44
# use internal libcrypto.so
45
# lib.req: ERROR: .../opt/unigine-superposition/bin/qt/lib/libssl.so: library libcrypto.so.1.0.0 not found
46
a= patchelf --remove-needed libcrypto.so.1.0.0 $BUILDROOT$PRODUCTDIR/bin/qt/lib/libssl.so
47
a= patchelf --add-needed libcrypto.so $BUILDROOT$PRODUCTDIR/bin/qt/lib/libssl.so
48

49 50 51
# there is no libQt5Test.so.5
remove_file $PRODUCTDIR/bin/qt/lib/libQt5QuickTest.so.5

52 53 54
add_bin_exec_command superposition $PRODUCTDIR/bin/launcher
add_bin_link_command $PRODUCT /usr/bin/superposition

Vitaly Lipatov's avatar
Vitaly Lipatov committed
55
cat <<EOF | create_file /usr/share/applications/$PRODUCT.desktop
56 57 58 59 60 61 62 63 64 65 66
[Desktop Entry]
Version=1.0
Type=Application
Name=Unigine Superposition 2017 Benchmark
GenericName=A GPU Stress test tool from the UNIGINE
Icon=$PRODUCT
Exec=superposition
Terminal=false
Categories=Launcher;Benchmark;
EOF

67
add_libs_requires