source: trunk/dports/cad/LibreCAD/Portfile

Last change on this file was 147840, checked in by g5pw@…, 19 months ago

cad/LibreCAD: Fix destroot phase

closes #49843

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.5 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 147840 2016-04-17 18:12:19Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           github 1.0
6PortGroup           qmake 1.0
7
8github.setup        LibreCAD LibreCAD 2.0.8
9categories          cad
10platforms           darwin
11maintainers         rvt.dds.nl:librecad \
12                    gmail.com:dongxuli2011 \
13                    openmaintainer
14
15license             GPL-2+
16
17description         LibreCAD is a free Open Source CAD application.
18
19long_description    LibreCAD is a free Open Source CAD application for \
20                    Windows, Apple and Linux. Support and documentation is \
21                    free from our large, dedicated community of users, \
22                    contributors and developers. You, too, can also get \
23                    involved!
24
25homepage            http://librecad.org/
26
27checksums           rmd160  d5dc079046ac43265b971bd00f85dfae77e14b92 \
28                    sha256  ec13e47f3c960ae716040a16da0b688c58cd85e63f7c17cd44afc5bf73b01b84
29
30depends_lib-append  port:boost \
31                    port:freetype \
32                    port:libxmlxx2
33
34pre-configure {
35                    configure.args-append CONFIG+=\"build_muparser\"
36}
37
38if {${os.platform} eq "darwin" && ${os.major} < 13} {
39                    configure.compiler macports-gcc-4.8
40                    # -r ensure's that we will build all Makefiles when QMake get's executed
41                    configure.pre_args -r
42
43                    # Fixing -Xarch_X86_64 issues within the Makefile
44                    post-configure  {
45                        ui_info "Removing -Xarch_x86_64 from Makefiles"
46                        fs-traverse Makefile ${worksrcpath} {
47                            if {[string match "*/Makefile" ${Makefile}]} {
48                                ui_info "Fixing Xarch ${Makefile}"
49                                reinplace "s|-Xarch_x86_64||" ${Makefile}
50                            }
51                        }
52                    }
53}
54
55variant universal {}
56
57build.args          CC="${configure.cc} [get_canonical_archflags cc]" \
58                    CXX="${configure.cxx} [get_canonical_archflags cxx]" \
59                    LINK="${configure.cxx} [get_canonical_archflags cxx]"
60
61destroot {
62    if {${os.platform} eq "darwin" && ${os.major} < 13} {
63
64        # copy libgcc files over to within the application, a bug in macdeployqt prevent's this from happening correctly
65        set librecad "${worksrcpath}/LibreCAD.app/Contents/MacOS/LibreCAD"
66        file mkdir ${worksrcpath}/LibreCAD.app/Contents/Frameworks
67        foreach dep [exec otool -L ${librecad} | grep libgcc] {
68            if [string match -nocase "*/libgcc*.dylib" ${dep}] {
69                ui_info "Copy libgcc files over from ${dep} to ${worksrcpath}/LibreCAD.app/Contents/Frameworks"
70                file copy ${dep} ${worksrcpath}/LibreCAD.app/Contents/Frameworks/
71            }
72        }
73
74        # Set these libgcc libraries to local
75        # TODO: Put these in the foreach loop somehow
76        system "install_name_tool -change /opt/local/lib/libgcc/libstdc++.6.dylib \
77            @executable_path/../Frameworks/libstdc++.6.dylib ${librecad}"
78        system "install_name_tool -change /opt/local/lib/libgcc/libgcc_s.1.dylib \
79            @executable_path/../Frameworks/libgcc_s.1.dylib ${librecad}"
80
81    }
82    system -W ${worksrcpath} "${qt_bins_dir}/macdeployqt LibreCAD.app"
83    copy ${worksrcpath}/LibreCAD.app ${destroot}${applications_dir}
84}
Note: See TracBrowser for help on using the repository browser.