Skip to content

Commit 943e083

Browse files
committed
WIP
1 parent 6607596 commit 943e083

File tree

3 files changed

+13
-34
lines changed

3 files changed

+13
-34
lines changed

lib/call-cabal-project-to-nix.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,7 @@ let
417417
'';
418418
};
419419

420-
dummy-ghc-pkg-dump = import ./dummy-ghc-pkg-dump {
421-
inherit evalPackages;
420+
dummy-ghc-pkg-dump = evalPackages.callPackage ./dummy-ghc-pkg-dump {
422421
ghc-src = (ghc.raw-src or ghc.buildGHC.raw-src) evalPackages;
423422
ghc-version = ghc.version;
424423
};

lib/dummy-ghc-pkg-dump/default.nix

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
{ evalPackages, ghc-version, ghc-src }:
1+
{ lib, stdenv, runCommand, autoconf, automake, coreutils, findutils, jq
2+
, haskell-nix, ghc-version, ghc-src }:
23

34
let
4-
inherit (evalPackages) lib stdenv;
5-
65
varname = builtins.replaceStrings [ "-" ] [ "_" ];
76

87
ghc-pkgs = [
@@ -60,13 +59,8 @@ let
6059
path = ghc-src;
6160
name = "ghc-src-m4";
6261
};
63-
in evalPackages.runCommand "configure" {
64-
nativeBuildInputs = with evalPackages; [
65-
autoconf
66-
automake
67-
coreutils
68-
findutils
69-
];
62+
in runCommand "configure" {
63+
nativeBuildInputs = [ autoconf automake coreutils findutils ];
7064
} ''
7165
set -euo pipefail
7266
@@ -78,22 +72,14 @@ let
7872
autoconf --verbose
7973
'';
8074

81-
# config-status = ghc-src:
82-
# evalPackages.runCommand "config.status" {
83-
# nativeBuildInputs = [ (configure ghc-src) ];
84-
# } ''
85-
# mkdir -p $out/bin
86-
# cp -v config.status $out/bin/config.status
87-
# '';
88-
8975
x = ghc-src:
90-
evalPackages.runCommand "x" {
91-
76+
runCommand "x" {
9277
nativeBuildInputs = [
93-
evalPackages.haskell-nix.nix-tools-unchecked.exes.cabal2json
94-
evalPackages.jq
78+
# FIXME: for testing
79+
haskell-nix.nix-tools.exes.cabal2json
80+
# haskell-nix.nix-tools-unchecked.exes.cabal2json
81+
jq
9582
];
96-
9783
} ''
9884
set -euo pipefail
9985
@@ -113,19 +99,14 @@ let
11399
CABAL_FILES=(''${CABAL_IN_FILES[@]%.in})
114100
./config.status $(printf -- '--file %s ' "''${CABAL_FILES[@]}")
115101
116-
cabal2json --help
117-
118102
# Convert to json
119103
for f in ''${CABAL_FILES[@]}; do
120104
cabal2json --out="$f.json" "$f"
121105
done
122106
'';
123107

124-
in evalPackages.runCommand "dummy-ghc-pkg-dump" {
125-
nativeBuildInputs = [
126-
evalPackages.haskell-nix.nix-tools-unchecked.exes.cabal2json
127-
evalPackages.jq
128-
];
108+
in runCommand "dummy-ghc-pkg-dump" {
109+
nativeBuildInputs = [ haskell-nix.nix-tools-unchecked.exes.cabal2json jq ];
129110
passthru = { inherit configure x; };
130111
} ''
131112
PACKAGE_VERSION=${ghc-version}

overlays/haskell.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,8 @@ final: prev: {
594594

595595
};
596596

597-
dummy-ghc-pkg-dump = import ../lib/dummy-ghc-pkg-dump {
597+
dummy-ghc-pkg-dump = final.callPackage ../lib/dummy-ghc-pkg-dump {
598598
# FIXME: just for testing
599-
evalPackages = final;
600599
ghc-version = "0.0.0";
601600
ghc-src = final.ghc.src;
602601
};

0 commit comments

Comments
 (0)