From 3ca772275707fd0f781882bbdfb515574c931cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 18 Dec 2018 10:53:40 +0100 Subject: [PATCH] podman: use buildGoPackage --- .../virtualization/podman/default.nix | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/pkgs/applications/virtualization/podman/default.nix b/pkgs/applications/virtualization/podman/default.nix index 8dd1a0ab9e4a..9a6fec47266e 100644 --- a/pkgs/applications/virtualization/podman/default.nix +++ b/pkgs/applications/virtualization/podman/default.nix @@ -1,45 +1,39 @@ -{ stdenv, lib, fetchFromGitHub, removeReferencesTo, pkgconfig -, go, gpgme, lvm2, btrfs-progs, libseccomp +{ stdenv, fetchFromGitHub, pkgconfig +, buildGoPackage, gpgme, lvm2, btrfs-progs, libseccomp }: -with lib; - -stdenv.mkDerivation rec { +buildGoPackage rec { name = "podman-${version}"; version = "0.12.1.2"; + src = fetchFromGitHub { owner = "containers"; repo = "libpod"; rev = "v${version}"; sha256 = "1gz7vci273bgrihrxbks2zxlb2lsmlj3lisw7s3d54ci0zr7avv3"; }; - + + goPackagePath = "github.com/containers/libpod"; + # Optimizations break compilation of libseccomp c bindings hardeningDisable = [ "fortify" ]; - nativeBuildInputs = [ pkgconfig removeReferencesTo ]; - + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ - go btrfs-progs libseccomp gpgme lvm2 + btrfs-progs libseccomp gpgme lvm2 ]; buildPhase = '' + pushd $NIX_BUILD_TOP/go/src/${goPackagePath} patchShebangs . - mkdir -p .gopath/src/github.com/containers - ln -sf $PWD .gopath/src/github.com/containers/libpod - ln -sf $PWD/vendor/github.com/varlink .gopath/src/github.com/varlink - export GOPATH="$PWD/.gopath:$GOPATH" make binaries ''; - + installPhase = '' - install -Dm555 bin/podman $out/bin/podman - ''; - - preFixup = '' - find $out -type f -exec remove-references-to -t ${go} -t ${stdenv.cc.cc} -t ${stdenv.glibc.dev} '{}' + + install -Dm555 bin/podman $bin/bin/podman ''; - meta = { + meta = with stdenv.lib; { homepage = https://podman.io/; description = "A program for managing pods, containers and container images"; license = licenses.asl20;