gnucash-on-osx master: Wrap boost build in CMake.
John Ralls
jralls at code.gnucash.org
Fri Nov 9 00:22:00 EST 2018
Updated via https://github.com/Gnucash/gnucash-on-osx/commit/7004e0aa (commit)
from https://github.com/Gnucash/gnucash-on-osx/commit/0432cba5 (commit)
commit 7004e0aa1007ec4da5dcfeba0069b14916d2ba72
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Nov 4 20:01:03 2018 -0800
Wrap boost build in CMake.
So that it builds automatically.
diff --git a/modulesets/gnucash.modules b/modulesets/gnucash.modules
index 58a3b2c..a2ff48f 100644
--- a/modulesets/gnucash.modules
+++ b/modulesets/gnucash.modules
@@ -29,6 +29,8 @@
href="https://www.openssl.org/source/"/>
<repository type="tarball" name="postgres"
href="https://ftp.postgresql.org/pub/source/"/>
+ <repository type="tarball" name="bintray"
+ href="https://dl.bintray.com/boostorg/release/"/>
<include href="https://gitlab.gnome.org/GNOME/gtk-osx/raw/master/modulesets-stable/gtk-osx.modules"/>
<!--include href="file:///Users/john/Development/GTK-OSX/gtk-osx-build/modulesets-stable/gtk-osx.modules"/-->
@@ -214,20 +216,16 @@
</dependencies>
</autotools>
-<!--./b2 toolset=darwin address-model=32 cxxflags="$CPPFLAGS" cflags="$CPPFLAGS" linkflags="$LDFLAGS" dll-path=$PREFIX/lib -\-prefix=$PREFIX -\-build-dir=$PREFIX/../build/boost_1_56_0 install
-
-After which one must run
-for i in `ls $PREFIX/lib/libboost*.dylib`; do install_name_tool -id $i $i; done
-for i in `ls $PREFIX/lib/libboost*.dylib`; do for j in `ls $PREFIX/lib/libboost*.dylib`; do install_name_tool -change `basename $i` $i $j; done; done
--->
- <autotools id="boost" supports-non-srcdir-builds="no" skip-install="True">
- <branch module="boost/boost_1_56_0.tar.bz2" repo="sourceforge"
- version="1.56.0"/>
+ <cmake id="boost" cmakeargs="-DLIBRARIES='date_time;regex;locale;filesystem'">
+ <branch module="1.68.0/source/boost_1_68_0.tar.bz2" version="1.68.0"
+ repo="bintray">
+ <patch file="https://raw.githubusercontent.com/gnucash/gnucash-on-osx/master/patches/boost-cmake.patch" strip="1"/>
+ </branch>
<after>
<dep package="icu"/>
<dep package="icu55"/>
</after>
- </autotools>
+ </cmake>
<autotools id="guile22" autogen-sh="configure">
<branch repo="ftp.gnu.org" module="guile/guile-2.2.4.tar.gz"
diff --git a/patches/boost-cmake.patch b/patches/boost-cmake.patch
new file mode 100644
index 0000000..25a4958
--- /dev/null
+++ b/patches/boost-cmake.patch
@@ -0,0 +1,75 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e69de29..b53cf7a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -0,0 +1,70 @@
++#CMakeLists.txt for wrapping Boost.Build in a gtk-osx jhbuild environment.
++#Copyright 2018 John Ralls <jralls at ceridwen.us>
++#This file is part of gtk-osx.
++# 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 2 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
++
++cmake_minimum_required (VERSION 3.6)
++
++project (boost)
++
++if(NOT LIBRARIES)
++ set(LIBRARIES date_time;regex;locale;filesystem)
++endif()
++
++set(B2_EXE ${CMAKE_SOURCE_DIR}/b2)
++
++add_custom_command (
++ OUTPUT ${B2_EXE}
++ COMMAND ${CMAKE_SOURCE_DIR}/bootstrap.sh
++ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
++ )
++
++set(LIB_ARG "")
++foreach(lib ${LIBRARIES})
++ list(APPEND LIB_ARGS --with-${lib})
++endforeach()
++
++add_custom_target(bootstrap DEPENDS ${B2_EXE})
++
++set(BUILD_FLAGS
++ --prefix=${CMAKE_INSTALL_PREFIX}
++ ${LIB_ARGS}
++ --build-dir=${CMAKE_BINARY_DIR} --link-shared
++ toolset=darwin cxxflags=${CMAKE_CXX_FLAGS}
++ cflags=${CMAKE_C_FLAGS} linkflags=${CMAKE_SHARED_LINKER_FLAGS}
++ install)
++add_custom_target(boost_libs
++ COMMAND ${B2_EXE} ${BUILD_FLAGS}
++ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
++ )
++
++set(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
++
++file(WRITE ${CMAKE_BINARY_DIR}/script1.sh
++ "for i in ${CMAKE_INSTALL_PREFIX}/lib/libboost*.dylib; do \n"
++ "\tinstall_name_tool -id $i $i; \n"
++ "done; \n"
++ "for i in ${CMAKE_INSTALL_PREFIX}/lib/libboost*.dylib; do \n"
++ "\tfor j in $PREFIX/lib/libboost*.dylib; do \n"
++ "\t\tinstall_name_tool -change `basename $i` $i $j; \n"
++ "\tdone; \n"
++ "done \n"
++)
++
++add_custom_target(fix_rpaths ALL
++ COMMAND ${CMAKE_COMMAND_TMP} $ENV{SHELL} ${CMAKE_BINARY_DIR}/script1.sh
++ )
++
++add_dependencies(fix_rpaths boost_libs)
++add_dependencies(boost_libs bootstrap)
++
++install(FILES ${CMAKE_SOURCE_DIR}/LICENSE_1_0.txt
++ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/boost/)
Summary of changes:
modulesets/gnucash.modules | 18 +++++------
patches/boost-cmake.patch | 75 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 83 insertions(+), 10 deletions(-)
create mode 100644 patches/boost-cmake.patch
More information about the gnucash-changes
mailing list