on iko/ghcjs-patch-master help sign in
fix driver. Allow overrides.
commit2b0418605c1f1db95e7eaec107fbd3e258e3fddd authorMoritz Angermann <moritz.angermann@gmail.com> dateSun 15 Jul 2018, 16:36 (8 years ago) parent52fc9ec
1 file changed+5−10
compat/driver.nix+5−10
compat/driver.nix+5−10
@@ -40,20 +40,15 @@ with rec {
4040 // cabal.arch // { "is${arch}" = true; };
4141 }; in e;
4242};
43−# The `doVerbose` here is a nasty hack. We want to be
44−# able to say <package>.override { <some-generic-builder-arg> = <value };
45−# however due to the wrapping here, we'd need to capture all arguments
46−# and strip out `mkDerivation, stdenv, flags` and then inherit them all.
47−# OR define the keys and inherit them here (which is what we did with
48−# `doVerbose`. The better solution then is to try and drop those values
49−# from an @args caputre instead.
50−{ mkDerivation, stdenv, flags ? {}, doVerbose ? false }:
43+# These are the keys that <pkg>.override can override.
44+# the ... is used to allow to override all potential
45+# other keys, that the builder understands.
46+{ mkDerivation, stdenv, flags ? {}, ... }@args:
5147let expr = expr0 flags;
5248 pname = expr.package.identifier.name;
5349 pversion = expr.package.identifier.version;
5450in mkDerivation ({
5551 inherit pname;
56− inherit doVerbose;
5752 version = pversion;
5853 sha256 = (import <hackage/all-cabal-hashes.nix>).${pname}.${pversion} or null;
5954
@@ -81,4 +76,4 @@ in mkDerivation ({
8176 inherit (expr) src;
8277} // pkgs.lib.optionalAttrs (builtins.hasAttr "postUnpack" expr) {
8378 inherit (expr) postUnpack;
84−})
79+} // builtins.removeAttrs args [ "mkDerivation" "stdenv" "flags" ])