/[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.9 Revision 1.13
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.9 2005/04/08 01:13:39 araujo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ghc-package.eclass,v 1.13 2005/07/06 20:23:20 agriffis 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.
9 9
10inherit versionator 10inherit versionator
11 11
12ECLASS="ghc-package"
13INHERITED="${INHERITED} ${ECLASS}"
14 12
15# promote /opt/ghc/bin to a better position in the search path 13# promote /opt/ghc/bin to a better position in the search path
16PATH="/usr/bin:/opt/ghc/bin:${PATH}" 14PATH="/usr/bin:/opt/ghc/bin:${PATH}"
17 15
18# for later configuration using environment variables/ 16# for later configuration using environment variables/
87# no arguments are given, the resulting file is 85# no arguments are given, the resulting file is
88# empty 86# empty
89ghc-setup-pkg() { 87ghc-setup-pkg() {
90 local localpkgconf 88 local localpkgconf
91 localpkgconf="${S}/$(ghc-localpkgconf)" 89 localpkgconf="${S}/$(ghc-localpkgconf)"
92 echo '[' > ${localpkgconf} 90 echo '[]' > ${localpkgconf}
93 while [ -n "$1" ]; do 91 for pkg in $*; do
94 cat "$1" >> ${localpkgconf} 92 $(ghc-getghcpkgbin) -f ${localpkgconf} -u --force \
95 shift 93 < ${pkg} || die "failed to register ${pkg}"
96 [ -n "$1" ] && echo ',' >> ${localpkgconf}
97 done 94 done
98 echo ']' >> ${localpkgconf}
99} 95}
100 96
101# fixes the library and import directories path 97# fixes the library and import directories path
102# of the package configuration file 98# of the package configuration file
103ghc-fixlibpath() { 99ghc-fixlibpath() {
104 sed -i "s|$1|$(ghc-libdir)|" ${S}/$(ghc-localpkgconf) 100 sed -i "s|$1|$(ghc-libdir)|g" ${S}/$(ghc-localpkgconf)
105 if [[ -n "$2" ]]; then 101 if [[ -n "$2" ]]; then
106 sed -i "s|$2|$(ghc-libdir)/imports|" ${S}/$(ghc-localpkgconf) 102 sed -i "s|$2|$(ghc-libdir)/imports|g" ${S}/$(ghc-localpkgconf)
107 fi 103 fi
108} 104}
109 105
110# moves the local (package-specific) package configuration 106# moves the local (package-specific) package configuration
111# file to its final destination 107# file to its final destination
112ghc-install-pkg() { 108ghc-install-pkg() {
113 mkdir -p ${D}/$(ghc-confdir) 109 mkdir -p ${D}/$(ghc-confdir)
114 cat ${S}/$(ghc-localpkgconf) | sed "s:${D}::" \ 110 cat ${S}/$(ghc-localpkgconf) | sed "s|${D}||g" \
115 > ${D}/$(ghc-confdir)/$(ghc-localpkgconf) 111 > ${D}/$(ghc-confdir)/$(ghc-localpkgconf)
116} 112}
117 113
118# registers all packages in the local (package-specific) 114# registers all packages in the local (package-specific)
119# package configuration file 115# package configuration file

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20