[Slackbuilds-users] Error compiling webkitgtk

Didier Spaier didier at slint.fr
Sat Mar 31 11:23:37 UTC 2018


Hello,

this is an answer to this email:
https://lists.slackbuilds.org/pipermail/slackbuilds-users/2018-March/021041.html
that I didn't keep in my mailbox.

spaceman wrote:
>> I ma trying to compile webkit2gtk 2.8.26 statically and stripped
>> down, just to afterwards bundling it with yelp without this
>> resulting in a too huge package.
>
>I have managed to get a reasonably minimal (linked) build of 2.18.6
>going with the following config:
>
>  cmake -DPORT=GTK \
>        -DCMAKE_BUILD_TYPE=Release \
>        -DCMAKE_SKIP_RPATH=ON \
>        -DCMAKE_INSTALL_PREFIX=/usr \
>        -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
>        -DENABLE_GEOLOCATION=false \
>        -DENABLE_SPELLCHECK=false \
>        -DENABLE_VIDEO=false \
>        -DENABLE_WEB_AUDIO=false \
>        -DENABLE_INDEXED_DATABASE=false \
>        -DENABLE_PLUGIN_PROCESS_GTK2=false \
>        -DENABLE_DRAG_SUPPORT=false \
>        -DENABLE_NOTIFICATIONS=false \
>        -DENABLE_WEBDRIVER=false \
>        -DENABLE_WEB_CRYPTO=false \
>        -DENABLE_ICONDATABASE=false \
>        -DUSE_SYSTEM_MALLOC=true \
>        -DUSE_LIBHYPHEN=false \
>        -DUSE_LIBNOTIFY=false \
>        -DUSE_LIBSECRET=false \
>        -DUSE_LIBWEBP=false \
>        -DLIB_INSTALL_DIR=/usr/lib${LIBDIRSUFFIX} \
>        -DLIBEXEC_INSTALL_DIR=/usr/lib${LIBDIRSUFFIX}/webkit2gtk-4.0 \
>        ..
>
>Try putting back opengl, jit or touch events, one of them (i think touch
>events suprisingly) caused my build to fail.

I failed to compile it statically and anyway it was a bad idea as the
size of the installed package would have been way too big.

Instead the attached SlackBuild put it in a non-standard location,
known only by yelp (SlackBuild also attached), rpath set to it  for the
linker in both packages.

I wish I could have built a smaller package, but 60M installed
is still less than 102M.

I failed to build a package for version 2.20 for an unknown reason,
but for this specific use case I don't think this matters much.

At least the help files associated to MATE applications among
others are displayed as expected. 

Have a nice day,

Didier



