about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2020-03-14 10:25:53 -0500
committerGitHub <noreply@github.com>2020-03-14 10:25:53 -0500
commit8a0c1b8cf1706ca3ceae37fe09ec99c09c250dcd (patch)
treec62243f0005b313e69481200d82f3afbca48eef5 /pkgs/development/compilers
parent13e7a3e11272159b9b1fc41ec67f53c1088412ff (diff)
parent0f0cb0b8575247d3220cc9e352b12a98ac6447db (diff)
downloadnixlib-8a0c1b8cf1706ca3ceae37fe09ec99c09c250dcd.tar
nixlib-8a0c1b8cf1706ca3ceae37fe09ec99c09c250dcd.tar.gz
nixlib-8a0c1b8cf1706ca3ceae37fe09ec99c09c250dcd.tar.bz2
nixlib-8a0c1b8cf1706ca3ceae37fe09ec99c09c250dcd.tar.lz
nixlib-8a0c1b8cf1706ca3ceae37fe09ec99c09c250dcd.tar.xz
nixlib-8a0c1b8cf1706ca3ceae37fe09ec99c09c250dcd.tar.zst
nixlib-8a0c1b8cf1706ca3ceae37fe09ec99c09c250dcd.zip
Merge pull request #82068 from anmonteiro/anmonteiro/bs-platform-7.2.0
bs-platform: 7.0.1 -> 7.2.0
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/bs-platform/build-bs-platform.nix28
-rw-r--r--pkgs/development/compilers/bs-platform/default.nix8
2 files changed, 25 insertions, 11 deletions
diff --git a/pkgs/development/compilers/bs-platform/build-bs-platform.nix b/pkgs/development/compilers/bs-platform/build-bs-platform.nix
index 528fa5e4f420..d7d0fe0b12be 100644
--- a/pkgs/development/compilers/bs-platform/build-bs-platform.nix
+++ b/pkgs/development/compilers/bs-platform/build-bs-platform.nix
@@ -16,18 +16,28 @@
     patches = [];
   }))
 }:
-stdenv.mkDerivation {
+
+let
+  bin_folder = if stdenv.isDarwin then "darwin" else "linux";
+in
+
+stdenv.mkDerivation rec {
   inherit src version;
   pname = "bs-platform";
+
   BS_RELEASE_BUILD = "true";
+
+  # BuckleScript's idiosyncratic build process only builds artifacts required
+  # for editor-tooling to work when this environment variable is set:
+  # https://github.com/BuckleScript/bucklescript/blob/7.2.0/scripts/install.js#L225-L227
+  BS_TRAVIS_CI = "1";
+
   buildInputs = [ nodejs python3 custom-ninja ];
 
   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 ${custom-ninja}/bin/ninja vendor/ninja/snapshot/ninja.linux
   '';
 
   # avoid building the development version, will break aarch64 build
@@ -41,10 +51,14 @@ stdenv.mkDerivation {
 
   installPhase = ''
     mkdir -p $out/bin
-    cp -rf jscomp lib vendor odoc_gen native $out
+    cp -rf jscomp lib ${bin_folder} vendor odoc_gen native bsb bsc bsrefmt $out
+    mkdir $out/lib/ocaml
+    cp jscomp/runtime/js.* jscomp/runtime/*.cm* $out/lib/ocaml
+    cp jscomp/others/*.ml jscomp/others/*.mli jscomp/others/*.cm* $out/lib/ocaml
+    cp jscomp/stdlib-406/*.ml jscomp/stdlib-406/*.mli jscomp/stdlib-406/*.cm* $out/lib/ocaml
     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
+    ln -s $out/bsb $out/bin/bsb
+    ln -s $out/bsc $out/bin/bsc
+    ln -s $out/bsrefmt $out/bin/bsrefmt
   '';
 }
diff --git a/pkgs/development/compilers/bs-platform/default.nix b/pkgs/development/compilers/bs-platform/default.nix
index 763a4e3ba67a..6912cc6e9ff5 100644
--- a/pkgs/development/compilers/bs-platform/default.nix
+++ b/pkgs/development/compilers/bs-platform/default.nix
@@ -2,16 +2,16 @@
 let
   build-bs-platform = import ./build-bs-platform.nix;
 in
-(build-bs-platform {
+(build-bs-platform rec {
   inherit stdenv runCommand fetchFromGitHub ninja nodejs python3;
-  version = "7.0.1";
+  version = "7.2.0";
   ocaml-version = "4.06.1";
 
   src = fetchFromGitHub {
     owner = "BuckleScript";
     repo = "bucklescript";
-    rev = "52770839e293ade2bcf187f2639000ca0a9a1d46";
-    sha256 = "0s7g2zfhshsilv9zyp0246bypg34d294z27alpwz03ws9608yr7k";
+    rev = version;
+    sha256 = "1fsx7gvcp6rbqd0qf5fix02mbbmk9rgm09zbwjrx0lp5cjv3n2s4";
     fetchSubmodules = true;
   };
 }).overrideAttrs (attrs: {