nix flake build static with sqlite support

This commit is contained in:
m.huber 2025-07-23 15:39:10 +02:00
parent 65cd3f5309
commit 6ee5ae4d68
2 changed files with 33 additions and 25 deletions

View File

@ -746,7 +746,7 @@ security-check:
go run $(GOVULNCHECK_PACKAGE) -show color ./...
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w -extldflags "-static" $(LDFLAGS)' -o $@
.PHONY: release
release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-check

View File

@ -11,33 +11,41 @@
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
# generic
git
git-lfs
gnumake
gnused
gnutar
gzip
devShells.default =
with pkgs;
let
go = go_1_24;
in
pkgs.mkShell {
buildInputs = [
# generic
git
git-lfs
gnumake
gnused
gnutar
gzip
# frontend
nodejs_22
# frontend
nodejs_22
# linting
python312
uv
# linting
python312
uv
# backend
go_1_24
gofumpt
sqlite
];
shellHook = ''
export GO="${pkgs.go_1_24}/bin/go"
export GOROOT="${pkgs.go_1_24}/share/go"
'';
};
# backend
go
glibc.static
gofumpt
sqlite
];
CFLAGS = "-I${glibc.static.dev}/include";
LDFLAGS = "-L ${glibc.static}/lib";
GO = "${go}/bin/go";
GOROOT = "${go}/share/go";
TAGS = "sqlite sqlite_unlock_notify";
};
}
);
}