summaryrefslogtreecommitdiff
path: root/package/build.macos-64
blob: f810429feff7098472211b58385fe5038457b447 (plain)
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/bin/bash -xe
# clean
clean()
{
    prepare

    cd $SRCDIR/tizen
    if test -e "Makefile"
    then
        ./emulator_configure.sh x86 -e "$BUILD_CFLAGS $BUILD_LDFLAGS"
        make distclean
    fi
    rm -rf $SRCDIR/*.zip
    rm -rf $SRCDIR/*.tar.gz
}

# check build environment
prepare()
{
    if [ "$JAVA_HOME" = "" ]
    then
        echo "Make sure that you have installed JDK"
        echo "and then set installed JDK/bin path into JAVA_HOME"
        echo "as a system environment variable on your PC!!"
        exit 1
    fi

    export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ROOTDIR/glib2/lib/pkgconfig:$ROOTDIR/curl/lib/pkgconfig:$ROOTDIR/libffi/lib/pkgconfig:$ROOTDIR/libiconv/lib/pkgconfig:$ROOTDIR/libidn/lib/pkgconfig:$ROOTDIR/libxml2/lib/pkgconfig:$ROOTDIR/ncurses/lib/pkgconfig:$ROOTDIR/openssl/lib/pkgconfig:$ROOTDIR/pixman/lib/pkgconfig:$ROOTDIR/zlib/lib/pkgconfig:$ROOTDIR/libav/lib/pkgconfig

    BUILD_CFLAGS="--extra-cflags=-I$ROOTDIR/curl/include "
    BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/libffi/include "
    BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/glib2/include/glib-2.0 "
    BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/libiconv/include "
    BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/libidn/include "
    BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/libxml2/include "
    BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/ncurses/include "
    BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/openssl/include "
    BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/pixman/include "
    BUILD_CFLAGS+="--extra-cflags=-I$ROOTDIR/zlib/include "

    BUILD_LDFLAGS="--extra-ldflags=-L$ROOTDIR/curl/lib "
    BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/libffi/lib "
    BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/glib2/lib "
    BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/libiconv/lib "
    BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/libidn/lib "
    BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/libxml2/lib "
    BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/ncurses/lib "
    BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/openssl/lib "
    BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/pixman/lib "
    BUILD_LDFLAGS+="--extra-ldflags=-L$ROOTDIR/zlib/lib "
}

modify_files(){
    LIBIDN_PC=$ROOTDIR/libidn/lib/pkgconfig/libidn.pc
    GLIB_PC=$ROOTDIR/glib2/lib/pkgconfig/glib-2.0.pc
    PIXMAN_PC=$ROOTDIR/pixman/lib/pkgconfig/pixman-1.pc

    #modify .pc files
    ROOT_TMP=`echo $ROOTDIR | sed 's,/,\\\\\\/,g'`
    sed "s/prefix=\/opt\/local/prefix="$ROOT_TMP"\/libidn/g" $LIBIDN_PC > tmpfile
    cp -f tmpfile $LIBIDN_PC
    rm -f tmpfile

    sed "s/prefix=\/opt\/local/prefix="$ROOT_TMP"\/glib2/g" $GLIB_PC > tmpfile
    cp -f tmpfile $GLIB_PC
    rm -f tmpfile

    sed "s/prefix=\/opt\/local/prefix="$ROOT_TMP"\/pixman/g" $PIXMAN_PC > tmpfile
    cp -f tmpfile $PIXMAN_PC
    rm -f tmpfile

    #modify Makefile.target
    sed "/check-gl: check_gl.o/a \\
        export PKG_CONFIG_PATH=$PKG_CONFIG_PATH
    " $SRCDIR/Makefile.target > tmpfile

    sed 's/export PKG_CONFIG_PATH/	export PKG_CONFIG_PATH/g' tmpfile > $SRCDIR/Makefile.target
    rm -f tmpfile

    #just in case
#    sed "1 i\\
#    export PKG_CONFIG_PATH=$PKG_CONFIG_PATH
#
#    " $SRCDIR/Makefile.target > tmp
#    cp -f tmp $SRCDIR/Makefile.target
#    rm -f tmp
#    sed 's/export PKG_CONFIG_PATH/ export PKG_CONFIG_PATH/g' $SRCDIR/Makefile.target > tmp
#    cp -f tmp $SRCDIR/Makefile.target
#    rm -f tmp

}
# build
build()
{
    prepare

    modify_files

    cd $SRCDIR/tizen/

    ./emulator_configure.sh x86 -e "$BUILD_CFLAGS $BUILD_LDFLAGS"
    make all_dibs
    if [ $? -eq 0 ]
    then
        echo "build success"
    else
        echo "build failure"
        exit 1
    fi

#   make install_dibs
#   make clean
#
#   ./emulator_configure.sh arm
#   make all_dibs
#   if [ $? -eq 0 ]
#   then
#       echo "arm build success"
#   else
#       echo "arm build failure"
#       exit 1
#   fi
#   make install_dibs
}

# install
install()
{
    X86_BIN_DIR=$SRCDIR/package/emulator-qemu-x86.package.${TARGET_OS}/data/tools
#   ARM_BIN_DIR=$SRCDIR/package/emulator-qemu-arm.package.${TARGET_OS}/data/tools
    COMMON_BIN_DIR=$SRCDIR/package/emulator-qemu-common.package.${TARGET_OS}/data/tools
    MOBILE_3_0_SKIN_RESOURCE_DIR=$SRCDIR/package/mobile-3.0-emulator-qemu-skins.package.${TARGET_OS}/data/platforms/mobile-3.0/emulator-resources/skins/
    mkdir -p $X86_BIN_DIR
#   mkdir -p $ARM_BIN_DIR
    mkdir -p $COMMON_BIN_DIR
    mkdir -p $MOBILE_3_0_SKIN_RESOURCE_DIR

    cd $SRCDIR/tizen
    make install_dibs

    mv x86 $X86_BIN_DIR/emulator
#   mv x86 $ARM_BIN_DIR/emulator
    mv common $COMMON_BIN_DIR/emulator

    #profile skins
    cp -pPR src/skin/client/skins/mobile-general-3btn $MOBILE_3_0_SKIN_RESOURCE_DIR/
    cp -pPR src/skin/client/skins/mobile-480x800-3btn $MOBILE_3_0_SKIN_RESOURCE_DIR/
    cp -pPR src/skin/client/skins/mobile-720x1280-3btn $MOBILE_3_0_SKIN_RESOURCE_DIR/
}

[ "$1" = "clean" ] && clean
[ "$1" = "build" ] && build
[ "$1" = "install" ] && install

echo "success"