-
Notifications
You must be signed in to change notification settings - Fork 98
/
win.sh
executable file
·55 lines (44 loc) · 1.17 KB
/
win.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
set -e
VERSION_VIPS_SHORT=${VERSION_VIPS%.[[:digit:]]*}
# Common options for curl
CURL="curl --silent --location --retry 3 --retry-max-time 30"
# Fetch and unzip
mkdir /vips
cd /vips
case ${PLATFORM} in
*arm64v8)
ARCH=arm64
;;
*x64)
ARCH=w64
;;
*ia32)
ARCH=w32
;;
esac
FILENAME="vips-dev-${ARCH}-web-${VERSION_VIPS}-static.zip"
URL="https://github.com/libvips/build-win64-mxe/releases/download/v${VERSION_VIPS}/${FILENAME}"
echo "Downloading $URL"
$CURL -O $URL
unzip $FILENAME
# Clean and zip
cd /vips/vips-dev-${VERSION_VIPS_SHORT}
rm bin/libvips-cpp-42.dll
cp bin/*.dll lib/
# Create platform.json
printf "\"${PLATFORM}\"" >platform.json
# Add third-party notices
$CURL -O https://raw.githubusercontent.com/lovell/sharp-libvips/main/THIRD-PARTY-NOTICES.md
echo "Creating tarball"
tar czf /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz \
include \
lib/glib-2.0 \
lib/libvips.lib \
lib/*.dll \
*.json \
THIRD-PARTY-NOTICES.md
# Allow tarballs to be read outside container
chmod 644 /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.*
# Remove working directories
rm -rf lib include *.json THIRD-PARTY-NOTICES.md