Re: replace bundled libraries in borgbackup

2018-01-05 Thread Klemens Nanni
On Fri, Jan 05, 2018 at 03:53:32PM +0100, Klemens Nanni wrote:
> On Fri, Jan 05, 2018 at 03:15:22PM +0100, Björn Ketelaars wrote:
> > On Thu 04/01/2018 23:27, Klemens Nanni wrote:
> > > You can build it with SEPARATE_BUILD=Yes.
> > 
> > The build of borgbackup still works with SEPARATE_BUILD=Yes, however I'm not
> > sure that it makes sense to set this variable. With this variable set 
> > nothing
> > is build in the separate generated ${WRKBUILD} directory.
> > Guess that Python's setuptools doesn't care.
> My bad, I did only half the job.
> 
> setup.py accepts a parameter called --build-base but SEPARATE_BUILD
> doesn't automatically effect it's usage:
> 
>   $ make -p SEPARATE_BUILD=yes | grep ^MODPY_DISTUTILS_BUILD
>   MODPY_DISTUTILS_BUILD = build --build-base=${WRKSRC}
> 
> So in order to actually make use of it, you need
> 
>   MODPY_DISTUTILS_BUILD =›build
>   MODPY_DISTUTILS_BUILDARGS=--build-base ${WRKBUILD}
Without this bloody typo of course.

> > My proposal would be to leave out the SEPARATE_BUILD bit, and keep the diff 
> > as
> > is.
> Updated diff attached. Builds fine, tests are still running but seem all
> fine so far.
> 
> diff --git a/sysutils/borgbackup/Makefile b/sysutils/borgbackup/Makefile
> index e941957b50d..cd00e182beb 100644
> --- a/sysutils/borgbackup/Makefile
> +++ b/sysutils/borgbackup/Makefile
> @@ -4,6 +4,7 @@ COMMENT = deduplicating backup program
>  
>  MODPY_EGG_VERSION =  1.1.4
>  DISTNAME =   borgbackup-${MODPY_EGG_VERSION}
> +REVISION =   0
>  
>  CATEGORIES = sysutils
>  
> @@ -15,11 +16,16 @@ PERMIT_PACKAGE_CDROM =Yes
>  MODULES =lang/python
>  MODPY_PI =   Yes
>  MODPY_SETUPTOOLS =   Yes
> +MODPY_DISTUTILS_BUILD =  build
> +MODPY_DISTUITLS_BUILDARGS=--build-base ${WRKBUILD}
  +MODPY_DISTUTILS_BUILDARGS=--build-base ${WRKBUILD}

Anyways, sthen is probably right.



Re: replace bundled libraries in borgbackup

2018-01-05 Thread Stuart Henderson
On 2018/01/05 15:53, Klemens Nanni wrote:
> On Fri, Jan 05, 2018 at 03:15:22PM +0100, Björn Ketelaars wrote:
> > On Thu 04/01/2018 23:27, Klemens Nanni wrote:
> > > You can build it with SEPARATE_BUILD=Yes.
> > 
> > The build of borgbackup still works with SEPARATE_BUILD=Yes, however I'm not
> > sure that it makes sense to set this variable. With this variable set 
> > nothing
> > is build in the separate generated ${WRKBUILD} directory.
> > Guess that Python's setuptools doesn't care.
> My bad, I did only half the job.
> 
> setup.py accepts a parameter called --build-base but SEPARATE_BUILD
> doesn't automatically effect it's usage:
> 
>   $ make -p SEPARATE_BUILD=yes | grep ^MODPY_DISTUTILS_BUILD
>   MODPY_DISTUTILS_BUILD = build --build-base=${WRKSRC}
> 
> So in order to actually make use of it, you need
> 
>   MODPY_DISTUTILS_BUILD =›build
>   MODPY_DISTUITLS_BUILDARGS=--build-base ${WRKBUILD}
> 
> > My proposal would be to leave out the SEPARATE_BUILD bit, and keep the diff 
> > as
> > is.
> Updated diff attached. Builds fine, tests are still running but seem all
> fine so far.

That sort of scaffolding is not something that should be done in an
individual port, if it's done anywhere it should be in python.port.mk.

Though realistically Python things aren't usually big enough for
SEPARATE_BUILD to be much of a win.



Re: replace bundled libraries in borgbackup

2018-01-05 Thread Klemens Nanni
On Fri, Jan 05, 2018 at 03:15:22PM +0100, Björn Ketelaars wrote:
> On Thu 04/01/2018 23:27, Klemens Nanni wrote:
> > You can build it with SEPARATE_BUILD=Yes.
> 
> The build of borgbackup still works with SEPARATE_BUILD=Yes, however I'm not
> sure that it makes sense to set this variable. With this variable set nothing
> is build in the separate generated ${WRKBUILD} directory.
> Guess that Python's setuptools doesn't care.
My bad, I did only half the job.

setup.py accepts a parameter called --build-base but SEPARATE_BUILD
doesn't automatically effect it's usage:

$ make -p SEPARATE_BUILD=yes | grep ^MODPY_DISTUTILS_BUILD
MODPY_DISTUTILS_BUILD = build --build-base=${WRKSRC}

So in order to actually make use of it, you need

MODPY_DISTUTILS_BUILD =›build
MODPY_DISTUITLS_BUILDARGS=--build-base ${WRKBUILD}

