spec file requires rpm-build... change requires dependent on os-release? - rpmbuild

I'm building a spec file that requires /usr/bin/rpmbuild to be installed. Under Opensuse13.1 that is very simple: I just add this line in my spec file:
Requires: rpm-build
and this works nicely on Opensuse13.1
Yet When I try to build and install this package on opensuse12.1; this does not work, since the binary /usr/bin/rpmbuild is provided there by the package rpm and not by the package rpm-build.
How do I work around this problem? I didn't find a virtual package they both provide. Note that the package rpm also exists on opensuse13.1 and that rpm-build depends on it.

You can use:
Requires: /usr/bin/rpmbuild

Related

install_version breaks symlinks in the renv library

I use renv to manage R package dependencies. The global cache works great for all packages that are installed with install.packages command; however, if I install the same package with devtools::install_version command it only installs it locally. As a result, any changes in the version number require manual installations again and again.
Do you have any idea how to address this issue?
I found the problem with my approach. Instead of using install_version, I should have used renv::install(). Here is an example:
Instead of using:
devtools::install_version(package="BART", version = "2.2")
Use
renv::install("BART")
renv::install("BART#2.2")

Use GitHub Package R Actions

I was trying to use actions in a package I wrote. The issue is that the package actions uses remotes in its setup to install CRAN only packages.
Since the package I am working on depends on a non CRAN package that is present on GitHub, both coverage and R CMD checks fail. I tried to avoid this by naively downgrading to an earlier version of the package in depends but some functions are not exported. I am wondering if someone knows a workaround that might help(I cannot open an issue at actions since their support.md file discourages this).
If your package depends on a non-CRAN package, you must include under Remotes: rather than just Imports: in your DESCRIPTION file. Here you would have:
Imports:
actions
Remotes:
r-lib/actions
This will pass checks, but there is no work around for publishing to CRAN if any of your dependencies are not on CRAN, thus you'll get a warning if any packages are present in the Remotes field.
The alternative using Travis is adding r_github_packages: r-lib/actions to your .travis.yml.
After some time, I have found a workaround that for now is good enough if you want to test for the development version(like I wanted). You should include an install_github command in the check.yaml file. Here's an example:
- name: Install dependencies
run: |
install.packages(c("remotes","testthat"),dependencies=TRUE)
remotes::install_github("tidyverse/dplyr")
remotes::install_cran("covr")
shell: Rscript {0}
The above snippet fixed my issue because I wanted to depend on a future dplyr version. You can view the full yaml file here.

R package dependency error on travis-ci but not local machine

I am trying to build my first R package (GitHub link). It is currently passing all local checks with devtools::check(), but failing on Travis:
ERROR: dependency ‘Rmpfr’ is not available for package ‘streamDepletr’
Looking at the Installed package versions section of the travis-ci output, Rmpfr is not listed. However, my DESCRIPTION file includes it as an import:
Imports:
Rmpfr,
dplyr,
magrittr
and Rmpfr is available on CRAN; my question is, how do I get travis-ci to install it?
The solution may be related to this previous question where the author had to include Java in their .travis.yml file. For Rmpfr, it looks like the MPFR C library is necessary. Is there a way to instruct travis to install this library in my .travis.yml file? Or am I barking up the wrong tree?
As you found out, you need the libmpfr-dev package to be installed. You can do this by adding
addons:
apt:
packages:
- libmpfr-dev
to your .travis.yml. See the documentation for reference.

How to force devtools to install packages in remotes

devtools package introduces a nice concept of adding dependancies not available in CRAN, into DESCRIPTION file (described in the vignette). However, I have not been able to figure out how to get it to install the dependancies automatically. The vignette linked above certainly hints that is possible and the install command certainly parses for the "remote" (got an error when they were not specified correctly), however, it only installed dependancies from CRAN. Anybody has ideas if there are some parameters I should specify to make the installation automatic?
Thusfar, I have tried install, install_bitbucket and install_local. install managed to download all the dependancies available in CRAN. install_bitbucket did the same and install_local just did not work at all.
The Remotes: field is used to tell devtools where to look for the packages that are listed in the standard Depends:, Imports: and Suggests:.
So make sure that you have the package listed in the appropriate standard field, and its source listed in Remotes. Then running the following should install these packages from the Remotes source:
devtools::install_deps()

R's devtools - install from github with "configure" file

I have an R package on github that uses a "configure" script (since some of the C code depends on GSL libraries). I try installing the package using github_install() function from devtools package and get the error:
(as ‘lib’ is unspecified)
* installing *source* package ‘wrightscape’ ...
ERROR: 'configure' exists but is not executable -- see the 'R Installation and Administration Manual'
Not sure what to do -- are there such a thing as execute permissions for a file on github? is this a devtools issue or a configuration issue? (Installing the package from source works fine for me). The package is here. https://github.com/cboettig/wrightscape
This is now fixed in the latest version of devtools (0.7).
Git does not manage file permissions directly. It is usually the responsibility of a build or install script to adjust permissions correctly once the bits are delivered from git. There are third party tools that can help with this. See the discussion on SO question Retaining file permissions with Git.
Hope this helps.
I had a similar issue which was caused by my /tmp dir being mounted noexec, and solved by setting a different TMPDIR, as explained here
export TMPDIR=~/tmp

Resources