Solved Makefile warnings I couldn't solve.

Hi. I am trying to update one of my ports but I am getting a makefile error that I couldn't solve.

Code:
# make extract
/!\ tgpt-2.8.0_3: Makefile warnings, please consider fixing /!\

You are using USE_GITHUB and WRKSRC is set which is wrong.  Set GH_PROJECT
correctly or set WRKSRC_SUBDIR and remove WRKSRC entirely.

===>  License GPLv3 accepted by the user
===>   tgpt-2.8.0_3 depends on file: /usr/local/sbin/pkg - found
===>   tgpt-2.8.0_3 depends on file: /usr/local/bin/go122 - found
===>   tgpt-2.8.0_3 depends on package: ca_root_nss>0 - found
===> Fetching all distfiles required by tgpt-2.8.0_3 for building
===> Fetching github.com/aandrew-me/tgpt/v2 dependencies
===>  Extracting for tgpt-2.8.0_3
=> SHA256 Checksum OK for go/www_tgpt/aandrew-me-tgpt-v2.8.0_GH0/v2.8.0.mod.
=> SHA256 Checksum OK for go/www_tgpt/aandrew-me-tgpt-v2.8.0_GH0/v2.8.0.zip.
=> SHA256 Checksum OK for go/www_tgpt/aandrew-me-tgpt-v2.8.0_GH0/aandrew-me-tgpt-v2.8.0_GH0.tar.gz.
===> Tidying github.com/aandrew-me/tgpt/v2 dependencies
===> Vendoring github.com/aandrew-me/tgpt/v2 dependencies

Here is my Makefile.

Code:
# cat Makefile
PORTNAME=       tgpt
DISTVERSIONPREFIX=      v
DISTVERSION=    2.8.0
PORTREVISION=   3
CATEGORIES=     www

MAINTAINER=     nxjoseph@protonmail.com
COMMENT=        AI Chatbots in terminal without needing API keys
WWW=            https://github.com/aandrew-me/tgpt

LICENSE=        GPLv3
LICENSE_FILE=   ${WRKSRC}/LICENSE

USES=           go:1.22,modules

USE_GITHUB=     yes
GH_ACCOUNT=     aandrew-me
GH_PROJECT=     tgpt

GO_MODULE=      github.com/aandrew-me/tgpt/v2
GO_BUILDFLAGS=  -ldflags="-s -w" -o ./build/tgpt

PLIST_FILES=    bin/tgpt

.include <bsd.port.mk>

I added GH_PROJECT but i am still getting same Makefile error. Thanks.
 
Thanks, I removed LICENSE_FILE but the warning isn't solved.

Code:
PORTNAME=       tgpt
DISTVERSIONPREFIX=      v
DISTVERSION=    2.8.0
PORTREVISION=   3
CATEGORIES=     www

MAINTAINER=     nxjoseph@protonmail.com
COMMENT=        AI Chatbots in terminal without needing API keys
WWW=            https://github.com/aandrew-me/tgpt

LICENSE=        GPLv3

USES=           go:1.22,modules

USE_GITHUB=     yes
GH_ACCOUNT=     aandrew-me
GH_PROJECT=     tgpt

GO_MODULE=      github.com/aandrew-me/tgpt/v2
GO_BUILDFLAGS=  -ldflags="-s -w" -o ./build/tgpt

PLIST_FILES=    bin/tgpt

.include <bsd.port.mk>
 
Thanks for your comment but building is not an issue here, it builds successfully but what I want to do here is to fix the Makefile warning because I want to submit a clean port.
 

Attachments

  • 1722529894373.png
    1722529894373.png
    250 KB · Views: 234
edited.
Code:
PORTNAME=       tgpt
DISTVERSIONPREFIX=      v
DISTVERSION=    2.8.0
PORTREVISION=   3
CATEGORIES=     www

MAINTAINER=     nxjoseph@protonmail.com
COMMENT=        AI Chatbots in terminal without needing API keys
WWW=            https://github.com/aandrew-me/tgpt

LICENSE=        GPLv3
LICENSE_FILE=   ${WRKSRC}/LICENSE

USES=           go:1.22,modules

USE_GITHUB=     nodefault
GH_ACCOUNT=     aandrew-me

GO_MODULE=      github.com/aandrew-me/tgpt/v2
GO_BUILDFLAGS=  -ldflags="-s -w" -o ./build/tgpt

PLIST_FILES=    bin/tgpt

.include <bsd.port.mk>
 
The Makefile warning is fixed somehow after changing it to nodefault but I am faced with a different problem. My port now requires networking to build in poudriere. I guess I changed something different this time.
 
Just for reference, according /usr/ports/Mk/bsd.sites.mk, this error is raised when WRKSRC is defined:

sh:
.    if !defined(IGNORE_MASTER_SITE_GITHUB) && defined(USE_GITHUB) && empty(USE_GITHUB:Mnodefault)
.      if defined(WRKSRC)
DEV_WARNING+=    "You are using USE_GITHUB and WRKSRC is set which is wrong.  Set GH_PROJECT correctly or set WRKSRC_SUBDIR and remove WRKSRC entirely."
.      endif
WRKSRC?=        ${WRKDIR}/${GH_PROJECT_DEFAULT}-${GH_TAGNAME_EXTRACT}
.    endif

The thing is it shouldn't be defined at this stage, excepted if you've defined it yourself for any reason in your environment.

I've encountered it when I wanted to test manually an install step and I manually set it in my shell, just unset WRKSRC and the problem disappears.

(So I guess the problem disappeared for you when you revisited the thing with a new shell).
 
Back
Top