Prechádzať zdrojové kódy

Updated Packaging Windows from Linux for parity

Phallacy 6 rokov pred
rodič
commit
4e7675e78f

+ 36 - 1
deployment/win-x64/package.sh

@@ -1,9 +1,44 @@
 #!/usr/bin/env bash
+package_win64() (
+    local NSSM_URL="https://nssm.cc/ci/nssm-2.24-101-g897c7ad.zip"
+    local FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-4.0.2-win64-static.zip"
+    local ROOT=${1-$DEFAULT_ROOT}
+    local OUTPUT_DIR=${2-$DEFAULT_OUTPUT_DIR}
+    local PKG_DIR=${3-$DEFAULT_PKG_DIR}
+    local ARCHIVE_CMD="zip -r"
+    # Package portable build result
+    if [ -d ${OUTPUT_DIR} ]; then      
+        echo -e "${CYAN}Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}'.${NC}"
+        local TEMP_DIR="$(mktemp -d)" 
+        wget ${NSSM_URL} -O ${TEMP_DIR}/nssm.zip
+        wget ${FFMPEG_URL} -O ${TEMP_DIR}/ffmpeg.zip
+        unzip ${TEMP_DIR}/nssm.zip -d $TEMP_DIR
+        cp ${TEMP_DIR}/nssm-2.24-101-g897c7ad/win64/nssm.exe ${OUTPUT_DIR}/nssm.exe
+        unzip ${TEMP_DIR}/ffmpeg.zip -d $TEMP_DIR
+        cp ${TEMP_DIR}/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe ${OUTPUT_DIR}/ffmpeg.exe
+        cp ${TEMP_DIR}/ffmpeg-4.0.2-win64-static/bin/ffprobe.exe ${OUTPUT_DIR}/ffprobe.exe
+        rm -r ${TEMP_DIR}
+        cp ${ROOT}/deployment/win-generic/install-jellyfin.ps1 ${OUTPUT_DIR}/install-jellyfin.ps1
+        cp ${ROOT}/deployment/win-generic/install.bat ${OUTPUT_DIR}/install.bat
+        mkdir -p ${PKG_DIR}
+        pushd ${OUTPUT_DIR} 
+        ${ARCHIVE_CMD} ${ROOT}/${PKG_DIR}/`basename "${OUTPUT_DIR}"`.zip .
+        popd
+        local EXIT_CODE=$?
+        if [ $EXIT_CODE -eq 0 ]; then
+            echo -e "${GREEN}[DONE] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' complete.${NC}"
+        else
+            echo -e "${RED}[FAIL] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' FAILED.${NC}"
+        fi       
+    else
+        echo -e "${RED}[FAIL] Build artifacts do not exist for ${OUTPUT_DIR}. Run build.sh first.${NC}"
+    fi
+)
 
 source ../common.build.sh
 
 VERSION=`get_version ../..`
 
-package_portable ../.. `pwd`/dist/jellyfin_${VERSION}
+package_win64 ../.. `pwd`/dist/jellyfin_${VERSION}
 
 #TODO setup and maybe change above code to produce the Windows native zip format.

+ 36 - 2
deployment/win-x86/package.sh

@@ -1,9 +1,43 @@
 #!/usr/bin/env bash
-
+package_win32() (
+    local NSSM_URL="https://nssm.cc/ci/nssm-2.24-101-g897c7ad.zip"
+    local FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-4.0.2-win32-static.zip"
+    local ROOT=${1-$DEFAULT_ROOT}
+    local OUTPUT_DIR=${2-$DEFAULT_OUTPUT_DIR}
+    local PKG_DIR=${3-$DEFAULT_PKG_DIR}
+    local ARCHIVE_CMD="zip -r"
+    # Package portable build result
+    if [ -d ${OUTPUT_DIR} ]; then      
+        echo -e "${CYAN}Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}'.${NC}"
+        local TEMP_DIR="$(mktemp -d)" 
+        wget ${NSSM_URL} -O ${TEMP_DIR}/nssm.zip
+        wget ${FFMPEG_URL} -O ${TEMP_DIR}/ffmpeg.zip
+        unzip ${TEMP_DIR}/nssm.zip -d $TEMP_DIR
+        cp ${TEMP_DIR}/nssm-2.24-101-g897c7ad/win32/nssm.exe ${OUTPUT_DIR}/nssm.exe
+        unzip ${TEMP_DIR}/ffmpeg.zip -d $TEMP_DIR
+        cp ${TEMP_DIR}/ffmpeg-4.0.2-win32-static/bin/ffmpeg.exe ${OUTPUT_DIR}/ffmpeg.exe
+        cp ${TEMP_DIR}/ffmpeg-4.0.2-win32-static/bin/ffprobe.exe ${OUTPUT_DIR}/ffprobe.exe
+        rm -r ${TEMP_DIR}
+        cp ${ROOT}/deployment/win-generic/install-jellyfin.ps1 ${OUTPUT_DIR}/install-jellyfin.ps1
+        cp ${ROOT}/deployment/win-generic/install.bat ${OUTPUT_DIR}/install.bat
+        mkdir -p ${PKG_DIR}
+        pushd ${OUTPUT_DIR} 
+        ${ARCHIVE_CMD} ${ROOT}/${PKG_DIR}/`basename "${OUTPUT_DIR}"`.zip .
+        popd
+        local EXIT_CODE=$?
+        if [ $EXIT_CODE -eq 0 ]; then
+            echo -e "${GREEN}[DONE] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' complete.${NC}"
+        else
+            echo -e "${RED}[FAIL] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' FAILED.${NC}"
+        fi       
+    else
+        echo -e "${RED}[FAIL] Build artifacts do not exist for ${OUTPUT_DIR}. Run build.sh first.${NC}"
+    fi
+)
 source ../common.build.sh
 
 VERSION=`get_version ../..`
 
-package_portable ../.. `pwd`/dist/jellyfin_${VERSION}
+package_win32 ../.. `pwd`/dist/jellyfin_${VERSION}
 
 #TODO setup and maybe change above code to produce the Windows native zip format.