1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit qmake-utils multilib
9 DESCRIPTION="Design, diagram, and deploy PostgreSQL databases"
10 HOMEPAGE="http://www.pgmodeler.com.br/"
11 SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV/_/-}.tar.gz"
15 KEYWORDS="~amd64 ~x86"
18 RDEPEND="dev-db/postgresql
23 dev-qt/qtprintsupport:5
28 DOCS=( CHANGELOG.md README.md )
30 S="${WORKDIR}/${PN}-${PV/_/-}"
33 # Don't build the plugins, their build system doesn't work with a
34 # non-default LIBDIR. See,
36 # https://github.com/pgmodeler/pgmodeler/issues/479
38 sed -i -e '/plugins\/dummy/d' -e '/plugins\/xml2object/d' pgmodeler.pro \
39 || die 'failed to disable plugins'
41 sed -i -e 's/TARGET = pgmodeler/TARGET = pgmodeler-bin/' main/main.pro \
42 || die 'failed to rename binary'
46 local bindir="${D}usr/bin"
47 local libdir="${D}usr/$(get_libdir)"
48 local resdir="${D}usr/share/${PN}"
49 mkdir -p "${bindir}" "${libdir}" "${resdir}" || die
52 BINDIR+="${bindir}" LIBDIR+="${libdir}" RESDIR+="${resdir}"
62 # Install our shell script wrapper.
63 cat <<-EOF > "${T}/pgmodeler"
66 export PGMODELER_ROOT="${ROOT}usr/share/pgmodeler"
68 # There is no good way to install pgmodeler globally for more than one
69 # user, since it requires write access to its own conf files. As a
70 # workaround, we install the upstream conf files globally, and copy them
71 # to the user's home directory before launching pgmodeler.
72 USERDIR="\${HOME}/.pgmodeler"
73 if [ ! -d "\${USERDIR}/conf" ]; then
74 mkdir -p "\${USERDIR}"
75 cp --no-clobber -a "\${PGMODELER_ROOT}/conf" "\${USERDIR}/"
78 export PGMODELER_CONF_DIR="\${USERDIR}/conf"
79 export PGMODELER_SCHEMAS_DIR="\${PGMODELER_ROOT}/schemas"
80 export PGMODELER_LANG_DIR="\${PGMODELER_ROOT}/lang"
81 export PGMODELER_TMP_DIR="${ROOT}tmp"
82 export PGMODELER_PLUGINS_DIR="\${PGMODELER_ROOT}/plugins" # Not installed
83 export PGMODELER_CHANDLER_PATH="${ROOT}usr/bin/pgmodeler-ch"
88 dobin "${T}/pgmodeler"
92 einfo ">>> Test phase: ${CATEGORY}/${PF}"
93 cd "${S}/tests" || die
96 # Before `make install`, all of the binaries and libraries are
97 # stored in ${S}/build.
98 PGMODELER_ROOT="${S}/build" ../build/tests || die "tests failed"