head	1.1;
access;
symbols
	pkgsrc-2026Q1:1.1.0.20
	pkgsrc-2026Q1-base:1.1
	pkgsrc-2025Q4:1.1.0.18
	pkgsrc-2025Q4-base:1.1
	pkgsrc-2025Q3:1.1.0.16
	pkgsrc-2025Q3-base:1.1
	pkgsrc-2025Q2:1.1.0.14
	pkgsrc-2025Q2-base:1.1
	pkgsrc-2025Q1:1.1.0.12
	pkgsrc-2025Q1-base:1.1
	pkgsrc-2024Q4:1.1.0.10
	pkgsrc-2024Q4-base:1.1
	pkgsrc-2024Q3:1.1.0.8
	pkgsrc-2024Q3-base:1.1
	pkgsrc-2024Q2:1.1.0.6
	pkgsrc-2024Q2-base:1.1
	pkgsrc-2024Q1:1.1.0.4
	pkgsrc-2024Q1-base:1.1
	pkgsrc-2023Q4:1.1.0.2
	pkgsrc-2023Q4-base:1.1;
locks; strict;
comment	@# @;


1.1
date	2023.10.11.03.07.31;	author pho;	state Exp;
branches;
next	;
commitid	7KDJSfUnoWHMH9IE;


desc
@@


1.1
log
@lang/ghc94: Fix broken "make bootstrap"

Bootstrapping the compiler without "cabal-install" is something GHC devs
rarely do, and it keeps bitrotting. This time I could make it work again,
but at some point we might end up having to distribute binaries of
cabal-install for each platform.
@
text
@#!/bin/sh
set -eu

# This script extracts the package DB originally came from GHC you are
# using. Only needed when you create a hadrian bootstrap archive.

if [ "$#" -lt 1 ]; then
    echo >&2 "Usage: $0 PKG_DB_DIR"
    exit
fi
PKG_DB_DIR="$1"

mkdir -p "$PKG_DB_DIR"
pkg_info -qL ghc | {
    conf_dir_path=
    while read path; do
        conf_dir_removed="${path#*/package.conf.d/}"
        if [ "$conf_dir_removed" != "$path" ]; then
            echo "Copying ${path}..."
            if [ "$conf_dir_path" = "" ]; then
                conf_dir_path="${path%/${conf_dir_removed}}"
            fi
            sed -e "s|\\\${pkgroot}|${conf_dir_path}/..|g" \
                < "${path}" \
                > "${PKG_DB_DIR}/${conf_dir_removed}"
        fi
    done
}
ghc-pkg --package-db="$PKG_DB_DIR" recache
@
