podman: use buildGoPackage

This commit is contained in:
Jörg Thalheim 2018-12-18 10:53:40 +01:00 committed by Vincent Demeester
parent 1a10caf4df
commit 3ca7722757
No known key found for this signature in database
GPG Key ID: 083CC6FD6EB699A3

View File

@ -1,12 +1,11 @@
{ stdenv, lib, fetchFromGitHub, removeReferencesTo, pkgconfig { stdenv, fetchFromGitHub, pkgconfig
, go, gpgme, lvm2, btrfs-progs, libseccomp , buildGoPackage, gpgme, lvm2, btrfs-progs, libseccomp
}: }:
with lib; buildGoPackage rec {
stdenv.mkDerivation rec {
name = "podman-${version}"; name = "podman-${version}";
version = "0.12.1.2"; version = "0.12.1.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "containers"; owner = "containers";
repo = "libpod"; repo = "libpod";
@ -14,32 +13,27 @@ stdenv.mkDerivation rec {
sha256 = "1gz7vci273bgrihrxbks2zxlb2lsmlj3lisw7s3d54ci0zr7avv3"; sha256 = "1gz7vci273bgrihrxbks2zxlb2lsmlj3lisw7s3d54ci0zr7avv3";
}; };
goPackagePath = "github.com/containers/libpod";
# Optimizations break compilation of libseccomp c bindings # Optimizations break compilation of libseccomp c bindings
hardeningDisable = [ "fortify" ]; hardeningDisable = [ "fortify" ];
nativeBuildInputs = [ pkgconfig removeReferencesTo ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ buildInputs = [
go btrfs-progs libseccomp gpgme lvm2 btrfs-progs libseccomp gpgme lvm2
]; ];
buildPhase = '' buildPhase = ''
pushd $NIX_BUILD_TOP/go/src/${goPackagePath}
patchShebangs . 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 make binaries
''; '';
installPhase = '' installPhase = ''
install -Dm555 bin/podman $out/bin/podman install -Dm555 bin/podman $bin/bin/podman
''; '';
preFixup = '' meta = with stdenv.lib; {
find $out -type f -exec remove-references-to -t ${go} -t ${stdenv.cc.cc} -t ${stdenv.glibc.dev} '{}' +
'';
meta = {
homepage = https://podman.io/; homepage = https://podman.io/;
description = "A program for managing pods, containers and container images"; description = "A program for managing pods, containers and container images";
license = licenses.asl20; license = licenses.asl20;