-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwxGTK3.SlackBuild
More file actions
executable file
·116 lines (101 loc) · 3.28 KB
/
Copy pathwxGTK3.SlackBuild
File metadata and controls
executable file
·116 lines (101 loc) · 3.28 KB
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
#!/bin/sh
# Copyright 2023 Mauricio Ferrari <m10ferrari1200@gmail.com>
# All rights reserved.
[ $UID != 0 ] && { echo -e "\nExecute como Root !\n"; exit 1; }
PRGNAM=wxGTK3
SRCNAM=wxWidgets
VERSION=3.2.1
BUILD=${BUILD:-1}
TAG=${TAG:-_mxnt}
NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
[ -e "../../_PKGS" ] && { mkdir -p ../../_PKGS/$PRGNAM; chown -R 1000:users ../../_PKGS; cd ../../_PKGS/$PRGNAM; } || {
mkdir -p PKGS/$PRGNAM; chown -R 1000:users PKGS; cd PKGS/$PRGNAM
}
CWD=$PWD
TMP=/var/tmp/MXNT
PKG=$TMP/package-$PRGNAM
LINK=https://github.com/wxWidgets/wxWidgets/archive/v3.2.1/wxWidgets-3.2.1.tar.gz
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "aarch64" ]; then
SLKCFLAGS="-O2"
LIBDIRSUFFIX="64"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
wget -c $LINK
rm -rf $TMP
mkdir -p $TMP $PKG/{install,usr/doc/$PRGNAM-$VERSION}
cd $TMP; tar xvf $CWD/$SRCNAM-$VERSION.tar.?z*
cd $SRCNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a+X-s .
cd 3rdparty
git clone https://github.com/wxWidgets/nanosvg.git
cd ..
sed -i "s|@libdir@|/usr/lib${LIBDIRSUFFIX}|g" wx-config.in
cmake -B build-gtk3 \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=None \
-DwxBUILD_TOOLKIT=gtk3 \
-DwxUSE_OPENGL=ON \
-DwxUSE_REGEX=sys\
-DwxUSE_ZLIB=sys \
-DwxUSE_EXPAT=sys \
-DwxUSE_LIBJPEG=sys \
-DwxUSE_LIBPNG=sys \
-DwxUSE_LIBTIFF=sys \
-DwxUSE_LIBLZMA=sys \
-DwxUSE_LIBMSPACK=ON \
-DwxUSE_PRIVATE_FONTS=ON \
-DwxUSE_GTKPRINT=ON
cmake --build build-gtk3 $NUMJOBS
DESTDIR=$PKG cmake --install build-gtk3
[ "${LIBDIRSUFFIX}" = "64" ] && ( cd $PKG; mv usr/lib usr/lib64)
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find $PKG | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null || true
cp -a docs/* $PKG/usr/doc/$PRGNAM-$VERSION
rm $PKG/usr/bin/wx-config
ln -s /usr/lib${LIBDIRSUFFIX}/wx/config/gtk3-unicode-3.2 $PKG/usr/bin/wx-config
echo " |-----handy-ruler------------------------------------------------------|
wxGTK3: wxGTK3 (cross-platform GUI toolkit)
wxGTK3:
wxGTK3: wxGTK3 is part of wxWidgets, a cross-platform API for writing GUI
wxGTK3: applications on multiple platforms that still utilize the native
wxGTK3: platform's controls and utilities.
wxGTK3:
wxGTK3: http://wxwidgets.org
wxGTK3:
wxGTK3:
wxGTK3:
wxGTK3:" > $PKG/install/slack-desc
cd $PKG; /sbin/makepkg -l y -c n $CWD/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
chown -R 1000:users $CWD/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
rm -rf $TMP
cd $CWD
[ ${TIME:-0} != 0 ] && TIME="-t $TIME" || TIME=
if [ "${INST:-no}" = "yes" ]; then
OPTION=y
else
read $TIME -p "O pacote já pode ser instalado? (y/n) (default=n)" OPTION
fi
case "$OPTION" in
y|Y) /sbin/upgradepkg --install-new --reinstall $PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz ;;
esac; exit 0