On 2018/06/12 15:38, Elias M. Mariani wrote:
> Well, is wasn't like qwt... xD
> 
> The problem is using MODULES.
> there is no "MODULES-package" it seems.
> So, in the case of qwt it works, because it uses devel/qmake module
> and the flavor adds another module that is x11/qt4.
> devel/qmake does not add any dependency on qwt.
> In this case the only module is lang/python, but the same reacts
> differently with the flavor, so if you build like qwt you get a
> py-sqlalchemy-docs that uses python2.7 as a run dependency (or
> python3.6).
> I worked it out by copying the depends from the python module to
> DEPENDS-main, and clearing the DEPENDS, so, is almost the same but
> backwards... instead of removing the dependencies and wantlibs from
> the -docs package you have to remove them from the vanilla and add
> them only to the -main package.
> 
> This solution could be used by many others python packages that build
> with docs and python3 flavor, like:
> py-lxml, py-paramiko, py-parsing, py-pathlib, py-pexpect, py-psycopg2,
> and that is just by looking at the folders that I have in my vm
> /usr/local/share/doc directory... :D
> If you like it (or maybe needs some modifications...) I could make the
> diff for those as well, but my recommendation would be:
> Lets not make the docs a dependency of the main package!
> So, it takes less time installing from packages, most of the time
> people just want the python package as a dependency without needing
> the docs and examples, so why force those things ?
> If you want the docs, OK, you can pkg_add py-sqlalchemy-docs and you have it.
> 
> Attached is the new revision of databases/py-sqlalchemy that build 3
> packages: py3-sqlalchemy. py-sqlalchemy, they both depend on
> py-sqlalchemy-docs.
> 
> Cheers.
> Elias.

+WANTLIB =              #empty
+RUN_DEPENDS =          #empty
+LIB_DEPENDS =          #empty

- it's a noop, but leave these as they were. just set RUN_DEPENDS-docs to empty
and let -main inherit from the default. and WANTLIB/LIB_DEPENDS aren't set
by default anyway so no need to override, just set them for -main.


+BUILD_DEPENDS =                #empty
+BUILD_DEPENDS-main =   ${_MODPY_BUILD_DEPENDS}
..
 # Other DB connectors would work, too.
-TEST_DEPENDS =         devel/py-test-xdist${MODPY_FLAVOR} \
+TEST_DEPENDS-main =    devel/py-test-xdist${MODPY_FLAVOR} \
                        devel/py-mock${MODPY_FLAVOR}
 # On python3, sqlite3 is used.
-.if ${FLAVOR} == ""
-TEST_DEPENDS +=                databases/py-sqlite2${MODPY_FLAVOR}>=2.8.3
+.if empty (FLAVOR)
+TEST_DEPENDS-main +=   databases/py-sqlite2${MODPY_FLAVOR}>=2.8.3
 .endif

- these are bogus, BUILD_DEPENDS and TEST_DEPENDS relate to the whole port.
subpackages are split only in packaging.


+.if ${FLAVOR:Mpython3}
+FULLPKGNAME-main =     py3-sqlalchemy-${MODPY_EGG_VERSION:S/p/./}
+FULLPKGPATH-main =     databases/py-sqlalchemy${MODPY_FLAVOR}
+.endif

- leave FULLPKG*-main at the default, you only want to override FULLPKG*-docs.


- also missing the @pkgpath marker needed in PLIST-main to allow upgrades to
work. you can test by installing the old ones from a snap, building new packages
and trying to upgrade with 'env TRUSTED_PKG_PATH=/path/to/new/packages
PKG_PATH=/path/to/new/packages pkg_add -u'.

Reply via email to