package: update version (2.8.0.7)
[sdk/emulator/qemu.git] / package / build.common
1 # build_common
2 prepare_common()
3 {
4         if [ "$JAVA_HOME" = "" ]
5         then
6                 echo "Make sure that you have installed JDK"
7                 echo "and then set installed JDK/bin path into JAVA_HOME"
8                 echo "as a system environment variable on your PC!!"
9                 exit 1
10         fi
11 }
12
13 build_common()
14 {
15         prepare_common
16         prepare
17
18         TIZEN_SDK_DEV_PATH=${ROOTDIR}
19         PATH=${TIZEN_SDK_DEV_PATH}/bin:${PATH}
20
21         cd ${SRCDIR}/tizen
22
23         TIZEN_SDK_DEV_PATH=${TIZEN_SDK_DEV_PATH} ./emulator_configure.sh x86_64
24
25         make clean
26         PATH=${PATH} make all -j8
27         make install
28
29         if [ $? -eq 0 ]
30         then
31                 echo "x86 build success"
32         else
33                 echo "x86 build failure"
34                 exit 1
35         fi
36 }
37
38 # install_common
39 install_common()
40 {
41         TIZEN_VERSIONS="4.0 3.0 2.4 2.3.2"
42
43         for VER in ${TIZEN_VERSIONS} ; do
44                 # emulator
45                 EMULATOR_COMMON_DIR=$SRCDIR/package/$VER-emulator-qemu-common.package.${TARGET_OS}/data/platforms/tizen-$VER/common
46                 mkdir -p $EMULATOR_COMMON_DIR
47                 # we have nothing for common now
48
49                 EMULATOR_X86_DIR=$SRCDIR/package/$VER-emulator-qemu-x86.package.${TARGET_OS}/data/platforms/tizen-$VER/common
50
51                 mkdir -p $EMULATOR_X86_DIR
52                 cp -pPR $SRCDIR/tizen/emulator $EMULATOR_X86_DIR/emulator
53
54                 # profile skins
55                 MOBILE_SKIN_RESOURCE_DIR=$SRCDIR/package/mobile-$VER-emulator-qemu-skins.package.${TARGET_OS}/data/platforms/tizen-$VER/mobile/emulator-resources/skins
56                 WEARABLE_SKIN_RESOURCE_DIR=$SRCDIR/package/wearable-$VER-emulator-qemu-skins.package.${TARGET_OS}/data/platforms/tizen-$VER/wearable/emulator-resources/skins
57                 # Tizen 2.3.2 does not have the tv profile
58                 if [ "$VER" != "2.3.2" ] ; then
59                         TV_SKIN_RESOURCE_DIR=$SRCDIR/package/tv-$VER-emulator-qemu-skins.package.${TARGET_OS}/data/platforms/tizen-$VER/tv/emulator-resources/skins
60                 fi
61
62                 mkdir -p $MOBILE_SKIN_RESOURCE_DIR
63                 mkdir -p $WEARABLE_SKIN_RESOURCE_DIR
64                 if [ "$VER" != "2.3.2" ] ; then
65                         mkdir -p $TV_SKIN_RESOURCE_DIR
66                 fi
67
68                 cp -pPR $SRCDIR/tizen/src/ui/resource/skins/mobile/* $MOBILE_SKIN_RESOURCE_DIR
69                 cp -pPR $SRCDIR/tizen/src/ui/resource/skins/wearable/* $WEARABLE_SKIN_RESOURCE_DIR
70                 if [ "$VER" != "2.3.2" ] ; then
71                         cp -pPR $SRCDIR/tizen/src/ui/resource/skins/tv/* $TV_SKIN_RESOURCE_DIR
72                 fi
73
74                 # make install/remove script, depending on the version
75                 ORIGIN_INSTALL_FILE=$SRCDIR/package/emulator-qemu-x86.install.$TARGET_OS_CATEGORY
76                 ORIGIN_REMOVE_FILE=$SRCDIR/package/emulator-qemu-x86.remove.$TARGET_OS_CATEGORY
77                 TARTGET_INSTALL_FILE=$SRCDIR/package/$VER-emulator-qemu-x86.install.$TARGET_OS_CATEGORY
78                 TARTGET_REMOVE_FILE=$SRCDIR/package/$VER-emulator-qemu-x86.remove.$TARGET_OS_CATEGORY
79                 if [ -e "$ORIGIN_INSTALL_FILE" ] ; then
80                         cp -p "$ORIGIN_INSTALL_FILE" "$TARTGET_INSTALL_FILE"
81                         # Replace existing version to inputted version.
82                         # To apply some variables to 'sed' command,
83                         # you must enclose expressions in double quotes("").
84                         # -i'' option means that does not make backup file, it must have an extension in macOS.
85                         sed -i'' -e "s/tizen-x.x/tizen-$VER/g" "$TARTGET_INSTALL_FILE"
86                 fi
87                 if [ -e "$ORIGIN_REMOVE_FILE" ] ; then
88                         cp -p "$ORIGIN_REMOVE_FILE" "$TARTGET_REMOVE_FILE"
89                         # Replace existing version to inputted version.
90                         # Now it is not necessary. Uncomment the line below if necessary.
91                         #sed -i'' -e "s/tizen-x.x/tizen-$VER/g" "$TARTGET_INSTALL_FILE"
92                 fi
93         done
94 }