From db11c832fb95128b58f0156dd9eb64726d2473b2 Mon Sep 17 00:00:00 2001 From: Domen Kožar Date: Tue, 21 Aug 2018 22:51:59 +0100 Subject: WIP Elm 0.19 --- pkgs/development/compilers/elm/default.nix | 57 +++------------------- .../compilers/elm/packages/elm-compiler.nix | 41 ---------------- .../compilers/elm/packages/elm-make.nix | 26 ---------- .../compilers/elm/packages/elm-package.nix | 39 --------------- .../compilers/elm/packages/elm-repl.nix | 30 ------------ pkgs/development/compilers/elm/packages/elm.nix | 30 ++++++++++++ pkgs/development/compilers/elm/update-elm.rb | 28 ----------- 7 files changed, 38 insertions(+), 213 deletions(-) delete mode 100644 pkgs/development/compilers/elm/packages/elm-compiler.nix delete mode 100644 pkgs/development/compilers/elm/packages/elm-make.nix delete mode 100644 pkgs/development/compilers/elm/packages/elm-package.nix delete mode 100644 pkgs/development/compilers/elm/packages/elm-repl.nix create mode 100644 pkgs/development/compilers/elm/packages/elm.nix delete mode 100755 pkgs/development/compilers/elm/update-elm.rb (limited to 'pkgs/development/compilers') diff --git a/pkgs/development/compilers/elm/default.nix b/pkgs/development/compilers/elm/default.nix index 6a8d5f11b75c..b7482efe7f55 100644 --- a/pkgs/development/compilers/elm/default.nix +++ b/pkgs/development/compilers/elm/default.nix @@ -40,28 +40,13 @@ let EOF '' + lib.concatStrings cmds; - hsPkgs = haskell.packages.ghc802.override { + hsPkgs = haskell.packages.ghc822.override { overrides = self: super: let hlib = haskell.lib; - elmRelease = import ./packages/release.nix { inherit (self) callPackage; }; - elmPkgs' = elmRelease.packages; - elmPkgs = elmPkgs' // { - - elm-reactor = hlib.overrideCabal elmPkgs'.elm-reactor (drv: { - buildTools = drv.buildTools or [] ++ [ self.elm-make ]; - preConfigure = makeElmStuff (import ./packages/elm-reactor-elm.nix); - }); - - elm-repl = hlib.overrideCabal elmPkgs'.elm-repl (drv: { - doCheck = false; - buildTools = drv.buildTools or [] ++ [ makeWrapper ]; - postInstall = - let bins = lib.makeBinPath [ nodejs self.elm-make ]; - in '' - wrapProgram $out/bin/elm-repl \ - --prefix PATH ':' ${bins} - ''; - }); + elmPkgs = { + elm = hlib.overrideCabal (self.callPackage ./packages/elm.nix { }) { + preConfigure = "export HOME=`pwd`"; + }; /* This is not a core Elm package, and it's hosted on GitHub. @@ -72,37 +57,11 @@ let where foo is a tag for a new version, for example "0.3.1-alpha". */ elm-format = self.callPackage ./packages/elm-format.nix { }; - elm-interface-to-json = self.callPackage ./packages/elm-interface-to-json.nix { - aeson-pretty = self.aeson-pretty_0_7_2; - either = hlib.overrideCabal self.either (drv :{ - jailbreak = true; - version = "4.4.1.1"; - sha256 = "1lrlwqqnm6ibfcydlv5qvvssw7bm0c6yypy0rayjzv1znq7wp1xh"; - libraryHaskellDepends = drv.libraryHaskellDepends or [] ++ [ - self.exceptions self.free self.mmorph self.monad-control - self.MonadRandom self.profunctors self.transformers - self.transformers-base - ]; - }); - }; + elm-interface-to-json = self.callPackage ./packages/elm-interface-to-json.nix {}; }; in elmPkgs // { inherit elmPkgs; - elmVersion = elmRelease.version; - # https://github.com/elm-lang/elm-compiler/issues/1566 - indents = hlib.overrideCabal super.indents (drv: { - version = "0.3.3"; - #test dep tasty has a version mismatch - doCheck = false; - sha256 = "16lz21bp9j14xilnq8yym22p3saxvc9fsgfcf5awn2a6i6n527xn"; - libraryHaskellDepends = drv.libraryHaskellDepends ++ [super.concatenative]; - }); + elmVersion = elmPkgs.elm.version; }; }; -in hsPkgs.elmPkgs // { - elm = lib.hiPrio (buildEnv { - name = "elm-${hsPkgs.elmVersion}"; - paths = lib.mapAttrsToList (name: pkg: pkg) hsPkgs.elmPkgs; - pathsToLink = [ "/bin" ]; - }); -} +in hsPkgs.elmPkgs diff --git a/pkgs/development/compilers/elm/packages/elm-compiler.nix b/pkgs/development/compilers/elm/packages/elm-compiler.nix deleted file mode 100644 index 1242f556838a..000000000000 --- a/pkgs/development/compilers/elm/packages/elm-compiler.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ mkDerivation, aeson, aeson-pretty_0_7_2, ansi-terminal, ansi-wl-pprint -, base, binary, bytestring, containers, directory, edit-distance -, fetchgit, filemanip, filepath, HUnit, indents -, language-ecmascript, language-glsl, mtl, parsec, pretty, process -, QuickCheck, stdenv, test-framework, test-framework-hunit -, test-framework-quickcheck2, text, union-find -}: -mkDerivation { - pname = "elm-compiler"; - version = "0.18"; - src = fetchgit { - url = "https://github.com/elm-lang/elm-compiler"; - sha256 = "09fmrbfpc1kzc3p9h79w57b9qjhajdswc4jfm9gyjw95vsiwasgh"; - rev = "eb97f2a5dd5421c708a91b71442e69d02453cc80"; - }; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - aeson aeson-pretty_0_7_2 ansi-terminal ansi-wl-pprint base binary - bytestring containers directory edit-distance filepath indents - language-ecmascript language-glsl mtl parsec pretty process text - union-find - ]; - executableHaskellDepends = [ - aeson base binary directory filepath process text - ]; - testHaskellDepends = [ - aeson aeson-pretty_0_7_2 ansi-terminal ansi-wl-pprint base binary - bytestring containers directory edit-distance filemanip filepath - HUnit indents language-ecmascript language-glsl mtl parsec pretty - process QuickCheck test-framework test-framework-hunit - test-framework-quickcheck2 text union-find - ]; - jailbreak = true; - homepage = http://elm-lang.org; - description = "Values to help with elm-package, elm-make, and elm-lang.org."; - license = stdenv.lib.licenses.bsd3; - # added manually since tests are not passing - # https://travis-ci.org/elm-lang/elm-compiler/builds/176845852 - doCheck = false; -} diff --git a/pkgs/development/compilers/elm/packages/elm-make.nix b/pkgs/development/compilers/elm/packages/elm-make.nix deleted file mode 100644 index 98e57ac9b7c6..000000000000 --- a/pkgs/development/compilers/elm/packages/elm-make.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ mkDerivation, aeson, ansi-terminal, ansi-wl-pprint, base, binary -, blaze-html, blaze-markup, bytestring, containers, directory -, elm-compiler, elm-package, fetchgit, filepath, mtl -, optparse-applicative, raw-strings-qq, stdenv, text, time -}: -mkDerivation { - pname = "elm-make"; - version = "0.18"; - src = fetchgit { - url = "https://github.com/elm-lang/elm-make"; - sha256 = "1yq4w4yqignlc2si5ns53pmz0a99gix5d2qgi6x7finf7i6sxyw2"; - rev = "1a554833a70694ab142b9179bfac996143f68d9e"; - }; - isLibrary = false; - isExecutable = true; - executableHaskellDepends = [ - aeson ansi-terminal ansi-wl-pprint base binary blaze-html - blaze-markup bytestring containers directory elm-compiler - elm-package filepath mtl optparse-applicative raw-strings-qq text - time - ]; - jailbreak = true; - homepage = http://elm-lang.org; - description = "A build tool for Elm projects"; - license = stdenv.lib.licenses.bsd3; -} diff --git a/pkgs/development/compilers/elm/packages/elm-package.nix b/pkgs/development/compilers/elm/packages/elm-package.nix deleted file mode 100644 index 49eddb58a142..000000000000 --- a/pkgs/development/compilers/elm/packages/elm-package.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ mkDerivation, aeson, aeson-pretty_0_7_2, ansi-wl-pprint, base, binary -, bytestring, containers, directory, edit-distance, elm-compiler -, fetchgit, fetchurl, filepath, HTTP, http-client, http-client-tls -, http-types, mtl, network, optparse-applicative, parallel-io -, pretty, stdenv, text, time, unordered-containers, vector -, zip-archive -}: -mkDerivation { - pname = "elm-package"; - version = "0.18"; - src = fetchgit { - url = "https://github.com/elm-lang/elm-package"; - sha256 = "19krnkjvfk02gmmic5h5i1i0lw7s30927bnd5g57cj8nqbigysv7"; - rev = "8bd150314bacab5b6fc451927aa01deec2276fbf"; - }; - patches = fetchurl { - url = https://github.com/jerith666/elm-package/commit/40bab60c2fbff70812cc24cdd97f5e09db3844ad.patch; - sha256 = "0j6pi6cv3h9s6vz68bh0c73fysvk83yhhk56kgshvnrmnpcb3jib"; - }; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - aeson aeson-pretty_0_7_2 ansi-wl-pprint base binary bytestring containers - directory edit-distance elm-compiler filepath HTTP http-client - http-client-tls http-types mtl network parallel-io text time - unordered-containers vector zip-archive - ]; - executableHaskellDepends = [ - aeson aeson-pretty_0_7_2 ansi-wl-pprint base binary bytestring containers - directory edit-distance elm-compiler filepath HTTP http-client - http-client-tls http-types mtl network optparse-applicative - parallel-io pretty text time unordered-containers vector - zip-archive - ]; - jailbreak = true; - homepage = https://github.com/elm-lang/elm-package; - description = "Package manager for Elm libraries"; - license = stdenv.lib.licenses.bsd3; -} diff --git a/pkgs/development/compilers/elm/packages/elm-repl.nix b/pkgs/development/compilers/elm/packages/elm-repl.nix deleted file mode 100644 index 8c168dedc759..000000000000 --- a/pkgs/development/compilers/elm/packages/elm-repl.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ mkDerivation, base, binary, bytestring, bytestring-trie, cmdargs -, containers, directory, elm-compiler, elm-package, fetchgit -, filepath, haskeline, HUnit, mtl, parsec, QuickCheck, stdenv -, test-framework, test-framework-hunit, test-framework-quickcheck2 -, text -}: -mkDerivation { - pname = "elm-repl"; - version = "0.18"; - src = fetchgit { - url = "https://github.com/elm-lang/elm-repl"; - sha256 = "112fzykils4lqz4pc44q4mwvxg0px0zfwx511bfvblrxkwwqlfb5"; - rev = "85f0bcfc28ea6c8a99a360d55c21ff25a556f9fe"; - }; - isLibrary = false; - isExecutable = true; - executableHaskellDepends = [ - base binary bytestring bytestring-trie cmdargs containers directory - elm-compiler elm-package filepath haskeline mtl parsec text - ]; - testHaskellDepends = [ - base bytestring bytestring-trie cmdargs directory elm-compiler - elm-package filepath haskeline HUnit mtl parsec QuickCheck - test-framework test-framework-hunit test-framework-quickcheck2 - ]; - jailbreak = true; - homepage = https://github.com/elm-lang/elm-repl; - description = "a REPL for Elm"; - license = stdenv.lib.licenses.bsd3; -} diff --git a/pkgs/development/compilers/elm/packages/elm.nix b/pkgs/development/compilers/elm/packages/elm.nix new file mode 100644 index 000000000000..1097c8a1e192 --- /dev/null +++ b/pkgs/development/compilers/elm/packages/elm.nix @@ -0,0 +1,30 @@ +{ mkDerivation, ansi-terminal, ansi-wl-pprint, base, binary +, bytestring, containers, directory, edit-distance, fetchgit +, file-embed, filepath, ghc-prim, haskeline, HTTP, http-client +, http-client-tls, http-types, language-glsl, logict, mtl, network +, parsec, process, raw-strings-qq, scientific, SHA, snap-core +, snap-server, stdenv, template-haskell, text, time +, unordered-containers, utf8-string, vector, zip-archive +}: +mkDerivation { + pname = "elm"; + version = "0.19.0"; + src = fetchgit { + url = "https://github.com/elm/compiler"; + sha256 = "0s93z9vr0vp5w894ghc5s34nsq09sg1msf59zfiba87sid5vgjqy"; + rev = "32059a289d27e303fa1665e9ada0a52eb688f302"; + }; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ + ansi-terminal ansi-wl-pprint base binary bytestring containers + directory edit-distance file-embed filepath ghc-prim haskeline HTTP + http-client http-client-tls http-types language-glsl logict mtl + network parsec process raw-strings-qq scientific SHA snap-core + snap-server template-haskell text time unordered-containers + utf8-string vector zip-archive + ]; + homepage = "http://elm-lang.org"; + description = "The `elm` command line interface"; + license = stdenv.lib.licenses.bsd3; +} diff --git a/pkgs/development/compilers/elm/update-elm.rb b/pkgs/development/compilers/elm/update-elm.rb deleted file mode 100755 index 5169ff3fd29a..000000000000 --- a/pkgs/development/compilers/elm/update-elm.rb +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env ruby - -# Take those from https://github.com/elm-lang/elm-platform/blob/master/installers/BuildFromSource.hs -$elm_version = "0.18.0" -$elm_packages = { "elm-compiler" => "0.18.0", - "elm-package" => "0.18.0", - "elm-make" => "0.18.0", - "elm-reactor" => "0.18.0", - "elm-repl" => "0.18.0" - } - -for pkg, ver in $elm_packages - system "cabal2nix https://github.com/elm-lang/#{pkg} --revision refs/tags/#{ver} --jailbreak > packages/#{pkg}.nix" -end - -File.open("packages/release.nix", 'w') do |file| - file.puts "# This file is auto-generated by ./update-elm.rb." - file.puts "# Please, do not modify it by hand!" - file.puts "{ callPackage }:" - file.puts "{" - file.puts " version = \"#{$elm_version}\";" - file.puts " packages = {" - for pkg, ver in $elm_packages - file.puts " #{pkg} = callPackage ./#{pkg}.nix { };" - end - file.puts " };" - file.puts "}" -end -- cgit 1.4.1