/[gentoo-x86]/eclass/ghc-package.eclass
Gentoo

Diff of /eclass/ghc-package.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.8 Revision 1.10
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/ghc-package.eclass,v 1.8 2005/04/07 22:00:20 kosmikus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ghc-package.eclass,v 1.10 2005/05/08 14:49:25 dcoutts Exp $
4# 4#
5# Author: Andres Loeh <kosmikus@gentoo.org> 5# Author: Andres Loeh <kosmikus@gentoo.org>
6# 6#
7# This eclass helps with the Glasgow Haskell Compiler's package 7# This eclass helps with the Glasgow Haskell Compiler's package
8# configuration utility. 8# configuration utility.
87# no arguments are given, the resulting file is 87# no arguments are given, the resulting file is
88# empty 88# empty
89ghc-setup-pkg() { 89ghc-setup-pkg() {
90 local localpkgconf 90 local localpkgconf
91 localpkgconf="${S}/$(ghc-localpkgconf)" 91 localpkgconf="${S}/$(ghc-localpkgconf)"
92 echo '[' > ${localpkgconf} 92 echo '[]' > ${localpkgconf}
93 while [ -n "$1" ]; do 93 for pkg in $*; do
94 cat "$1" >> ${localpkgconf} 94 $(ghc-getghcpkgbin) -f ${localpkgconf} -u --force \
95 shift 95 < ${pkg}
96 [ -n "$1" ] && echo ',' >> ${localpkgconf}
97 done 96 done
98 echo ']' >> ${localpkgconf} 97}
98
99# fixes the library and import directories path
100# of the package configuration file
101ghc-fixlibpath() {
102 sed -i "s|$1|$(ghc-libdir)|g" ${S}/$(ghc-localpkgconf)
103 if [[ -n "$2" ]]; then
104 sed -i "s|$2|$(ghc-libdir)/imports|g" ${S}/$(ghc-localpkgconf)
105 fi
99} 106}
100 107
101# moves the local (package-specific) package configuration 108# moves the local (package-specific) package configuration
102# file to its final destination 109# file to its final destination
103ghc-install-pkg() { 110ghc-install-pkg() {
104 mkdir -p ${D}/$(ghc-confdir) 111 mkdir -p ${D}/$(ghc-confdir)
105 cat ${S}/$(ghc-localpkgconf) | sed "s:${D}::" \ 112 cat ${S}/$(ghc-localpkgconf) | sed "s|${D}||g" \
106 > ${D}/$(ghc-confdir)/$(ghc-localpkgconf) 113 > ${D}/$(ghc-confdir)/$(ghc-localpkgconf)
107} 114}
108 115
109# registers all packages in the local (package-specific) 116# registers all packages in the local (package-specific)
110# package configuration file 117# package configuration file

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20