R-macos / recipes

System for building static dependent libraries for CRAN packages
43 stars 15 forks source link

Boost with linking #9

Closed eddelbuettel closed 4 years ago

eddelbuettel commented 5 years ago

I have two different packages [1] that would benefit greatly from having Boost libraries present.

This should be doable as CRAN / macOS use such a well-presecribed setup so

I do not have access to macOS or any familiarity with it so I can't drive this. Who can?

[1] One upstream discussion of brew vs macports is here

eddelbuettel commented 5 years ago

Bump

s-u commented 5 years ago

I have no idea - I'm not familiar with how boosts libraries get compiled, but the example handling of the headers should give you an example how to do it - you simply define the Makefile that does the job so it's infinitely flexible.

coatless commented 5 years ago

@eddelbuettel in short @s-u's reference is here:

https://github.com/s-u/recipes/commit/74cc1e61c47c366fdccb6b4d319d94ba7c4f9d14#diff-67b94cf00f17c1998fe81d3e2ab09f36

To compile the boost library package, we need to create a boost-lib.patch that contains:

diff -Nru test_0.0/configure xx/configure
--- test_0.0/configure       1969-12-31 19:00:00.000000000 -0500
+++ xx/configure         2019-03-14 14:22:40.000000000 -0400
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+src=`dirname $0`
+
+cat << EOF >> Makefile
+all:
+
+install:
+   echo Installing from $src to \$(DESTDIR)/usr/local/boost-1.69.0/
+   mkdir -p \$(DESTDIR)/usr/local/boost-1.69.0
+   ./bootstrap.sh --prefix=\$(DESTDIR)/usr/local/boost-1.69.0
+ .    sudo ./b2 cxxflags=-std=c++11 install
+
+EOF

The recipe file boost-lib would then be given as:

Package: boost-lib
Version: 1.69-0
Source.URL: https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz
Configure.driver: sh
eddelbuettel commented 5 years ago

@coatless Do you want to give it a spin? Hard for me to work on any of this as I don't have the OS in question at hand.

s-u commented 5 years ago

Yes, I'll have a look - just no need for sudo - the build is user-space, the permissions are set before packaging from DESTDIR

coatless commented 5 years ago

See notes in #10.