Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MarkusBarthlen opened this issue Jul 19, 2015 · 1 comment

Comments

@MarkusBarthlen
Copy link

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
Copy link
Author

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;};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant