From 94d12f3e7cc5b02e53f3ed92e34546bb971dfd6c Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 27 Sep 2018 18:27:07 -0400 Subject: [PATCH] ghcjs-{7.10, 8.0}: Make symmetrical There's no reason other than misleading branch names to prefer one over another. --- .../ghcjs/{ghcjs.patch => 7.10/boot.patch} | 0 .../compilers/ghcjs/7.10/default.nix | 50 +++++++++++++++++++ .../compilers/ghcjs/{ => 7.10}/shims.nix | 0 .../compilers/ghcjs/{ => 7.10}/stage2.nix | 0 .../{ghcjs-head.patch => 8.0/boot.patch} | 0 .../ghcjs/{head.nix => 8.0/default.nix} | 8 +-- .../ghcjs/{head_shims.nix => 8.0/shims.nix} | 0 .../ghcjs/{head_stage2.nix => 8.0/stage2.nix} | 0 pkgs/development/compilers/ghcjs/base.nix | 46 +++-------------- pkgs/development/compilers/ghcjs/default.nix | 5 -- pkgs/top-level/haskell-packages.nix | 4 +- 11 files changed, 62 insertions(+), 51 deletions(-) rename pkgs/development/compilers/ghcjs/{ghcjs.patch => 7.10/boot.patch} (100%) create mode 100644 pkgs/development/compilers/ghcjs/7.10/default.nix rename pkgs/development/compilers/ghcjs/{ => 7.10}/shims.nix (100%) rename pkgs/development/compilers/ghcjs/{ => 7.10}/stage2.nix (100%) rename pkgs/development/compilers/ghcjs/{ghcjs-head.patch => 8.0/boot.patch} (100%) rename pkgs/development/compilers/ghcjs/{head.nix => 8.0/default.nix} (84%) rename pkgs/development/compilers/ghcjs/{head_shims.nix => 8.0/shims.nix} (100%) rename pkgs/development/compilers/ghcjs/{head_stage2.nix => 8.0/stage2.nix} (100%) delete mode 100644 pkgs/development/compilers/ghcjs/default.nix diff --git a/pkgs/development/compilers/ghcjs/ghcjs.patch b/pkgs/development/compilers/ghcjs/7.10/boot.patch similarity index 100% rename from pkgs/development/compilers/ghcjs/ghcjs.patch rename to pkgs/development/compilers/ghcjs/7.10/boot.patch diff --git a/pkgs/development/compilers/ghcjs/7.10/default.nix b/pkgs/development/compilers/ghcjs/7.10/default.nix new file mode 100644 index 000000000000..f18a094aa3cf --- /dev/null +++ b/pkgs/development/compilers/ghcjs/7.10/default.nix @@ -0,0 +1,50 @@ +{ fetchgit, fetchFromGitHub, bootPkgs, cabal-install }: + +bootPkgs.callPackage ../base.nix { + version = "0.2.0"; + + inherit bootPkgs cabal-install; + + ghcjsSrc = fetchFromGitHub { + owner = "ghcjs"; + repo = "ghcjs"; + rev = "689c7753f50353dd05606ed79c51cd5a94d3922a"; + sha256 = "076020a9gjv8ldj5ckm43sbzq9s6c5xj6lpd8v28ybpiama3m6b4"; + }; + ghcjsBootSrc = fetchgit { + url = git://github.com/ghcjs/ghcjs-boot.git; + rev = "8c549931da27ba9e607f77195208ec156c840c8a"; + sha256 = "0yg9bnabja39qysh9pg1335qbvbc0r2mdw6cky94p7kavacndfdv"; + fetchSubmodules = true; + }; + + shims = import ./shims.nix { inherit fetchFromGitHub; }; + stage1Packages = [ + "array" + "base" + "binary" + "bytestring" + "containers" + "deepseq" + "directory" + "filepath" + "ghc-boot" + "ghc-boot-th" + "ghc-prim" + "ghci" + "ghcjs-prim" + "ghcjs-th" + "integer-gmp" + "pretty" + "primitive" + "process" + "rts" + "template-haskell" + "time" + "transformers" + "unix" + ]; + stage2 = import ./stage2.nix; + + patches = [ ./boot.patch ]; +} diff --git a/pkgs/development/compilers/ghcjs/shims.nix b/pkgs/development/compilers/ghcjs/7.10/shims.nix similarity index 100% rename from pkgs/development/compilers/ghcjs/shims.nix rename to pkgs/development/compilers/ghcjs/7.10/shims.nix diff --git a/pkgs/development/compilers/ghcjs/stage2.nix b/pkgs/development/compilers/ghcjs/7.10/stage2.nix similarity index 100% rename from pkgs/development/compilers/ghcjs/stage2.nix rename to pkgs/development/compilers/ghcjs/7.10/stage2.nix diff --git a/pkgs/development/compilers/ghcjs/ghcjs-head.patch b/pkgs/development/compilers/ghcjs/8.0/boot.patch similarity index 100% rename from pkgs/development/compilers/ghcjs/ghcjs-head.patch rename to pkgs/development/compilers/ghcjs/8.0/boot.patch diff --git a/pkgs/development/compilers/ghcjs/head.nix b/pkgs/development/compilers/ghcjs/8.0/default.nix similarity index 84% rename from pkgs/development/compilers/ghcjs/head.nix rename to pkgs/development/compilers/ghcjs/8.0/default.nix index 84eb2d8bd0da..a786f536eb9b 100644 --- a/pkgs/development/compilers/ghcjs/head.nix +++ b/pkgs/development/compilers/ghcjs/8.0/default.nix @@ -1,6 +1,6 @@ { fetchgit, fetchFromGitHub, bootPkgs, cabal-install }: -bootPkgs.callPackage ./base.nix { +bootPkgs.callPackage ../base.nix { version = "0.2.020170323"; inherit bootPkgs cabal-install; @@ -18,7 +18,7 @@ bootPkgs.callPackage ./base.nix { fetchSubmodules = true; }; - shims = import ./head_shims.nix { inherit fetchFromGitHub; }; + shims = import ./shims.nix { inherit fetchFromGitHub; }; stage1Packages = [ "array" "base" @@ -44,7 +44,7 @@ bootPkgs.callPackage ./base.nix { "transformers" "unix" ]; - stage2 = import ./head_stage2.nix; + stage2 = import ./stage2.nix; - patches = [ ./ghcjs-head.patch ]; + patches = [ ./boot.patch ]; } diff --git a/pkgs/development/compilers/ghcjs/head_shims.nix b/pkgs/development/compilers/ghcjs/8.0/shims.nix similarity index 100% rename from pkgs/development/compilers/ghcjs/head_shims.nix rename to pkgs/development/compilers/ghcjs/8.0/shims.nix diff --git a/pkgs/development/compilers/ghcjs/head_stage2.nix b/pkgs/development/compilers/ghcjs/8.0/stage2.nix similarity index 100% rename from pkgs/development/compilers/ghcjs/head_stage2.nix rename to pkgs/development/compilers/ghcjs/8.0/stage2.nix diff --git a/pkgs/development/compilers/ghcjs/base.nix b/pkgs/development/compilers/ghcjs/base.nix index 46e9d8d72bed..34c332d87d91 100644 --- a/pkgs/development/compilers/ghcjs/base.nix +++ b/pkgs/development/compilers/ghcjs/base.nix @@ -37,57 +37,23 @@ , coreutils , libiconv -, version ? "0.2.0" -, ghcjsSrc ? fetchFromGitHub { - owner = "ghcjs"; - repo = "ghcjs"; - rev = "689c7753f50353dd05606ed79c51cd5a94d3922a"; - sha256 = "076020a9gjv8ldj5ckm43sbzq9s6c5xj6lpd8v28ybpiama3m6b4"; - } -, ghcjsBootSrc ? fetchgit { - url = git://github.com/ghcjs/ghcjs-boot.git; - rev = "8c549931da27ba9e607f77195208ec156c840c8a"; - sha256 = "0yg9bnabja39qysh9pg1335qbvbc0r2mdw6cky94p7kavacndfdv"; - fetchSubmodules = true; - } +, version +, ghcjsSrc +, ghcjsBootSrc , ghcjsBoot ? import ./ghcjs-boot.nix { inherit runCommand; src = ghcjsBootSrc; } -, shims ? import ./shims.nix { inherit fetchFromGitHub; } +, shims # This is the list of the Stage 1 packages that are built into a booted ghcjs installation # It can be generated with the command: # nix-shell -p haskell.packages.ghcjs.ghc --command "ghcjs-pkg list | sed -n 's/^ \(.*\)-\([0-9.]*\)$/\1_\2/ p' | sed 's/\./_/g' | sed 's/^\([^_]*\)\(.*\)$/ \"\1\"/'" -, stage1Packages ? [ - "array" - "base" - "binary" - "bytestring" - "containers" - "deepseq" - "directory" - "filepath" - "ghc-boot" - "ghc-boot-th" - "ghc-prim" - "ghci" - "ghcjs-prim" - "ghcjs-th" - "integer-gmp" - "pretty" - "primitive" - "process" - "rts" - "template-haskell" - "time" - "transformers" - "unix" - ] +, stage1Packages , stage2 ? import ./stage2.nix -, patches ? [ ./ghcjs.patch ] +, patches # used for resolving compiler plugins , ghcLibdir ? null diff --git a/pkgs/development/compilers/ghcjs/default.nix b/pkgs/development/compilers/ghcjs/default.nix deleted file mode 100644 index 7f3cc9440015..000000000000 --- a/pkgs/development/compilers/ghcjs/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ bootPkgs, cabal-install }: - -bootPkgs.callPackage ./base.nix { - inherit bootPkgs cabal-install; -} diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index ea5cc8ded1db..69fcc283326d 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -80,11 +80,11 @@ in { llvmPackages = pkgs.llvmPackages_5; }; ghcjs = compiler.ghcjs84; - ghcjs710 = packages.ghc7103.callPackage ../development/compilers/ghcjs { + ghcjs710 = packages.ghc7103.callPackage ../development/compilers/ghcjs/7.10 { bootPkgs = packages.ghc7103; inherit (pkgs) cabal-install; }; - ghcjs80 = packages.ghc802.callPackage ../development/compilers/ghcjs/head.nix { + ghcjs80 = packages.ghc802.callPackage ../development/compilers/ghcjs/8.0 { bootPkgs = packages.ghc802; inherit (pkgs) cabal-install; };