bs-platform: init at 6.2.1

This commit is contained in:
Marek Fajkus 2019-12-05 20:41:34 +01:00 committed by Jon
parent 7f05023fcf
commit 088550273b
4 changed files with 88 additions and 0 deletions

View file

@ -0,0 +1,55 @@
{ stdenv, fetchFromGitHub, ninja, nodejs, python3 }:
let
version = "6.2.1";
ocaml-version = "4.06.1";
src = fetchFromGitHub {
owner = "BuckleScript";
repo = "bucklescript";
rev = "${version}";
sha256 = "0zx9nq7cik0c60n3rndqfqy3vdbj5lcrx6zcqcz2d60jjxi1z32y";
fetchSubmodules = true;
};
ocaml = import ./ocaml.nix {
bs-version = version;
version = ocaml-version;
inherit stdenv;
src = "${src}/ocaml";
};
in
stdenv.mkDerivation {
inherit src version;
pname = "bs-platform";
BS_RELEASE_BUILD = "true";
buildInputs = [ nodejs python3 ];
patchPhase = ''
sed -i 's:./configure.py --bootstrap:python3 ./configure.py --bootstrap:' ./scripts/install.js
mkdir -p ./native/${ocaml-version}/bin
ln -sf ${ocaml}/bin/* ./native/${ocaml-version}/bin
rm -f vendor/ninja/snapshot/ninja.linux
cp ${ninja}/bin/ninja vendor/ninja/snapshot/ninja.linux
'';
configurePhase = ''
node scripts/ninja.js config
'';
buildPhase = ''
node scripts/ninja.js build
'';
installPhase = ''
node scripts/install.js
mkdir -p $out/bin
cp -rf jscomp lib vendor odoc_gen native $out
cp bsconfig.json package.json $out
ln -s $out/lib/bsb $out/bin/bsb
ln -s $out/lib/bsc $out/bin/bsc
ln -s $out/lib/bsrefmt $out/bin/bsrefmt
'';
}

View file

@ -0,0 +1,15 @@
{ stdenv, fetchFromGitHub, ninja, nodejs, python3, ... }:
let
meta = with stdenv.lib; {
description = "A JavaScript backend for OCaml focused on smooth integration and clean generated code.";
homepage = https://bucklescript.github.io;
license = licenses.lgpl3;
maintainers = with maintainers; [ turbomack gamb ];
platforms = platforms.all;
};
in
{
bs-platform-621 = import ./bs-platform-62.nix {
inherit stdenv fetchFromGitHub ninja nodejs python3;
} // { inherit meta; };
}

View file

@ -0,0 +1,16 @@
{ stdenv, src, version, bs-version }:
stdenv.mkDerivation rec {
inherit src version;
name = "ocaml-${version}+bs-${bs-version}";
configurePhase = ''
./configure -prefix $out
'';
buildPhase = ''
make -j9 world.opt
'';
meta = with stdenv.lib; {
branch = "4.06";
platforms = platforms.all;
};
}

View file

@ -1289,6 +1289,8 @@ in
burpsuite = callPackage ../tools/networking/burpsuite {};
bs-platform = (callPackage ../development/compilers/bs-platform {}).bs-platform-621;
c3d = callPackage ../applications/graphics/c3d {
inherit (darwin.apple_sdk.frameworks) Cocoa;
};