[gnome-continuous] Add jansson to the build



commit bfa528f72834c3597f63b8114e9e0496a60ed3eb
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Wed Oct 5 11:00:35 2016 -0400

    Add jansson to the build
    
    NetworkManager now require the jansson libray by default; while
    the JSON validation in the team support that uses this is disableable
    and the team support isn't useful for us, it's better to stick to
    upstream defaults. Pull request for the build-api patch:
    https://github.com/akheron/jansson/pull/310

 manifest.json                        |    4 +
 patches/jansson-cmake-buildapi.patch |  153 ++++++++++++++++++++++++++++++++++
 2 files changed, 157 insertions(+), 0 deletions(-)
---
diff --git a/manifest.json b/manifest.json
index d3959df..a5edcf0 100644
--- a/manifest.json
+++ b/manifest.json
@@ -535,6 +535,10 @@
                {"src": "fd:libmbim/libmbim",
                 "name": "libmbim"},
 
+                {"src": "git:git://github.com/akheron/jansson",
+                 "config-opts": ["--disable-documentation", "--enable-shared"],
+                 "patches": ["jansson-cmake-buildapi.patch"]},
+
                {"src": "fd-MM:ModemManager.git",
                 "config-opts": ["--with-udev-base-dir=/usr/lib/udev",
                                 "--disable-more-warnings"]},
diff --git a/patches/jansson-cmake-buildapi.patch b/patches/jansson-cmake-buildapi.patch
new file mode 100644
index 0000000..adda6f1
--- /dev/null
+++ b/patches/jansson-cmake-buildapi.patch
@@ -0,0 +1,153 @@
+From c9cea3d83c8e571daea8b20127f5225ff850e118 Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor fishsoup net>
+Date: Wed, 5 Oct 2016 10:22:13 -0400
+Subject: [PATCH] build: Add a "configure" script implementing the GNOME Build
+ API
+
+See http://people.gnome.org/~walters/docs/build-api.txt
+
+(Based on a patch for libssh from Colin Walters <walters verbum org>)
+---
+ .gitignore     |  1 -
+ CMakeLists.txt | 19 +++++++++---------
+ configure      | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ jansson.pc.in  |  2 +-
+ 4 files changed, 74 insertions(+), 11 deletions(-)
+ create mode 100755 configure
+
+diff --git a/.gitignore b/.gitignore
+index e6533b4..9b6400d 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -13,7 +13,6 @@ config.h.in
+ config.log
+ config.status
+ config.sub
+-configure
+ depcomp
+ install-sh
+ libtool
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 17974c2..aca54fe 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -595,24 +595,25 @@ endif()
+ 
+ set(JANSSON_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
+ 
++# Make sure the paths are absolute.
++foreach(p LIB BIN INCLUDE CMAKE)
++    set(var JANSSON_INSTALL_${p}_DIR)
++    if(NOT IS_ABSOLUTE "${${var}}")
++        set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
++    endif()
++endforeach()
++
+ # Create pkg-conf file.
+ # (We use the same files as ./configure does, so we
+ #  have to defined the same variables used there).
+ set(prefix      ${CMAKE_INSTALL_PREFIX})
+ set(exec_prefix ${CMAKE_INSTALL_PREFIX})
+-set(libdir      ${CMAKE_INSTALL_PREFIX}/${JANSSON_INSTALL_LIB_DIR})
++set(libdir      ${JANSSON_INSTALL_LIB_DIR})
++set(includedir  ${JANSSON_INSTALL_INCLUDE_DIR})
+ set(VERSION     ${JANSSON_DISPLAY_VERSION})
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/jansson.pc.in
+                ${CMAKE_CURRENT_BINARY_DIR}/jansson.pc @ONLY)
+ 
+-# Make sure the paths are absolute.
+-foreach(p LIB BIN INCLUDE CMAKE)
+-    set(var JANSSON_INSTALL_${p}_DIR)
+-    if(NOT IS_ABSOLUTE "${${var}}")
+-        set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
+-    endif()
+-endforeach()
+-
+ # Export targets (This is used for other CMake projects to easily find the libraries and include files).
+ export(TARGETS jansson
+         FILE "${PROJECT_BINARY_DIR}/JanssonTargets.cmake")
+diff --git a/configure b/configure
+new file mode 100755
+index 0000000..f9b5f33
+--- /dev/null
++++ b/configure
+@@ -0,0 +1,63 @@
++#!/bin/bash
++# configure script adapter for cmake
++# Copyright 2010, 2011, 2013 Colin Walters <walters verbum 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.
++read_arg() {
++    # $1 = arg name
++    # $2 = arg value
++    # $3 = arg parameter
++    local rematch='^[^=]*=(.*)$'
++    if [[ $2 =~ $rematch ]]; then
++        read "$1" <<< "${BASH_REMATCH[1]}"
++    else
++        read "$1" <<< "$3"
++        # There is no way to shift our callers args, so
++        # return 1 to indicate they should do it instead.
++        return 1
++    fi
++}
++
++disable_documentation=false
++enable_shared=false
++
++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;;
++        --disable-documentation)  disable_documentation=true ;;
++        --enable-shared)  enable_shared=true ;;
++        *) echo "Ignoring unknown option '$1'";;
++    esac
++    shift
++done
++
++bindir=${bindir:-$prefix/bin}
++libdir=${libdir:-$prefix/lib}
++
++srcdir=$(dirname $0)
++
++opts=
++$disable_documentation && opts="$opts -DJANSSON_BUILD_DOCS=OFF"
++$enable_shared && opts="$opts -DJANSSON_BUILD_SHARED_LIBS=ON"
++
++cmake \
++     "-DCMAKE_INSTALL_PREFIX:PATH=$prefix" \
++     "-DJANSSON_INSTALL_LIB_DIR:PATH=$libdir" \
++     "-DJANSSON_INSTALL_BIN_DIR:PATH=$bindir" \
++     "-DJANSSON_INSTALL_INCLUDE_DIR:PATH=$prefix/include" \
++     "-DJANSSON_INSTALL_CMAKE_DIR:PATH=$libdir/cmake" \
++     $opts \
++     ${srcdir}
+diff --git a/jansson.pc.in b/jansson.pc.in
+index d9bf4da..69c9a43 100644
+--- a/jansson.pc.in
++++ b/jansson.pc.in
+@@ -1,7 +1,7 @@
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ libdir=@libdir@
+-includedir=${prefix}/include
++includedir=@includedir@
+ 
+ Name: Jansson
+ Description: Library for encoding, decoding and manipulating JSON data
+-- 
+2.7.4
+


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