Skip to content

Commit

Permalink
add workaround for mono bug with armv5
Browse files Browse the repository at this point in the history
  • Loading branch information
hgy59 committed Feb 4, 2020
1 parent e62d5b4 commit 1bc3d97
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
8 changes: 6 additions & 2 deletions spk/jackett/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
service_prestart ()
{
# Replace generic service startup

MONO_PATH="${SYNOPKG_PKGDEST}/../mono/bin"
PATH="${SYNOPKG_PKGDEST}/bin:${MONO_PATH}:${PATH}"
MONO="${MONO_PATH}/mono"
JACKETT="${SYNOPKG_PKGDEST}/share/${SYNOPKG_PKGNAME}/JackettConsole.exe"
HOME_DIR="${SYNOPKG_PKGDEST}/var"

# workaround for mono bug with armv5 (https://github.com/mono/mono/issues/12537)
if [ "$SYNOPKG_DSM_ARCH" == "88f8621" -o "$SYNOPKG_DSM_ARCH" == "88f8622" ]; then
MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO_PATH}/mono"
fi

echo "Starting Jackett as user ${EFF_USER}" >> ${LOG_FILE}
COMMAND="env HOME=${HOME_DIR} PATH=${PATH} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${MONO} ${JACKETT} --PIDFile ${PID_FILE}"

Expand All @@ -30,5 +34,5 @@ service_postinst ()
$BIN/delgroup "${USER}" "users" >> ${INST_LOG}
$BIN/deluser "${USER}" >> ${INST_LOG}

echo "service_postinst ${SYNOPKG_PKG_STATUS}" >> $INST_LOG
echo "service_postinst ${SYNOPKG_PKG_STATUS}" >> ${INST_LOG}
}
9 changes: 7 additions & 2 deletions spk/lidarr/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PATH="${SYNOPKG_PKGDEST}/bin:${PATH}"
MONO_PATH="/usr/local/mono/bin"
MONO_PATH="${SYNOPKG_PKGDEST}/../mono/bin"
MONO="${MONO_PATH}/mono"

# Check versions during upgrade
Expand All @@ -14,6 +14,11 @@ PID_FILE="${CONFIG_DIR}/Lidarr/lidarr.pid"
# Some have it stored in the root of package
LEGACY_CONFIG_DIR="${SYNOPKG_PKGDEST}/.config"

# workaround for mono bug with armv5 (https://github.com/mono/mono/issues/12537)
if [ "$SYNOPKG_DSM_ARCH" == "88f8621" -o "$SYNOPKG_DSM_ARCH" == "88f8622" ]; then
MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO_PATH}/mono"
fi

GROUP="sc-download"

SERVICE_COMMAND="env PATH=${MONO_PATH}:${PATH} HOME=${HOME_DIR} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${MONO} ${LIDARR}"
Expand Down Expand Up @@ -46,7 +51,7 @@ service_preupgrade ()

service_postupgrade ()
{
# Restore Current Lidarr Binary If Current Ver. >= SPK Ver.
# Restore Current Lidarr Binary if Current Ver. >= SPK Ver.
. ${CONFIG_DIR}/KEEP_VAR
if [ "$KEEP_CUR" == "yes" ]; then
echo "Restoring Lidarr version from before upgrade" >> ${INST_LOG}
Expand Down
9 changes: 7 additions & 2 deletions spk/radarr/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PATH="${SYNOPKG_PKGDEST}/bin:${PATH}"
MONO_PATH="/usr/local/mono/bin"
MONO_PATH="${SYNOPKG_PKGDEST}/../mono/bin"
MONO="${MONO_PATH}/mono"

# Check versions during upgrade
Expand All @@ -14,6 +14,11 @@ PID_FILE="${CONFIG_DIR}/Radarr/nzbdrone.pid"
# Some have it stored in the root of package
LEGACY_CONFIG_DIR="${SYNOPKG_PKGDEST}/.config"

# workaround for mono bug with armv5 (https://github.com/mono/mono/issues/12537)
if [ "$SYNOPKG_DSM_ARCH" == "88f8621" -o "$SYNOPKG_DSM_ARCH" == "88f8622" ]; then
MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO_PATH}/mono"
fi

GROUP="sc-download"
LEGACY_GROUP="sc-media"

Expand Down Expand Up @@ -68,7 +73,7 @@ service_preupgrade ()

service_postupgrade ()
{
# Restore Current Radarr Binary If Current Ver. >= SPK Ver.
# Restore Current Radarr Binary if Current Ver. >= SPK Ver.
. ${CONFIG_DIR}/KEEP_VAR
if [ "$KEEP_CUR" == "yes" ]; then
echo "Restoring Radarr version from before upgrade" >> ${INST_LOG}
Expand Down
7 changes: 6 additions & 1 deletion spk/sonarr/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PATH="${SYNOPKG_PKGDEST}/bin:${PATH}"
MONO_PATH="/usr/local/mono/bin"
MONO_PATH="${SYNOPKG_PKGDEST}/../mono/bin"
MONO="${MONO_PATH}/mono"

# Sonarr uses the home directory to store it's ".config"
Expand Down Expand Up @@ -29,6 +29,11 @@ fi
# Some have it stored in the root of package
LEGACY_CONFIG_DIR="${SYNOPKG_PKGDEST}/.config"

# workaround for mono bug with armv5 (https://github.com/mono/mono/issues/12537)
if [ "$SYNOPKG_DSM_ARCH" == "88f8621" -o "$SYNOPKG_DSM_ARCH" == "88f8622" ]; then
MONO="MONO_ENV_OPTIONS='-O=-aot,-float32' ${MONO_PATH}/mono"
fi

GROUP="sc-download"
LEGACY_GROUP="sc-media"

Expand Down

0 comments on commit 1bc3d97

Please sign in to comment.