This repository was archived by the owner on Feb 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-plugins
executable file
·90 lines (74 loc) · 2 KB
/
make-plugins
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
#!/bin/sh
###################
# Variables setup #
###################
vdr=VDR-NG
plugins=VDR-Plugins/Source+patch
vdr_plugins=$vdr/PLUGINS/src
vdr_plugins_lib=$vdr/PLUGINS/lib
TC_bin=`pwd`/VDR-NG-FW/m7x0_xtc_uclibc_`uname`-`uname -m`/bin
#############
# Functions #
#############
# patches a plugin from a given patch-dir. only vdr-m7x0-plugin.patch file is patched with patch -p1
# usage: patch_plugin <dest dir> <patchdir>
patch_plugin() {
for patch_file in `find $2 -type f -iname 'vdr-m7x0-plugin.patch' | sort` ; do \
patch -p1 -E -d $1 < $patch_file ; \
done
}
# Check ToolChain directory
if [ ! -d "$TC_bin" ]
then
echo "ToolChain-bin dir not found: $TC_bin" 1>&2
exit 1
else
export PATH="$TC_bin:$PATH"
fi
# Firmware type selection
echo "Firmware type? 1-Pro/Lite 2-RootFS [Default: 1] : "
read response
if test "$response" = "2"
then
firmware_type="rootfs"
fi
# Update VDR-NG and plugins from SVN open7x0.org from SVN open7x0.org
if [ ! -d "$vdr" ]
then
./make-vdr "$firmware_type"
echo "CHECKOUT: $vdr_plugins"
rm -rf $vdr_plugins/
mkdir $vdr_plugins/
svn checkout -q "svn://open7x0.org/vdr-m7x0-PLUGINS/branches/unstable" "$vdr_plugins"
rm -rf "$vdr_plugins/sharedlibs"
fi
# Update plugins from SVN
if [ ! -d "$plugins" ]
then
echo "Update: $plugins"
svn update -q "$plugins"
fi
# Patching plugins
for dp in `ls $plugins `; do
if [ -d $plugins/$dp ] ; then
for dps in `ls $plugins/$dp/`; do
if [ -d $plugins/$dp/$dps ] ; then
dptarget=`echo $dps | cut -d'-' -f1`
# Clean patch
rm -rf $vdr_plugins/$dptarget/
mkdir $vdr_plugins/$dptarget/
# Copy plugin
cp -Trf $plugins/$dp/$dps $vdr_plugins/$dptarget
find $vdr_plugins/$dptarget/ '(' -name '.svn' ')' -exec rm -rf {} \; 2> /dev/null
# Patching plugins
patch_plugin $vdr_plugins/$dptarget/ $plugins/$dp
fi
done
fi
done;
# Compiling plugins
( cd $vdr; make plugins )
# Stripping plugins
for libvdr in `ls $vdr_plugins_lib ` ; do
sstrip $vdr_plugins_lib/$libvdr
done;