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 ./... go run $(GOVULNCHECK_PACKAGE) -show color ./...
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ) $(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 .PHONY: release
release: frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-check 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}; pkgs = nixpkgs.legacyPackages.${system};
in in
{ {
devShells.default = pkgs.mkShell { devShells.default =
buildInputs = with pkgs; [ with pkgs;
# generic let
git go = go_1_24;
git-lfs in
gnumake pkgs.mkShell {
gnused buildInputs = [
gnutar # generic
gzip git
git-lfs
gnumake
gnused
gnutar
gzip
# frontend # frontend
nodejs_22 nodejs_22
# linting # linting
python312 python312
uv uv
# backend # backend
go_1_24 go
gofumpt glibc.static
sqlite gofumpt
]; sqlite
shellHook = '' ];
export GO="${pkgs.go_1_24}/bin/go" CFLAGS = "-I${glibc.static.dev}/include";
export GOROOT="${pkgs.go_1_24}/share/go" LDFLAGS = "-L ${glibc.static}/lib";
''; GO = "${go}/bin/go";
}; GOROOT = "${go}/share/go";
TAGS = "sqlite sqlite_unlock_notify";
};
} }
); );
} }