From 0cdbfe8413000c02695fda0c8faa14d498891f76 Mon Sep 17 00:00:00 2001 From: Stefan Paletta Date: Mon, 3 Sep 2007 09:41:57 +0000 Subject: [PATCH] Stefan Paletta: package cmake and hook it up with the build system [2007072500570559570] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@8691 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- Documentation/Developers/PKG-BUILD-VARS | 4 +++ package/kde/k3b/k3b.conf | 1 + package/public/cmake/cmake.conf | 8 +++++ package/public/cmake/cmake.desc | 47 +++++++++++++++++++++++++ scripts/Build-Pkg | 3 +- scripts/functions | 9 ++++- 6 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 package/public/cmake/cmake.conf create mode 100644 package/public/cmake/cmake.desc diff --git a/Documentation/Developers/PKG-BUILD-VARS b/Documentation/Developers/PKG-BUILD-VARS index d8434ef3d..f3fb7ff46 100644 --- a/Documentation/Developers/PKG-BUILD-VARS +++ b/Documentation/Developers/PKG-BUILD-VARS @@ -91,6 +91,10 @@ configscript .. script file name of the GNU autoconf configure script configexec .... command for executing $configscript (default=bash) pyconfopt ..... options for 'setup.py' - Python setup scripts +runcmake ...... set to '0' if you want to skip running 'cmake .' +cmakesrcdir ... set to path of srcdir when requesting an out-of-source build +cmakedefs ..... options passed to cmake + runxmkmf ...... set to '0' if you want to skip running 'xmkmf' runmkpl ....... set to '0' if you want to skip running 'perl Makefile.PL' runpysetup .... set to '0' if you want to skip running 'python setup.py' diff --git a/package/kde/k3b/k3b.conf b/package/kde/k3b/k3b.conf index 656a03741..506d82800 100644 --- a/package/kde/k3b/k3b.conf +++ b/package/kde/k3b/k3b.conf @@ -21,4 +21,5 @@ # --- ROCK-COPYRIGHT-NOTE-END --- . $base/package/kde/kde-3.conf +runcmake=0 diff --git a/package/public/cmake/cmake.conf b/package/public/cmake/cmake.conf new file mode 100644 index 000000000..2e83068e9 --- /dev/null +++ b/package/public/cmake/cmake.conf @@ -0,0 +1,8 @@ + +pkginstalled zlib && var_append cmakedefs ' ' '-DCMAKE_USE_SYSTEM_ZLIB=ON' +pkginstalled expat && var_append cmakedefs ' ' '-DCMAKE_USE_SYSTEM_EXPAT=ON' +pkginstalled curl && var_append cmakedefs ' ' '-DCMAKE_USE_SYSTEM_CURL=ON' + +configscript="./bootstrap" +confopt="--prefix=/${prefix} --mandir=${mandir#/${prefix}} --docdir=${docdir#/${prefix}}" + diff --git a/package/public/cmake/cmake.desc b/package/public/cmake/cmake.desc new file mode 100644 index 000000000..b92630e88 --- /dev/null +++ b/package/public/cmake/cmake.desc @@ -0,0 +1,47 @@ + +[COPY] --- ROCK-COPYRIGHT-NOTE-BEGIN --- +[COPY] +[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch. +[COPY] Please add additional copyright information _after_ the line containing +[COPY] the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +[COPY] the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +[COPY] +[COPY] ROCK Linux: rock-src/package/public/cmake/cmake.desc +[COPY] ROCK Linux is Copyright (C) 1998 - 2007 Clifford Wolf +[COPY] +[COPY] This program is free software; you can redistribute it and/or modify +[COPY] it under the terms of the GNU General Public License as published by +[COPY] the Free Software Foundation; either version 2 of the License, or +[COPY] (at your option) any later version. A copy of the GNU General Public +[COPY] License can be found at Documentation/COPYING. +[COPY] +[COPY] Many people helped and are helping developing ROCK Linux. Please +[COPY] have a look at http://www.rocklinux.org/ and the Documentation/TEAM +[COPY] file for details. +[COPY] +[COPY] --- ROCK-COPYRIGHT-NOTE-END --- + +[I] A cross-platform, open-source make system + +[T] CMake is a cross-platform, open-source make system. CMake is used to +[T] control the software compilation process using simple platform- +[T] independent and compiler-independent configuration files. CMake generates +[T] native makefiles and workspaces that can be used in the compiler +[T] environment of your choice. CMake is quite sophisticated: it is possible +[T] to support complex environments requiring system configuration, +[T] preprocessor generation, code generation, and template instantiation. + +[U] http://www.cmake.org/ + +[A] Kitware, Inc., Insight Consortium +[M] The ROCK Linux Project + +[C] extra/development + +[L] BSD +[S] Stable +[V] 2.4.7 +[P] X -----5---9 800.000 + +[D] 1260768222 cmake-2.4.7.tar.gz http://www.cmake.org/files/v2.4/ + diff --git a/scripts/Build-Pkg b/scripts/Build-Pkg index 16be88ab0..b195dd0ab 100755 --- a/scripts/Build-Pkg +++ b/scripts/Build-Pkg @@ -548,9 +548,10 @@ srcdir=auto ; srctar=auto taropt="--use-compress-program=bzip2 -xf" mainfunction="build_this_package" -runconf=1 ; runxmkmf=1 ; runmkpl=1 ; runpysetup=1 ; autopatch=1 +runconf=1 ; runxmkmf=1 ; runmkpl=1 ; runpysetup=1 ; runcmake=1 ; autopatch=1 autoextract=1 ; chownsrcdir=1 ; nocvsinsrcdir=1; patchopt="-bfp1 -z .orig" createprefix=1 ; createdocs="" ; rmemptydir="" ; autoso2a=0 ; forcefpic="" +cmakesrcdir=. check_shared=1 check_usrlocal=1 diff --git a/scripts/functions b/scripts/functions index 5761c9b5c..d06897a1f 100644 --- a/scripts/functions +++ b/scripts/functions @@ -242,6 +242,10 @@ set_confopt() { else confopt="$confopt --build=\$arch_build --host=\$arch_target" fi + + cmakedefs="-DCMAKE_INSTALL_PREFIX=/${prefix}" + cmakedefs="$cmakedefs -DCMAKE_MAN_DIR=${mandir#/${prefix}}" + cmakedefs="$cmakedefs -DCMAKE_DOC_DIR=${docdir#/${prefix}}" } # @@ -740,7 +744,10 @@ build_this_package() { # hook_eval preconf # - if [ $runconf = 1 ]; then + if [ $runcmake = 1 -a -f $cmakesrcdir/CMakeLists.txt -a -n "$( type -p cmake )" ] + then + cmake $cmakesrcdir $cmakedefs + elif [ $runconf = 1 ]; then if [ -n "$( type -p $configscript )" -o $autogen = 1 ] then eval_config_command $( eval echo $confopt )