KTp/Getting Set Up/Scripted: Difference between revisions

From KDE Community Wiki
(indented build function)
No edit summary
Line 11: Line 11:
#
#
# Copyright (C) 2011 Rohan Garg <[email protected]>
# Copyright (C) 2011 Rohan Garg <[email protected]>
# Copyright (C) 2011 Dominik Schmidt <[email protected]>
#
#
# This program is free software: you can redistribute it and/or modify
# This program is free software: you can redistribute it and/or modify
Line 26: Line 27:
#
#
###############################################################################
###############################################################################
# init variables, use current directory to look for folders and build them
DIR="."


function build {
SOURCE_DIR="."
INSTALL_DIR=`kde4-config --prefix`


    ## Add/Remove custom CMake options over here
# Add telepathy-qt4 here, if you want to build it from master too
    customcmakeopts="-DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` \
REPOS="telepathy-accounts-kcm
                    -DCMAKE_BUILD_TYPE=debugfull"
telepathy-accounts-kcm-plugins
telepathy-approver
telepathy-chat-handler
telepathy-contact-list
telepathy-nepomuk-service
telepathy-presence-applet
telepathy-presence-dataengine
telepathy-contact-applet
telepathy-filetransfer-handler
telepathy-send-file"
# these don't work currently, readd them at some point
# telepathy-call-ui - dont have farsight*/
# telepathy-kde - doesnt build
# telepathy-testlib


# configure your own custom build function here
function build { 
     cpus=$(ls -d /sys/devices/system/cpu/cpu? | wc -l)
     cpus=$(ls -d /sys/devices/system/cpu/cpu? | wc -l)
 
   
     if [ -f /usr/bin/neonmake ]; then
     if [ -f /usr/bin/neonmake ]; then
         neonmake
         neonmake
Line 43: Line 58:
         mkdir -p build
         mkdir -p build
         cd build
         cd build
         cmake $customcmakeopts ..
         cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DCMAKE_BUILD_TYPE=debugfull ..
         make --jobs=$makej
         make --jobs=$makej
        sudo make install
         cd ..
         cd ..
     fi
     fi
}
mkdir -p $DIR
cd $DIR


}
for repo in $REPOS
do
    if [ -d "$repo" ]; then
        cd $repo
        echo "####################################################"
        echo "              Updating $repo              "
        echo "####################################################"


if [ -n "$(ls -A $DIR)" ]; then
        git pull --rebase
    echo "Updating telepathy repos, since $DIR is not Empty"
     else
     for folder in $(ls -p | grep \/); do
        cd $folder
         echo "####################################################"
         echo "####################################################"
         echo "              Updating folder $folder             "  
         echo "              Cloning $repo             "  
         echo "####################################################"
         echo "####################################################"
         git pull
          
         if [ "$1" = "-b" ]; then
         if [ "$repo" = "telepathy-qt4" ]; then
             echo "####################################################"
             git clone git://anongit.freedesktop.org/telepathy/$repo
            echo "              Building folder $folder              "
        else
            echo "####################################################"
             git clone kde:$repo
             build
         fi
         fi
         cd ..
 
    done
         cd $repo
else
     fi
    echo "$DIR is Empty, clone them repos!!!"
 
    # Uncomment the next line to build telepathy-qt4 from sources as well
    # git://anongit.freedesktop.org/telepathy/telepathy-qt4
    git clone git://oscaf.git.sourceforge.net/gitroot/oscaf/shared-desktop-ontologies
    git clone kde:kwhiteboard
    git clone kde:telepathy-accounts-kcm
     git clone kde:telepathy-approver
    git clone kde:telepathy-call-ui
    git clone kde:telepathy-chat-handler
    git clone kde:telepathy-contact-list
    git clone kde:telepathy-kde
    git clone kde:telepathy-nepomuk-service
    git clone kde:telepathy-presence-applet
    git clone kde:telepathy-presence-dataengine 
    git clone kde:telepathy-testlib
    git clone kde:telepathy-contact-applet
    git clone kde:telepathy-filetransfer-handler
    git clone kde:telepathy-send-file
    git clone kde:telepathy-accounts-kcm-plugins
     if [ "$1" = "-b" ]; then
     if [ "$1" = "-b" ]; then
      for folder in $(ls -p | grep \/); do
        echo "####################################################"
            cd $folder
        echo "              Building $folder              "  
              echo "####################################################"
        echo "####################################################"
              echo "              Building folder $folder              "  
        build
              echo "####################################################"
        cd ..
              build
              cd ..  
      done
     fi
     fi
fi
done
 
</source>
</source>

Revision as of 17:24, 14 September 2011

Here is a script to help you a major part of Telepathy KDE, feel free to modify it according to your needs.

#!/bin/bash
#
# Build script for telepathy-kde, assumes you have the latest telepathy-qt4, 
# have a proper gitconfig setup for and that you use Project Neon
#
# Instructions on how to use the script :
#      -b : Also build the cloned repos
#
# Copyright (C) 2011 Rohan Garg <[email protected]>
# Copyright (C) 2011 Dominik Schmidt <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################

SOURCE_DIR="."
INSTALL_DIR=`kde4-config --prefix`

# Add telepathy-qt4 here, if you want to build it from master too 
REPOS="telepathy-accounts-kcm
telepathy-accounts-kcm-plugins
telepathy-approver
telepathy-chat-handler
telepathy-contact-list
telepathy-nepomuk-service
telepathy-presence-applet
telepathy-presence-dataengine
telepathy-contact-applet
telepathy-filetransfer-handler
telepathy-send-file"
# these don't work currently, readd them at some point
# telepathy-call-ui - dont have farsight*/
# telepathy-kde - doesnt build
# telepathy-testlib

# configure your own custom build function here
function build {  
    cpus=$(ls -d /sys/devices/system/cpu/cpu? | wc -l)
    
    if [ -f /usr/bin/neonmake ]; then
        neonmake
    else
        makej=$(($cpus + 1))
        mkdir -p build
        cd build
        cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DCMAKE_BUILD_TYPE=debugfull ..
        make --jobs=$makej
        sudo make install
        cd ..
    fi
}

mkdir -p $DIR
cd $DIR

for repo in $REPOS
do
    if [ -d "$repo" ]; then
        cd $repo
        echo "####################################################"
        echo "               Updating $repo              " 
        echo "####################################################"

        git pull --rebase
    else
        echo "####################################################"
        echo "               Cloning $repo              " 
        echo "####################################################"
        
        if [ "$repo" = "telepathy-qt4" ]; then
            git clone git://anongit.freedesktop.org/telepathy/$repo
        else
            git clone kde:$repo
        fi

        cd $repo
    fi

    if [ "$1" = "-b" ]; then
        echo "####################################################"
        echo "              Building $folder               " 
        echo "####################################################"
        build
        cd ..
    fi
done