Re: UPDATE: ansible-2.8.6

2019-10-19 Thread Pavel Korovin
Hopefilly it's ok for a little bit more noise with huge diffs.

Here's the last one cleaned up after Stuart's suggestions (reduced
number of patches by 2).

I also removed BUILD_DEPENDS on textproc/py-sphinx since
textproc/py-sphinx-notfound-page already depends on this.

Looking for OK's to commit.

-- 
With best regards,
Pavel Korovin


ansible-2.8.6.diff.gz
Description: Binary data


Re: UPDATE: ansible-2.8.6

2019-10-19 Thread Stuart Henderson
On 2019/10/19 14:11, Pavel Korovin wrote:
> Stuart, thank you for comments!
> 
> Please find the updated diff attached.
> Looking for OKs to commit.
> 
> -- 
> With best regards,
> Pavel Korovin

Here's an updated diff for Makefile (I won't include the rest of the 3k line
diff) that cleans up post-build and drops devel/gmake from BUILD_DEPENDS.

I am just using CPUS=${MAKE_JOBS}, because that is the long-term result
that we want (it seems quite possibly that the breakage is a sphinx bug;
our in-tree sphinx is very old) and there's no real expectation that a
user setting MAKE_JOBS to anything other than 1 will work. (As you know
but commenting for other readers, we do need to override the default
which sets multiple jobs automatically based on #cpus).


Index: Makefile
===
RCS file: /cvs/ports/sysutils/ansible/Makefile,v
retrieving revision 1.110
diff -u -p -r1.110 Makefile
--- Makefile2 Oct 2019 07:55:22 -   1.110
+++ Makefile19 Oct 2019 13:22:27 -
@@ -3,7 +3,7 @@
 COMMENT-main = ssh based config management framework
 COMMENT-html = offline Ansible documentation in HTML format
 
-MODPY_EGG_VERSION =2.8.5
+MODPY_EGG_VERSION =2.8.6
 DISTNAME = ansible-${MODPY_EGG_VERSION}
 PKGNAME-main = ${PKGNAME}
 PKGNAME-html = ansible-html-${MODPY_EGG_VERSION}
@@ -26,19 +26,24 @@ MODPY_SETUPTOOLS =  Yes
 MODPY_VERSION =${MODPY_DEFAULT_VERSION_3}
 
 BUILD_DEPENDS =textproc/py-sphinx${MODPY_FLAVOR} \
-   textproc/py-sphinx-notfound-page${MODPY_FLAVOR}
+   textproc/py-sphinx-notfound-page${MODPY_FLAVOR} \
+   textproc/py-yaml${MODPY_FLAVOR}
 RUN_DEPENDS =  net/py-netaddr${MODPY_FLAVOR} \
security/py-cryptodome${MODPY_FLAVOR} \
security/py-paramiko${MODPY_FLAVOR} \
security/py-passlib${MODPY_FLAVOR} \
textproc/py-yaml${MODPY_FLAVOR} \
www/py-jinja2${MODPY_FLAVOR}
-RUN_DEPENDS-html = ${BUILD_PKGPATH},-main
+RUN_DEPENDS-html =
+
+USE_GMAKE =Yes
 
 PKG_ARCH-html =*
 
 NO_TEST =  Yes
 
+MODPY_ADJ_FILES =  docs/bin/*.py
+
 DOCDIR =   ${PREFIX}/share/doc/ansible
 EXDIR =${PREFIX}/share/examples/ansible
 PLUGINDIR =${PREFIX}/share/ansible_plugins
@@ -50,10 +55,15 @@ pre-configure:
${WRKSRC}/examples/ansible.cfg \
${WRKSRC}/docs/man/man1/*.1
 
-# "_build" to be revisited in case SEPARATE_BUILD is changed
+pre-build:
+   ln -sf ${LOCALBASE}/bin/sphinx-build${MODPY_BIN_SUFFIX} \
+   ${WRKDIR}/bin/sphinx-build
+
 post-build:
-   cd ${WRKSRC}/docs/docsite; \
-   ${LOCALBASE}/bin/sphinx-build${MODPY_BIN_SUFFIX} -M html rst _build -j 
${MAKE_JOBS}
+   ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} -C ${WRKSRC}/docs/docsite \
+   ANSIBLE_LOCAL_TEMP=./tmp CPUS=${MAKE_JOBS} all
+   sed -i -e "s,/_prefix_start_/_prefix_end_/,,g" \
+   ${WRKSRC}/docs/docsite/_build/html/404.html
 
 post-install:
${INSTALL_DATA_DIR} ${EXDIR}/scripts ${DOCDIR}



Re: UPDATE: ansible-2.8.6

2019-10-19 Thread Pavel Korovin
Stuart, thank you for comments!

Please find the updated diff attached.
Looking for OKs to commit.

-- 
With best regards,
Pavel Korovin


ansible-2.8.6.diff.gz
Description: Binary data


Re: UPDATE: ansible-2.8.6

2019-10-18 Thread Stuart Henderson
On 2019/10/18 23:03, Pavel Korovin wrote:
> Dear all,
> 
> Please find the diff for ansible-2.8.6 attached.
> Ansible changelog:
> https://github.com/ansible/ansible/blob/stable-2.8/changelogs/CHANGELOG-v2.8.rst#v2-8-6
> 
> Port changes:
> 
> * Removed RUN_DEPENDS-html = ${BUILD_PKGPATH},-main
>   Maybe I didn't get this right, but I don't see the reason for this dep

I agree with dropping ${BUILD_PKGPATH},-main but your diff changes it so
that -html RUN_DEPENDS on the various py-* things from the global RUN_DEPENDS.
Best to explicitly set it to blank,

RUN_DEPENDS-html =

> * I noticed that html docs were built without modules docs, and something
>   else was missing. Fixed to build the complete docs prescribed by Makefile,
>   added devel/gmake dependency for this to happen.

I think it's better to set USE_GMAKE for this rather than BUILD_DEPENDS and
using ${GMAKE}.

>   While building the docs, found that ${MAKE_JOBS} > 1 produces an error,
>   so locked it to 1, I didn't want to go deeper with it, I just want
>   html docs :)

> +Index: docs/docsite/Makefile
> +--- docs/docsite/Makefile.orig
>  docs/docsite/Makefile
> +@@ -5,11 +5,18 @@ TESTING_FORMATTER=../bin/testing_formatter.sh
> + DUMPER=../bin/dump_keywords.py
> + CONFIG_DUMPER=../bin/dump_config.py
> + GENERATE_CLI=../bin/generate_man.py
> +-ifeq ($(shell echo $(OS) | egrep -ic 'Darwin|FreeBSD|OpenBSD|DragonFly'),1)
> ++ifdef MAKE_JOBS
> ++CPUS = $(MAKE_JOBS)
> ++endif
> ++ifndef MAKE_JOBS
> ++ifeq ($(shell echo $(OS) | egrep -ic 'Darwin|FreeBSD|DragonFly'),1)
> + CPUS ?= $(shell sysctl hw.ncpu|awk '{print $$2}')
> ++else ifeq ($(shell echo $(OS) | egrep -ic 'OpenBSD'),1)
> ++CPUS ?= $(shell sysctl -n hw.ncpu)
> + else
> + CPUS ?= $(shell nproc)
> + endif
> ++endif

For the ncpu thing the correct thing to do here would be to pass
CPUS=${MAKE_JOBS} to gmake (on the command line, not in the environment,
i.e. "${MAKE_PROGRAM} CPUS=... all"), you don't need the ifdef patches to
Makefile because command line variables override the Makefile anyway.

There's no requirement for ports to work with MAKE_JOBS>1 but if it is
set I do think it should be passed on to internal make invocations.

> + 
> + # Sets the build output directory if it's not already specified
> + ifndef BUILDDIR
> +@@ -106,5 +113,5 @@ epub:
> + (CPUS=$(CPUS) $(MAKE) -f Makefile.sphinx epub)
> + 
> + htmlsingle: assertrst
> +-sphinx-build -j $(CPUS) -b html -d $(BUILDDIR)/doctrees ./rst 
> $(BUILDDIR)/html rst/$(rst)
> ++sphinx-build-3 -j $(CPUS) -b html -d $(BUILDDIR)/doctrees ./rst 
> $(BUILDDIR)/html rst/$(rst)

This shouldn't hardcode -3. I think I would symlink 
sphinx-build${MODPY_BIN_SUFFIX}
into ${WRKDIR}/bin/sphinx-build in pre-build instead rather than messing about
with SUBST_CMD'ing variables.

> + @echo "Output is in $(BUILDDIR)/html/$(rst:.rst=.html)"
> Index: patches/patch-docs_docsite_Makefile_sphinx
> ===
> RCS file: patches/patch-docs_docsite_Makefile_sphinx
> diff -N patches/patch-docs_docsite_Makefile_sphinx
> --- /dev/null 1 Jan 1970 00:00:00 -
> +++ patches/patch-docs_docsite_Makefile_sphinx18 Oct 2019 19:41:38 
> -
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +
> +Index: docs/docsite/Makefile.sphinx
> +--- docs/docsite/Makefile.sphinx.orig
>  docs/docsite/Makefile.sphinx
> +@@ -3,7 +3,7 @@
> + 
> + # You can set these variables from the command line.
> + SPHINXOPTS= -j $(CPUS) -n -w rst_warnings
> +-SPHINXBUILD   = sphinx-build
> ++SPHINXBUILD   = sphinx-build-3

same. (I wonder why they set SPHINXBUILD here but hardcode sphinx-build
in the htmlsingle target ..)

> -share/doc/ansible/html/reference_appendices/general_precedence.html

I think moving this between subpackages probably needs @conflict markers