-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
package-nuget-win.sh
108 lines (88 loc) · 3.18 KB
/
package-nuget-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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/usr/bin/env bash
set -e
version=${1:?"Usage: $0 <libvlc version>"}
downloadUrlx86="https://get.videolan.org/vlc/$version/win32/vlc-$version-win32.7z"
downloadUrlx64="https://get.videolan.org/vlc/$version/win64/vlc-$version-win64.7z"
packageName="VideoLAN.LibVLC.Windows"
packageNameGPL="VideoLAN.LibVLC.Windows.GPL"
x86PluginsLocation="build/win7-x86/native/plugins"
x64PluginsLocation="build/win7-x64/native/plugins"
# GPL plugin list
gpl_plugins=(
"access/libaccess_realrtsp_plugin.dll"
"access/libdvdnav_plugin.dll"
"access/libdvdread_plugin.dll"
"access/libvnc_plugin.dll"
"access/libdshow_plugin.dll"
"audio_filter/libmad_plugin.dll"
"audio_filter/libmono_plugin.dll"
"audio_filter/libsamplerate_plugin.dll"
"codec/liba52_plugin.dll"
"codec/libaribsub_plugin.dll"
"codec/libdca_plugin.dll"
"codec/libfaad_plugin.dll"
"codec/liblibmpeg2_plugin.dll"
"codec/libt140_plugin.dll"
"codec/libx264_plugin.dll"
"codec/libx265_plugin.dll"
"control"
"demux/libmpc_plugin.dll"
"demux/libreal_plugin.dll"
"demux/libsid_plugin.dll"
"gui"
"logger/libfile_logger_plugin.dll"
"misc/libaudioscrobbler_plugin.dll"
"misc/libexport_plugin.dll"
"misc/liblogger_plugin.dll"
"misc/libstats_plugin.dll"
"misc/libvod_rtsp_plugin.dll"
"packetizer/libpacketizer_a52_plugin.dll"
"services_discovery/libmediadirs_plugin.dll"
"services_discovery/libpodcast_plugin.dll"
"services_discovery/libsap_plugin.dll"
"stream_out/libstream_out_cycle_plugin.dll"
"stream_out/libstream_out_rtp_plugin.dll"
"video_filter/libpostproc_plugin.dll"
"video_filter/librotate_plugin.dll"
)
# echo "downloading x86 binaries..." $downloadUrlx86
curl -Lsfo x86.7z $downloadUrlx86
# echo "downloading x64 binaries..." $downloadUrlx64
curl -Lsfo x64.7z $downloadUrlx64
if [ ! -f "nuget.exe" ]; then
echo "downloading NuGet..."
curl -Lsfo nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
fi
echo "unzipping vlc..."
7z x x86.7z -o./x86
7z x x64.7z -o./x64
echo "copying x86 dlls, libs and headers files..."
mkdir -p build/win7-x86/native/
cp -R ./x86/vlc-$version/{libvlc.dll,libvlccore.dll,hrtfs,lua,plugins} build/win7-x86/native/
cp ./x86/vlc-$version/sdk/lib/{libvlc.lib,libvlccore.lib,vlc.lib,vlccore.lib} build/win7-x86/native/
cp -R ./x86/vlc-$version/sdk/include build/win7-x86/native/
echo "copying x64 dlls, libs and headers files..."
mkdir -p build/win7-x64/native/
cp -R ./x64/vlc-$version/{libvlc.dll,libvlccore.dll,hrtfs,lua,plugins} build/win7-x64/native/
cp ./x64/vlc-$version/sdk/lib/{libvlc.lib,libvlccore.lib,vlc.lib,vlccore.lib} build/win7-x64/native/
cp -R ./x64/vlc-$version/sdk/include build/win7-x64/native/
echo "packaging GPL version..."
mono nuget.exe pack "$packageNameGPL".nuspec -Version "$version"
echo "removing GPL plugins from x86..."
# remove x86 GPL plugins
for file in "${gpl_plugins[@]}"; do
rm -rf "$x86PluginsLocation/$file"
done
echo "removing GPL plugins from x64..."
# remove x64 GPL plugins
for file in "${gpl_plugins[@]}"; do
rm -rf "$x64PluginsLocation/$file"
done
echo "packaging LGPL version..."
mono nuget.exe pack "$packageName".nuspec -Version "$version"
echo "cleaning up..."
rm ./x86.7z
rm -rf ./x86
rm ./x64.7z
rm -rf ./x64
echo "done"