Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysutils/tt: New port #232

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

sysutils/tt: New port #232

wants to merge 1 commit into from

Conversation

0x501D
Copy link
Contributor

@0x501D 0x501D commented Feb 8, 2024

Command-line utility to manage Tarantool applications.

Command-line utility to manage Tarantool applications.
@arrowd
Copy link
Contributor

arrowd commented Feb 8, 2024

@wahjava You're knowledgeable in Go, would mind looking at this?

do-build:
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GO_ENV} ${LOCALBASE}/bin/mage build

GH_TUPLE= \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we can use GO_MODULE instead of GH_TUPLE.

Copy link
Contributor

@wahjava wahjava Feb 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it'll also help with fetching modules which aren't on GitHub. Please refer to go USES for more details.

Copy link
Contributor Author

@0x501D 0x501D Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, tt does not work as a go module due to the complexity and structure of the project itself:

go: github.com/tarantool/tt@latest (in github.com/tarantool/tt@v1.3.1):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

The tt source code uses external code from the submodule, this breaks the mechanism of Go modules.
The only way to make the tt port work was with GH_TUPLE.

Copy link
Contributor Author

@0x501D 0x501D Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to just remove USES= go:modules, GH_TUPLE and just do the mage build in the Makefile?
This works fine:

PORTNAME=       tt
PORTVERSION=    2.1.2
DISTVERSIONSUFFIX=      -complete
MASTER_SITES=   https://github.com/tarantool/tt/releases/download/v${PORTVERSION}/
WRKSRC=         ${WRKDIR}/${PORTNAME}-${PORTVERSION}
CATEGORIES=     sysutils databases

MAINTAINER=     mail@void.so
COMMENT=        Command-line utility to manage Tarantool applications
WWW=            https://github.com/tarantool/tt

LICENSE=        BSD2CLAUSE
LICENSE_FILE=   ${WRKSRC}/LICENSE

ONLY_FOR_ARCHS=         amd64 aarch64
ONLY_FOR_ARCHS_REASON=  the managed program only supports these architectures

BUILD_DEPENDS=  ${LOCALBASE}/bin/mage:devel/mage

PLIST_FILES=    bin/tt

do-build:
        @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GO_ENV} ${LOCALBASE}/bin/mage build

do-install:
            ${INSTALL_PROGRAM} ${WRKSRC}/tt ${STAGEDIR}${PREFIX}/bin

.include <bsd.port.mk>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And if port absolutely need to build without a network, I can try to use a cache of vendor libraries, the tt repository has them for tt gentoo ebuild.

do-build:
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GO_ENV} ${LOCALBASE}/bin/mage build

GH_TUPLE= \
Copy link
Contributor

@wahjava wahjava Feb 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it'll also help with fetching modules which aren't on GitHub. Please refer to go USES for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants