LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How do I hack a slackbuild of a cmake project to comply with Slackware64...? (https://www.linuxquestions.org/questions/slackware-14/how-do-i-hack-a-slackbuild-of-a-cmake-project-to-comply-with-slackware64-782068/)

Alexvader 01-13-2010 06:33 PM

How do I hack a slackbuild of a cmake project to comply with Slackware64...?
 
Hi Forum...

There is this slackbuild in which I have changed the part in bold...

Code:

#!/bin/sh
# Packager GioPower, luca.gio.85~at~gmail~dot~com
# VTK (Visualization Toolkit)
#
# The Visualization Toolkit (VTK) is an open-source, freely available
# software system for 3D computer graphics, image provessing and
# visualization.
#
# Web site: www.vtk.org
#


# Cmake flags
SHARED=ON
EXAMPLES=OFF

DO_STRIP=true

MAKE_FLAGS=-j5
# multithreading: may use -j3 for dual-core or -j5 for quad-core (or more ;))


CWD=`pwd`
TMP=${TMP:-/tmp/tgz}
NAME=vtk
MAJ_VERSION=5.4
VERSION=$MAJ_VERSION.2
ARCH=${ARCH:-x86_64}
BUILD=2gp
PKG=$TMP/package-$NAME
DESTDIR=$PKG/usr
rm -rf $PKG
mkdir -p $PKG
mkdir -p $DESTDIR


if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = x86_64 ]; then
  SLKCFLAGS="-O2 -fPIC"
fi

SOURCE=http://www.vtk.org/files/release/$MAJ_VERSION/$NAME-$VERSION.tar.gz

if [ ! -e $NAME-$VERSION.tar.gz ]; then
wget -c $SOURCE
fi

cd $TMP
rm -rf $NAME-$VERSION
tar xzvf $CWD/$NAME-$VERSION.tar.gz || exit 1
mv VTK $NAME-$MAJ_VERSION
cd $NAME-$MAJ_VERSION
chown -R root:root .

#configure and build
cmake -D BUILD_TESTING=OFF \
      -D BUILD_EXAMPLES=$EXAMPLES \
      -D BUILD_SHARED_LIBS=$SHARED \
      -D CMAKE_INSTALL_PREFIX=$DESTDIR \
      -D CMAKE_CXX_FLAGS="$SLKCFLAGS" \
      -D CMAKE_C_FLAGS="$SLKCFLAGS" \
      -D VTK_USE_GUISUPPORT=ON \
      -D VTK_USE_QVTK=ON \
      -D DESIRED_QT_VERSION=4 \
      $TMP/$NAME-$MAJ_VERSION || exit 1
make $MAKE_FLAGS || exit 1
#make || exit 1
make install || exit 1

#strip
if [ $DO_STRIP ]; then
strip --strip-unneeded $DESTDIR/lib/*
strip --strip-unneeded $DESTDIR/bin/*
fi

mkdir -p $PKG/install
cat $CWD/slack-desc >$PKG/install/slack-desc
cat $CWD/doinst.sh >$PKG/install/doinst.sh
DOCDIR=$PKG/usr/doc/$NAME-$MAJ_VERSION
mkdir -p $DOCDIR
cat $CWD/slack-desc >$DOCDIR/slack-desk
cat $CWD/$NAME.SlackBuild >$DOCDIR/$NAME.SlackBuild

cd $PKG
requiredbuilder -y -v -s $CWD $PKG
makepkg -p -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.txz

if [ "$1" = "--cleanup" ]; then
  rm -rf $TMP/$NAME-$MAJ_VERSION
  rm -rf $PKG
fi


This will still drop stuff into /usr/lib, which is clearly anti Slackware64... I do not know enough of cmake builds, which flag do I have to pass in the slackbuild for cmake to drop stuff in /usr/lib64...?

BRGDS

Alex

GooseYArd 01-13-2010 06:44 PM

try VTK_INSTALL_LIB_DIR

Alien Bob 01-14-2010 07:27 AM

Compare your cmake commandline to one that is actually used by Slackware:

Code:

mkdir -p build
cd build
  cmake \
    -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
    -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DMAN_INSTALL_DIR=/usr/man \
    -DSYSCONF_INSTALL_DIR=/etc/kde \
    -DLIB_SUFFIX=${LIBDIRSUFFIX} \

and you'll see how to get that package to install to "lib64".

Eric


All times are GMT -5. The time now is 03:04 AM.