LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to compile FreeCAD unstable 0.14 ? (https://www.linuxquestions.org/questions/slackware-14/how-to-compile-freecad-unstable-0-14-a-4175504825/)

brodo 05-13-2014 08:32 AM

How to compile FreeCAD unstable 0.14 ?
 
Here we have instructions for several distros:

http://freecadweb.org/wiki/index.php...=CompileOnUnix

Has anyone compiled FreeCAD 0.14 in Slackware ?

willysr 05-13-2014 09:12 AM

We only have 0.13.x in SBo
http://slackbuilds.org/repository/14.1/graphics/FreeCad

brodo 05-13-2014 09:38 AM

I have 0.13 onboard, but 0.14 has definitely more features ...

cnv 05-15-2014 03:45 AM

I tried to compile development version. It takes several hours.
All of the mentioned requirements are available from SlackBuilds.org

xerces-c
eigen3
Coin
SoQt
Pivy
OpenCASCADE

apiextractor
generatorrunner
shiboken
pyside

FreeCAD
Code:


#!/bin/sh

# Slackware build script for FreeCAD

# Copyright 2010-2012 Niels Horn, Rio de Janeiro, RJ, Brazil
# 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.

# Edited by cnv 2014

PRGNAM=FreeCAD
VERSION=${VERSION:-git$(date +"%y%m%d")}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

SRCNAM=freecad

# Check if we have the tarball
if [ ! -r $SRCNAM-git*.tar.bz2 ]; then
  echo ""
  echo "$SRCNAM-$VERSION.tar.bz2 not found. Getting the source code."
  echo ""
  git clone git://git.code.sf.net/p/free-cad/code freecad || exit 1
  cd $SRCNAM || exit 1
  find . -name ".*" -print0 | xargs -0 rm -rf 2> /dev/null
  cd -
  tar -cvjf $SRCNAM-$VERSION.tar.bz2 $SRCNAM || exit 1
  rm -rf $SRCNAM
fi

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

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -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

#set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT || exit 1
cd $TMP
rm -rf $SRCNAM
tar xvf $CWD/$SRCNAM-git*.tar.bz2 || exit 1
cd $SRCNAM || exit 1
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 {} \;

# no downloads allowed during the build
#patch -p1 < $CWD/files/no_coin3d_docs.patch

# thanks to archlinux for these fixes
# compatibility issues with OCC-6.6
#for i in $( grep -Rl "BRepTools::OuterShell" * )
#do
#  sed -e "s|BRepTools|BRepClass3d|g" -i "$i"
#done

# these patch contain some code taken from upstream
# thanks to cbuehler
#patch -p1 -i $CWD/files/freecad-0.13.diff

mkdir build
cd build
  cmake \
    -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
    -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -Wno-cpp" \
    -DCMAKE_INSTALL_PREFIX=/opt/$PRGNAM \
    -DRESOURCEDIR=/opt/$PRGNAM/share/data \
    -DLIB_SUFFIX=${LIBDIRSUFFIX} \
    -DMAN_INSTALL_DIR=/usr/man \
    -DDOCDIR=/usr/doc/$PRGNAM-$VERSION \
    -DOCC_INCLUDE_DIR=/usr/include/OpenCASCADE \
    -DOCC_LIBRARY=/usr/lib${LIBDIRSUFFIX} \
    -DFREECAD_USE_EXTERNAL_PIVY:BOOL=ON \
    -DCMAKE_BUILD_TYPE=Release ..

  make V=1 || exit 1
  make install DESTDIR=$PKG || exit 1
cd ..

# build the qt plugin
cd src/Tools/plugins/widget
  qmake plugin.pro
  make || exit 1
  install -m 0755 -D libFreeCAD_widgets.so \
    $PKG/usr/lib$LIBDIRSUFFIX/qt4/plugins/designer/libFreeCAD_widgets.so || exit 1
cd -

# create links in /usr/bin
mkdir -p $PKG/usr/bin
ln -s /opt/FreeCAD/bin/FreeCADCmd $PKG/usr/bin/FreeCADCmd || exit 1
ln -s /opt/FreeCAD/bin/FreeCAD $PKG/usr/bin/FreeCAD || exit 1

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

# Copy icon, desktop file and mime info
mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps $PKG/usr/share/mime/packages
cp $PKG/opt/$PRGNAM/data/freecad.xpm $PKG/usr/share/pixmaps/
cat $CWD/files/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
cat $CWD/files/$PRGNAM.xml > $PKG/usr/share/mime/packages/$PRGNAM.xml

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
  README.Linux ChangeLog.txt \
  $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 || exit 1
cat $CWD/doinst.sh > $PKG/install/doinst.sh || exit 1

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


brodo 05-15-2014 05:54 AM

Did you succeed with this compilation ?
Is this 0.14 git version running smoothly ?

cnv 05-16-2014 12:24 AM

Compilation was successful. FreeCAD works fine.
http://s28.postimg.org/lq8vr2qbx/freecad.png

brodo 05-16-2014 04:09 AM

Quote:

Originally Posted by cnv (Post 5171817)
Compilation was successful. FreeCAD works fine.
http://s28.postimg.org/lq8vr2qbx/freecad.png

Compilation succeded ! Thanks !


All times are GMT -5. The time now is 02:33 AM.