fix varnamcli build

This commit is contained in:
Adithya 2024-05-24 22:53:29 +05:30
parent ed5eab69ef
commit 84f2fdd93b
Signed by: adtya
GPG key ID: B8857BFBA2C47B9C
2 changed files with 10 additions and 3 deletions

View file

@ -22,6 +22,7 @@ buildGoModule rec {
CGO_ENABLED = 1;
nativeBuildInputs = [ pkg-config libgovarnam ];
buildInputs = [ pkg-config libgovarnam ];
ldflags = [
"-w"
@ -30,16 +31,19 @@ buildGoModule rec {
"-X 'github.com/varnamproject/govarnam/govarnam.VersionString=${version}'"
];
subPackages = [
"cli"
];
postInstall = ''
mv $out/bin/cli $out/bin/varnamcli
'';
meta = {
description = "Easily type Indic languages on computer and mobile. GoVarnam is a cross-platform transliteration library. Manglish -> Malayalam, Thanglish -> Tamil, Hinglish -> Hindi plus another 10 languages. GoVarnam is a near-Go port of libvarnam";
homepage = "https://github.com/varnamproject/govarnam";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ adtya ];
mainProgram = "varnamcli";
};
}

View file

@ -22,7 +22,10 @@ buildGoModule rec {
buildPhase = ''
runHook preInstall
go build -tags "fts5" -buildmode=c-shared -ldflags "-s -w -X 'github.com/varnamproject/govarnam/govarnam.BuildString=${version} (\#0000000 1970-01-01T00:00:00+0000)' -X 'github.com/varnamproject/govarnam/govarnam.VersionString=${version}' -extldflags "-Wl,-soname,${pname}.so.1,--version-script,${src}/govarnam.syms"" -o ${pname}.so .
go build -tags "fts5" -buildmode=c-shared -ldflags \
"-s -w -X 'github.com/varnamproject/govarnam/govarnam.BuildString=${version} (\#0000000 1970-01-01T00:00:00+0000)' \
-X 'github.com/varnamproject/govarnam/govarnam.VersionString=${version}' \
-extldflags "-Wl,-soname,${pname}.so.1,--version-script,${src}/govarnam.syms"" -o ${pname}.so .
runHook postInstall
'';