Bug 218851 - [NEW PORT] devel/brotli: Brotli lossless compression libraries and commandline tool
Summary: [NEW PORT] devel/brotli: Brotli lossless compression libraries and commandlin...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL: https://github.com/google/brotli
Depends on:
Reported: 2017-04-24 15:39 UTC by Markus Kohlmeyer
Modified: 2017-07-12 19:52 UTC (History)
3 users (show)

See Also:

add devel/brotli to ports tree (2.04 KB, patch)
2017-04-24 15:39 UTC, Markus Kohlmeyer
no flags Details | Diff
add devel/brotli to ports tree (2.02 KB, patch)
2017-04-24 22:24 UTC, Markus Kohlmeyer
no flags Details | Diff
add devel/brotli to ports tree (2.50 KB, patch)
2017-04-26 12:36 UTC, Markus Kohlmeyer
no flags Details | Diff
add devel/brotli to ports tree (2.89 KB, patch)
2017-04-26 22:39 UTC, Markus Kohlmeyer
no flags Details | Diff
svn diff for archivers/brotli (5.04 KB, patch)
2017-06-21 09:11 UTC, Bernard Spil
brnrd: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Kohlmeyer 2017-04-24 15:39:15 UTC
Created attachment 182046 [details]
add devel/brotli to ports tree

This patch adds devel/brotli to the tree

It will be requiered by the upcoming releases of Apache HTTPd >=2.4.26 (www/apache24) which include the new mod_brotli

Also www/nginx and possible other ports may need this in the (not so fare) future

This port could also replace archivers/py-brotli and devel/libbrotli as both are included in this port
Comment 1 Markus Kohlmeyer 2017-04-24 22:24:47 UTC
Created attachment 182062 [details]
add devel/brotli to ports tree

Comment 2 Sergey A. Osokin freebsd_committer 2017-04-25 22:39:21 UTC
Hi Markus,

thanks for the port.

Would you mind to fix a couple of issues:

1. please add ability to build a static library too
2. please create the lib/libbrotlicommon.so.0 in addition to 

Also, what's the reason to include pre and post mk files?
.include <bsd.port.pre.mk>
.include <bsd.port.post.mk>

Would you mind to replace them with `.include <bsd.port.mk>' record?

Thank you.
Comment 3 Markus Kohlmeyer 2017-04-25 23:22:38 UTC
Hi Sergey,

thanks for your feedback, i'll fix your points in the next days.
Comment 4 Markus Kohlmeyer 2017-04-26 12:36:51 UTC
Created attachment 182096 [details]
add devel/brotli to ports tree

New patch with Sergeys suggestions.

There might be an upstream issue regarding building the static libs :(
I added the --disable-shared-libs option as proposed by upstream in the README, but that option does in fact do nothing.
As i'm not a programmer i'm a bit lost here, sorry.
It seems to me that the problem is in upstreams custom configure-cmake and/or the corresponding .configure-custom.sh file, but i can't figure out how to fix this.
The only reference to the lib_a i found is in the toplevel Makefile, but that is not used by cmake :(

Anything i can do?
Comment 5 Sergey A. Osokin freebsd_committer 2017-04-26 20:53:03 UTC
Hi Markus,

I'd recommend to talk to the vendor, i.e. raise an issue in https://github.com/google/brotli/issues for the same.
Comment 6 Markus Kohlmeyer 2017-04-26 21:22:18 UTC
Opened upsteam issue at https://github.com/google/brotli/issues/542
Comment 7 Markus Kohlmeyer 2017-04-26 22:39:30 UTC
Created attachment 182113 [details]
add devel/brotli to ports tree

Updated patch with upstream workaround for the static building of libs and binary.

Upstream fix might be in the to be upcomming brotli-0.6.1 release.
Comment 8 Sergey A. Osokin freebsd_committer 2017-04-27 01:28:28 UTC
Is there any chance to build both static and shared libraries?

Basically a port from FreeBSD ports tree basically provides both types of libraries.
Comment 9 Markus Kohlmeyer 2017-06-10 22:32:20 UTC
Tag and Release date for Apache 2.4.26 is proposed/set to 06/12/2017, so this port should go in tree soon.


As for the parallel build of shared and static brotli-libs we have to wait for a future release of brotli because the Google-Dev(s) haven't provided this feature yet.
Comment 10 Bernard Spil freebsd_committer 2017-06-21 09:10:00 UTC
Just created https://reviews.freebsd.org/D11290 to move devel/libbrotli to archivers/brotli. There seems to be no reason to keep both to me.
Comment 11 Bernard Spil freebsd_committer 2017-06-21 09:11:42 UTC
Created attachment 183668 [details]
svn diff for archivers/brotli

For reference, the patch from the D11290 review
Comment 12 Markus Kohlmeyer 2017-06-21 09:54:58 UTC
Thanks Bernard, the idea of moving/merging devel/libbrotli and archivers/brotli looks good for me.

But that moving/merging doesn't address all parts of my proposed patch to add devel/brotli to the tree.
Maybe you can merge yours and mine patches?
Comment 13 Bernard Spil freebsd_committer 2017-06-21 10:34:58 UTC
(In reply to Markus Kohlmeyer from comment #12)
Added the STATIC option to the review. Thanks for the pointer!

I've not applied it in full,

PORTREVISION?=	0 -> Only for master-ports

GH_PROJECT=	brotli -> defaults to PORTNAME

USES=		cmake:outsource compiler:c++0x localbase pathfix pkgconfig
  -> localbase is irrelevant, no brotli in base
  -> pathfix   it builds fine for me without, am I missing something?

BUILD_DEPENDS=	bash:shells/bash -> Builds fine without bash, am I missing something?

OPTIONS_DEFAULT= -> default is empty already

STATIC_DESC= -> defined in Mk/bsd.options.desc.mk

.if ${PORT_OPTIONS:MSTATIC} -> Convert to OPTIONS framework

I see Sergey requested the .0 symlinks, not sure why...
Comment 14 Markus Kohlmeyer 2017-06-21 11:06:23 UTC
OK, then i'm fine with it, thanks.
Comment 15 commit-hook freebsd_committer 2017-07-12 19:45:36 UTC
A commit references this bug:

Author: brnrd
Date: Wed Jul 12 19:44:57 UTC 2017
New revision: 445604
URL: https://svnweb.freebsd.org/changeset/ports/445604

  archivers/brotli: Move and update to 0.6.0

   - Move from devel/libbrotli to archivers/brotli
   - Remove meta-project for library build
   - Bump epoch for meta 1.0 to upstream 0.6 update
   - Add MOVED entry
   - Switch from autoconf to cmake

  PR:		218813, 218851
  Submitted by:	Markus Kohlmeyer <rootservice@gmail.com>
  Approved by:	maintainer time-out
  Differential Revision:	https://reviews.freebsd.org/D11290