[gnome-continuous] Update the build-api patch for libgit2



commit 7658bbe72e2e579b565d0b83ae8e78f586cf9e05
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sat Feb 18 11:38:00 2017 +0000

    Update the build-api patch for libgit2
    
    Use the Ninja generator for CMake.

 patches/libssh-cmake-buildapi.patch |   95 +++++++++++++++++++++++++++--------
 1 files changed, 73 insertions(+), 22 deletions(-)
---
diff --git a/patches/libssh-cmake-buildapi.patch b/patches/libssh-cmake-buildapi.patch
index 3717d04..3b7e1f1 100644
--- a/patches/libssh-cmake-buildapi.patch
+++ b/patches/libssh-cmake-buildapi.patch
@@ -1,30 +1,31 @@
-From 9841e201a9da3b9c56c2dc9877b82fb24a9c6d61 Mon Sep 17 00:00:00 2001
-From: Colin Walters <walters verbum org>
+From cc18aab086da29d5f3425a014500e06b2ba8060d Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi gnome org>
 Date: Tue, 12 Nov 2013 10:50:07 -0500
-Subject: [PATCH] build: Add a "configure" script implementing the GNOME Build API
+Subject: [PATCH] build: Add a "configure" script implementing the GNOME Build
+ API
 
 See http://people.gnome.org/~walters/docs/build-api.txt
 
-Hopefully this will turn into a generic copy/paste-able adapter for
-cmake.
+v2:
+  - Add sanity checks for binaries we depend on
+  - Use the Ninja generator for CMake
 ---
- configure |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 49 insertions(+), 0 deletions(-)
+ configure | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 98 insertions(+)
  create mode 100755 configure
 
 diff --git a/configure b/configure
 new file mode 100755
-index 0000000..b50e1ff
+index 0000000..857d072
 --- /dev/null
 +++ b/configure
-@@ -0,0 +1,49 @@
+@@ -0,0 +1,98 @@
 +#!/bin/bash
 +# configure script adapter for cmake
 +# Copyright 2010, 2011, 2013 Colin Walters <walters verbum org>
++# Copyright 2017 Emmanuele Bassi <ebassi gnome org>
 +# Licensed under the new-BSD license (http://www.opensource.org/licenses/bsd-license.php)
 +
-+prefix=/usr
-+
 +# Little helper function for reading args from the commandline.
 +# it automatically handles -a b and -a=b variants, and returns 1 if
 +# we need to shift $3.
@@ -43,17 +44,43 @@ index 0000000..b50e1ff
 +    fi
 +}
 +
++sanitycheck() {
++    # $1 = arg name
++    # $1 = arg command
++    # $2 = arg alternates
++    local cmd=$( which $2 2>/dev/null )
++    if [ -x "$cmd" ]; then
++        read "$1" <<< "$cmd"
++        return 0
++    fi
++    test -z $3 || {
++        for alt in $3; do
++            cmd=$( which $alt 2>/dev/null )
++            if [ -x "$cmd" ]; then
++                read "$1" <<< "$cmd"
++                return 0
++            fi
++        done
++    }
++    echo -e "\e[1;31mERROR\e[0m: Command '$2' not found"
++    exit 1
++}
++
++sanitycheck CMAKE 'cmake'
++sanitycheck NINJA 'ninja' 'ninja-build'
++
 +while (($# > 0)); do
 +    case "${1%%=*}" in
-+              --prefix) read_arg prefix "$@" || shift;;
-+              --bindir) read_arg bindir "$@" || shift;;
-+              --sbindir) read_arg sbindir "$@" || shift;;
-+              --libexecdir) read_arg libexecdir "$@" || shift;;
-+              --datarootdir) read_arg datarootdir "$@" || shift;;
-+              --datadir) read_arg datadir "$@" || shift;;
-+              --sysconfdir) read_arg sysconfdir "$@" || shift;;
-+              --libdir) read_arg libdir "$@" || shift;;
-+              --mandir) read_arg mandir "$@" || shift;;
++        --prefix) read_arg prefix "$@" || shift;;
++        --bindir) read_arg bindir "$@" || shift;;
++        --sbindir) read_arg sbindir "$@" || shift;;
++        --libexecdir) read_arg libexecdir "$@" || shift;;
++        --datarootdir) read_arg datarootdir "$@" || shift;;
++        --datadir) read_arg datadir "$@" || shift;;
++        --sysconfdir) read_arg sysconfdir "$@" || shift;;
++        --libdir) read_arg libdir "$@" || shift;;
++        --mandir) read_arg mandir "$@" || shift;;
++        --includedir) read_arg includedir "$@" || shift;;
 +      *) echo "Ignoring unknown option '$1'";;
 +    esac
 +    shift
@@ -61,12 +88,36 @@ index 0000000..b50e1ff
 +
 +srcdir=$(dirname $0)
 +
-+exec cmake \
++# Defaults
++test -z ${prefix} && prefix="/usr/local"
++test -z ${bindir} && bindir=${prefix}/bin
++test -z ${sbindir} && sbindir=${prefix}/sbin
++test -z ${libexecdir} && libexecdir=${prefix}/bin
++test -z ${datarootdir} && datarootdir=${prefix}/share
++test -z ${datadir} && datadir=${datarootdir}
++test -z ${sysconfdir} && sysconfdir=${prefix}/etc
++test -z ${libdir} && libdir=${prefix}/lib
++test -z ${mandir} && mandir=${prefix}/share/man
++test -z ${includedir} && includedir=${prefix}/include
++
++cat > Makefile <<END
++# Generated by configure; do not edit
++
++all:
++      ${NINJA}
++
++install:
++      DESTDIR="\$(DESTDIR)" ${NINJA} install
++END
++
++
++exec ${CMAKE} \
 +     -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
 +     -DLIB_INSTALL_DIR:PATH=${libdir} \
 +     -DSYSCONF_INSTALL_DIR:PATH=${sysconfdir} \
 +     -DSHARE_INSTALL_PREFIX:PATH=${datadir} \
++     -GNinja \
 +     ${srcdir}
 -- 
-1.7.1
+2.9.3
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]