diff options
author | Marek Fajkus <marek.faj@gmail.com> | 2019-12-20 15:39:39 +0100 |
---|---|---|
committer | Jon <jonringer@users.noreply.github.com> | 2020-01-14 15:17:57 -0800 |
commit | 77752c6c086512a7c1eb066edcef731696fa2a8e (patch) | |
tree | 685f2711613a2cd7c9230d7f54367cd67ddddf27 /pkgs/development/compilers/bs-platform/build-bs-platform.nix | |
parent | afe905246d890edf4026a565de3ca340a601de2a (diff) |
bs-platform: 6.2.1 -> 7.0.1
Diffstat (limited to 'pkgs/development/compilers/bs-platform/build-bs-platform.nix')
-rw-r--r-- | pkgs/development/compilers/bs-platform/build-bs-platform.nix | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/pkgs/development/compilers/bs-platform/build-bs-platform.nix b/pkgs/development/compilers/bs-platform/build-bs-platform.nix new file mode 100644 index 0000000000000..03e01a7a0da5e --- /dev/null +++ b/pkgs/development/compilers/bs-platform/build-bs-platform.nix @@ -0,0 +1,50 @@ +# 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"; + }), + 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 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 + ''; + + 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 + ''; +} |