Solved Package version string when compiling from Github

Hi,

I'm currently struggling a little bit with a port, airdcpp-webclient, which I submitted a few months ago. After compiling the version string shows AirDC++w 10-eol-94631-g67a0854-d while I expected AirDC++w 2.11.1. How can I get a proper version string while using Github as source? I did try a longshot with CONFIGURE_ARGS= --with-version-string=${DISTVERSION}, but that does not seem like the way you should go. Any help is much appreciated!

Code:
# Created by: Venim <ven1m@protonmail.com>
# $FreeBSD$

PORTNAME=    airdcpp-webclient
DISTVERSION=    2.11.1
CATEGORIES=    net-p2p
MASTER_SITES=    https://airdcpp-web.github.io/

MAINTAINER=    ven1m@protonmail.com
COMMENT=    Peer-to-peer file sharing application for file servers/NAS devices

LICENSE=    MIT

BUILD_DEPENDS=    npm>=1.54:www/npm \
        websocketpp>=0.7.0:devel/websocketpp
RUN_DEPENDS=    npm>=1.54:www/npm
LIB_DEPENDS=    libboost_regex.so:devel/boost-libs \
        libboost_thread.so:devel/boost-libs \
        libboost_system.so:devel/boost-libs \
        libmaxminddb.so:net/libmaxminddb \
        libleveldb.so:databases/leveldb \
        libminiupnpc.so:net/miniupnpc

USES=        cmake compiler:c++11-lang pkgconfig python ssl iconv

USE_GITHUB=    yes
GH_ACCOUNT=    airdcpp-web

AIRDCPP_VARDIR?=    /var
AIRDCPP_RUNDIR?=    ${AIRDCPP_VARDIR}/run/airdcppd

BINARY_ALIAS=    python=${PYTHON_CMD}

AIRDCPP_USER?=    airdcpp
AIRDCPP_GROUP?=    airdcpp

USE_RC_SUBR=    airdcppd
SUB_FILES=    pkg-message dcppboot.xml
SUB_LIST+=    AIRDCPP_USER=${AIRDCPP_USER} \
        AIRDCPP_GROUP=${AIRDCPP_GROUP} \
        AIRDCPP_RUNDIR=${AIRDCPP_RUNDIR}

OPTIONS_DEFINE=        NATPMP TBB
OPTIONS_DEFAULT=    NATPMP

NATPMP_DESC=        Optional NAT-PMP support
NATPMP_CONFIGURE_WITH=    natpmp
NATPMP_LIB_DEPENDS=    libnatpmp.so:net/libnatpmp

TBB_DESC=        Optional Intel Threading Building Blocks (TBB) support
TBB_CONFIGURE_WITH=    tbb
TBB_LIB_DEPENDS=    libtbb.so:devel/tbb

ALL_TARGET=    all

post-install:
    ${MKDIR} ${STAGEDIR}${PREFIX}/etc/airdcpp/
    ${INSTALL_DATA} ${WRKDIR}/dcppboot.xml ${STAGEDIR}${PREFIX}/etc/airdcpp/dcppboot.xml.sample
    ${MKDIR} ${STAGEDIR}${AIRDCPP_RUNDIR}

.include <bsd.port.mk>
 
How can I get a proper version string while using Github as source?
Find out in the source (or its build scripts) where this is actually set. Then you probably need to patch one of the files to set the version.
 
I'd remove the MASTER_SITES, you're downloading the code from Github (USE_GITHUB). And add a GH_TAGNAME=2.11.1. That will download the correct sources instead of the 'main' branch.
 
Seems like the scripts/generate-version.sh pick up the FreeBSD git repository instead. Is it bad practice to patch this file and replace git ls-remote with false? This fixes the problem, at least for now since the source file is not a git repository and instead picks up the one located in /usr/ports.
 
Back
Top