idris-hackers / idrispkgs

Old Nix expressions for Idris packaging. Idris support moved into Nixpkgs!
https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/idris-modules
MIT License
28 stars 4 forks source link

nix-build example.nix unsuccessful on https://nixos.org/channels/nixos-unstable #3

Open MarkusBarthlen opened 9 years ago

MarkusBarthlen commented 9 years ago

Running nix-build example.nix on https://nixos.org/channels/nixos-unstable is unsuccessful.

1 markus@nixos ~/git/idris/temp/idrispkgs (git)-[master] % nix-build --show-trace example.nix :( error: while evaluating the attribute ‘buildCommand’ of the derivation ‘idris-nix-example’ at /home/markus/git/idris/temp/idrispkgs/example.nix:7:3: while evaluating the attribute ‘buildCommand’ of the derivation ‘idris-wrapper’ at /nix/store/jcn0fckjwisxc000xxqmh316bgl2s8hi-nixos-15.06pre65267.6ad8fab/nixos/nixpkgs/pkgs/build-support/trivial-builders.nix:10:14: while evaluating ‘callPackage’ at /nix/store/jcn0fckjwisxc000xxqmh316bgl2s8hi-nixos-15.06pre65267.6ad8fab/nixos/nixpkgs/pkgs/development/haskell-modules/default.nix:50:26, called from /home/markus/git/idris/temp/idrispkgs/default.nix:2:17: while evaluating ‘callPackageWithScope’ at /nix/store/jcn0fckjwisxc000xxqmh316bgl2s8hi-nixos-15.06pre65267.6ad8fab/nixos/nixpkgs/pkgs/development/haskell-modules/default.nix:44:42, called from /nix/store/jcn0fckjwisxc000xxqmh316bgl2s8hi-nixos-15.06pre65267.6ad8fab/nixos/nixpkgs/pkgs/development/haskell-modules/default.nix:50:32: while evaluating ‘callPackageWith’ at /nix/store/jcn0fckjwisxc000xxqmh316bgl2s8hi-nixos-15.06pre65267.6ad8fab/nixos/nixpkgs/lib/customisation.nix:103:35, called from /nix/store/jcn0fckjwisxc000xxqmh316bgl2s8hi-nixos-15.06pre65267.6ad8fab/nixos/nixpkgs/pkgs/development/haskell-modules/default.nix:44:49: while evaluating ‘makeOverridable’ at /nix/store/jcn0fckjwisxc000xxqmh316bgl2s8hi-nixos-15.06pre65267.6ad8fab/nixos/nixpkgs/lib/customisation.nix:56:24, called from /nix/store/jcn0fckjwisxc000xxqmh316bgl2s8hi-nixos-15.06pre65267.6ad8fab/nixos/nixpkgs/lib/customisation.nix:107:8: anonymous function at /home/markus/git/idris/temp/idrispkgs/idris_plain/default.nix:1:1 called without required argument ‘cabal’, at /nix/store/jcn0fckjwisxc000xxqmh316bgl2s8hi-nixos-15.06pre65267.6ad8fab/nixos/nixpkgs/lib/customisation.nix:58:12

What I tried: I tried to modify default.nix by changing the arguments to { nixpkgs ? import {} , idris_plain ? nixpkgs.haskellPackages.callPackage ./idris_plain { cabal = nixpkgs.haskellPackages.cabal-install; inherit (nixpkgs.haskellPackages) annotatedWlPprint ansiTerminal ansiWlPprint base64Bytestring binary blazeHtml blazeMarkup boehmgc cheapskate deepseq filepath fingertree gmp happy haskeline lens libffi mtl network optparseApplicative parsers safe split text time transformers trifecta unorderedContainers utf8String vector vectorBinaryInstances xml zlib fetchFromGitHub ;} }:

which yields 1 markus@nixos ~/git/idris/idrispkgs (git)-[master] % nix-build example.nix :( error: attribute ‘mkDerivation’ missing, at /home/markus/git/idris/idrispkgs/idris_plain/default.nix:10:1

So it seems, I need to inject a variable "cabal" that has mkDerivation defined. Unfortunately, I do not know enough about nix yet to do that.

Thank you very much.

MarkusBarthlen commented 9 years ago

Looks like I need to do the same as in hackage-packages.nix, possibly renaming the packages (camelcase to snakecase).

Example: "idris" = callPackage ({ mkDerivation, annotated-wl-pprint, ansi-terminal, ansi-wl-pprint , base, base64-bytestring, binary, blaze-html, blaze-markup , boehmgc, bytestring, cheapskate, containers, deepseq, directory , filepath, fingertree, gmp, happy, haskeline, lens, libffi, mtl , network, optparse-applicative, parsers, pretty, process, safe , split, text, time, transformers, transformers-compat, trifecta , uniplate, unix, unordered-containers, utf8-string, vector , vector-binary-instances, xml, zip-archive, zlib }: mkDerivation { pname = "idris"; version = "0.9.18.1"; sha256 = "0xd4kqnjdx427l26b07rrw9bnrxb8zrsqy93wayf4rmg6l8rymj8"; isLibrary = true; isExecutable = true; buildDepends = [ annotated-wl-pprint ansi-terminal ansi-wl-pprint base base64-bytestring binary blaze-html blaze-markup bytestring cheapskate containers deepseq directory filepath fingertree haskeline lens libffi mtl network optparse-applicative parsers pretty process safe split text time transformers transformers-compat trifecta uniplate unix unordered-containers utf8-string vector vector-binary-instances xml zip-archive zlib ]; buildTools = [ happy ]; extraLibraries = [ boehmgc gmp ]; configureFlags = [ "-fffi" "-fgmp" ]; jailbreak = true; homepage = "http://www.idris-lang.org/"; description = "Functional Programming Language with Dependent Types"; license = stdenv.lib.licenses.bsd3; }) { inherit (pkgs) boehmgc; inherit (pkgs) gmp;};