> My proposal would be to leave out the SEPARATE_BUILD bit, and keep the diff as
> is.
Updated diff attached. Builds fine, tests are still running but seem all
fine so far.

diff --git a/sysutils/borgbackup/Makefile b/sysutils/borgbackup/Makefile
index e941957b50d..cd00e182beb 100644
--- a/sysutils/borgbackup/Makefile
+++ b/sysutils/borgbackup/Makefile
@@ -4,6 +4,7 @@ COMMENT =   deduplicating backup program
 
 MODPY_EGG_VERSION =1.1.4
 DISTNAME = borgbackup-${MODPY_EGG_VERSION}
+REVISION = 0
 
 CATEGORIES =   sysutils
 
@@ -15,11 +16,16 @@ PERMIT_PACKAGE_CDROM =  Yes
 MODULES =  lang/python
 MODPY_PI = Yes
 MODPY_SETUPTOOLS = Yes
+MODPY_DISTUTILS_BUILD =build
+MODPY_DISTUITLS_BUILDARGS=--build-base ${WRKBUILD}
 MODPY_VERSION =${MODPY_DEFAULT_VERSION_3}
 
-WANTLIB += ${MODPY_WANTLIB} crypto lz4 pthread
+WANTLIB += ${MODPY_WANTLIB} b2 crypto lz4 pthread zstd
 
-LIB_DEPENDS += ${MODPY_LIB_DEPENDS} archivers/lz4
+LIB_DEPENDS += ${MODPY_LIB_DEPENDS} \
+   archivers/lz4 \
+   archivers/zstd \
+   security/libb2
 BUILD_DEPENDS +=   ${RUN_DEPENDS} \
devel/py-setuptools_scm${MODPY_FLAVOR} \
textproc/py-sphinx_guzzle_theme${MODPY_FLAVOR}
@@ -29,6 +35,8 @@ TEST_DEPENDS +=   ${RUN_DEPENDS} \
devel/py-test-benchmark${MODPY_FLAVOR} \
devel/py-test-xdist${MODPY_FLAVOR}
 
+SEPARATE_BUILD =   Yes
+
 post-build:
${MODPY_CMD} build_ext --inplace
cd ${WRKSRC}/docs; env PYTHONPATH=${WRKSRC} \



Re: replace bundled libraries in borgbackup

2018-01-05 Thread Björn Ketelaars
On Thu 04/01/2018 23:27, Klemens Nanni wrote:
> You can build it with SEPARATE_BUILD=Yes.

The build of borgbackup still works with SEPARATE_BUILD=Yes, however I'm not
sure that it makes sense to set this variable. With this variable set nothing
is build in the separate generated ${WRKBUILD} directory.
Guess that Python's setuptools doesn't care.

My proposal would be to leave out the SEPARATE_BUILD bit, and keep the diff as
is.

-- 
Björn Ketelaars
GPG key: 0x4F0E5F21



Re: replace bundled libraries in borgbackup

2018-01-04 Thread Klemens Nanni
On Thu, Jan 04, 2018 at 10:25:28PM +0100, Björn Ketelaars wrote:
> Now that archivers/zstd provides libzstd, and libb2 is in ports it seems like
> a good idea to replace the bundled copies in borgbackup by those in ports.
> 
> No regressions found using 'make test'. Also tested by making, and restoring
> a backup.
> 
> Comments/OKs?
> 
> -- 
> Björn Ketelaars
> GPG key: 0x4F0E5F21
> 
> 
> diff --git sysutils/borgbackup/Makefile sysutils/borgbackup/Makefile
> index e941957b50d..70a4fa75257 100644
> --- sysutils/borgbackup/Makefile
> +++ sysutils/borgbackup/Makefile
> @@ -4,6 +4,7 @@ COMMENT = deduplicating backup program
>  
>  MODPY_EGG_VERSION =  1.1.4
>  DISTNAME =   borgbackup-${MODPY_EGG_VERSION}
> +REVISION =   0
>  
>  CATEGORIES = sysutils
>  
> @@ -17,9 +18,12 @@ MODPY_PI = Yes
>  MODPY_SETUPTOOLS =   Yes
>  MODPY_VERSION =  ${MODPY_DEFAULT_VERSION_3}
>  
> -WANTLIB +=   ${MODPY_WANTLIB} crypto lz4 pthread
> +WANTLIB +=   ${MODPY_WANTLIB} b2 crypto lz4 pthread zstd
>  
> -LIB_DEPENDS +=   ${MODPY_LIB_DEPENDS} archivers/lz4
> +LIB_DEPENDS +=   ${MODPY_LIB_DEPENDS} \
> + archivers/lz4 \
> + archivers/zstd \
> + security/libb2
>  BUILD_DEPENDS += ${RUN_DEPENDS} \
>   devel/py-setuptools_scm${MODPY_FLAVOR} \
>   textproc/py-sphinx_guzzle_theme${MODPY_FLAVOR}
> 
Looks good to me:

$ make build
===>  Building for borgbackup-1.1.4p0
Detected and preferring liblz4 over bundled LZ4
Detected and preferring libb2 over bundled BLAKE2
Detected and preferring libzstd over bundled ZSTD
[...]

Works here, too. Sorry for possibly delaying this with my zstd test
failures.

You can build it with SEPARATE_BUILD=Yes.