2022-01-02 19:23:35 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
#
|
|
|
|
# EmulationStation Desktop Edition
|
|
|
|
# Windows_dependencies_setup_MinGW.sh
|
|
|
|
#
|
|
|
|
# Downloads and prepares the external dependencies for building in-tree.
|
|
|
|
# If the directories already exist they will be removed and the libraries will be downloaded again.
|
|
|
|
#
|
|
|
|
# This script needs to run from the root of the repository.
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ ! -f .clang-format ]; then
|
|
|
|
echo "You need to run this script from the root of the repository."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo -e "Setting up dependencies in the ./external directory..."
|
|
|
|
|
|
|
|
cd external
|
|
|
|
|
2022-06-29 15:22:50 +00:00
|
|
|
echo -e "\nSetting up curl"
|
2023-06-24 11:27:42 +00:00
|
|
|
rm -rf curl*
|
2022-01-02 19:23:35 +00:00
|
|
|
|
2023-06-24 11:27:42 +00:00
|
|
|
curl -O https://curl.se/windows/dl-8.1.2_3/curl-8.1.2_3-win64-mingw.zip
|
|
|
|
unzip curl-8.1.2_3-win64-mingw.zip
|
2022-10-30 11:34:57 +00:00
|
|
|
|
2023-06-24 11:27:42 +00:00
|
|
|
if [ ! -d curl-8.1.2_3-win64-mingw ]; then
|
2022-10-30 11:34:57 +00:00
|
|
|
echo "curl directory is missing, aborting."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2023-06-24 11:27:42 +00:00
|
|
|
mv curl-8.1.2_3-win64-mingw curl
|
|
|
|
|
|
|
|
cp -p curl/bin/libcurl-x64.dll ..
|
2022-01-02 19:23:35 +00:00
|
|
|
|
|
|
|
echo -e "\nSetting up GLEW"
|
2023-06-24 11:27:42 +00:00
|
|
|
rm -rf glew*
|
2022-01-02 19:23:35 +00:00
|
|
|
|
|
|
|
curl -LO https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.zip
|
|
|
|
unzip glew-2.1.0.zip
|
|
|
|
|
2022-12-15 19:36:43 +00:00
|
|
|
if [ ! -d glew-2.1.0 ]; then
|
|
|
|
echo "GLEW directory is missing, aborting."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2023-06-24 11:27:42 +00:00
|
|
|
mv glew-2.1.0 glew
|
|
|
|
|
2022-01-02 19:23:35 +00:00
|
|
|
echo -e "\nSetting up FreeType"
|
|
|
|
rm -rf freetype
|
|
|
|
|
|
|
|
git clone https://github.com/freetype/freetype.git
|
2022-10-30 11:34:57 +00:00
|
|
|
|
|
|
|
if [ ! -d freetype ]; then
|
|
|
|
echo "FreeType directory is missing, aborting."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2022-01-02 19:23:35 +00:00
|
|
|
cd freetype
|
2023-06-24 11:27:42 +00:00
|
|
|
git checkout VER-2-13-0
|
2022-01-02 19:23:35 +00:00
|
|
|
mkdir build
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo -e "\nSetting up FreeImage"
|
|
|
|
rm -rf FreeImage
|
|
|
|
|
|
|
|
curl -LO https://downloads.sourceforge.net/project/freeimage/Binary%20Distribution/3.18.0/FreeImage3180Win32Win64.zip
|
2022-02-27 14:25:41 +00:00
|
|
|
unzip FreeImage3180Win32Win64.zip
|
2022-10-30 11:34:57 +00:00
|
|
|
|
|
|
|
if [ ! -d FreeImage ]; then
|
|
|
|
echo "FreeImage directory is missing, aborting."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2022-01-02 19:23:35 +00:00
|
|
|
cp -p FreeImage/Dist/x64/FreeImage.dll ..
|
|
|
|
|
2023-03-21 22:22:07 +00:00
|
|
|
echo -e "\nSetting up libgit2"
|
|
|
|
rm -rf libgit2
|
|
|
|
|
|
|
|
git clone https://github.com/libgit2/libgit2.git
|
|
|
|
|
|
|
|
if [ ! -d libgit2 ]; then
|
|
|
|
echo "libgit2 directory is missing, aborting."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd libgit2
|
2023-06-24 11:27:42 +00:00
|
|
|
git checkout v1.6.4
|
2023-03-21 22:22:07 +00:00
|
|
|
mkdir build
|
|
|
|
cd ..
|
|
|
|
|
2023-06-24 11:27:42 +00:00
|
|
|
echo -e "\nSetting up Poppler"
|
|
|
|
rm -rf poppler*
|
|
|
|
|
|
|
|
curl -JO https://gitlab.com/es-de/emulationstation-de/-/package_files/83268133/download
|
|
|
|
unzip Poppler_Windows_MinGW_23.06.0-1.zip
|
|
|
|
|
|
|
|
if [ ! -d poppler ]; then
|
|
|
|
echo "Poppler directory is missing, aborting."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
cp -p poppler/Library/bin/*.dll ../es-pdf-converter
|
|
|
|
|
2022-01-02 19:23:35 +00:00
|
|
|
echo -e "\nSetting up pugixml"
|
|
|
|
rm -rf pugixml
|
|
|
|
|
2022-01-11 16:33:34 +00:00
|
|
|
git clone https://github.com/zeux/pugixml.git
|
2022-10-30 11:34:57 +00:00
|
|
|
|
|
|
|
if [ ! -d pugixml ]; then
|
|
|
|
echo "pugixml directory is missing, aborting."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2022-01-02 19:23:35 +00:00
|
|
|
cd pugixml
|
2023-06-24 11:27:42 +00:00
|
|
|
git checkout v1.13
|
2022-01-02 19:23:35 +00:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo -e "\nSetting up SDL"
|
2023-06-24 11:27:42 +00:00
|
|
|
rm -rf SDL2*
|
2022-01-02 19:23:35 +00:00
|
|
|
|
2023-04-09 12:12:28 +00:00
|
|
|
curl -O https://libsdl.org/release/SDL2-devel-2.26.5-mingw.tar.gz
|
2022-09-27 15:49:51 +00:00
|
|
|
|
2023-04-09 12:12:28 +00:00
|
|
|
tar xvzf SDL2-devel-2.26.5-mingw.tar.gz
|
2022-02-27 14:25:41 +00:00
|
|
|
# Needed due to some kind of file system race condition that sometimes occurs on Windows.
|
|
|
|
sleep 1
|
2022-10-30 11:34:57 +00:00
|
|
|
|
2023-04-09 12:12:28 +00:00
|
|
|
if [ ! -d SDL2-2.26.5 ]; then
|
2022-10-30 11:34:57 +00:00
|
|
|
echo "SDL directory is missing, aborting."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2023-06-24 11:27:42 +00:00
|
|
|
mv SDL2-2.26.5 SDL2
|
|
|
|
|
|
|
|
mv SDL2/x86_64-w64-mingw32/include/SDL2 SDL2/
|
|
|
|
cp -p SDL2/x86_64-w64-mingw32/lib/libSDL2main.a ..
|
|
|
|
cp -p SDL2/x86_64-w64-mingw32/bin/SDL2.dll ..
|
2022-01-02 19:23:35 +00:00
|
|
|
|
|
|
|
echo -e "\nSetting up FFmpeg"
|
2023-06-24 11:27:42 +00:00
|
|
|
rm -rf ffmpeg*
|
2022-01-02 19:23:35 +00:00
|
|
|
|
2022-09-27 15:49:51 +00:00
|
|
|
# This package should be available for download for two years.
|
2023-06-25 10:42:16 +00:00
|
|
|
curl -LO https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2023-05-31-12-47/ffmpeg-n6.0-22-g549430e14d-win64-gpl-shared-6.0.zip
|
|
|
|
unzip ffmpeg-n6.0-22-g549430e14d-win64-gpl-shared-6.0.zip
|
2022-10-30 11:34:57 +00:00
|
|
|
|
2023-06-25 10:42:16 +00:00
|
|
|
if [ ! -d ffmpeg-n6.0-22-g549430e14d-win64-gpl-shared-6.0 ]; then
|
2022-10-30 11:34:57 +00:00
|
|
|
echo "FFmpeg directory is missing, aborting."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2023-06-25 10:42:16 +00:00
|
|
|
mv ffmpeg-n6.0-22-g549430e14d-win64-gpl-shared-6.0 ffmpeg
|
2023-06-24 11:27:42 +00:00
|
|
|
|
2023-06-25 10:42:16 +00:00
|
|
|
cp -p ffmpeg/bin/avcodec-60.dll ..
|
|
|
|
cp -p ffmpeg/bin/avfilter-9.dll ..
|
|
|
|
cp -p ffmpeg/bin/avformat-60.dll ..
|
|
|
|
cp -p ffmpeg/bin/avutil-58.dll ..
|
|
|
|
cp -p ffmpeg/bin/postproc-57.dll ..
|
2023-06-24 11:27:42 +00:00
|
|
|
cp -p ffmpeg/bin/swresample-4.dll ..
|
2023-06-25 10:42:16 +00:00
|
|
|
cp -p ffmpeg/bin/swscale-7.dll ..
|
2022-01-02 19:23:35 +00:00
|
|
|
|
|
|
|
echo -e "\nSetting up OpenSSL"
|
|
|
|
|
|
|
|
if [ ! -f /c/Program\ Files/OpenSSL-Win64/libcrypto-1_1-x64.dll ]; then
|
|
|
|
curl -O https://slproweb.com/download/Win64OpenSSL_Light-1_1_1m.exe
|
|
|
|
# Run the installer.
|
|
|
|
./Win64OpenSSL_Light-1_1_1m.exe
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Return to the root of the repository.
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
cp -p /c/Program\ Files/OpenSSL-Win64/libcrypto-1_1-x64.dll .
|
|
|
|
cp -p /c/Program\ Files/OpenSSL-Win64/libssl-1_1-x64.dll .
|
|
|
|
|
|
|
|
echo -e "\nCopying DLL files from Windows\System32"
|
|
|
|
|
|
|
|
cp /c/Windows/System32/vcomp140.dll .
|
2022-10-30 11:34:57 +00:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Done setting up all dependencies."
|