File: build

package info (click to toggle)
gnumeric 1.12.57-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 111,496 kB
  • sloc: ansic: 296,601; xml: 56,363; perl: 6,615; sh: 5,288; makefile: 2,981; yacc: 1,341; python: 389
file content (130 lines) | stat: -rwxr-xr-x 3,823 bytes parent folder | download | duplicates (5)
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
#!/bin/sh

# configurable settings
#py_ver=26
#py_pkg_ver=2.6.4

###################################################
builddir="$1"
srcdir="$2"
build="$3"

if [ -z "${builddir}" -o -z "${srcdir}" -o -z "${build}" ]; then
    echo "usage  : $0 <builddir> <srcdir> <build>"
    exit 1
fi

export WINEPREFIX="${builddir}/wine"
export WINEARCH=win32
WINEDIR="${WINEPREFIX}/drive_c"
archive_dir="${builddir}/archive"
export JH_PREFIX="${builddir}/${build}"
export JH_MODULE_SET="${srcdir}/moduleset"
export JH_BUILD="${build}"

build_mkdir() {
     if [ ! -d "$1" ]; then
	    echo mkdir -p "$1"
	    mkdir -p "$1"
	fi
}
build_ls_s() {
    if [ ! -L "$2" ]; then
       echo ln -s "$1" "$2"
       ln -s "$1" "$2"
    fi
}

download() {
	cd "${archive_dir}"
	echo wget -N $*
	wget -N $*
}

# From : http://code.google.com/p/htmlhelp/wiki/HHW4Wine
setup_html_help() {
    cd "${archive_dir}"

    wine htmlhelp.exe
    wine regedit "${builddir}/htmlhelp.reg"

    # Install ITSS.DLL
    cabextract -F hhupd.exe htmlhelp.exe
    cabextract -F itircl.dll hhupd.exe
    cabextract -F itss.dll hhupd.exe

    cp -a itircl.dll "$WINEPREFIX/drive_c/windows/system32/"
    cp -a itss.dll   "$WINEPREFIX/drive_c/windows/system32/"
    wine regsvr32 /s 'C:\WINDOWS\SYSTEM32\itircl.dll'
    wine regsvr32 /s 'C:\WINDOWS\SYSTEM32\itss.dll'
}

# Setup up the JH_PREFIX/deploy
    build_mkdir "${JH_PREFIX}/deploy" ; cd "${JH_PREFIX}/deploy"
    build_mkdir "bin"
    build_mkdir "lib"
    build_mkdir "include"

    (cd "${JH_PREFIX}/deploy" && cp $srcdir/../../COPYING .)
    (cd "${JH_PREFIX}/deploy" && cp $srcdir/../../COPYING-gpl2 .)
    (cd "${JH_PREFIX}/deploy" && cp $srcdir/../../COPYING-gpl3 .)

    build_mkdir "${archive_dir}"

    if [ "x$py_ver" != "x" ]; then
# Setup Python
       py_pkg="${archive_dir}/python-${py_pkg_ver}.msi"

       if [ ! -f "$py_pkg" ]; then
	   ( download "http://www.python.org/ftp/python/${py_pkg_ver}/python-${py_pkg_ver}.msi" )
       fi
       if [ ! -d "${WINEDIR}/Python${py_ver}" ]; then
	   echo wine msiexec /i ${py_pkg}
	   wine msiexec /i ${py_pkg}
       fi
       build_ls_s "${WINEDIR}/Python${py_ver}"			 	"Python${py_ver}" 
       build_ls_s "${WINEDIR}/windows/system32/python${py_ver}.dll" 	"bin/python${py_ver}.dll"
       build_ls_s "${WINEDIR}/Python${py_ver}/libs/libpython${py_ver}.a"	"lib/libpython${py_ver}.dll.a"
    fi

# Download HTML Help
    if [ ! -f "${archive_dir}/htmlhelp.exe" ]; then
	( download 'http://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe' )
    fi
    if [ ! '(' -d "${WINEDIR}/Program Files/HTML Help Workshop" -o -d "${WINEDIR}/Program Files (x86)/HTML Help Workshop" ')' ]; then
	( setup_html_help )
    fi

# example usage:
#	make debug
#	make start=foo debug
#	make module=foo debug
#	make target=shell debug
#	make target=doc debug
    
    if [ "x${target}" = "xinstaller" ]; then
	( cd "${JH_PREFIX}/deploy" && \
	  makensis gnumeric.nsi )
    elif [ "x${target}" = "xshell" ]; then
 	${HOME}/bin/jhbuild -f "${srcdir}/jhbuildrc.py" shell ${JHBUILD}
    elif [ "x${target}" = "xdoc" ]; then
	echo make -C "${srcdir}/../../doc/C" chm
	make -C "${srcdir}/../../doc/C" chm
	echo cp -r "${srcdir}/../../doc/C/chm" ..
	cp -r "${srcdir}/../../doc/C/chm" ..
	echo exiting
	exit 0
    elif [ ! "x${start}" = "x" ]; then
 	${HOME}/bin/jhbuild -f "${srcdir}/jhbuildrc.py" build ${JHBUILD} --start-at="${start}"
    elif [ ! "x${module}" = "x" ]; then
 	${HOME}/bin/jhbuild -f "${srcdir}/jhbuildrc.py" buildone ${JHBUILD} "${module}"
    else
	${HOME}/bin/jhbuild -f "${srcdir}/jhbuildrc.py" build ${JHBUILD}
fi

################################################################
# TODO
#    - pangorc
#    - better auto location of jbuild (not always in HOME)
#    - doc generation and deployment
#    - packaging