2222# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
2323# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2424
25- cd $( dirname $0 ) ; CWD=$( pwd)
25+ cd " $( dirname " $0 " ) " ; CWD=$( pwd)
2626
2727PRGNAM=wine-tkg
2828VERSION=${VERSION:- git}
@@ -34,8 +34,11 @@ PKGTYPE=${PKGTYPE:-tgz}
3434USE_STAGING=${USE_STAGING:- YES}
3535USE_GE_PATCHES=${USE_GE_PATCHES:- YES}
3636PROTONIFY=${PROTONIFY:- NO}
37+ DXVK_DXGI=${DXVK_DXGI:- YES}
38+ WAYLAND=${WAYLAND:- NO}
3739LOCAL_PRESET_PROMPT=${LOCAL_PRESET_PROMPT:- NO}
3840ALLOW_SERVER_RT_PRIO=${ALLOW_SERVER_RT_PRIO:- YES}
41+ NTSYNC=${NTSYNC:- NO}
3942FASTSYNC=${FASTSYNC:- NO}
4043ESYNC=${ESYNC:- YES}
4144FSYNC=${FSYNC:- YES}
@@ -52,34 +55,40 @@ TMP=${TMP:-/tmp/SSb}
5255PKG=${PKG:- $TMP / package-$PRGNAM -git}
5356OUTPUT=${OUTPUT:-/ tmp}
5457
55- if [ ! -z " ${PRINT_PACKAGE_NAME} " ]; then
58+ if [ -n " ${PRINT_PACKAGE_NAME} " ]; then
5659 echo " $PRGNAM -$VERSION -$ARCH -$BUILD$TAG .$PKGTYPE "
5760 exit 0
5861fi
5962
60- if [ $ARCH != " x86_64" ]; then
63+ if [ " $ARCH " != " x86_64" ]; then
6164 echo " This script supports only x86_64 now, "
6265 exit 1
6366fi
6467
65- if [ ! -f /var/log/packages/glibc-[0-9]* _multilib-x86_64-* alien ]; then
66- echo " Install glibc-[0-9]*_multilib-x86_64-*alien"
68+ WINETMP=" $( mktemp -d " $TMP /wine-test-XXXXXX" ) "
69+ echo " int main(void) {; return(0); }" > " $WINETMP /test.c"
70+ gcc -m32 " $WINETMP /test.c" -o /dev/null > /dev/null 2>&1 && WINE32TEST=${WINE32TEST:- yes}
71+ rm -rf " $WINETMP "
72+ if [[ $WINE32TEST = " yes" ]]; then
73+ echo " The multilib test passed."
74+ else
75+ echo " The multilib test has failed."
6776 exit 1
6877fi
6978
7079set -e
7180
72- rm -rf $PKG
73- mkdir -p $TMP $PKG $OUTPUT
74- cd $TMP
81+ rm -rf " $PKG "
82+ mkdir -p " $TMP " " $PKG " " $OUTPUT "
83+ cd " $TMP "
7584rm -rf wine-tkg-git
7685rm -rf /tmp/wine-tkg
7786
7887git clone https://github.com/Frogging-Family/wine-tkg-git
7988
8089cd wine-tkg-git/wine-tkg-git
8190
82- if [ $VERSION != " git" ]; then
91+ if [ " $VERSION " != " git" ]; then
8392 sed -i " s/_plain_version=\"\" /_plain_version=\" wine-$VERSION \" /" customization.cfg
8493 sed -i " s/_staging_version=\"\" /_staging_version=\" v$VERSION \" /" customization.cfg
8594else
8897fi
8998
9099
91- if [ $USE_STAGING == " NO" ]; then
100+ if [ " $USE_STAGING " == " NO" ]; then
92101 sed -i ' /_use_staging=/ s/"true"/"false"/' customization.cfg
93102fi
94103
95- if [ $USE_GE_PATCHES == " NO" ]; then
104+ if [ " $USE_GE_PATCHES " == " NO" ]; then
96105 sed -i ' /_use_GE_patches=/ s/"true"/"false"/' customization.cfg
97106fi
98107
99- if [ $PROTONIFY == " YES" ]; then
108+ if [ " $PROTONIFY " == " YES" ]; then
100109 sed -i ' /_protonify=/ s/"false"/"true"/' customization.cfg
101110fi
102111
103- if [ $LOCAL_PRESET_PROMPT == " NO" ]; then
112+ if [ " $LOCAL_PRESET_PROMPT " == " NO" ]; then
104113 sed -i ' /_LOCAL_PRESET=/ s/""/"none"/' customization.cfg
105114fi
106115
107- if [ $ALLOW_SERVER_RT_PRIO == " YES" ]; then
116+ if [ " $ALLOW_SERVER_RT_PRIO " == " YES" ]; then
108117 sed -i ' /_allow_server_rt_prio=/ s/"false"/"true"/' wine-tkg-profiles/advanced-customization.cfg
109118fi
110119
111- if [ $FASTSYNC == " YES" ]; then
120+ if [ " $DXVK_DXGI " == " NO" ]; then
121+ sed -i ' /_dxvk_dxgi=/ s/"true"/"false"/' customization.cfg
122+ fi
123+
124+ if [ " $WAYLAND " == " YES" ]; then
125+ sed -i ' /_wayland_driver=/ s/"false"/"true"/' customization.cfg
126+ fi
127+
128+ if [ " $NTSYNC " == " YES" ]; then
129+ sed -i ' /_use_ntsync=/ s/"false"/"true"/' customization.cfg
130+ fi
131+
132+ if [ " $FASTSYNC " == " YES" ]; then
112133 sed -i ' /_use_fastsync=/ s/"false"/"true"/' customization.cfg
113134fi
114135
115- if [ $ESYNC == " NO" ]; then
136+ if [ " $ESYNC " == " NO" ]; then
116137 sed -i ' /_use_esync=/ s/"true"/"false"/' customization.cfg
117138fi
118139
119- if [ $FSYNC == " NO" ]; then
140+ if [ " $FSYNC " == " NO" ]; then
120141 sed -i ' /_use_fsync=/ s/"true"/"false"/' customization.cfg
121142fi
122143
123144sed -i " s|_nomakepkg_prefix_path=\"\" |_nomakepkg_prefix_path=\" /usr\" |g" customization.cfg
145+ sed -i ' /_nomakepkg_dependency_autoresolver=/ s/"true"/"false"/' customization.cfg
124146sed -i ' /_nomakepkg_nover=/ s/"false"/"true"/' wine-tkg-profiles/advanced-customization.cfg
125147
126- sed -i " s|\"\$ _prefix\" |$PKG \"\$ _prefix\" |g" wine-tkg-scripts/build.sh
127- sed -i " s|make install|make install DESTDIR=$PKG |g" wine-tkg-scripts/build.sh
128- sed -i ' s|_nomakepkg_pkgname="${pkgname}"|_nomakepkg_pkgname=""|g' wine-tkg-scripts/build.sh
129- sed -i ' s|_nomakepkg_pkgname="${pkgname}"|_nomakepkg_pkgname=""|g' non-makepkg-build.sh
130- sed -i ' s|local _prefix="${_nomakepkg_prefix_path}/${_nomakepkg_pkgname}"|local _prefix="${_nomakepkg_prefix_path}"|g' wine-tkg-scripts/build.sh
131- sed -i ' s|local _prefix="${_nomakepkg_prefix_path}/${_nomakepkg_pkgname}"|local _prefix="${_nomakepkg_prefix_path}"|g' non-makepkg-build.sh
148+ sed -i " s|\"\$ _prefix\" |$PKG \"\$ _prefix\" |g" wine-tkg-scripts/build.sh
149+ sed -i " s|make install|make install DESTDIR=$PKG |g" wine-tkg-scripts/build.sh
150+ sed -i " s|_nomakepkg_pkgname=\"\$ {pkgname}\" |_nomakepkg_pkgname=\"\" |g" wine-tkg-scripts/build.sh
151+ sed -i " s|_nomakepkg_pkgname=\"\$ {pkgname}\" |_nomakepkg_pkgname=\"\" |g" non-makepkg-build.sh
152+
153+ look_for=" local _prefix=\"\$ {_nomakepkg_prefix_path}/\$ {_nomakepkg_pkgname}\" "
154+ turn_into=" local _prefix=\"\$ {_nomakepkg_prefix_path}\" "
155+ sed -i " s|$look_for |$turn_into |g" wine-tkg-scripts/build.sh
156+ sed -i " s|$look_for |$turn_into |g" non-makepkg-build.sh
132157
133158files_to_copy=$( find " $CWD /patches" -type f -name ' [0-9][0-9][0-9][0-9]-*.mypatch' || \
134159 find " $CWD /patches" -type f -name ' [0-9][0-9][0-9][0-9]-*.myrevert' || \
@@ -148,56 +173,61 @@ find -L . \
148173 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
149174
150175./non-makepkg-build.sh || { rm -rf /tmp/wine-tkg; exit 1; }
176+ stty sane
151177
152-
153- find $PKG -print0 | xargs -0 file | grep -e " executable" -e " shared object" | grep ELF \
178+ find " $PKG " -print0 | xargs -0 file | grep -e " executable" -e " shared object" | grep ELF \
154179 | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
155180
156181cd src/wine-git
157- VERSION=$( cat VERSION | awk ' {print $3}' )
158- VERSION=$( echo $VERSION | tr ' -' . )
159182
160- # Add a desktop menu for winecfg, wine-uninstaller, wine-browsedrive and doc:
161- mkdir -p $PKG /usr/share/{applications,icons/hicolor/scalable/apps,pixmaps}
162- mkdir -p $PKG /usr/doc/$PRGNAM -$VERSION
183+ VERSION=$( awk ' {print $3}' VERSION)
184+ VERSION=$( echo " $VERSION " | tr ' -' . )
163185
164- DOCS=" AUTHORS COPYING.LIB LICENSE* MAINTAINERS VERSION"
165- FONTS_LICENSE=" COPYING.arial COPYING.cour COPYING.msyh COPYING.times"
166- cp $DOCS $FONTS_LICENSE $PKG /usr/doc/$PRGNAM -$VERSION
167- cp programs/winecfg/winecfg.svg $PKG /usr/share/icons/hicolor/scalable/apps/
186+ # Add a desktop menu for winecfg, wine-uninstaller, wine-browsedrive and doc:
187+ mkdir -p " $PKG /usr/share/" {applications,icons/hicolor/scalable/apps,pixmaps}
188+ mkdir -p " $PKG /usr/doc/$PRGNAM -$VERSION "
189+ DOCS=(" AUTHORS" " COPYING.LIB" " LICENSE" " LICENSE.OLD" " MAINTAINERS" " VERSION" )
190+ FONTS_LICENSE=(" COPYING.arial" " COPYING.cour" " COPYING.msyh" " COPYING.times" )
191+ cp " ${DOCS[@]} " " ${FONTS_LICENSE[@]} " " $PKG /usr/doc/$PRGNAM -$VERSION "
192+ cp programs/winecfg/winecfg.svg " $PKG /usr/share/icons/hicolor/scalable/apps/"
168193
169194# clear source from tmp (can stop the user from being able to build in $HOME)
170195cd ../..
171196rm -rf /tmp/wine-tkg
172197
173198# on slackware /usr/share/man is a symbolic link to /usr/man
174- mv $PKG /usr/share/man $PKG /usr/man
175- find $PKG /usr/man -type f -exec gzip -9 {} \;
176- for i in $( find $PKG /usr/man -type l ) ; do ln -s $( readlink $i ) .gz $i .gz ; rm $i ; done
199+ mv " $PKG /usr/share/man" " $PKG /usr/man"
200+ find " $PKG /usr/man" -type f -exec gzip -9 {} \;
201+ find " $PKG /usr/man" -type l -exec sh -c '
202+ for i; do
203+ ln -s "$(readlink "$i").gz" "$i.gz"
204+ rm "$i"
205+ done
206+ ' sh {} +
177207
178208# Add font configuration:
179- install -d $PKG /etc/fonts/conf.{avail,d}
180- install -m644 $CWD /30-win32-aliases.conf $PKG /etc/fonts/conf.avail
181- ln -sf /etc/fonts/conf.avail/30-win32-aliases.conf $PKG /etc/fonts/conf.d/30-win32-aliases.conf
182- install -Dm 644 $CWD /wine-binfmt.conf $PKG /usr/lib/binfmt.d/wine.conf
209+ install -d " $PKG /etc/fonts/conf." {avail,d}
210+ install -m644 " $CWD /30-win32-aliases.conf" " $PKG /etc/fonts/conf.avail"
211+ ln -sf /etc/fonts/conf.avail/30-win32-aliases.conf " $PKG /etc/fonts/conf.d/30-win32-aliases.conf"
212+ install -Dm 644 " $CWD /wine-binfmt.conf" " $PKG /usr/lib/binfmt.d/wine.conf"
183213
184214# Create Wine menu structure:
185- mkdir -p $PKG /etc/xdg/menus/applications-merged
186- cp $CWD /wine.menu $PKG /etc/xdg/menus/applications-merged
215+ install -Dm 644 " $CWD /wine.menu" " $PKG /etc/xdg/menus/applications-merged/wine.menu"
187216
188217# icons and desktop files
189- convert $CWD /wine.svg -scale 64 $PKG /usr/share/pixmaps/wine.png
190- cp $CWD /wine.svg $PKG /usr/share/icons/hicolor/scalable/apps/
191- convert $CWD /winecfg.png -scale 64 $PKG /usr/share/pixmaps/winecfg.png
192- convert $CWD /winecfg.png -scale 64 $PKG /usr/share/pixmaps/folder-wine.png
193- convert $CWD /winecfg.png -scale 64 $PKG /usr/share/pixmaps/wine-uninstaller.png
194- cp $CWD /* .desktop $PKG /usr/share/applications/
218+ install -Dm 644 " $CWD /wine.svg" " $PKG /usr/share/icons/hicolor/scalable/apps/wine.svg"
219+ magick " $CWD /wine.svg" -scale 64 " $PKG /usr/share/pixmaps/wine.png"
220+ magick " $CWD /winecfg.png" -scale 64 " $PKG /usr/share/pixmaps/winecfg.png"
221+ magick " $CWD /winecfg.png" -scale 64 " $PKG /usr/share/pixmaps/folder-wine.png"
222+ magick " $CWD /winecfg.png" -scale 64 " $PKG /usr/share/pixmaps/wine-uninstaller.png"
223+
224+ find " $CWD " -maxdepth 1 -name " *.desktop" -exec install -m 644 {} " $PKG /usr/share/applications/" \;
195225
196- cat $CWD /$PRGNAM .SlackBuild > $PKG /usr/doc/$PRGNAM -$VERSION /$PRGNAM .SlackBuild
226+ cat " $CWD /$PRGNAM .SlackBuild" > " $PKG /usr/doc/$PRGNAM -$VERSION /$PRGNAM .SlackBuild"
197227
198- mkdir -p $PKG /install
199- cat $CWD /slack-desc > $PKG /install/slack-desc
200- cat $CWD /doinst.sh > $PKG /install/doinst.sh
228+ mkdir -p " $PKG /install"
229+ cat " $CWD /slack-desc" > " $PKG /install/slack-desc"
230+ cat " $CWD /doinst.sh" > " $PKG /install/doinst.sh"
201231
202- cd $PKG
203- /sbin/makepkg -l y -c n $OUTPUT /$PRGNAM -$VERSION -$ARCH -$BUILD$TAG .$PKGTYPE
232+ cd " $PKG "
233+ /sbin/makepkg -l y -c n " $OUTPUT /$PRGNAM -$VERSION -$ARCH -$BUILD$TAG .$PKGTYPE "
0 commit comments