Ticket #44882: Portfile

File Portfile, 8.2 KB (added by RJVB (René Bertin), 10 years ago)
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 122038 2014-07-13 11:29:03Z nicos@macports.org $
3
4PortSystem          1.0
5PortGroup           kde4   1.1
6
7fetch.type          git
8#git.url            git://anongit.kde.org/kdelibs
9git.url             /Users/bertin/cworks/new/KDE/kdelibs/kdelibs-git
10#git.branch          f040d08
11git.branch          9ed4f721
12
13name                kdelibs4
14version             4.14.1
15revision            20141008
16categories          kde kde4
17maintainers         nicos
18license             LGPL-2+ GPL-2+ BSD
19description         KDE4 core libraries, git/master
20long_description    Core libraries for KDE4 applications to function. \
21                    This port follows git/master
22platforms           darwin
23homepage            http://www.kde.org
24master_sites        kde:stable/${version}/src/
25use_xz              yes
26#distname            kdelibs-${version}
27
28#checksums           rmd160  8db76ec77ed09d180223fb3a37b38e8ca8798d75 \
29#                    sha256  d291b4bc159a3f686ad93ff3dfbe90a0a7e33600357e8390c84154ec050efc82
30
31#No binary links to openssl libraries, apart from libkio.dylib at
32#runtime if required. As libkio.dylib code is purely LGPL, there is no
33#conflict with openssl license
34license_noconflict  openssl
35
36depends_build-append port:flex port:gmake port:docbook-xsl-ns
37
38depends_lib-append  port:bzip2 port:zlib \
39                    port:soprano port:cyrus-sasl2 \
40                    port:strigi port:gettext \
41                    port:pcre port:shared-mime-info \
42                    lib:libgif:giflib port:tiff \
43                    port:jpeg port:libpng \
44                    port:jasper port:openexr \
45                    port:expat port:libart_lgpl \
46                    port:libidn port:libiconv \
47                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
48                    port:openssl port:enchant \
49                    port:aspell port:aspell-dict-en \
50                    port:attica port:xz \
51                    port:avahi port:qca \
52                    port:libxml2 port:libxslt \
53                    port:dbusmenu-qt port:docbook-xml \
54                    port:docbook-xsl port:grantlee \
55                    port:kerberos5 \
56                    port:shared-desktop-ontologies
57
58# the aspell dictionaries are just files
59depends_skip_archcheck aspell-dict-en
60
61conflicts           kdelibs3
62
63#workaround-kdeinit4-crash: Mac-specific patch developed by Macports to circumvent some crashes.
64#avoid-kwindowinfo-destructor: Prevent sending null pointer to CFRelease (see ticket #44258)
65#default-kde4-xdg-menu-prefix: solves a conflict with a file from gnome-menus (see ticket #18914)
66#add-bundles-to-path: improve support for KIO slaves by adding a search path
67#kapplications-raster: ensures that kde applications start in raster (faster) mode, but also provides a switch for non-working applications
68#removeFindFlex: remove FindFlex.cmake which may hide the working one of cmake (ticket #44119)
69#patch-cmake-modules-FindKDE4-Internal.cmake: Fixes zlib detection (see ticket #24128)
70#patch-cmake-modules-KDE4Macros.cmake: Ensures that compiled objects are properly detected during build (see ticket #43720)
71
72patchfiles           workaround-kdeinit4-crash.patch \
73                     default-kde4-xdg-menu-prefix.patch \
74                     add-bundles-to-path.patch \
75                     patch-kapplications-raster.diff \
76                     patch-removeFindFlex.diff \
77                     patch-cmake-modules-FindKDE4-Internal.cmake.diff
78
79# RJVB
80# fixCrashInKCrash.patch
81patchfiles-append    fixInvokeBrowser.patch \
82                 fixReportBug.patch \
83                 streamline-systray-menu.patch \
84                 correct-PreferencesAndSysTray-Menu.patch \
85                 nogui-patches.patch
86
87
88variant nativefiledialogs description {File dialogs are native by default.\
89                    Set Native=false under [KFileDialog Settings] in kdeglobalrc to use KDE dialogs} {}
90
91if { [variant_isset nativefiledialogs] } {
92        patchfiles-append  native-filedialogs.patch
93}
94
95
96variant unifiedtoolbar description {Add a unified title and tool bar} {}
97
98if { [variant_isset unifiedtoolbar] } {
99        patchfiles-append  unified-toolbar.patch
100}
101
102
103patch.pre_args      -p1
104
105# explicitly define certain headers and libraries, to avoid
106# conflicts with those installed into system paths by the user.
107configure.args-append   -DWITH_ENCHANT=ON \
108                        -DWITH_Soprano=ON \
109                        -DWITH_Avahi=ON \
110                        -DKDE_DEFAULT_HOME=Library/Preferences/KDE \
111                        -DWITH_HSPELL=OFF \
112                        -DWITH_FAM=OFF \
113                        -DKDE4_AUTH_BACKEND_NAME="OSX"
114
115variant osxkeychain description {kwallet uses the OSX KeyChain} {}
116
117if { [variant_isset osxkeychain] } {
118        configure.args-append -DMAC_USE_OSXKEYCHAIN:BOOL=ON
119# mods committed on 20140902
120#       patchfiles-append     AuthServicesBackend.patch \
121#                             use-osx-keychain.patch \
122#                                         kwallettest.patch
123}
124
125variant nostrip description {Prevent stripping of binaries} {}
126
127if { [variant_isset nostrip] } {
128        configure.args-delete -DCMAKE_BUILD_TYPE=Release
129        configure.args-append -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DCMAKE_STRIP:FILEPATH=/bin/echo
130}
131
132if { [file exists ${destroot}${prefix}/lib/kde4/kspell_aspell.so] } {
133    notes "
134Only the English dictionary has been installed.
135You will need to install extra dictionaries to
136get support for spell checking other languages.
137The command 'port search aspell-dict' will show
138you the currently available dictionary options.
139"
140}
141
142set startup_root ""
143
144pre-configure {
145    #The FindFlex.cmake file is not working and may conflict with the one provided by cmake (ticket #44119)
146    delete file ${worksrcpath}/cmake/modules/FindFlex.cmake
147}
148
149pre-activate {
150    if {![catch {set vers [lindex [registry_active kde4-runtime] 0]}]
151        && [vercmp [lindex $vers 1] 4.8.1] < 0} {
152        registry_deactivate_composite kde4-runtime "" [list ports_nodepcheck 1]
153    }
154}
155
156post-destroot {
157    xinstall -d ${destroot}${prefix}/include/nepomuk
158    eval xinstall -m 644 [glob ${worksrcpath}/nepomuk/core/*.h] \
159        ${destroot}${prefix}/include/nepomuk
160    eval xinstall -m 644 [glob ${worksrcpath}/nepomuk/types/*.h] \
161        ${destroot}${prefix}/include/nepomuk
162    eval xinstall -m 644 [glob ${worksrcpath}/nepomuk/nepomuk_export.h] \
163        ${destroot}${prefix}/include/nepomuk   
164
165    xinstall -d -m 755 ${destroot}${prefix}/Library/LaunchAgents
166    xinstall -m 644 ${filespath}/org.macports.kdecache.plist \
167        ${destroot}${prefix}/Library/LaunchAgents
168    reinplace "s|%PREFIX%|${prefix}|g" \
169        ${destroot}${prefix}/Library/LaunchAgents/org.macports.kdecache.plist
170    reinplace "s|%APPLICATIONS_DIR%|${applications_dir}|g" \
171        ${destroot}${prefix}/Library/LaunchAgents/org.macports.kdecache.plist
172   
173    # The startupitem.install keyword does not exist in MacPorts < 2.1.
174    if {![info exists startupitem.install]} {
175        set startupitem.install yes
176    }
177    if { ${startupitem.install} != "no" } {
178        xinstall -d -m 755 ${destroot}${startup_root}/Library/LaunchAgents
179        ln -s ${prefix}/Library/LaunchAgents/org.macports.kdecache.plist ${destroot}${startup_root}/Library/LaunchAgents
180    }
181}
182
183post-activate {
184    if { ![variant_isset no_root] } {
185        file attributes ${prefix}/Library/LaunchAgents/org.macports.kdecache.plist -owner root -group wheel
186    }
187}
188
189notes-append "An agent to provide communication between KDE programs must be started.
190To start it run the following command:
191 launchctl load -w ${startup_root}/Library/LaunchAgents/org.macports.kdecache.plist"
192
193variant no_root description {Run the kde cache agent as MacPorts install user.} {
194    pre-fetch {
195        if { ${install.user}=="root" || ${install.group}=="wheel" } {
196            ui_error "The kde cache agent should not be run as root with no_root variant."
197            error "Please do not use this variant with your MacPorts configuration."
198        }
199    }
200
201    set startup_root  [join [lrange [exec /usr/bin/dscl . -read Users/${install.user} NFSHomeDirectory] 1 end]]
202    # Files are installed into user's startup directory.
203    destroot.violate_mtree  yes
204}
205
206#livecheck.url       http://kde.mirrors.hoobly.com/stable/
207#livecheck.regex     (\\d+(\\.\\d+)+)