Skip to content

Commit

Permalink
sqlitebrowser: use qmake for darwin
Browse files Browse the repository at this point in the history
change maintainer
  • Loading branch information
i0ntempest authored and kencu committed Jun 9, 2020
1 parent 53165cd commit 0c5579b
Showing 1 changed file with 44 additions and 42 deletions.
86 changes: 44 additions & 42 deletions databases/sqlitebrowser/Portfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# -*- 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

PortSystem 1.0
PortGroup qt5 1.0
PortGroup cmake 1.1
PortGroup github 1.0
PortGroup app 1.0

github.setup sqlitebrowser sqlitebrowser 3.11.2 v
revision 0
revision 1

categories databases
platforms darwin linux
license GPL-3
maintainers {gmail.com:rjvbertin @RJVB} openmaintainer
maintainers {@i0ntempest me.com:szf1234} openmaintainer

description GUI editor for SQLite databases
long_description SQLite Database Browser is a visual tool used to create, design and edit \
Expand Down Expand Up @@ -45,59 +42,64 @@ github.livecheck.regex {([0-9.]+)}

universal_variant no

# Uses QSysInfo::buildAbi and QSysInfo::currentCpuArchitecture
qt5.min_version 5.4

depends_lib-append port:antlr \
port:qscintilla-qt5

qt5.depends_component \
qtmacextras qttools

patchfiles-append 0001-Changes-for-MacPorts.patch
patch.pre_args -p1

if {[info procs cmake.save_configure_cmd] ne ""} {
# create a .macports-$subport-configure.cmd file containing the cmake invocation details
# (provided by a pending update to cmake-1.1
cmake.save_configure_cmd "log too"
}

compiler.cxx_standard 2011

configure.args-append \
-DQSCINTILLA_INCLUDE_DIR=${qt_includes_dir} \
-DQT_LIBRARY_DIR=${qt_frameworks_dir}

platform darwin {
app.executable ${build.dir}/sqlitebrowser
app.icon ${worksrcpath}/src/icons/sqlitebrowser.png
PortGroup qmake5 1.0

configure.args-append \
CONFIG+=c++11 \
INCLUDEPATH+=${qt_includes_dir} \
QMAKE_LIBDIR+=${qt_libs_dir}

# Uses QSysInfo::buildAbi and QSysInfo::currentCpuArchitecture
qt5.min_version 5.4

pre-configure {
reinplace "s|libs/antlr-2.7.7/antlr.pro||g" ${worksrcpath}/sqlitebrowser.pro
reinplace "s|libs/qscintilla/Qt4Qt5/qscintilla.pro||g" ${worksrcpath}/sqlitebrowser.pro
reinplace "s|-lqscintilla2|-lqscintilla2_qt5|g" ${worksrcpath}/src/src.pro
reinplace "s|\$\$PWD/../libs/antlr-2.7.7||g" ${worksrcpath}/src/src.pro
reinplace "s|\$\$PWD/../libs/qscintilla/Qt4Qt5||g" ${worksrcpath}/src/src.pro
delete ${worksrcpath}/libs/antlr-2.7.7 ${worksrcpath}/libs/qscintilla
}

depends_lib-append port:sqlite3
qt5.depends_component \
qtmacextras qttools

destroot {
copy "${worksrcpath}/src/DB Browser for SQLite.app" ${destroot}${applications_dir}
}

post-destroot {
set APPNAME "${qt_apps_dir}/SQLiteBrowser.app"
xinstall -m 755 -d ${destroot}${qt_apps_dir}
# for some reason the app PG capitalises the 1st letter
file rename ${destroot}${applications_dir}/Sqlitebrowser.app ${destroot}${APPNAME}
file rename ${destroot}${APPNAME}/Contents/MacOS/Sqlitebrowser ${destroot}${APPNAME}/Contents/MacOS/Sqlitebrowser-temp
file rename ${destroot}${APPNAME}/Contents/MacOS/Sqlitebrowser-temp ${destroot}${APPNAME}/Contents/MacOS/sqlitebrowser
file rename ${destroot}${APPNAME}/Contents/Resources/Sqlitebrowser.icns ${destroot}${APPNAME}/Contents/Resources/Sqlitebrowser.icns-temp
file rename ${destroot}${APPNAME}/Contents/Resources/Sqlitebrowser.icns-temp ${destroot}${APPNAME}/Contents/Resources/sqlitebrowser.icns
xinstall -m 755 ${worksrcpath}/src/app.plist ${destroot}${APPNAME}/Contents/Info.plist
reinplace "s|@EXECUTABLE@|sqlitebrowser|g" ${destroot}${APPNAME}/Contents/Info.plist
reinplace "s|@ICON@|sqlitebrowser.icns|g" ${destroot}${APPNAME}/Contents/Info.plist

if {[info procs qt5.add_app_wrapper] != ""} {
file delete ${destroot}${prefix}/bin/sqlitebrowser
qt5.add_app_wrapper sqlitebrowser SQLiteBrowser sqlitebrowser
}
ln -s "${applications_dir}/DB Browser for SQLite.app/Contents/MacOS/DB Browser for SQLite" ${destroot}${prefix}/bin/sqlitebrowser
}
}

platform linux {
PortGroup qt5 1.0
PortGroup cmake 1.1

qt5.min_version 5.4

qt5.depends_component \
qtmacextras qttools
cmake.install_rpath-prepend \
${qt_libs_dir} ${prefix}/lib
configure.args-append \
-DCMAKE_PREFIX_PATH=${prefix}
configure.args-replace \
-DQT_LIBRARY_DIR=${qt_frameworks_dir} \
-DCMAKE_PREFIX_PATH=${prefix} \
-DQSCINTILLA_INCLUDE_DIR=${qt_includes_dir} \
-DQT_LIBRARY_DIR=${qt_libs_dir}
if {[info procs cmake.save_configure_cmd] ne ""} {
# create a .macports-$subport-configure.cmd file containing the cmake invocation details
# (provided by a pending update to cmake-1.1
cmake.save_configure_cmd "log too"
}
}

0 comments on commit 0c5579b

Please sign in to comment.