@@ -74,7 +74,7 @@ LDFLAGS_PODMAN ?= \
7474 -X $(LIBPOD ) /define.buildInfo=$(BUILD_INFO ) \
7575 -X $(LIBPOD ) /config._installPrefix=$(PREFIX ) \
7676 -X $(LIBPOD ) /config._etcDir=$(ETCDIR ) \
77- -extldflags " $( LDFLAGS ) "
77+ $( EXTRA_LDFLAGS )
7878# Update to LIBSECCOMP_COMMIT should reflect in Dockerfile too.
7979LIBSECCOMP_COMMIT := v2.3.3
8080# Rarely if ever should integration tests take more than 50min,
@@ -217,6 +217,30 @@ bin/podman.cross.%: .gopathok
217217 GOARCH=" $$ {TARGET##*.}" \
218218 $(GO_BUILD ) -gcflags ' $(GCFLAGS)' -asmflags ' $(ASMFLAGS)' -ldflags ' $(LDFLAGS_PODMAN)' -tags ' $(BUILDTAGS_CROSS)' -o " $@ " $(PROJECT ) /cmd/podman
219219
220+ # Update nix/nixpkgs.json its latest master commit
221+ .PHONY : nixpkgs
222+ nixpkgs :
223+ @nix run -f channel:nixpkgs-unstable nix-prefetch-git -c nix-prefetch-git \
224+ --no-deepClone https://github.com/nixos/nixpkgs > nix/nixpkgs.json
225+
226+ NIX_IMAGE ?= quay.io/podman/nix-podman:1.0.0
227+
228+ # Build the nix image as base for static builds
229+ .PHONY : nix-image
230+ nix-image :
231+ $(CONTAINER_RUNTIME ) build -t $(NIX_IMAGE ) -f Containerfile-nix .
232+
233+ # Build podman statically linked based on the default nix container image
234+ .PHONY : build-static
235+ build-static :
236+ $(CONTAINER_RUNTIME ) run \
237+ --rm -it \
238+ -v $(shell pwd) :/work \
239+ -w /work $(NIX_IMAGE ) \
240+ sh -c " nix build -f nix && \
241+ mkdir -p bin && \
242+ cp result-* bin/bin/podman bin/podman-static"
243+
220244.PHONY : run-docker-py-tests
221245run-docker-py-tests :
222246 $(eval testLogs=$(shell mktemp) )
0 commit comments