Add harbour for Python2 [WIP] (thx Zbigniew Halas)
[harbours.git] / msim / HARBOUR
blob92165de6114c4d049ccbd6545d5259dc9fa6fa34
2 # Copyright (c) 2013 Vojtech Horky
3 # All rights reserved.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
7 # are met:
9 # - Redistributions of source code must retain the above copyright
10 #   notice, this list of conditions and the following disclaimer.
11 # - Redistributions in binary form must reproduce the above copyright
12 #   notice, this list of conditions and the following disclaimer in the
13 #   documentation and/or other materials provided with the distribution.
14 # - The name of the author may not be used to endorse or promote products
15 #   derived from this software without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 shipname=msim
30 shipversion=1.3.8.1
31 shipsources="http://d3s.mff.cuni.cz/~holub/sw/${shipname}/${shipname}-${shipversion}.tar.bz2 \
32         Makefile config.h helenos.h input.c misc.c"
33 shipfunnels=0
35 build() {
36         run tar xjf "${shipname}-${shipversion}.tar.bz2"
37         
38         # There is a lot of patching involved and it is simpler not to run
39         # ./configure at all and do it all manually instead.
40         
41         # Copy the prepared config.h and some HelenOS specific implementations
42         # instead of the (expected) Linux ones.
43         run cp config.h "${shipname}-${shipversion}"
44         run mkdir -p "${shipname}-${shipversion}/src/arch/helenos"
45         run cp helenos.h input.c misc.c "${shipname}-${shipversion}/src/arch/helenos"
46         run cp Makefile "${shipname}-${shipversion}/src/"
47         
48         cd "${shipname}-${shipversion}"
49         
50         msg "Exctracting source file names."
51         # The list of the files is in src/Makefile.in in the SOURCES variable.
52         # From the list we remove unsupported things (such as GDB) and add
53         # HelenOS-specific sources.
54         (
55                 cd src;
56                 echo 'all__:'; \
57                 echo -e '\t@echo SOURCES = $(SOURCES)'; cat Makefile.in \
58         ) | make -f - | grep 'SOURCES' \
59         | sed \
60                 -e 's:io/input.c:arch/helenos/input.c arch/helenos/misc.c:' \
61                 -e 's:debug/gdb.c::' \
62                 -e 's:arch/posix/stdin.c::' \
63         >src/Makefile.sources
64         
65         # Now we would use the HelenOS-style Makefile to actually build
66         # the binary.
67         run make -C src -j$shipfunnels \
68                 CC="$HSCT_CC" \
69                 HSCT_CFLAGS="$HSCT_CFLAGS" \
70                 LD="$HSCT_LD" \
71                 HSCT_LDFLAGS="$HSCT_LDFLAGS" \
72                 HSCT_CACHE_INCLUDE="$HSCT_CACHE_INCLUDE" \
73                 HSCT_CACHE_LIB="$HSCT_CACHE_LIB"
76 package() {
77         cd "${shipname}-${shipversion}"
78         
79         run mkdir -p "$HSCT_MY_DIR/app/"
80         run cp "src/${shipname}" "$HSCT_MY_DIR/app/"