-------------- next part --------------
#!/bin/sh
# Avoid over heating if need be.
# Here the max frequecy allowed is 3500000, adapt to your hardware.
# echo 2500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
# Maintainer: Didier Spaier <didier~at~slint~dot~fr>
# This pacakage does not replace webkit2gtk.
# It is stripped down (60M installed instead of 102) and intede to be
# used only by yelp as private libraries. For this reason it is intalled
# in a non-standard location: /usr/libexec/yelp-webkit
CWD=$(pwd)
PKGNAME=webkit2gtk-private
SOURCE=webkitgtk
VERSION=2.18.6
BUILD=1slint
CWD=$(pwd)
PKGDIR=$CWD/package-$PKGNAME
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi
rm -rf ${SOURCE}-$VERSION $PKGDIR
tar xf ${SOURCE}-${VERSION}.tar.xz
cd ${SOURCE}-$VERSION
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
rm -rf build
mkdir build
cd build
LIBDIRSUFFIX="64"
CFLAGS="-Wno-expansion-to-defined"
CXXFLAGS="-Wno-expansion-to-defined"
CXXFLAGS+=" -fno-delete-null-pointer-checks"
CFLAGS+=" -fno-delete-null-pointer-checks"
LDFLAGS="-Wl,-rpath,/usr/libexec/yelp-webkit/lib64" \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/libexec/yelp-webkit \
-DCMAKE_SKIP_RPATH=ON \
-DENABLE_DRAG_SUPPORT=OFF \
-DENABLE_GEOLOCATION=OFF \
-DENABLE_ICONDATABASE=OFF \
-DENABLE_INDEXED_DATABASE=OFF \
-DENABLE_NOTIFICATIONS=OFF \
-DENABLE_PLUGIN_PROCESS_GTK2=OFF \
-DENABLE_SPELLCHECK=OFF \
-DENABLE_VIDEO=OFF \
-DENABLE_WEBDRIVER=OFF \
-DENABLE_WEB_AUDIO=OFF \
-DENABLE_WEB_CRYPTO=OFF \
-DLIBEXEC_INSTALL_DIR=/usr/libexec/yelp-webkit/lib${LIBDIRSUFFIX}/webkit2gtk-4.0 \
-DLIB_INSTALL_DIR=/usr/libexec/yelp-webkit/lib${LIBDIRSUFFIX} \
-DPORT=GTK \
-DUSE_LIBHYPHEN=OFF \
-DUSE_LIBNOTIFY=OFF \
-DUSE_LIBSECRET=OFF \
-DUSE_SYSTEM_MALLOC=ON \
-DENABLE_3D_TRANSFORMS=OFF \
-DENABLE_CHANNEL_MESSAGING=OFF \
-DENABLE_CONTEXT_MENUS=ON \
-DENABLE_OPENGL=OFF \
-DENABLE_JIT=OFF \
-DENABLE_DFG_JIT=OFF \
-DENABLE_DOWNLOAD_ATTRIBUTE=OFF \
-DENABLE_FETCH_API=ON \
-DENABLE_FTL_JIT=OFF \
-DENABLE_FULLSCREEN_API=ON \
-DENABLE_INDEXED_DATABASE_IN_WORKERS=OFF \
-DENABLE_INDIE_UI=OFF \
-DENABLE_INPUT_TYPE_COLOR=ON \
-DENABLE_INTERSECTION_OBSERVER=OFF \
-DENABLE_LEGACY_VENDOR_PREFIXES=OFF \
-DENABLE_MATHML=ON \
-DENABLE_MEDIA_CONTROLS_SCRIPT=OFF \
-DENABLE_NETSCAPE_PLUGIN_API=OFF \
-DENABLE_REMOTE_INSPECTOR=ON \
-DENABLE_STREAMS_API=ON \
-DENABLE_SUBTLE_CRYPTO=OFF \
-DENABLE_VIDEO_TRACK=OFF \
-DENABLE_WEBASSEMBLY=OFF \
-DENABLE_WEBGL=OFF \
.. 2>&1| tee ../../CONFIGLOG$PKGNAME-$VERSION-$ARCH-$BUILD$TAG
make -j 2 2>&1| tee ../../MAKELOG$PKGNAME-$VERSION-$ARCH-$BUILD$TAG|| return 1
make install DESTDIR=$PKGDIR

mkdir -p $PKGDIR/usr/doc/$PKGNAME-$VERSION
cp -a ../NEWS $PKGDIR/usr/doc/$PKGNAME-$VERSION
cat $CWD/$PKGNAME.SlackBuild > $PKGDIR/usr/doc/$PKGNAME-$VERSION/$PKGNAME.SlackBuild

mkdir -p $PKGDIR/install
cat $CWD/slack-desc > $PKGDIR/install/slack-desc

cd $PKGDIR
/sbin/makepkg -l y -c n $CWD/$PKGNAME-$VERSION-$ARCH-$BUILD.txz
-------------- next part --------------
#!/bin/sh

# Slackware build script for yelp

# Copyright 2014-2016 Willy Sudiarto Raharjo <willysr at slackbuilds.org>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Modified for Slint by Didier Spaier <didier~at~slint~dot~fr> for Slint.
# webkit2gtk is a build and run time dependency made private for yelp
# hence the rpath /usr/libexec/yelp-webkit/lib$ARCH
# This needs that webkit2ftk be installed there, and us the same rpath
# as it is auto-dependent at run time. 

PRGNAM=yelp
VERSION=3.26.0
BUILD=1
TAG=slint

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=$CWD
PKG=$TMP/package-$PRGNAM
OUTPUT=$CWD

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz

cd $PRGNAM-$VERSION

chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
 -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

# Let's yelp know where to find its private run time dependencies
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
LDFLAGS="-Wl,-L/usr/libexec/yelp-webkit/lib$ARCH" \
LDFLAGS+="-Wl,-rpath,/usr/libexec/yelp-webkit/lib$ARCH" \
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/libexec/yelp-webkit/lib$ARCH/pkgconfig" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/man \
  --docdir=/usr/doc/$PRGNAM-$VERSION \
  --enable-static=no \
  --disable-schemas-compile \
  --build=$ARCH-slackware-linux
make
make install DESTDIR=$PKG

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS COPYING* ChangeLog INSTALL NEWS README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0xD50202EF60C03EEA.asc
Type: application/pgp-keys
Size: 1718 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20180331/d7710f54/attachment.bin>


More information about the SlackBuilds-users mailing list