Ticket #54448: Portfile

File Portfile, 4.2 KB (added by RJVB (René Bertin), 7 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#
3PortSystem          1.0
4PortGroup           qt5 1.0
5PortGroup           cmake 1.1
6PortGroup           github 1.0
7PortGroup           app 1.0
8
9set VERSION         3.9.1
10github.setup        sqlitebrowser sqlitebrowser v${VERSION}
11github.tarball_from \
12                    archive
13version             ${VERSION}
14categories          databases
15platforms           darwin linux
16license             GPL-3
17maintainers         gmail.com:rjvbertin
18
19description         GUI editor for SQLite databases
20long_description    SQLite Database Browser is a visual tool used to create, design and edit \
21                    database files compatible with SQLite. Its interface is based on Qt, and is \
22                    meant to be used by users and developers who want to create databases or edit \
23                    and search data using a familiar spreadsheet-like interface, without the need \
24                    to learn complicated SQL commands. Controls and wizards are available for users \
25                    to: \
26                    * Create and compact database files \
27                    * Create, define, modify and delete tables \
28                    * Create, define and delete indexes \
29                    * Browse, edit, add and delete records \
30                    * Search records \
31                    * Import and export records as text \
32                    * Import and export tables from/to CSV files \
33                    * Import and export databases from/to SQL dump files \
34                    * Issue SQL queries and inspect the results \
35                    * Examine a log of all SQL commands issued by the application. \
36                    SQLite Database Browser is not a visual shell for the sqlite command line tool. \
37                    It does not require familiarity with SQL commands.
38
39homepage            http://sqlitebrowser.org
40
41checksums           rmd160  d75366fe615238688a8bb88a50a9bdf6ddd7c39b \
42                    sha256  d0d2e06a69927ba1d0b955f3261ce70c61befc5bd5ddaa06752dae8bb4219ed8
43
44worksrcdir          ${subport}-${version}
45
46universal_variant   no
47
48depends_lib-append  port:antlr \
49                    port:qscintilla2
50
51qt5.depends_component \
52                    qtmacextras qttools
53
54patchfiles-append   patch-build-for-MP.diff
55
56if {[info procs cmake.save_configure_cmd] ne ""} {
57    # create a .macports-$subport-configure.cmd file containing the cmake invocation details
58    # (provided by a pending update to cmake-1.1
59    cmake.save_configure_cmd "log too"
60}
61
62configure.args-append \
63                    -DUSE_QT5=ON \
64                    -DQSCINTILLA_INCLUDE_DIR=${qt_includes_dir} \
65                    -DQSCINTILLA_LIB_DIR=${qt_frameworks_dir}
66
67platform darwin {
68    app.executable  ${build.dir}/sqlitebrowser
69    app.icon        ${worksrcpath}/src/icons/sqlitebrowser.png
70
71    post-destroot {
72        set APPNAME "${qt_apps_dir}/SQLiteBrowser.app"
73        xinstall -m 755 -d ${destroot}${qt_apps_dir}
74        # for some reason the app PG capitalises the 1st letter
75        file rename ${destroot}${applications_dir}/Sqlitebrowser.app ${destroot}${APPNAME}
76        file rename ${destroot}${APPNAME}/Contents/MacOS/Sqlitebrowser ${destroot}${APPNAME}/Contents/MacOS/sqlitebrowser
77        file rename ${destroot}${APPNAME}/Contents/Resources/Sqlitebrowser.icns ${destroot}${APPNAME}/Contents/Resources/sqlitebrowser.icns
78        xinstall -m 755 ${worksrcpath}/src/app.plist ${destroot}${APPNAME}/Contents/Info.plist
79        reinplace "s|@EXECUTABLE@|sqlitebrowser|g" ${destroot}${APPNAME}/Contents/Info.plist
80        reinplace "s|@ICON@|sqlitebrowser.icns|g" ${destroot}${APPNAME}/Contents/Info.plist
81
82        if {[info procs qt5.add_app_wrapper] != ""} {
83            file delete ${destroot}${prefix}/bin/sqlitebrowser
84            qt5.add_app_wrapper sqlitebrowser SQLiteBrowser sqlitebrowser
85        }
86    }
87}
88platform linux {
89    cmake.install_rpath-prepend \
90                    ${qt_libs_dir} ${prefix}/lib
91    configure.args-append \
92                    -DCMAKE_PREFIX_PATH=${prefix}
93    configure.args-replace \
94                    -DQSCINTILLA_LIB_DIR=${qt_frameworks_dir} \
95                    -DQSCINTILLA_LIB_DIR=${qt_libs_dir}
96}