Blob Blame History Raw
%global packname crosstalk
%global packver
%global rlibdir  %{_datadir}/R/library

Name:             R-%{packname}
Release:          1%{?dist}
Summary:          Inter-Widget Interactivity for HTML Widgets

# Mostly MIT, selectize.js is ASL 2.0
License:          MIT and ASL 2.0
URL:    {packname}
# Remove extra glyphicons references; Fedora only;
Patch0001:        0001-Remove-non-ttf-font-references.patch

# Here's the R view of the dependencies world:
# Depends:
# Imports:   R-htmltools >= 0.3.5, R-jsonlite, R-lazyeval, R-R6
# Suggests:  R-shiny, R-ggplot2, R-testthat >= 2.1.0
# LinkingTo:
# Enhances:

BuildArch:        noarch
BuildRequires:    R-devel
BuildRequires:    tex(latex)
BuildRequires:    R-htmltools >= 0.3.5
BuildRequires:    R-jsonlite
BuildRequires:    R-lazyeval
BuildRequires:    R-R6
BuildRequires:    R-shiny >= 0.11
BuildRequires:    R-ggplot2
BuildRequires:    R-testthat >= 2.1.0

BuildRequires: web-assets-devel
# MIT; inst/lib/bootstrap/
Provides:         bundled(xstatic-bootstrap-common) = 3.4.1
BuildRequires:    glyphicons-halflings-fonts
Requires:         glyphicons-halflings-fonts

# MIT; inst/lib/ionrangeslider
Provides:         bundled(js-IonDen-ionrangeslider) = 2.1.2

# MIT; inst/lib/jquery
BuildRequires:    js-jquery3 >= 3.4.1
Requires:         js-jquery3 >= 3.4.1

# ASL 2.0; inst/lib/selectize
Provides:         bundled(js-brianreavis-selectize) = 0.12.1

# MIT; inst/lib/strftime
Provides:         bundled(js-samsonjs-strftime) = 0.9.2

Provides building blocks for allowing HTML widgets to communicate with each
other, with Shiny or without (i.e. static .html files). Currently supports
linked brushing and filtering.

%setup -q -c -n %{packname}

pushd %{packname}
%patch0001 -p1


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

pushd %{buildroot}%{rlibdir}/%{packname}
# Replace fonts by system fonts (note that this cannot be done in prep because
# R CMD INSTALL copies symlink targets.)
ln -sf %{_datadir}/fonts/glyphicons-halflings/glyphicons-halflings-regular.ttf \

for f in jquery.js jquery.min.js; do
    ln -sf %{_jsdir}/jquery/3/$f lib/jquery/$f

%{_bindir}/R CMD check %{packname}

%dir %{rlibdir}/%{packname}
%doc %{rlibdir}/%{packname}/html
%doc %{rlibdir}/%{packname}/
%license %{rlibdir}/%{packname}/LICENSE

* Sun Aug 02 2020 Elliott Sales de Andrade <> -
- initial package for Fedora