source: trunk/dports/devel/codeblocks/Portfile

Last change on this file was 147181, checked in by mojca@…, 20 months ago

codeblocks: upgrade to version 16.01

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.1 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=2:ts=2:sts=2
2# $Id: Portfile 147181 2016-03-30 13:11:37Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           wxWidgets 1.0
6
7name                codeblocks
8version             16.01
9
10platforms           darwin freebsd
11categories          devel aqua x11
12license             GPL-3+
13license_noconflict  boost
14# I'm looking for a volunteer to take the port over
15maintainers         mojca openmaintainer
16description         Open Source, Cross-platform, Free C/C++/D IDE
17long_description    Code::Blocks is a free C++ IDE built specifically \
18                    to meet the most demanding needs of its users. \
19                    It was designed, right from the start, to be \
20                    extensible and configurable.
21
22homepage            http://www.codeblocks.org/
23master_sites        sourceforge:project/codeblocks/Sources/${version}
24
25distname            ${name}_${version}
26worksrcdir          ${name}-${version}.release
27
28checksums           rmd160  e98b034eb8d6cf52a89312f2d5eaa10b17f1355e \
29                    sha256  30fb9d206df4ab3c2e2fec2451a0a7c9723bfed9a673cc9be71e881c529d5a03
30
31depends_build       port:pkgconfig
32
33depends_lib         port:boost \
34                    port:hunspell
35
36# TODO: for a weird reason CB tries to run autotools and fails
37#       once a bug is fixed, we'll no longer need these dependencies
38depends_build-append \
39                    port:autoconf \
40                    port:automake \
41                    port:libtool
42use_autoconf        yes
43autoconf.cmd        ./bootstrap
44
45patchfiles          patch-sdk-configmanager.cpp
46
47# FileManager requires "gamin" to be installed when using wxGTK,
48# not sure whether it works with Carbon/Cocoa at all,
49# so it was disabled for now
50configure.args      --with-contrib-plugins=all,-FileManager
51
52post-destroot {
53    # TODO: this might need a review
54    system "strip -S ${destroot}${prefix}/bin/codeblocks"
55    system "strip -S ${destroot}${prefix}/lib/libcodeblocks*.so || true"
56    system "strip -S ${destroot}${prefix}/lib/libcodeblocks*.dylib || true"
57    system "strip -S ${destroot}${prefix}/lib/libwxsmithlib*.so || true"
58    system "strip -S ${destroot}${prefix}/lib/libwxsmithlib*.dylib || true"
59#   system "strip -S ${destroot}${prefix}/lib/wxSmithContribItems/lib*.so || true"
60#   system "strip -S ${destroot}${prefix}/lib/wxSmithContribItems/lib*.dylib || true"
61    system "strip -S ${destroot}${prefix}/lib/codeblocks/plugins/*.so"
62
63    set appPath ${destroot}${applications_dir}/CodeBlocks.app/Contents
64    xinstall -d -m 0755 ${destroot}${applications_dir}
65    xinstall -d -m 0755 ${appPath}
66    xinstall -d -m 0755 ${appPath}/Resources
67    file copy -force ${worksrcpath}/codeblocks.plist ${appPath}/Info.plist
68    foreach {icn} {app cbp csd c cg cpp d f h rc} {
69        file copy -force ${worksrcpath}/src/src/resources/icons/${icn}.icns ${appPath}/Resources
70    }
71
72    xinstall -d -m 0755 ${appPath}/MacOS
73    ln -sf ${prefix}/bin/codeblocks ${appPath}/MacOS/CodeBlocks
74    xinstall -d -m 0755 ${appPath}/Resources/share
75    ln -sf ${prefix}/share/codeblocks ${appPath}/Resources/share/codeblocks
76    xinstall -d -m 0755 ${appPath}/Resources/lib
77    ln -sf ${prefix}/lib/codeblocks ${appPath}/Resources/lib/codeblocks
78
79    delete ${destroot}${prefix}/share/applications/codeblocks.desktop
80    delete ${destroot}${prefix}/share/icons/hicolor
81    delete ${destroot}${prefix}/share/mime/packages/codeblocks.xml
82    delete ${destroot}${prefix}/share/pixmaps/codeblocks.png
83
84    # TODO without the following block the app fails to start and throws the following error:
85    #
86    # Cannot find resources...
87    # Code::Blocks was configured to be installed in '/Applications/MacPorts/CodeBlocks.app/Contents/MacOS/share/codeblocks'.
88    # Please use the command-line switch '--prefix' or set the CODEBLOCKS_DATA_DIR environment variable to point where Code::Blocks is installed,
89    # or try re-installing the application...
90    #
91    # but this seems like a bug
92    xinstall -d -m 0755 ${appPath}/MacOS/share
93    ln -sf ${prefix}/share/codeblocks ${appPath}/MacOS/share
94}
95
96# disable precompiled headers for the universal build
97variant universal {
98    configure.args-append   --disable-pch
99}
100
101variant wxwidgets30 conflicts wxwidgets28 wxgtk30 wxgtk28 description {Use Cocoa-based wxWidgets 3.0} {
102    wxWidgets.use           wxWidgets-3.0
103    depends_lib-append      port:${wxWidgets.port}
104    autoconf.env-append     ACLOCAL_PATH=${wxWidgets.prefix}/share/aclocal
105    configure.args-append   --with-wxdir=${wxWidgets.wxdir}
106}
107
108variant wxwidgets28 conflicts wxwidgets30 wxgtk30 wxgtk28 description {Use 32-bit Carbon-based wxWidgets 2.8} {
109    wxWidgets.use           wxWidgets-2.8
110    depends_lib-append      port:${wxWidgets.port}
111    autoconf.env-append     ACLOCAL_PATH=${wxWidgets.prefix}/share/aclocal
112    configure.args-append   --with-wxdir=${wxWidgets.wxdir}
113
114    if {${wxWidgets.sdk} ne ""} {
115        configure.sdkroot ${wxWidgets.sdk}
116    }
117}
118
119variant wxgtk30 conflicts wxwidgets30 wxwidgets28 wxgtk28 description {Use wxWidgets 3.0 with GTK} {
120    wxWidgets.use           wxGTK-3.0
121    depends_lib-append      port:${wxWidgets.port}
122    autoconf.env-append     ACLOCAL_PATH=${wxWidgets.prefix}/share/aclocal
123    configure.args-append   --with-wxdir=${wxWidgets.wxdir}
124}
125
126variant wxgtk28 conflicts wxwidgets30 wxwidgets28 wxgtk30 description {Use wxWidgets 2.8 with GTK} {
127    wxWidgets.use           wxGTK-2.8
128    depends_lib-append      port:${wxWidgets.port}
129    autoconf.env-append     ACLOCAL_PATH=${wxWidgets.prefix}/share/aclocal
130    configure.args-append   --with-wxdir=${wxWidgets.wxdir}
131}
132
133if {[variant_isset wxgtk28] || [variant_isset wxgtk30]} {
134    # TODO: someone needs to do a careful check of this list of dependencies
135    # codeblocks ends up linking against these, but it is quite possible that
136    # some of them are also needed when liking against Carbon/Cocoa-based wxWidgets
137    depends_lib-append      path:lib/pkgconfig/cairo.pc:cairo \
138                            path:lib/pkgconfig/pango.pc:pango \
139                            path:lib/pkgconfig/glib-2.0.pc:glib2 \
140                            port:atk \
141                            port:fontconfig \
142                            port:freetype \
143                            port:gdk-pixbuf2 \
144                            port:gettext \
145                            port:gtk2 \
146                            port:xorg-libX11 \
147                            port:xorg-libXcomposite \
148                            port:xorg-libXcursor \
149                            port:xorg-libXdamage \
150                            port:xorg-libXdmcp \
151                            port:xorg-libXext \
152                            port:xorg-libXfixes \
153                            port:xorg-libXi \
154                            port:xorg-libXinerama \
155                            port:xorg-libXrandr \
156                            port:xrender
157}
158
159if {![variant_isset wxwidgets30] && ![variant_isset wxwidgets28] && ![variant_isset wxgtk30] && ![variant_isset wxgtk28]} {
160    default_variants +wxwidgets30
161}
162
163livecheck.type      regex
164livecheck.url       ${homepage}/downloads/source
165livecheck.regex     <p>${name}_(\[0-9.\]+)${extract.suffix}</p>
Note: See TracBrowser for help on using the repository browser.