[r-cran-yaml] 01/01: hack src/Makevars to explicitly link with system -lyaml.

Joost van Baal joostvb at moszumanska.debian.org
Wed Jan 6 23:49:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

joostvb pushed a commit to branch master
in repository r-cran-yaml.

commit a06358da15f1e0f60c0793ee471b005f55a7c98e
Author: Joost van Baal-Ilić <joostvb at nusku.mdcc.cx>
Date:   Thu Jan 7 00:49:14 2016 +0100

    hack src/Makevars to explicitly link with system -lyaml.
---
 debian/changelog | 165 ++++++++++++++++++++++++++++---------------------------
 debian/rules     |   6 ++
 2 files changed, 90 insertions(+), 81 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 5d55c6b..6f86fd1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,7 +4,8 @@ r-cran-yaml (2.1.13-3) unstable; urgency=low
   * debian/copyright: add upstream vcs at github and alternative upstream homepage at
     http://biostat.mc.vanderbilt.edu/wiki/Main/YamlR as comments.
   * debian/rules: remove convenience copy of libyaml sources before building, use system
-    <yaml.h> in r-ext.c and implicit.c.
+    <yaml.h> in r-ext.c and implicit.c, hack src/Makevars to explicitly link with system
+    -lyaml.
   * debian/control: add libyaml-dev to build depends.
 
   * FIXME: http://cran.r-project.org/doc/manuals/R-admin.html#Customizing-package-compilation
@@ -110,87 +111,89 @@ r-cran-yaml (2.1.13-3) unstable; urgency=low
      
      /** @} */
      
