forked from lovell/sharp-libvips
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwin.sh
executable file
·55 lines (43 loc) · 1.2 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
VARIANT=static
case "${PLATFORM#*-}" in
x64) ARCH=w64 ;;
x64.net452)
ARCH=w64
VARIANT=static-ffi
;;
x86) ARCH=w32 ;;
x86.net452)
ARCH=w32
VARIANT=static-ffi
;;
arm64) ARCH=arm64 ;;
esac
FILENAME="vips-dev-${ARCH}-web-${VERSION_VIPS}-${VARIANT}.zip"
URL="https://github.com/libvips/build-win64-mxe/releases/download/v${VERSION_VIPS}/${FILENAME}"
echo "Downloading $URL"
$CURL -O $URL
unzip $FILENAME
cd /vips/vips-dev-${VERSION_VIPS_SHORT}
# Move DLLs to the lib directory
cp bin/*.dll lib/
# Add third-party notices
$CURL -O https://raw.githubusercontent.com/kleisauke/libvips-packaging/main/THIRD-PARTY-NOTICES.md
# Create tarball
tar czf /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz \
include \
lib/glib-2.0 \
lib/*.{dll,lib} \
versions.json \
THIRD-PARTY-NOTICES.md
# Allow tarballs to be read outside container
chmod 644 /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz
# Remove working directories
rm -rf lib include versions.json THIRD-PARTY-NOTICES.md