File tree Expand file tree Collapse file tree 2 files changed +51
-25
lines changed Expand file tree Collapse file tree 2 files changed +51
-25
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,17 @@ ifeq ($(HAS_GO), yes)
4848 CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
4949endif
5050
51+ CGO_ENABLED ?= 0
52+ ifneq (,$(findstring sqlite,$(TAGS ) )$(findstring pam,$(TAGS ) ) )
53+ CGO_ENABLED = 1
54+ endif
55+
56+ STATIC ?=
57+ EXTLDFLAGS ?=
58+ ifneq ($(STATIC ) ,)
59+ EXTLDFLAGS = -extldflags "-static"
60+ endif
61+
5162ifeq ($(GOOS ) ,windows)
5263 IS_WINDOWS := yes
5364else ifeq ($(patsubst Windows%,Windows,$(OS)),Windows)
@@ -746,7 +757,10 @@ security-check:
746757 go run $(GOVULNCHECK_PACKAGE ) -show color ./...
747758
748759$(EXECUTABLE ) : $(GO_SOURCES ) $(TAGS_PREREQ )
749- CGO_CFLAGS=" $( CGO_CFLAGS) " $(GO ) build $(GOFLAGS ) $(EXTRA_GOFLAGS ) -tags ' $(TAGS)' -ldflags ' -s -w $(LDFLAGS)' -o $@
760+ ifneq ($(and $(STATIC ) ,$(findstring pam,$(TAGS ) ) ) ,)
761+ $(error pam support set via TAGS doesn't support static builds)
762+ endif
763+ CGO_ENABLED="$(CGO_ENABLED)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(EXTLDFLAGS) $(LDFLAGS)' -o $@
750764
751765.PHONY : release
752766release : frontend generate release-windows release-linux release-darwin release-freebsd release-copy release-compress vendor release-sources release-check
Original file line number Diff line number Diff line change 1111 pkgs = nixpkgs . legacyPackages . ${ system } ;
1212 in
1313 {
14- devShells . default = pkgs . mkShell {
15- buildInputs = with pkgs ; [
16- # generic
17- git
18- git-lfs
19- gnumake
20- gnused
21- gnutar
22- gzip
14+ devShells . default =
15+ with pkgs ;
16+ let
17+ # only bump toolchain versions here
18+ go = go_1_24 ;
19+ nodejs = nodejs_24 ;
20+ python3 = python312 ;
21+ in
22+ pkgs . mkShell {
23+ buildInputs = [
24+ # generic
25+ git
26+ git-lfs
27+ gnumake
28+ gnused
29+ gnutar
30+ gzip
2331
24- # frontend
25- nodejs_22
32+ # frontend
33+ nodejs
2634
27- # linting
28- python312
29- uv
35+ # linting
36+ python3
37+ uv
3038
31- # backend
32- go_1_24
33- gofumpt
34- sqlite
35- ] ;
36- shellHook = ''
37- export GO="${ pkgs . go_1_24 } /bin/go"
38- export GOROOT="${ pkgs . go_1_24 } /share/go"
39- '' ;
40- } ;
39+ # backend
40+ go
41+ glibc . static
42+ gofumpt
43+ sqlite
44+ ] ;
45+ CFLAGS = "-I${ glibc . static . dev } /include" ;
46+ LDFLAGS = "-L ${ glibc . static } /lib" ;
47+ GO = "${ go } /bin/go" ;
48+ GOROOT = "${ go } /share/go" ;
49+
50+ TAGS = "sqlite sqlite_unlock_notify" ;
51+ STATIC = "true" ;
52+ } ;
4153 }
4254 ) ;
4355}
You can’t perform that action at this time.
0 commit comments