Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Help with versioning scheme

1 view
Skip to first unread message

Adam Weinberger

unread,
Jan 17, 2018, 1:19:40 PM1/17/18
to
> On 17 Jan, 2018, at 11:08, Martin Waschbüsch <mar...@waschbuesch.de> wrote:
>
> Hi there,
>
> I am preparing a patch for a port (archivers/libz4) that I am maintaining.
> The versioning scheme upstream originally used was for instance:
>
> rXXX
> e.g. r123
>
> When they changed to
>
> vX.Y.Z
> e.g. v1.8.1
>
> I had to up PORTEPOCH in order not to get wrong warnings about new
> versions available.
>
> Now, they added a fourth digit to that.
>
> vV.X.Y.Z
> e.g. v1.8.1.2
>
> So far so good. Now, the last digit is equivalent to our port revisions.
> E.g. the version of the library as declared in the source is still 1.8.1.
>
> How do I adapt the Makefile that the correct tarball will be downloaded
> from git (which contains v1.8.1.2) but either ignore the fourth digit or
> use it to represent the port revision?
>
> Also, would you consider it impolite to (humbly) ask upstream to
> (carefully) choose a versioning scheme and stick with it (longterm)? ;-)

Hi Martin,

You don't want to use the upstream version to represent PORTREVISION.
PORTREVISION is for when you need to force rebuilds of the port itself, and
so tying it to upstream would make it impossible to bump it ourselves.

Why do you need to ignore the fourth digit? It's perfectly valid for our
purposes.

# Adam


--
Adam Weinberger
ad...@adamw.org
http://www.adamw.org

_______________________________________________
freebs...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-port...@freebsd.org"

Adam Weinberger

unread,
Jan 17, 2018, 1:38:54 PM1/17/18
to
> On 17 Jan, 2018, at 11:29, Martin Waschbüsch <mar...@waschbuesch.de> wrote:
>
> Hi Adam,

>> Am 17.01.2018 um 19:19 schrieb Adam Weinberger <ad...@adamw.org>:
>> Hi Martin,
>>
>> You don't want to use the upstream version to represent PORTREVISION.
>> PORTREVISION is for when you need to force rebuilds of the port itself,
>> and so tying it to upstream would make it impossible to bump it
>> ourselves.
>>
>> Why do you need to ignore the fourth digit? It's perfectly valid for our
>> purposes.
>
> So far, I had (because it coincided with their version number) used it to
> provide SO_VER. But that breaks now:
>
> ---
> # Created by: adamw
> # $FreeBSD: head/archivers/liblz4/Makefile 448415 2017-08-20 12:30:25Z
> sunpoet $
>
> PORTNAME= lz4
> PORTVERSION= 1.8.1
> DISTVERSIONPREFIX= v
> PORTEPOCH= 1
> CATEGORIES= archivers
> PKGNAMEPREFIX= lib
>
> MAINTAINER= mar...@waschbuesch.de
> COMMENT= LZ4 compression library, lossless and very fast
>
> LICENSE= BSD2CLAUSE GPLv2
> LICENSE_COMB= multi
>
> USES= gmake pathfix pkgconfig
> USE_GITHUB= yes
> USE_LDCONFIG= yes
> #PATHFIX_MAKEFILEIN= Makefile
>
> ALL_TARGET= default # don't remove this
> SO_VER= ${PORTVERSION}
> PLIST_SUB+= SO_VER=${SO_VER} SO_VER_MAJ=${SO_VER:R:R}
> LIBDIR= ${PREFIX}/lib
>
> post-patch:
> @${FIND} ${WRKSRC} -name Makefile | ${XARGS} ${REINPLACE_CMD} \
> -e '/^MANDIR :=/s|share/||'
> @${REINPLACE_CMD} -e '/^all:/s/$$/ liblz4.pc/' \
> ${WRKSRC}/lib/Makefile
> @${REINPLACE_CMD} -e '/^all:/s|fullbench.*||' \
> ${WRKSRC}/programs/Makefile
>
> post-install:
> ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/lz4*
> ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/liblz4.so.${SO_VER}
>
> .include <bsd.port.mk>
> ---
>
> Manually specifying the SO_VER seems also very weird.
>
> I am sorry if these questions seem clumsy - I am not terribly experienced
> with porting stuff, but eager to learn.

You can still use them---just add an extra :R.

PLIST_SUB+= SO_VER=${SO_VER:R} SO_VER_MAJ=${SO_VER:R:R}

Martin Waschbüsch

unread,
Jan 17, 2018, 1:40:32 PM1/17/18
to
Thanks, Freddie,
> Am 17.01.2018 um 19:35 schrieb Freddie Cash <fjw...@gmail.com>:

>
> On Wed, Jan 17, 2018 at 10:29 AM, Martin Waschbüsch <mar...@waschbuesch.de <mailto:mar...@waschbuesch.de>> wrote:
> Hi Adam,
> > Am 17.01.2018 um 19:19 schrieb Adam Weinberger <ad...@adamw.org <mailto:ad...@adamw.org>>:
> > Hi Martin,
> >
> > You don't want to use the upstream version to represent PORTREVISION. PORTREVISION is for when you need to force rebuilds of the port itself, and so tying it to upstream would make it impossible to bump it ourselves.
> >
> > Why do you need to ignore the fourth digit? It's perfectly valid for our purposes.
>
> So far, I had (because it coincided with their version number) used it to provide SO_VER. But that breaks now:
>
> ---
> # Created by: adamw
> # $FreeBSD: head/archivers/liblz4/Makefile 448415 2017-08-20 12:30:25Z sunpoet $
>
> PORTNAME= lz4
> PORTVERSION= 1.8.1
> DISTVERSIONPREFIX= v
> PORTEPOCH= 1
> CATEGORIES= archivers
> PKGNAMEPREFIX= lib
>
> MAINTAINER= mar...@waschbuesch.de <mailto:mar...@waschbuesch.de>

> COMMENT= LZ4 compression library, lossless and very fast
>
> LICENSE= BSD2CLAUSE GPLv2
> LICENSE_COMB= multi
>
> USES= gmake pathfix pkgconfig
> USE_GITHUB= yes
> USE_LDCONFIG= yes
> #PATHFIX_MAKEFILEIN= Makefile
>
> ALL_TARGET= default # don't remove this
> SO_VER= ${PORTVERSION}
> PLIST_SUB+= SO_VER=${SO_VER} SO_VER_MAJ=${SO_VER:R:R}
>
> ​Why can't you do something like the above to get SO_VER?
>
> PORTVERSION=1.8.1.2
> SO_VER=${PORTVERSION:R:R:R)
>
> Similar to how you get SO_VER_MAJ out of SO_VER.​

That is true. Do you think this is a robust solution, though?
Or is the whole relying on upstream variables idea problematic?

0 new messages