Ticket #14432: Portfile.2

File Portfile.2, 2.8 KB (added by rlonstein@…, 17 years ago)

revised Portfile

Line 
1# $Id: Portfile,v 1.7 2008/05/01 01:46:50 lonstein Exp $#
2# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3
4PortSystem         1.0
5
6name               cl-ppcre
7version            1.3.2
8categories         devel
9maintainers        rlonstein@pobox.com
10
11description        Portable Perl-compatible regular expressions for Common Lisp
12
13long_description   CL-PPCRE is a fast, portable, thread-safe regular expression library \
14                   for Common Lisp compatible with Perl under a BSD license.
15
16homepage           http://weitz.de/cl-ppcre/
17platforms          darwin
18master_sites       http://weitz.de/files/
19
20distfiles          ${name}${extract.suffix}
21distname           ${name}-${version}
22
23checksums          md5 23ceea63cb306ead203f5c4f41a4f1d2 \
24                   sha1 4e2fb7e7bf732cbb07b0a87bab5b5d107b48ff69 \
25                   rmd160 2b308153af31386bcd566e9cd2e63ac509b76e8a
26
27universal_variant  no
28
29variant asdf_binary_locations description {Keep compiled Lisp files organized} {
30        depends_lib port:asdf-binary-locations
31}
32
33variant sbcl description {Compile using Steel Bank Common Lisp} {
34        depends_build port:sbcl
35}
36
37
38extract   {}
39configure {}
40build     {}
41
42set destroot-lisp "${destroot}${prefix}/share/common-lisp/"
43set lisp-system-path "#p\"${prefix}/share/common-lisp/systems/\""
44
45destroot {
46          xinstall -m 0755 -d ${destroot-lisp}/src
47          xinstall -m 0755 -d ${destroot-lisp}/systems
48          system "cd ${destroot-lisp}/src && \
49              ${extract.cmd} ${extract.pre_args} ${distpath}/${distfile} ${extract.post_args}"
50          system "find ${destroot-lisp}/src/${name}-${version} -type d -exec chmod 755 {} \\;"
51          system "find ${destroot-lisp}/src/${name}-${version} -type f -exec chmod 644 {} \\;"
52
53         foreach f [glob -dir ${destroot-lisp}/src/${name}-${version} -tails *.asd] {
54             ln -sf ../src/${name}-${version}/$f ${destroot-lisp}/systems/$f
55         }
56}
57
58post-destroot {
59      proc asdf-load {lisp lisp-system-path destroot-system name} {
60          set loadops "${lisp} --no-userinit \
61                       --eval '(require \"asdf\")' \
62                       --eval '(in-package :cl-user)' \
63                       --eval '(setf asdf:*central-registry* (list* (quote *default-pathname-defaults*) ${lisp-system-path} ${destroot-system} asdf:*central-registry*))'"
64          if {[variant_isset asdf_binary_locations]} {
65              append loadops " --eval '(asdf:operate (quote asdf:load-op) (quote asdf-binary-locations))'"
66          }
67          append loadops " --eval '(asdf:operate (quote asdf:load-op) (quote ${name}))'"
68          system "${loadops}"
69     }
70
71     if {[variant_isset sbcl]} {
72         set destroot-system "#p\"${destroot-lisp}/systems/\""
73         asdf-load "/opt/local/bin/sbcl" ${lisp-system-path} ${destroot-system} ${name}
74     }
75
76}