File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616VERSION := $(BRANCH ) .$(GIT_COMMIT_HASH )
1717DIRTY := "dev"
1818endif
19+ # X11 support
20+ X11 := 0
21+ ifeq ($(shell go env GOOS) ,linux)
22+ ifeq ($(shell ldconfig -p | grep X11 || echo "") )
23+ X11 := 1
24+ endif
25+ endif
1926LDFLAGS =--ldflags "-s -X github.com/SwissDataScienceCenter/renku-dev-utils/pkg/version.Version=$(VERSION ) -X github.com/SwissDataScienceCenter/renku-dev-utils/pkg/version.VersionSuffix=$(DIRTY ) "
27+ TAGS =
28+ ifeq ($(X11 ) ,1)
29+ TAGS=-tags =x11
30+ endif
2031
2132.PHONY : all
2233all : help
@@ -29,6 +40,7 @@ vars: ## Show the Makefile vars
2940 @echo GIT_TAG=" '$( GIT_TAG) '"
3041 @echo VERSION=" '$( VERSION) '"
3142 @echo DIRTY=" '$( DIRTY) '"
43+ @echo X11=" '$( X11) '"
3244
3345.PHONY : rdu
3446rdu : build/renku-dev-utils # # Build and install renku-dev-utils
@@ -38,7 +50,7 @@ rdu: build/renku-dev-utils ## Build and install renku-dev-utils
3850
3951.PHONY : build/renku-dev-utils
4052build/renku-dev-utils :
41- go build -v -o build/ $(LDFLAGS )
53+ go build -v -o build/ $(TAGS ) $( LDFLAGS )
4254
4355# From the operator sdk Makefile
4456# The help target prints out all targets with their descriptions organized
@@ -75,7 +87,7 @@ lint: ## Lint source files with `golangci-lint run`
7587
7688.PHONY : test
7789test : # # Run go tests
78- go test -v ./...
90+ go test -v $( TAGS ) ./...
7991
8092# #@ Code generation
8193
Original file line number Diff line number Diff line change 1- //go:build !linux
1+ //go:build !linux || x11
22
33package clipboard
44
Original file line number Diff line number Diff line change 1- //go:build linux
1+ //go:build linux && !x11
22
33package clipboard
44
You can’t perform that action at this time.
0 commit comments