Skip to content

Commit 94aff31

Browse files
author
Pavel Marek
committed
Fix build of rpart and cluster
(cherry picked from commit fd48470559cec086cdd046de63a4a63402c72a38)
1 parent 8444e30 commit 94aff31

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

com.oracle.truffle.r.native.recommended/Makefile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ endif
3737

3838
FASTR_R_HOME = $(abspath $(TOPDIR)/..)
3939
R_VERSION = 4.0.3
40-
# The package tar balls are copied from $(GNUR_HOME_BINARY_UNPACKED)/src/library/Recommended
40+
# Most of the package tar balls are copied from $(GNUR_HOME_BINARY_UNPACKED)/src/library/Recommended
4141
export GNUR_HOME_BINARY_UNPACKED = $(FASTR_R_HOME)/libdownloads/R-$(R_VERSION)
4242

4343
ifndef GNUR_HOME_BINARY
@@ -121,6 +121,24 @@ install.recommended: $(ALL_RECOMMENDED_TARS)
121121
# If FASTR_RECOMMENDED_BINARY is not defined, we just build the packages
122122
else
123123

124+
RPART_DIR_NAME := bethatkinson-rpart-4020bb4
125+
RPART_BUILT_TARBALL := rpart_4.1-16.tar.gz
126+
# rpart package is downloaded as a tarball directly from GitHub. Unfortunately, we have to make some
127+
# modifications to that tarball - remove `build` directory.
128+
rpart.ts: $(RPART_TAR)
129+
@echo 'Installing recommended package rpart'
130+
tar xf $<
131+
rm -rf $(RPART_DIR_NAME)/build
132+
# This command creates $RPART_BUILT_TARBALL via GNU-R for better compatibility
133+
$(GNUR_HOME_BINARY)/bin/R CMD build --no-build-vignettes $(RPART_DIR_NAME)
134+
_R_CHECK_INSTALL_DEPENDS_=no FASTR_USE_F2C=true $(FASTR_R_HOME)/bin/R --polyglot CMD INSTALL $(INSTALL_OPTS) --library=$(FASTR_R_HOME)/library $(RPART_BUILT_TARBALL) &> $@.out || (cat $@.out && exit 1)
135+
@echo Finished installing recommended package `basename $<`
136+
137+
cluster.ts: $(CLUSTER_TAR)
138+
@echo Installing recommended package `basename $<`
139+
@_R_CHECK_INSTALL_DEPENDS_=no FASTR_USE_F2C=true $(FASTR_R_HOME)/bin/R --polyglot CMD INSTALL $(INSTALL_OPTS) --library=$(FASTR_R_HOME)/library $< &> $@.out || (cat $@.out && exit 1)
140+
@echo Finished installing recommended package `basename $<`
141+
124142
%.ts: $(GNUR_RECOMMENDED_TAR_DIR)%.tgz
125143
@echo Installing recommended package `basename $<`
126144
@_R_CHECK_INSTALL_DEPENDS_=no FASTR_USE_F2C=true $(FASTR_R_HOME)/bin/R --polyglot CMD INSTALL $(INSTALL_OPTS) --library=$(FASTR_R_HOME)/library $< &> $@.out || (cat $@.out && exit 1)

mx.fastr/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
# A recommended package "rpart" with a fixed version rather than taken from GNU-R.
7272
"RPART" : {
7373
"path" : "libdownloads/rpart.tar.gz",
74-
"ext" : "tar.gz",
74+
"ext" : ".tar.gz",
7575
"version" : "4020bb4ee8fd6739bd97e8c39931fa7e3901300c",
7676
"urls" : ["https://api.github.com/repos/bethatkinson/rpart/tarball/{version}"],
7777
"sha1" : "ec76dbd51acad10bed843a0005ba5fdcf5c7a35d",
@@ -81,7 +81,7 @@
8181
# A recommended package "cluster" with a fixed version rather than taken from GNU-R.
8282
"CLUSTER" : {
8383
"path" : "libdownloads/cluster.tar.gz",
84-
"ext" : "tar.gz",
84+
"ext" : ".tar.gz",
8585
"version" : "2.1.2",
8686
"urls" : ["https://cran.r-project.org/src/contrib/cluster_{version}.tar.gz"],
8787
"sha1" : "47763fa44d11e0f2c2feafade3e331c05eda30d1",

0 commit comments

Comments
 (0)