2018-01-15 14:12:55 +00:00
|
|
|
{ stdenv, fetchurl, fetchFromGitHub, makeDesktopItem, cmake, boost
|
|
|
|
, zlib, openssl, R, qtbase, qtwebkit, qtwebchannel, libuuid, hunspellDicts
|
|
|
|
, unzip, ant, jdk, gnumake, makeWrapper, pandoc
|
2017-01-27 23:54:50 +00:00
|
|
|
}:
|
2015-03-23 20:26:13 +00:00
|
|
|
|
|
|
|
let
|
2018-01-15 14:12:55 +00:00
|
|
|
version = "1.1.414";
|
2015-03-23 20:26:13 +00:00
|
|
|
ginVer = "1.5";
|
2017-04-30 10:36:42 +01:00
|
|
|
gwtVer = "2.7.0";
|
2015-03-23 20:26:13 +00:00
|
|
|
in
|
2016-11-22 00:06:28 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-03-23 20:26:13 +00:00
|
|
|
name = "RStudio-${version}";
|
|
|
|
|
2017-09-26 19:23:10 +01:00
|
|
|
nativeBuildInputs = [ cmake unzip ant jdk makeWrapper pandoc ];
|
|
|
|
|
2017-11-09 23:00:47 +00:00
|
|
|
buildInputs = [ boost zlib openssl R qtbase qtwebkit qtwebchannel libuuid ];
|
2015-03-23 20:26:13 +00:00
|
|
|
|
2018-01-15 14:12:55 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rstudio";
|
|
|
|
repo = "rstudio";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1rr2zkv53r8swhq5d745jpp0ivxpsizzh7srf34isqpkn5pgx3v8";
|
2015-03-23 20:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Hack RStudio to only use the input R.
|
2018-01-15 14:12:55 +00:00
|
|
|
patches = [ ./r-location.patch ];
|
2015-03-23 20:26:13 +00:00
|
|
|
postPatch = "substituteInPlace src/cpp/core/r_util/REnvironmentPosix.cpp --replace '@R@' ${R}";
|
|
|
|
|
|
|
|
inherit ginVer;
|
|
|
|
ginSrc = fetchurl {
|
|
|
|
url = "https://s3.amazonaws.com/rstudio-buildtools/gin-${ginVer}.zip";
|
|
|
|
sha256 = "155bjrgkf046b8ln6a55x06ryvm8agnnl7l8bkwwzqazbpmz8qgm";
|
|
|
|
};
|
|
|
|
|
|
|
|
inherit gwtVer;
|
|
|
|
gwtSrc = fetchurl {
|
|
|
|
url = "https://s3.amazonaws.com/rstudio-buildtools/gwt-${gwtVer}.zip";
|
2017-04-30 10:36:42 +01:00
|
|
|
sha256 = "1cs78z9a1jg698j2n35wsy07cy4fxcia9gi00x0r0qc3fcdhcrda";
|
2015-03-23 20:26:13 +00:00
|
|
|
};
|
|
|
|
|
2016-11-22 00:06:28 +00:00
|
|
|
hunspellDictionaries = builtins.attrValues hunspellDicts;
|
2015-03-23 20:26:13 +00:00
|
|
|
|
|
|
|
mathJaxSrc = fetchurl {
|
2017-04-30 10:36:42 +01:00
|
|
|
url = https://s3.amazonaws.com/rstudio-buildtools/mathjax-26.zip;
|
|
|
|
sha256 = "0wbcqb9rbfqqvvhqr1pbqax75wp8ydqdyhp91fbqfqp26xzjv6lk";
|
|
|
|
};
|
|
|
|
|
2018-01-15 14:12:55 +00:00
|
|
|
rmarkdownSrc = fetchFromGitHub {
|
|
|
|
owner = "rstudio";
|
|
|
|
repo = "rmarkdown";
|
|
|
|
rev = "v1.8";
|
|
|
|
sha256 = "1blqxdr1vp2z5wd52nmf8hq36sdd4s2pyms441dqj50v35f8girb";
|
2017-04-30 10:36:42 +01:00
|
|
|
};
|
|
|
|
|
2018-01-15 14:12:55 +00:00
|
|
|
rsconnectSrc = fetchFromGitHub {
|
|
|
|
owner = "rstudio";
|
|
|
|
repo = "rsconnect";
|
|
|
|
rev = "953c945779dd180c1bfe68f41c173c13ec3e222d";
|
|
|
|
sha256 = "1yxwd9v4mvddh7m5rbljicmssw7glh1lhin7a9f01vxxa92vpj7z";
|
2017-04-30 10:36:42 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
rstudiolibclang = fetchurl {
|
|
|
|
url = https://s3.amazonaws.com/rstudio-buildtools/libclang-3.5.zip;
|
|
|
|
sha256 = "1sl5vb8misipwbbbykdymw172w9qrh8xv3p29g0bf3nzbnv6zc7c";
|
|
|
|
};
|
|
|
|
|
|
|
|
rstudiolibclangheaders = fetchurl {
|
|
|
|
url = https://s3.amazonaws.com/rstudio-buildtools/libclang-builtin-headers.zip;
|
|
|
|
sha256 = "0x4ax186bm3kf098izwmsplckgx1kqzg9iiyzg95rpbqsb4593qb";
|
2015-03-23 20:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure =
|
|
|
|
''
|
|
|
|
GWT_LIB_DIR=src/gwt/lib
|
|
|
|
|
|
|
|
mkdir -p $GWT_LIB_DIR/gin/$ginVer
|
|
|
|
unzip $ginSrc -d $GWT_LIB_DIR/gin/$ginVer
|
|
|
|
|
|
|
|
unzip $gwtSrc
|
|
|
|
mkdir -p $GWT_LIB_DIR/gwt
|
|
|
|
mv gwt-$gwtVer $GWT_LIB_DIR/gwt/$gwtVer
|
|
|
|
|
|
|
|
mkdir dependencies/common/dictionaries
|
2016-11-22 00:06:28 +00:00
|
|
|
for dict in $hunspellDictionaries; do
|
2015-03-25 18:03:57 +00:00
|
|
|
for i in "$dict/share/hunspell/"*
|
2015-03-23 20:26:13 +00:00
|
|
|
do ln -sv $i dependencies/common/dictionaries/
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
2017-04-30 10:36:42 +01:00
|
|
|
unzip $mathJaxSrc -d dependencies/common/mathjax-26
|
2018-01-15 14:12:55 +00:00
|
|
|
mkdir -p dependencies/common/rmarkdown
|
|
|
|
ln -s $rmarkdownSrc dependencies/common/rmarkdown/
|
|
|
|
mkdir -p dependencies/common/rsconnect
|
|
|
|
ln -s $rsconnectSrc dependencies/common/rsconnect/
|
2017-04-30 10:36:42 +01:00
|
|
|
mkdir -p dependencies/common/libclang/3.5
|
|
|
|
unzip $rstudiolibclang -d dependencies/common/libclang/3.5
|
|
|
|
mkdir -p dependencies/common/libclang/builtin-headers
|
|
|
|
unzip $rstudiolibclangheaders -d dependencies/common/libclang/builtin-headers
|
|
|
|
|
|
|
|
mkdir -p dependencies/common/pandoc
|
|
|
|
cp ${pandoc}/bin/pandoc dependencies/common/pandoc/
|
2015-03-23 20:26:13 +00:00
|
|
|
'';
|
|
|
|
|
2017-09-26 19:23:10 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-08-20 10:35:01 +01:00
|
|
|
cmakeFlags = [ "-DRSTUDIO_TARGET=Desktop" "-DQT_QMAKE_EXECUTABLE=$NIX_QT5_TMP/bin/qmake" ];
|
2015-03-23 20:26:13 +00:00
|
|
|
|
2016-11-22 00:03:16 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = name;
|
|
|
|
exec = "rstudio %F";
|
|
|
|
icon = "rstudio";
|
|
|
|
desktopName = "RStudio";
|
|
|
|
genericName = "IDE";
|
|
|
|
comment = meta.description;
|
|
|
|
categories = "Development;";
|
|
|
|
mimeType = "text/x-r-source;text/x-r;text/x-R;text/x-r-doc;text/x-r-sweave;text/x-r-markdown;text/x-r-html;text/x-r-presentation;application/x-r-data;application/x-r-project;text/x-r-history;text/x-r-profile;text/x-tex;text/x-markdown;text/html;text/css;text/javascript;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;";
|
|
|
|
};
|
|
|
|
|
2017-05-01 13:59:43 +01:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/rstudio --suffix PATH : ${gnumake}/bin
|
2016-11-22 00:03:16 +00:00
|
|
|
mkdir $out/share
|
|
|
|
cp -r ${desktopItem}/share/applications $out/share
|
|
|
|
mkdir $out/share/icons
|
|
|
|
ln $out/rstudio.png $out/share/icons
|
2015-10-25 15:18:21 +00:00
|
|
|
'';
|
|
|
|
|
2015-03-23 20:26:13 +00:00
|
|
|
meta = with stdenv.lib;
|
|
|
|
{ description = "Set of integrated tools for the R language";
|
2018-01-05 19:42:46 +00:00
|
|
|
homepage = https://www.rstudio.com/;
|
2015-03-23 20:26:13 +00:00
|
|
|
license = licenses.agpl3;
|
2017-08-29 12:26:03 +01:00
|
|
|
maintainers = with maintainers; [ ehmry changlinli ciil ];
|
2015-03-23 20:26:13 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|