Skip to content

Commit 97efe37

Browse files
committed
WIP
1 parent 943e083 commit 97efe37

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
AC_INIT([The Glorious Glasgow Haskell Compilation System], [0.00], [glasgow-haskell-bugs@haskell.org], [ghc-AC_PACKAGE_VERSION])
1+
AC_INIT([The Glorious Glasgow Haskell Compilation System], [0.0.0], [glasgow-haskell-bugs@haskell.org])
22

33
# Set this to YES for a released version, otherwise NO
44
: ${RELEASE=NO}
55

66
dnl ** Make sure we do not have a bogus source directory
77
AC_CONFIG_SRCDIR(ghc/Main.hs)
88

9-
dnl ** Output code to perform substitutions
10-
AC_CONFIG_FILES
11-
129
dnl ** Find unixy sort and find commands,
1310
dnl ** which are needed by FP_SETUP_PROJECT_VERSION
1411
FP_PROG_FIND
@@ -19,4 +16,7 @@ pushd ${srcdir}
1916
FP_SETUP_PROJECT_VERSION
2017
popd
2118

19+
dnl ** Output code to perform substitutions
20+
AC_CONFIG_FILES
21+
2222
AC_OUTPUT

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

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,15 @@ let
7373
'';
7474

7575
x = ghc-src:
76-
runCommand "x" {
76+
let
77+
## GHC version
78+
flags = (lib.optional stdenv.targetPlatform.isx86_64 "--arch x86_64")
79+
++ (lib.optional stdenv.targetPlatform.isAarch64 "--arch aarch64")
80+
++ (lib.optional stdenv.targetPlatform.isLinux "--os linux")
81+
++ (lib.optional stdenv.targetPlatform.isDarwin "--os osx")
82+
++ (lib.optional stdenv.targetPlatform.isGhcjs "--arch javascript");
83+
84+
in runCommand "x" {
7785
nativeBuildInputs = [
7886
# FIXME: for testing
7987
haskell-nix.nix-tools.exes.cabal2json
@@ -82,26 +90,32 @@ let
8290
];
8391
} ''
8492
set -euo pipefail
93+
shopt -s globstar
8594
8695
mkdir -p $out
8796
cd $out
8897
98+
# Run configure script (only for the project version)
99+
${configure ghc-src}/configure --srcdir=${ghc-src}
100+
89101
# Copy the cabal.in files
90102
pushd ${ghc-src}
91-
CABAL_IN_FILES=(*/*.cabal.in libraries/*/*.cabal.in)
92-
cp --no-preserve all --parents "''${CABAL_IN_FILES[@]}" "$out"
103+
cp --no-preserve all --parents */*.cabal */*.cabal.in libraries/*/*.cabal libraries/*/*.cabal.in "$out"
93104
popd
94105
95-
# Run configure script (only for the project version)
96-
${configure ghc-src}/configure --srcdir=${ghc-src}
106+
find
97107
98108
# Substitute config variables in the cabal files
99-
CABAL_FILES=(''${CABAL_IN_FILES[@]%.in})
100-
./config.status $(printf -- '--file %s ' "''${CABAL_FILES[@]}")
109+
FILES=( **/*.cabal.in )
110+
./config.status $(printf -- '--file %s ' ''${FILES[@]%.in})
101111
102112
# Convert to json
103-
for f in ''${CABAL_FILES[@]}; do
104-
cabal2json --out="$f.json" "$f"
113+
for f in **/*.cabal; do
114+
# FIXME
115+
if [[ $f == rts/rts.cabal ]]; then
116+
continue
117+
fi
118+
cabal2json ${lib.concatStringsSep " " flags} --out="$f.json" "$f"
105119
done
106120
'';
107121

0 commit comments

Comments
 (0)