diff options
Diffstat (limited to 'pkgs/development/compilers/bs-platform')
-rw-r--r-- | pkgs/development/compilers/bs-platform/build-bs-platform.nix (renamed from pkgs/development/compilers/bs-platform/bs-platform-62.nix) | 41 | ||||
-rw-r--r-- | pkgs/development/compilers/bs-platform/default.nix | 29 | ||||
-rw-r--r-- | pkgs/development/compilers/bs-platform/ocaml.nix | 4 |
3 files changed, 41 insertions, 33 deletions
diff --git a/pkgs/development/compilers/bs-platform/bs-platform-62.nix b/pkgs/development/compilers/bs-platform/build-bs-platform.nix index d2913caaee64..03e01a7a0da5 100644 --- a/pkgs/development/compilers/bs-platform/bs-platform-62.nix +++ b/pkgs/development/compilers/bs-platform/build-bs-platform.nix @@ -1,35 +1,33 @@ -{ 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; +# This file is based on https://github.com/turboMaCk/bs-platform.nix/blob/master/build-bs-platform.nix +# to make potential future updates simpler + +{ stdenv, fetchFromGitHub, ninja, runCommand, nodejs, python3, + ocaml-version, version, src, + ocaml ? (import ./ocaml.nix { version = ocaml-version; inherit stdenv; src = "${src}/ocaml"; - }; -in + }), + custom-ninja ? (ninja.overrideAttrs (attrs: { + src = runCommand "ninja-patched-source" {} '' + mkdir -p $out + tar zxvf ${src}/vendor/ninja.tar.gz -C $out + ''; + patches = []; + })) +}: stdenv.mkDerivation { inherit src version; pname = "bs-platform"; BS_RELEASE_BUILD = "true"; - buildInputs = [ nodejs python3 ]; + 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 - + ln -sf ${ocaml}/bin/* ./native/${ocaml-version}/bin rm -f vendor/ninja/snapshot/ninja.linux - cp ${ninja}/bin/ninja vendor/ninja/snapshot/ninja.linux + cp ${custom-ninja}/bin/ninja vendor/ninja/snapshot/ninja.linux ''; configurePhase = '' @@ -42,12 +40,9 @@ stdenv.mkDerivation { 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 diff --git a/pkgs/development/compilers/bs-platform/default.nix b/pkgs/development/compilers/bs-platform/default.nix index 5eb11671ca90..7abf7b306a55 100644 --- a/pkgs/development/compilers/bs-platform/default.nix +++ b/pkgs/development/compilers/bs-platform/default.nix @@ -1,15 +1,28 @@ -{ stdenv, fetchFromGitHub, ninja, nodejs, python3, ... }: +{ stdenv, runCommand, fetchFromGitHub, ninja, nodejs, python3, ... }: let + build-bs-platform = import ./build-bs-platform.nix; +in +(build-bs-platform { + inherit stdenv runCommand fetchFromGitHub ninja nodejs python3; + version = "7.0.1"; + ocaml-version = "4.06.1"; + + src = fetchFromGitHub { + owner = "BuckleScript"; + repo = "bucklescript"; + rev = "52770839e293ade2bcf187f2639000ca0a9a1d46"; + sha256 = "0s7g2zfhshsilv9zyp0246bypg34d294z27alpwz03ws9608yr7k"; + fetchSubmodules = true; + }; +}).overrideAttrs (attrs: { 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 ]; + maintainers = with maintainers; [ turbomack gamb anmonteiro ]; platforms = platforms.all; + # Currently there is an issue with aarch build in hydra + # https://github.com/BuckleScript/bucklescript/issues/4091 + badPlatforms = platforms.aarch64; }; -in -{ - bs-platform-621 = import ./bs-platform-62.nix { - inherit stdenv fetchFromGitHub ninja nodejs python3; - } // { inherit meta; }; -} +}) diff --git a/pkgs/development/compilers/bs-platform/ocaml.nix b/pkgs/development/compilers/bs-platform/ocaml.nix index 1f2fdd571f3d..9aa34d02b362 100644 --- a/pkgs/development/compilers/bs-platform/ocaml.nix +++ b/pkgs/development/compilers/bs-platform/ocaml.nix @@ -1,7 +1,7 @@ -{ stdenv, src, version, bs-version }: +{ stdenv, src, version }: stdenv.mkDerivation rec { inherit src version; - name = "ocaml-${version}+bs-${bs-version}"; + name = "ocaml-${version}+bs"; configurePhase = '' ./configure -prefix $out ''; |