mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-24 10:22:19 -05:00
add SHIP_HOME (Linux) (#1210)
This commit is contained in:
parent
e12e1d67c6
commit
ed1708508a
@ -316,6 +316,12 @@ namespace Ship {
|
|||||||
return fpath;
|
return fpath;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
char* fpath = std::getenv("SHIP_HOME");
|
||||||
|
if (fpath != NULL)
|
||||||
|
return std::string(fpath);
|
||||||
|
#endif
|
||||||
|
|
||||||
return ".";
|
return ".";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,14 +5,18 @@ export PATH="$HERE"/bin:"$HERE"/usr/bin:"$PATH"
|
|||||||
export LD_LIBRARY_PATH="$HERE"/usr/lib:"$LD_LIBRARY_PATH"
|
export LD_LIBRARY_PATH="$HERE"/usr/lib:"$LD_LIBRARY_PATH"
|
||||||
export ZENITY=$(command -v zenity)
|
export ZENITY=$(command -v zenity)
|
||||||
|
|
||||||
while [[ ! -e "$PWD"/oot.otr ]]; do
|
if [ -z ${SHIP_HOME+x} ]; then
|
||||||
|
export SHIP_HOME=$PWD
|
||||||
|
fi
|
||||||
|
|
||||||
|
while [[ ! -e "$SHIP_HOME"/oot.otr ]]; do
|
||||||
export ASSETDIR="$(mktemp -d /tmp/assets-XXXXX)"
|
export ASSETDIR="$(mktemp -d /tmp/assets-XXXXX)"
|
||||||
ln -s "$HERE"/usr/bin/{assets,soh.elf,OTRGui} "$ASSETDIR"
|
ln -s "$HERE"/usr/bin/{assets,soh.elf,OTRGui} "$ASSETDIR"
|
||||||
export OLDPWD="$PWD"
|
export OLDPWD="$PWD"
|
||||||
mkdir -p "$ASSETDIR"/tmp
|
mkdir -p "$ASSETDIR"/tmp
|
||||||
mkdir -p "$ASSETDIR"/Extract/assets
|
mkdir -p "$ASSETDIR"/Extract/assets
|
||||||
if [ -e "$PWD"/*.*64 ]; then
|
if [ -e "$SHIP_HOME"/*.*64 ]; then
|
||||||
ln -s "$OLDPWD"/*.*64 "$ASSETDIR"/tmp/rom.z64
|
ln -s "$SHIP_HOME"/*.*64 "$ASSETDIR"/tmp/rom.z64
|
||||||
cp -r "$ASSETDIR"/assets/game/ship_of_harkinian "$ASSETDIR"/Extract/assets/
|
cp -r "$ASSETDIR"/assets/game/ship_of_harkinian "$ASSETDIR"/Extract/assets/
|
||||||
cd "$ASSETDIR"
|
cd "$ASSETDIR"
|
||||||
ROMHASH=$(sha1sum -b "$ASSETDIR"/tmp/rom.z64 | awk '{ print $1 }')
|
ROMHASH=$(sha1sum -b "$ASSETDIR"/tmp/rom.z64 | awk '{ print $1 }')
|
||||||
@ -36,22 +40,19 @@ while [[ ! -e "$PWD"/oot.otr ]]; do
|
|||||||
echo "Processing..."
|
echo "Processing..."
|
||||||
fi
|
fi
|
||||||
assets/extractor/ZAPD.out ed -eh -i assets/extractor/xmls/"${ROM}" -b tmp/rom.z64 -fl assets/extractor/filelists -o placeholder -osf placeholder -gsf 1 -rconf assets/extractor/Config_"${ROM}".xml -se OTR > /dev/null 2>&1
|
assets/extractor/ZAPD.out ed -eh -i assets/extractor/xmls/"${ROM}" -b tmp/rom.z64 -fl assets/extractor/filelists -o placeholder -osf placeholder -gsf 1 -rconf assets/extractor/Config_"${ROM}".xml -se OTR > /dev/null 2>&1
|
||||||
cp "$ASSETDIR"/oot.otr "$OLDPWD"
|
cp "$ASSETDIR"/oot.otr "$SHIP_HOME"
|
||||||
echo "Restart $APPIMAGE to play!"
|
echo "Restart $APPIMAGE to play!"
|
||||||
sleep 3
|
sleep 3
|
||||||
rm -r "$ASSETDIR"
|
rm -r "$ASSETDIR"
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
if [ -n "$ZENITY" ]; then
|
if [ -n "$ZENITY" ]; then
|
||||||
zenity --error --timeout=5 --text="Place ROM in $OWD" --title="Missing ROM file" --width=500 --width=200
|
zenity --error --timeout=5 --text="Place ROM in $SHIP_HOME" --title="Missing ROM file" --width=500 --width=200
|
||||||
else
|
else
|
||||||
echo -e "\nPlace ROM in this folder\n"
|
echo -e "\nPlace ROM in this folder\n"
|
||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
cd "$OWD"
|
(cd "$HERE/usr/bin"; ./soh.elf)
|
||||||
ln -s "$HERE"/usr/bin/gamecontrollerdb.txt "$PWD"
|
|
||||||
"$HERE"/usr/bin/soh.elf
|
|
||||||
unlink "$PWD"/gamecontrollerdb.txt
|
|
||||||
exit
|
exit
|
||||||
|
Loading…
Reference in New Issue
Block a user