mirror of
https://github.com/diddlesnaps/makemkv.git
synced 2026-04-22 23:12:02 -04:00
Re-add makemkv-launch script
* Set ccextractor path if unset. Fixes #11 * Set default save path to `$HOME/movies`. Fixes #10 Signed-off-by: Daniel Llewellyn <diddledan@ubuntu.com>
This commit is contained in:
32
scripts/makemkv-launch
Executable file
32
scripts/makemkv-launch
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh -e
|
||||
if [ ! -f $SNAP_USER_DATA/.MakeMKV/settings.conf ]; then
|
||||
mkdir -p $SNAP_USER_DATA/.MakeMKV
|
||||
|
||||
cat > $SNAP_USER_DATA/.MakeMKV/settings.conf <<SEOF
|
||||
#
|
||||
# MakeMKV settings file, written by MakeMKV v1.14.5 linux(x64-release)
|
||||
#
|
||||
|
||||
app_DestinationDir = "$SNAP_REAL_HOME/movies"
|
||||
app_DestinationType = "2"
|
||||
app_Java = "/snap/makemkv/current/usr/bin/java"
|
||||
app_Key = ""
|
||||
app_PreferredLanguage = ""
|
||||
app_ccextractor = "/snap/makemkv/current/usr/bin/ccextractor"
|
||||
dvd_MinimumTitleLength = "300"
|
||||
sdf_Stop = ""
|
||||
SEOF
|
||||
|
||||
else
|
||||
if grep -q 'app_DestinationDir = ""' $SNAP_USER_DATA/.MakeMKV/settings.conf; then
|
||||
sed -i -E 's|(app_DestinationDir = )""|\1"'"$SNAP_REAL_HOME/movies"'"|' $SNAP_USER_DATA/.MakeMKV/settings.conf
|
||||
fi
|
||||
if grep -q 'app_Java = ""' $SNAP_USER_DATA/.MakeMKV/settings.conf; then
|
||||
sed -i -E 's|(app_Java = )""|\1"/snap/makemkv/current/usr/bin/java"|' $SNAP_USER_DATA/.MakeMKV/settings.conf
|
||||
fi
|
||||
if grep -q 'app_ccextractor = ""' $SNAP_USER_DATA/.MakeMKV/settings.conf; then
|
||||
sed -i -E 's|(app_ccextractor = )""|\1"/snap/makemkv/current/usr/bin/ccextractor"|' $SNAP_USER_DATA/.MakeMKV/settings.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
exec $@
|
||||
@@ -64,6 +64,7 @@ apps:
|
||||
command-chain:
|
||||
- bin/desktop-launch
|
||||
- bin/check-ld-cache
|
||||
- bin/makemkv-launch
|
||||
- bin/snapcraft-preload
|
||||
desktop: usr/share/applications/makemkv.desktop
|
||||
environment:
|
||||
@@ -88,6 +89,7 @@ apps:
|
||||
command: usr/bin/makemkvcon
|
||||
command-chain:
|
||||
- bin/check-ld-cache
|
||||
- bin/makemkv-launch
|
||||
- bin/snapcraft-preload
|
||||
environment:
|
||||
FINAL_BINARY: $SNAP/usr/bin/makemkvcon.real
|
||||
@@ -259,7 +261,7 @@ parts:
|
||||
snapcraftctl build
|
||||
|
||||
JDK=$(find /usr/lib/jvm -type d -name "java-11-openjdk-*" | head -n1 | xargs basename)
|
||||
JDKBIN=../lib/jvm/$JDK/jre/bin
|
||||
JDKBIN=../lib/jvm/$JDK/bin
|
||||
for exec in java javaws jexec jjs; do
|
||||
ln -sf $JDKBIN/$exec $SNAPCRAFT_PART_INSTALL/usr/bin/$exec
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user