Hi Paul, Am Sun, Jul 02, 2023 at 10:31:35AM +0800 schrieb Paul Wise: > > The patch hard-codes the number in the Provides. > > You can extract the number from the header using cpp: > > $ echo R_GE_version | $(CPP) -I ./src/include/ -include > R_ext/GraphicsEngine.h | tail -n1 > 15 > > Then use a substvar to include the number in the Provides.
Very good point. The attached patch implements your suggestion. I kept some debug lines in d/rules since $(CPP) resolves to cc which does not work. Thus I simply hardcoded cpp which determines the number we need. Kind regards Andreas. -- http://fam-tille.de
diff --git a/debian/changelog b/debian/changelog index 2c23d966f..c9d4db356 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +r-base (4.3.1-1.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Add r-ge-version-16 + Closes: #1040038 + + -- Andreas Tille <ti...@debian.org> Sat, 01 Jul 2023 13:45:57 +0200 + r-base (4.3.1-1) unstable; urgency=medium * New upstream release diff --git a/debian/control b/debian/control index 37d0cd042..2eae826af 100644 --- a/debian/control +++ b/debian/control @@ -49,7 +49,7 @@ Package: r-base-core Architecture: any Depends: ${misc:Depends}, zip, unzip, libpaper-utils, xdg-utils, ${shlibs:Depends}, ucf (>= 3.0), ca-certificates Replaces: r-base (<= 1.4.1-1), r-recommended (<< 1.9.0), r-gnome (<= 2.3.1), r-cran-rcompgen (<= 0.1-17-1), r-base-latex (<= 2.9.2-4) -Provides: r-gnome, r-cran-rcompgen, r-base-latex, r-api-4.0 +Provides: r-gnome, r-cran-rcompgen, r-base-latex, r-api-4.0, r-ge-version-${R:GE:version} Conflicts: r-gnome, r-cran-rcompgen, r-base-latex Recommends: r-recommended, r-base-dev, r-doc-html Suggests: elpa-ess, r-doc-info | r-doc-pdf, r-mathlib, r-base-html diff --git a/debian/r-cran.mk b/debian/r-cran.mk index 7e54a19d7..eb8f5f880 100644 --- a/debian/r-cran.mk +++ b/debian/r-cran.mk @@ -65,6 +65,7 @@ endif # awk '/^Version/ {print $$2}') rversion := $(shell dpkg-query -W -f='$${Version}' r-base-dev) rapiversion := $(shell dpkg-query -W -f='$${Provides}' r-base-core | grep -o 'r-api[^, ]*') +rgraphicsapiversion := $(shell dpkg-query -W -f='$${Provides}' r-base-core | grep -o 'r-ge-version[^, ]*') ## we use these results for the to-be-installed-in directory debRlib := $(CURDIR)/debian/$(package)/$(debRdir) @@ -101,7 +102,7 @@ R_any_arch: dh_installdirs $(debRdir) ## ## support ${R:Depends} via debian/${package}.substvars - echo "R:Depends=r-base-core (>= ${rversion}), ${rapiversion}" >> debian/$(package).substvars + echo "R:Depends=r-base-core (>= ${rversion}), ${rapiversion}, ${rgraphicsapiversion}" >> debian/$(package).substvars ## ## call R to install the sources we're looking at ## use this inside xvfb-run if this wrapper is installed diff --git a/debian/rules b/debian/rules index c6f2a882f..4f0c554e9 100755 --- a/debian/rules +++ b/debian/rules @@ -767,6 +767,11 @@ binary-arch: build-arch install-arch # perl -p -i -e 's/atlas2-base, //' debian/r-recommended.substvars # cat debian/r-recommended.substvars # echo "*** Done ***" + echo "Determine graphics version" + #echo R_GE_version | $(CPP) -I ./src/include/ -include R_ext/GraphicsEngine.h | tail -n1 | sed 's/^/R:GE:version=/' >> debian/r-base-core.substvars + #For whatever reason $(CPP) resolves to cc which returns: cc: fatal error: no input files + echo R_GE_version | cpp -I ./src/include/ -include R_ext/GraphicsEngine.h | tail -n1 | sed 's/^/R:GE:version=/' >> debian/r-base-core.substvars + cat debian/r-base-core.substvars dh_gencontrol -a dh_md5sums -a dh_builddeb -a