Jump to content

KTp/Getting Set Up/Scripted: Difference between revisions

From KDE Community Wiki
Alin (talk | contribs)
No edit summary
Lclc (talk | contribs)
m kded-integration-module got renamed to kded-module in the repos
 
(10 intermediate revisions by 5 users not shown)
Line 5: Line 5:
#
#
# Build script for telepathy-kde, assumes you have the latest telepathy-qt4,  
# Build script for telepathy-kde, assumes you have the latest telepathy-qt4,  
# have a proper gitconfig setup for and that you use Project Neon
# have a proper gitconfig setup with the "kde:" prefix.
#
#
# Instructions on how to use the script :
# Instructions on how to use the script :
#     -b : Also build the cloned repos
#     -b   build only (updates repos before build)
#    -bi  build and install (updates repos before build)
#    -u    update/clone repos
#    -h    show help menu
#
#
# Copyright (C) 2011 Rohan Garg <[email protected]>
# Copyright (C) 2011 Rohan Garg <[email protected]>
# Copyright (C) 2011 Dominik Schmidt <[email protected]>
# Copyright (C) 2011 Dominik Schmidt <[email protected]>
# Copyright (C) 2011 Francesco Nwokeka <[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 27: Line 31:
#
#
###############################################################################
###############################################################################
 
SOURCE_DIR="."
SOURCE_DIR="."
INSTALL_DIR=`kde4-config --prefix`
INSTALL_DIR=`kde4-config --prefix`
 
# Add telepathy-qt4 here, if you want to build it from master too  
# Add telepathy-qt4 here, if you want to build it from master too  
REPOS="telepathy-accounts-kcm
REPOS="
telepathy-accounts-kcm-plugins
telepathy-logger-qt
telepathy-approver
ktp-common-internals
telepathy-text-ui
ktp-accounts-kcm
telepathy-contact-list
ktp-approver
telepathy-nepomuk-service
ktp-auth-handler
telepathy-presence-applet
ktp-call-ui
telepathy-presence-dataengine
ktp-contact-list
telepathy-contact-applet
ktp-contact-runner
telepathy-filetransfer-handler
ktp-desktop-applets
telepathy-send-file"
ktp-filetransfer-handler
ktp-kded-module
ktp-send-file
ktp-text-ui"
# these don't work currently, readd them at some point
# these don't work currently, readd them at some point
# telepathy-nepomuk-service
# telepathy-call-ui - dont have farsight*/
# telepathy-call-ui - dont have farsight*/
# telepathy-kde - doesnt build
# telepathy-kde - doesnt build
# telepathy-testlib
# telepathy-testlib
 
# configure your own custom build function here
# configure your own custom build function here
function build {
function build {
     cpus=$(ls -d /sys/devices/system/cpu/cpu? | wc -l)
     for repo in $REPOS
      
     do
    if [ -f /usr/bin/neonmake ]; then
         cd $repo
        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 $SOURCE_DIR
        cpus=$(ls -d /sys/devices/system/cpu/cpu? | wc -l)
cd $SOURCE_DIR


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


        git pull --rebase
         if [ $NEONENV ]; then
    else
             neonmake
        echo "####################################################"
        echo "              Cloning $repo              "
        echo "####################################################"
       
         if [ "$repo" = "telepathy-qt4" ]; then
             git clone git://anongit.freedesktop.org/telepathy/$repo
         else
         else
             git clone git://anongit.kde.org/$repo
             makej=$(($cpus + 1))
            mkdir -p build
            cd build
 
            if [ "$repo" = "telepathy-qt4" ]; then
                cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR ..
            else
                cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DCMAKE_BUILD_TYPE=debugfull ..
            fi
 
            make --jobs=$makej
            cd ..
         fi
         fi
        cd ..
    done
}
function buildInstall {
    build
    for repo in $REPOS
    do
        cd $repo/build
        sudo make install
        cd ../../
    done
}
function updateRepos {
    mkdir -p $SOURCE_DIR
    cd $SOURCE_DIR


        cd $repo
    for repo in $REPOS
     fi
     do
    if [ "$?" = "0" ]; then
        if [ -d "$repo" ]; then
        if [ "$1" = "-b" ]; then
            cd $repo
            echo ""
            echo "####################################################"
            echo "               Updating $repo              "
            echo "####################################################"
 
            git pull
            cd ..
        else
            echo ""
             echo "####################################################"
             echo "####################################################"
             echo "              Building $folder              "  
             echo "               Cloning $repo             "  
             echo "####################################################"
             echo "####################################################"
             build
 
         fi     
            if [ "$repo" = "telepathy-qt4" ]; then
         cd ..
                git clone git://anongit.freedesktop.org/telepathy/$repo
    fi
             else
done
                git clone git://anongit.kde.org/$repo
            fi
         fi
    done
}
 
function showHelp {
    echo "-b    build only (updates repos before build)"
    echo "-bi  build and install (updates repos before build)"
    echo "-u   update/clone repos"
    echo "-h    show this help menu"
}
 
 
if [ "$?" = "0" ];
    then
        if [ "$1" = "-b" ];
        then
            updateRepos
            build
 
        elif [ "$1" = "-bi" ];
        then
            updateRepos
            buildInstall
 
        elif [ "$1" = "-u" ];
        then
            updateRepos
 
         else [ "$1" = "-h" ];
            showHelp
        fi
fi


</source>
</source>

Latest revision as of 21:13, 29 April 2013

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 with the "kde:" prefix.
#
# Instructions on how to use the script :
#     -b    build only (updates repos before build)
#     -bi   build and install (updates repos before build)
#     -u    update/clone repos
#     -h    show help menu
#
# Copyright (C) 2011 Rohan Garg <[email protected]>
# Copyright (C) 2011 Dominik Schmidt <[email protected]>
# Copyright (C) 2011 Francesco Nwokeka <[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-logger-qt
ktp-common-internals
ktp-accounts-kcm
ktp-approver
ktp-auth-handler
ktp-call-ui
ktp-contact-list
ktp-contact-runner
ktp-desktop-applets
ktp-filetransfer-handler
ktp-kded-module
ktp-send-file
ktp-text-ui"
# these don't work currently, readd them at some point
# telepathy-nepomuk-service
# telepathy-call-ui - dont have farsight*/
# telepathy-kde - doesnt build
# telepathy-testlib
 
# configure your own custom build function here
function build {
    for repo in $REPOS
    do
        cd $repo

        cpus=$(ls -d /sys/devices/system/cpu/cpu? | wc -l)

        echo ""
        echo "####################################################"
        echo "              Building $repo               "
        echo "####################################################"

        if [ $NEONENV ]; then
            neonmake
        else
            makej=$(($cpus + 1))
            mkdir -p build
            cd build

            if [ "$repo" = "telepathy-qt4" ]; then
                cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR ..
            else
                cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DCMAKE_BUILD_TYPE=debugfull ..
            fi

            make --jobs=$makej
            cd ..
        fi
        cd ..
    done
}

function buildInstall {
    build

    for repo in $REPOS
    do
        cd $repo/build
        sudo make install
        cd ../../
    done
}

function updateRepos {
    mkdir -p $SOURCE_DIR
    cd $SOURCE_DIR

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

            git pull
            cd ..
        else
            echo ""
            echo "####################################################"
            echo "               Cloning $repo              " 
            echo "####################################################"

            if [ "$repo" = "telepathy-qt4" ]; then
                git clone git://anongit.freedesktop.org/telepathy/$repo
            else
                git clone git://anongit.kde.org/$repo
            fi
        fi
    done
}

function showHelp {
    echo "-b    build only (updates repos before build)"
    echo "-bi   build and install (updates repos before build)"
    echo "-u    update/clone repos"
    echo "-h    show this help menu"
}


if [ "$?" = "0" ]; 
    then
        if [ "$1" = "-b" ];
        then
            updateRepos
            build

        elif [ "$1" = "-bi" ];
        then
            updateRepos
            buildInstall

        elif [ "$1" = "-u" ];
        then
            updateRepos

        else [ "$1" = "-h" ];
            showHelp
        fi
fi