--------------------
-
-our r-ext.h has:
-
-#include "yaml.h"
-#include "yaml_private.h"
-
-should be
-
-#include <yaml.h>
-
-and, i guess
-
-#include "yaml_private.h"
-
-since libyaml-dev ships only /usr/include/yaml.h
-
-
-(sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% ls
-api.c     emitter.c   loader.c  parser.c  r-ext.c  scanner.c  yaml.h
-dumper.c  implicit.c  Makevars  reader.c  r-ext.h  writer.c   yaml_private.h
-(sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% rm api.c dumper.c emitter.c loader.c parser.c reader.c scanner.c writer.c 
-
-(sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% rm yaml.h 
-(sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% ls
-implicit.c  Makevars  r-ext.c  r-ext.h  yaml_private.h
-
-(sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% vi r-ext.h 
-
-(sid)joostvb at nusku:~/git/r-cran/r-cran-yaml-2.1.13% fakeroot ./debian/rules binary
-
-                MAKEFLAGS="LDFLAGS=-Wl,-z,relro" R CMD INSTALL -l /home/joostvb/git/r-cran/r-cran-yaml-2.1.13/debian/r-cran-yaml/usr/lib/R/site-library         \
-                                --clean  .  \
-                                "--built-timestamp=\"Tue, 22 Dec 2015 13:35:23 +0100\""                \
-                                ;                               \
-        fi
-* installing *source* package ‘yaml’ ...
-files ‘src/api.c’, ‘src/dumper.c’, ‘src/emitter.c’, ‘src/loader.c’, ‘src/parser.c’, ‘src/reader.c’, ‘src/scanner.c’, ‘src/writer.c’, ‘src/yaml.h’ are missing
-file ‘src/r-ext.h’ has the wrong MD5 checksum
-** libs
-make[1]: Entering directory '/home/joostvb/git/r-cran/r-cran-yaml-2.1.13/src'
-gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG     -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c implicit.c -o implicit.o
-gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG     -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c r-ext.c -o r-ext.o
-gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-z,relro -o yaml.so implicit.o r-ext.o -L/usr/lib/R/lib -lR
-
-....
-
-** testing if installed package can be loaded
-Error in dyn.load(file, DLLpath = DLLpath, ...) : 
-  unable to load shared object '/home/joostvb/git/r-cran/r-cran-yaml-2.1.13/debian/r-cran-yaml/usr/lib/R/site-library/yaml/libs/yaml.so':
-  /home/joostvb/git/r-cran/r-cran-yaml-2.1.13/debian/r-cran-yaml/usr/lib/R/site-library/yaml/libs/yaml.so: undefined symbol: yaml_sequence_start_event_initialize
-Error: loading failed
-
-      (sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% gcc -std=gnu99 -I/usr/share/R/include -I. -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c implicit.c -o implicit.o
+      -------------------
+      
+      our r-ext.h has:
+      
+      #include "yaml.h"
+      #include "yaml_private.h"
+      
+      should be
+      
+      #include <yaml.h>
+      
+      and, i guess
+      
+      #include "yaml_private.h"
+      
+      since libyaml-dev ships only /usr/include/yaml.h
+      
+      
       (sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% ls
-      implicit.c  implicit.o  Makevars  r-ext.c  r-ext.h  yaml_private.h
-
-      it compiles yaml.so without any error
-
-      this yaml.so is linked with
-
-              libR.so => /usr/lib/libR.so (0x00007f7614ddf000)
-
-      /usr/lib/x86_64-linux-gnu/libyaml-0.so.2.0.4 is _not_ linked with libR.so
-
-      seems removing yaml sources before compiling, and shipping the thus build r-ified yaml.so is the best?
-
-R CMD INSTALL --no-clean-on-error
-
-
-MAKEFLAGS="LDFLAGS=-Wl,-z,relro" R CMD INSTALL -l /home/joostvb/git/r-cran/r-cran-yaml/debian/r-cran-yaml/usr/lib/R/site-library        \
-                                --clean  . 
-
-(sid)joostvb at nusku:~/git/r-cran/r-cran-yaml% MAKEFLAGS="LDFLAGS=-Wl,-z,relro" R CMD INSTALL -l /home/joostvb/git/r-cran/r-cran-yaml/debian/r-cran-yaml/usr/lib/R/site-library --clean .   
-
-
-(sid)joostvb at nusku:~/git/r-cran/r-cran-yaml% MAKEFLAGS="LDFLAGS=-Wl,-z,relro" R CMD INSTALL -l /home/joostvb/git/r-cran/r-cran-yaml/debian/r-cran-yaml/usr/lib/R/site-library --clean --no-clean-on-error .
-
-yields
-
-debian/r-cran-yaml/usr/lib/R/site-library/yaml/libs/yaml.so*
+      api.c     emitter.c   loader.c  parser.c  r-ext.c  scanner.c  yaml.h
+      dumper.c  implicit.c  Makevars  reader.c  r-ext.h  writer.c   yaml_private.h
+      (sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% rm api.c dumper.c emitter.c loader.c parser.c reader.c scanner.c writer.c 
+      
+      (sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% rm yaml.h 
+      (sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% ls
+      implicit.c  Makevars  r-ext.c  r-ext.h  yaml_private.h
+      
+      (sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% vi r-ext.h 
+      
+      (sid)joostvb at nusku:~/git/r-cran/r-cran-yaml-2.1.13% fakeroot ./debian/rules binary
+      
+                      MAKEFLAGS="LDFLAGS=-Wl,-z,relro" R CMD INSTALL -l /home/joostvb/git/r-cran/r-cran-yaml-2.1.13/debian/r-cran-yaml/usr/lib/R/site-library         \
+                                      --clean  .  \
+                                      "--built-timestamp=\"Tue, 22 Dec 2015 13:35:23 +0100\""                \
+                                      ;                               \
+              fi
+      * installing *source* package ‘yaml’ ...
+      files ‘src/api.c’, ‘src/dumper.c’, ‘src/emitter.c’, ‘src/loader.c’, ‘src/parser.c’, ‘src/reader.c’, ‘src/scanner.c’, ‘src/writer.c’, ‘src/yaml.h’ are missing
+      file ‘src/r-ext.h’ has the wrong MD5 checksum
+      ** libs
+      make[1]: Entering directory '/home/joostvb/git/r-cran/r-cran-yaml-2.1.13/src'
+      gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG     -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c implicit.c -o implicit.o
+      gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG     -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c r-ext.c -o r-ext.o
+      gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-z,relro -o yaml.so implicit.o r-ext.o -L/usr/lib/R/lib -lR
+      
+      ....
+      
+      ** testing if installed package can be loaded
+      Error in dyn.load(file, DLLpath = DLLpath, ...) : 
+        unable to load shared object '/home/joostvb/git/r-cran/r-cran-yaml-2.1.13/debian/r-cran-yaml/usr/lib/R/site-library/yaml/libs/yaml.so':
+        /home/joostvb/git/r-cran/r-cran-yaml-2.1.13/debian/r-cran-yaml/usr/lib/R/site-library/yaml/libs/yaml.so: undefined symbol: yaml_sequence_start_event_initialize
+      Error: loading failed
+      
+            (sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% gcc -std=gnu99 -I/usr/share/R/include -I. -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c implicit.c -o implicit.o
+            (sid)joostvb at nusku:~/gi...n/r-cran-yaml-2.1.13/src% ls
+            implicit.c  implicit.o  Makevars  r-ext.c  r-ext.h  yaml_private.h
+      
+            it compiles yaml.so without any error
+      
+            this yaml.so is linked with
+      
+                    libR.so => /usr/lib/libR.so (0x00007f7614ddf000)
+      
+            /usr/lib/x86_64-linux-gnu/libyaml-0.so.2.0.4 is _not_ linked with libR.so
+      
+            seems removing yaml sources before compiling, and shipping the thus build r-ified yaml.so is the best?
+      
+      R CMD INSTALL --no-clean-on-error
+      
+      
+      MAKEFLAGS="LDFLAGS=-Wl,-z,relro" R CMD INSTALL -l /home/joostvb/git/r-cran/r-cran-yaml/debian/r-cran-yaml/usr/lib/R/site-library        \
+                                      --clean  . 
+      
+      (sid)joostvb at nusku:~/git/r-cran/r-cran-yaml% MAKEFLAGS="LDFLAGS=-Wl,-z,relro" R CMD INSTALL -l /home/joostvb/git/r-cran/r-cran-yaml/debian/r-cran-yaml/usr/lib/R/site-library --clean .   
+      
+      
+      (sid)joostvb at nusku:~/git/r-cran/r-cran-yaml% MAKEFLAGS="LDFLAGS=-Wl,-z,relro" R CMD INSTALL -l /home/joostvb/git/r-cran/r-cran-yaml/debian/r-cran-yaml/usr/lib/R/site-library --clean --no-clean-on-error .
+      
+      yields
+      
+      debian/r-cran-yaml/usr/lib/R/site-library/yaml/libs/yaml.so*
+
+      fixed?  seems to work now....
 
  -- Joost van Baal-Ilić <joostvb at debian.org>  Wed, 23 Dec 2015 15:52:52 +0100
 
diff --git a/debian/rules b/debian/rules
index 7a40d29..4857242 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,12 +13,18 @@ include /usr/share/dpkg/buildflags.mk
 
 makeFlags="LDFLAGS=$(LDFLAGS)"
 
+# use for debugging
+# extraInstallFlags := --no-clean-on-error
+
 include /usr/share/R/debian/r-cran.mk
 
+# see also /etc/R/Makeconf and /usr/lib/R/etc/Makeconf
+# and https://cran.r-project.org/doc/manuals/r-release/R-exts.html
 pre-build::
 	rm -vf src/api.c src/dumper.c src/emitter.c src/loader.c src/parser.c src/reader.c src/scanner.c src/writer.c src/yaml.h
 	sed -i 's/#include "yaml.h"/#include <yaml.h>/' src/implicit.c
 	sed -i 's/#include "yaml.h"/#include <yaml.h>/' src/r-ext.h
+	echo 'PKG_LIBS = -lyaml' >> src/Makevars
 
 common-install-arch::
 	rm -vf $(debRlib)/$(cranNameOrig)/LICENSE $(debRlib)/$(cranNameOrig)/CHANGELOG $(debRlib)/$(cranNameOrig)/THANKS

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/r-cran-yaml.git



More information about the debian-science-commits mailing list