r-cran.mk: Allow R package source tree as a subtree of larger project
Hello,
The Apache arrow source tree has a subdirectory "r" in which is residing what constitutes the r-cran-arrow source tree. I want to generate the r-cran-arrow package from the very same source tree as arrow itself, but ran into some lintian errors
E: r-cran-arrow: missing-dependency-on-libc needed by usr/lib/R/site-library/arrow/libs/arrow.so
E: r-cran-arrow: requires-r-api
that I thought I could circumvent by properly using r-cran.mk.
That parses the DESCRIPTION file which should now be r/DESCRIPTION and maybe if the variables are already set then those should not be overridden. Here a first suggestion for a patch to r-cran.mk with a request for further discussion - and if you happen to know how to manually overcome those lintian errors then I would obviously also appreciate that :-)
--- /usr/share/dh-r/r-cran.mk.orig 2025-09-11 13:21:18.681628060 +0100
+++ /usr/share/dh-r/r-cran.mk 2025-09-11 13:26:57.445627215 +0100
@@ -6,15 +6,16 @@
include /usr/share/dpkg/default.mk
-debRreposname := $(shell echo $(DEB_SOURCE) | sed 's/r-\([a-z]\+\)-.*/\1/')
+origRsubdir ?= "./"
+debRreposname ?= $(shell echo $(DEB_SOURCE) | sed 's/r-\([a-z]\+\)-.*/\1/')
# apply it to the upstream meta-info file DESCRIPTION (seems to be some helpful trick to keep the quoting)
-cranNameOrig := $(shell awk '/^(Package|Bundle):/ {print $$2 }' DESCRIPTION)
+cranNameOrig ?= $(shell awk '/^(Package|Bundle):/ {print $$2 }' ${origRsubdir}DESCRIPTION)
# generate a lc version
-cranName := $(shell echo "$(cranNameOrig)" | tr A-Z a-z)
-package := r-$(debRreposname)-$(cranName)
+cranName ?= $(shell echo "$(cranNameOrig)" | tr A-Z a-z)
+package ?= r-$(debRreposname)-$(cranName)
## awk command to extract word after Priority
-priority := $(shell awk '/^Priority:/ {print tolower($$2) }' DESCRIPTION)
+priority := $(shell awk '/^Priority:/ {print tolower($$2) }' ${origRsubdir}DESCRIPTION)
ifeq ($(priority),recommended)
debRdir := usr/lib/R/library
I think I am not subscribed to this list, please kindly CC me.
Best,
Steffen
Reply to: