Ticket #945: Portfile

File Portfile, 3.2 KB (added by pmoura@…, 21 years ago)

Logtalk portfile

Line 
1# $Id: $
2
3PortSystem      1.0
4name            logtalk
5version         2.15.4
6
7categories      lang
8maintainers     pmoura@mac.com
9platforms       darwin freebsd linux
10description     Logtalk - Open source object-oriented extension to Prolog
11
12long_description        \
13                Logtalk is an open source object-oriented extension to the      \
14                Prolog programming language. Integrating logic programming      \
15                with object-oriented and event-driven programming, it is        \
16                compatible with most Prolog compilers. It supports both         \
17                prototypes and classes. In addition, it supports component-     \
18                based programming through category-based composition.
19               
20
21homepage                http://www.logtalk.org/
22master_sites    http://www.logtalk.org/files/
23
24checksums               md5 762f606b7d29480d720e37da9ed40a66
25
26distname                lgt2154
27
28configure               {}
29
30build                   {}
31
32destroot                {
33        system "mkdir ${destroot}${prefix}/share/${distname}"
34        cd ${destroot}${prefix}/share/${distname}
35
36        system "cp ${workpath}/${worksrcdir}/LICENSE ."
37        system "cp ${workpath}/${worksrcdir}/QUICK_START ."
38        system "cp ${workpath}/${worksrcdir}/README ."
39        system "cp ${workpath}/${worksrcdir}/RELEASE_NOTES ."
40        system "cp ${workpath}/${worksrcdir}/UPGRADING ."
41        system "cp -R ${workpath}/${worksrcdir}/manuals ."
42        system "cp -R ${workpath}/${worksrcdir}/examples ."
43
44        system "mkdir ${destroot}${prefix}/lib/${distname}"
45        cd ${destroot}${prefix}/lib/${distname}
46
47        system "cp -R ${workpath}/${worksrcdir}/compiler ."
48        system "cp -R ${workpath}/${worksrcdir}/configs ."
49        system "cp -R ${workpath}/${worksrcdir}/library ."
50        system "cp -R ${workpath}/${worksrcdir}/wenv ."
51        system "cp -R ${workpath}/${worksrcdir}/xml ."
52
53        if {[variant_isset gprolog]} {
54                system "mkdir ${destroot}${prefix}/lib/${distname}/bin"
55                cd ${destroot}${prefix}/lib/${distname}/bin
56                system "cp ${workpath}/${worksrcdir}/gplgt ."
57        }
58
59        if {[variant_isset swi-prolog]} {
60                system "mkdir ${destroot}${prefix}/lib/${distname}/bin"
61                cd ${destroot}${prefix}/lib/${distname}/bin
62                system "cp ${workpath}/${worksrcdir}/logtalk.rc ."
63                system "cp ${workpath}/${worksrcdir}/swilgt ."
64        }
65}
66
67post-destroot   {
68        cd ${destroot}/${prefix}/lib
69        system "ln -s ${distname} logtalk"
70
71        cd ../share
72        system "ln -s ${distname} logtalk"
73
74        if {[variant_isset gprolog]} {
75                cd ../bin
76                system "ln -s ../lib/${distname}/bin/gplgt gplgt"
77        }
78
79        if {[variant_isset swi-prolog]} {
80                cd ../bin
81                system "ln -s ../lib/${distname}/bin/swilgt swilgt"
82        }
83}
84
85variant gprolog {
86        depends_lib bin:gplc:gprolog
87       
88        build {
89                cd ${workpath}/${worksrcdir}
90
91                system "cp configs/gnu.config configs/gnu.pl"
92                system "echo ':- built_in.' > compiler/gp"
93                system "cat compiler/gp compiler/logtalk.pl > compiler/logtalkgp.pl"
94                system "gplc -o gplgt configs/gnu.pl compiler/logtalkgp.pl"
95                system "rm configs/gnu.pl"
96                system "rm compiler/gp"
97        }
98}
99
100variant swi-prolog      {
101        depends_lib bin:swipl:swi-prolog
102       
103        build {
104                cd ${workpath}/${worksrcdir}
105
106                system "echo ':- consult(${prefix}/lib/logtalk/configs/swi.config).' > logtalk.rc"
107                system "echo ':- consult(${prefix}/lib/logtalk/compiler/logtalk.pl).' >> logtalk.rc"
108                reinplace "s|\(|('|g" logtalk.rc
109                reinplace "s|\)|')|g" logtalk.rc
110
111                system "echo '#/bin/sh' > swilgt"
112                system "echo 'swipl -f ${prefix}/lib/logtalk/bin/logtalk.rc' >> swilgt"
113                system "chmod a+x swilgt"
114        }
115}