Ticket #14432: Portfile

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