-
Notifications
You must be signed in to change notification settings - Fork 298
/
tk-8.6.10.recipe
137 lines (116 loc) · 3.8 KB
/
tk-8.6.10.recipe
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
SUMMARY="A windowing toolkit for use with Tcl"
DESCRIPTION="Tk is a graphical user interface toolkit that takes developing desktop \
applications to a higher level than conventional approaches. Tk is the \
standard GUI not only for Tcl, but for many other dynamic languages, and \
can produce rich, native applications that run unchanged across Windows, \
Mac OS X, Linux and more.
This package is based on UndroidWish, a SDL2-based Tk port."
HOMEPAGE="https://www.androwish.org"
COPYRIGHT="Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, and other parties"
LICENSE="TCL"
REVISION="4"
SOURCE_URI="http://androwish.org/download/androwish-c48f047f5b.tar.gz"
CHECKSUM_SHA256="4ecbc23193cb00b9fc34c0942e2327f0b6badbe587ab574b492780994707683d"
SOURCE_DIR="androwish-c48f047f5b/jni/sdl2tk/"
PATCHES="tk-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
commandBinDir=$binDir
commandSuffix=$secondaryArchSuffix
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
tk$secondaryArchSuffix = $portVersion compat >= 8.6
cmd:wish$commandSuffix = $portVersion compat >= 8.6
cmd:wish8.6$commandSuffix = $portVersion compat >= 8.6
lib:libtk8.6$secondaryArchSuffix = $portVersion compat >= 8.6
"
REQUIRES="
haiku$secondaryArchSuffix
tcl$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libSDL2_2.0$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
tk${secondaryArchSuffix}_devel = $portVersion
devel:libtk8.6$secondaryArchSuffix = $portVersion
devel:libtkstub8.6$secondaryArchSuffix = $portVersion
"
REQUIRES_devel="
tk$secondaryArchSuffix == $portVersion base
"
CONFLICTS_devel="
xlibe${secondaryArchSuffix}_devel
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
tcl${secondaryArchSuffix}_devel
devel:libfreetype$secondaryArchSuffix
devel:libSDL2$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:awk
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
cd sdl
chmod +x configure
local _64bit="--enable-64bit"
if [ "$targetArchitecture" = x86_gcc2 ]; then
_64bit="--disable-64bit"
fi
LDFLAGS="-Wl,--no-undefined" \
CFLAGS=-DTclpGetMonotonicTime=Tcl_GetTime \
runConfigure --omit-dirs binDir ./configure \
--bindir=$commandBinDir \
--with-tcl=$(finddir B_SYSTEM_DEVELOP_DIRECTORY)/lib$secondaryArchSubDir \
--enable-man-symlinks $_64bit
# patch Makefile for Haiku compatibility
sed -i s/-lsocket// Makefile
if [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then
sed -i s/-lstdc++/-lstdc++.r4/ Makefile
fi
# patch Makefile for shared Tcl compatibility
sed -i 's/-ltcl8.6/-ltcl8.6 -ltclstub8.6/' Makefile
# patch Makefile to be "regular Tk"
sed -i s/tkZipMain/tkMain/ Makefile
sed -i s/libsdl2tk/libtk/ Makefile
sed -i s/sdl2wish/wish/ Makefile
sed -i s/sdl2tk8/tk8/ Makefile
make
}
INSTALL()
{
cd sdl
make install
# rearrange to be "regular Tk"
mv $libDir/sdl2tkConfig.sh $libDir/tkConfig.sh
mv $libDir/pkgconfig/sdl2tk.pc $libDir/pkgconfig/tk.pc
# add standard symlinks
ln -s $commandBinDir/wish8.6 $commandBinDir/wish
prepareInstalledDevelLib libtkstub8.6
fixPkgconfig
# since we pretend to be regular tk
# correct library names in tk.pc and tkConfig.sh
sed -i 's/-lsdl2tk8.6 -lsdl2tkstub8.6/-ltk8.6 -ltkstub8.6/' \
$prefix/$relativeDevelopLibDir/pkgconfig/tk.pc
sed -i 's/libsdl2tk8.6.so/libtk8.6.so/' \
$prefix/$relativeLibDir/tkConfig.sh
sed -i 's/-lsdl2tk8.6/-ltk8.6/' \
$prefix/$relativeLibDir/tkConfig.sh
sed -i 's/libsdl2tkstub8.6.a/libtkstub8.6.a/' \
$prefix/$relativeLibDir/tkConfig.sh
sed -i 's/-lsdl2tkstub8.6/-ltkstub8.6/' \
$prefix/$relativeLibDir/tkConfig.sh
mv $libDir/tkConfig.sh $developLibDir
packageEntries devel \
$developDir
}