This commit is contained in:
Elliott Sales de Andrade 2020-09-12 04:50:43 -04:00
parent 2f5c222713
commit 58b4f48c7a
4 changed files with 107 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/brio_1.1.0.tar.gz

View File

@ -0,0 +1,31 @@
From 6beb3df583413a7084a9b2f6ffa6de3ea9817368 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Mon, 7 Sep 2020 23:52:27 -0400
Subject: [PATCH] Fix return type of fgetc.
On x86, this seems to work by fluke, but on other systems, it does not
work because `(char)EOF` never equals `EOF`, causing an infinite loop.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
src/file_line_endings.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/file_line_endings.c b/src/file_line_endings.c
index 4587994..e8c8709 100644
--- a/src/file_line_endings.c
+++ b/src/file_line_endings.c
@@ -14,8 +14,8 @@ SEXP brio_file_line_endings(SEXP path) {
error("Could not open file: %s", path_c);
}
- char c;
- char prev_c = '\0';
+ int c;
+ int prev_c = '\0';
while ((c = fgetc(fp)) != EOF) {
if (c == '\n') {
if (prev_c == '\r') {
--
2.26.2

74
R-brio.spec Normal file
View File

@ -0,0 +1,74 @@
%global packname brio
%global packver 1.1.0
%global rlibdir %{_libdir}/R/library
Name: R-%{packname}
Version: 1.1.0
Release: 1%{?dist}
Summary: Basic R Input Output
License: MIT
URL: https://CRAN.R-project.org/package=%{packname}
Source0: https://cran.r-project.org/src/contrib/%{packname}_%{packver}.tar.gz
# https://github.com/r-lib/brio/pull/9
Patch0001: 0001-Fix-return-type-of-fgetc.patch
# Here's the R view of the dependencies world:
# Depends:
# Imports:
# Suggests: R-testthat >= 2.1.0, R-covr
# LinkingTo:
# Enhances:
BuildRequires: R-devel
BuildRequires: tex(latex)
BuildRequires: R-testthat >= 2.1.0
%description
Functions to handle basic input output, these functions always read and write
UTF-8 (8-bit Unicode Transformation Format) files and provide more explicit
control over line endings.
%prep
%setup -q -c -n %{packname}
pushd %{packname}
%patch0001 -p1
# Don't need coverage; it's not packaged either.
sed -i 's/, covr//g' DESCRIPTION
popd
%build
%install
mkdir -p %{buildroot}%{rlibdir}
%{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname}
test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so)
rm -f %{buildroot}%{rlibdir}/R.css
%check
%{_bindir}/R CMD check %{packname}
%files
%dir %{rlibdir}/%{packname}
%doc %{rlibdir}/%{packname}/html
%{rlibdir}/%{packname}/DESCRIPTION
%doc %{rlibdir}/%{packname}/NEWS.md
%license %{rlibdir}/%{packname}/LICENSE
%{rlibdir}/%{packname}/INDEX
%{rlibdir}/%{packname}/NAMESPACE
%{rlibdir}/%{packname}/Meta
%{rlibdir}/%{packname}/R
%{rlibdir}/%{packname}/help
%dir %{rlibdir}/%{packname}/libs
%{rlibdir}/%{packname}/libs/%{packname}.so
%changelog
* Mon Sep 07 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.1.0-1
- initial package for Fedora

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (brio_1.1.0.tar.gz) = 70e13328f606ff4e33f7533fb2bda7101c01100f38eba896833489227fc20ffc45c7ff9a38fa43076469f0134f6380ad2ad8f2d89ca77702a2664d408d3c168b