diff options
author | Wong Hoi Sing Edison <hswong3i@gmail.com> | 2020-05-27 14:30:40 +0800 |
---|---|---|
committer | Wong Hoi Sing Edison <hswong3i@gmail.com> | 2020-07-18 09:03:28 +0800 |
commit | f53812a11ebfcb7ccb46df998147048e8f2a27a3 (patch) | |
tree | 0cb9ce9f7957555dcb07b308b955549aee860478 /Makefile | |
parent | 10c5f241231a55a90a37b9f578c84a6bb23ae33e (diff) | |
download | podman-f53812a11ebfcb7ccb46df998147048e8f2a27a3.tar.gz podman-f53812a11ebfcb7ccb46df998147048e8f2a27a3.tar.bz2 podman-f53812a11ebfcb7ccb46df998147048e8f2a27a3.zip |
Cleanup nix derivation for static builds
Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 27 |
1 files changed, 8 insertions, 19 deletions
@@ -220,29 +220,18 @@ bin/podman.cross.%: .gopathok GOARCH="$${TARGET##*.}" \ $(GO_BUILD) -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags '$(BUILDTAGS_CROSS)' -o "$@" $(PROJECT)/cmd/podman -# Update nix/nixpkgs.json its latest master commit +# Update nix/nixpkgs.json its latest stable commit .PHONY: nixpkgs nixpkgs: - @nix run -f channel:nixpkgs-unstable nix-prefetch-git -c nix-prefetch-git \ + @nix run -f channel:nixos-20.03 nix-prefetch-git -c nix-prefetch-git \ --no-deepClone https://github.com/nixos/nixpkgs > nix/nixpkgs.json -NIX_IMAGE ?= quay.io/podman/nix-podman:1.0.0 - -# Build the nix image as base for static builds -.PHONY: nix-image -nix-image: - $(CONTAINER_RUNTIME) build -t $(NIX_IMAGE) -f Containerfile-nix . - -# Build podman statically linked based on the default nix container image -.PHONY: build-static -build-static: - $(CONTAINER_RUNTIME) run \ - --rm -it \ - -v $(shell pwd):/work \ - -w /work $(NIX_IMAGE) \ - sh -c "nix build -f nix && \ - mkdir -p bin && \ - cp result-*bin/bin/podman bin/podman-static" +# Build statically linked binary +.PHONY: static +static: + @nix build -f nix/ + mkdir -p ./bin + cp -rfp ./result/bin/* ./bin/ .PHONY: run-docker-py-tests run-docker-py-tests: |