Skip to content

Commit

Permalink
Extract $VERSION for dependency scripts
Browse files Browse the repository at this point in the history
This will allow to update the version only once in these files.
  • Loading branch information
rom1v committed Nov 25, 2023
1 parent 2370298 commit 825d7f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
24 changes: 13 additions & 11 deletions app/prebuilt-deps/prepare-libusb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ cd "$DIR"
mkdir -p "$PREBUILT_DATA_DIR"
cd "$PREBUILT_DATA_DIR"

DEP_DIR=libusb-1.0.26
VERSION=1.0.26
DEP_DIR="libusb-$VERSION"

FILENAME=libusb-1.0.26-binaries.7z
FILENAME="libusb-$VERSION-binaries.7z"
SHA256SUM=9c242696342dbde9cdc47239391f71833939bf9f7aa2bbb28cdaabe890465ec5

if [[ -d "$DEP_DIR" ]]
Expand All @@ -17,20 +18,21 @@ then
exit 0
fi

get_file "https://github.com/libusb/libusb/releases/download/v1.0.26/$FILENAME" "$FILENAME" "$SHA256SUM"
get_file "https://github.com/libusb/libusb/releases/download/v$VERSION/$FILENAME" \
"$FILENAME" "$SHA256SUM"

mkdir "$DEP_DIR"
cd "$DEP_DIR"

7z x "../$FILENAME" \
libusb-1.0.26-binaries/libusb-MinGW-Win32/ \
libusb-1.0.26-binaries/libusb-MinGW-Win32/ \
libusb-1.0.26-binaries/libusb-MinGW-x64/ \
libusb-1.0.26-binaries/libusb-MinGW-x64/

mv libusb-1.0.26-binaries/libusb-MinGW-Win32 .
mv libusb-1.0.26-binaries/libusb-MinGW-x64 .
rm -rf libusb-1.0.26-binaries
"libusb-$VERSION-binaries/libusb-MinGW-Win32/" \
"libusb-$VERSION-binaries/libusb-MinGW-Win32/" \
"libusb-$VERSION-binaries/libusb-MinGW-x64/" \
"libusb-$VERSION-binaries/libusb-MinGW-x64/"

mv "libusb-$VERSION-binaries/libusb-MinGW-Win32" .
mv "libusb-$VERSION-binaries/libusb-MinGW-x64" .
rm -rf "libusb-$VERSION-binaries"

# Rename the dll to get the same library name on all platforms
mv libusb-MinGW-Win32/bin/msys-usb-1.0.dll libusb-MinGW-Win32/bin/libusb-1.0.dll
Expand Down
8 changes: 5 additions & 3 deletions app/prebuilt-deps/prepare-sdl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ cd "$DIR"
mkdir -p "$PREBUILT_DATA_DIR"
cd "$PREBUILT_DATA_DIR"

DEP_DIR=SDL2-2.28.4
VERSION=2.28.4
DEP_DIR="SDL2-$VERSION"

FILENAME=SDL2-devel-2.28.4-mingw.tar.gz
FILENAME="SDL2-devel-$VERSION-mingw.tar.gz"
SHA256SUM=779d091072cf97291f80030f5232d97aa3d48ab0f2c14fe0b9d9a33c593cdc35

if [[ -d "$DEP_DIR" ]]
Expand All @@ -17,7 +18,8 @@ then
exit 0
fi

get_file "https://github.com/libsdl-org/SDL/releases/download/release-2.28.4/$FILENAME" "$FILENAME" "$SHA256SUM"
get_file "https://github.com/libsdl-org/SDL/releases/download/release-$VERSION/$FILENAME" \
"$FILENAME" "$SHA256SUM"

mkdir "$DEP_DIR"
cd "$DEP_DIR"
Expand Down

0 comments on commit 825d7f7

Please sign in to comment.