nixpkgs/pkgs/desktops/deepin/dde-api/default.nix

68 lines
1.5 KiB
Nix
Raw Normal View History

2018-10-31 00:16:19 +00:00
{ stdenv, buildGoPackage, fetchFromGitHub, pkgconfig,
deepin-gettext-tools, go-dbus-factory, go-gir-generator, go-lib,
alsaLib, glib, gtk3, libcanberra, libgudev, librsvg, poppler,
pulseaudio, go, deepin }:
2018-10-12 11:07:58 +00:00
buildGoPackage rec {
name = "${pname}-${version}";
pname = "dde-api";
2018-10-31 00:16:19 +00:00
version = "3.5.0";
2018-10-12 11:07:58 +00:00
goPackagePath = "pkg.deepin.io/dde/api";
src = fetchFromGitHub {
owner = "linuxdeepin";
repo = pname;
rev = version;
2018-10-31 00:16:19 +00:00
sha256 = "1g3s0i5wa6qyv00yksz4r4cy2vhiknq8v0yx7aribvwm3gxf7jw3";
2018-10-12 11:07:58 +00:00
};
goDeps = ./deps.nix;
nativeBuildInputs = [
pkgconfig
deepin-gettext-tools
2018-10-31 00:16:19 +00:00
go-dbus-factory
go-gir-generator
go-lib
2018-10-12 11:07:58 +00:00
];
buildInputs = [
2018-10-31 00:16:19 +00:00
alsaLib
2018-10-12 11:07:58 +00:00
glib
gtk3
2018-10-31 00:16:19 +00:00
libcanberra
libgudev
2018-10-12 11:07:58 +00:00
librsvg
2018-10-31 00:16:19 +00:00
poppler
2018-10-12 11:07:58 +00:00
pulseaudio
];
postPatch = ''
2018-10-31 00:16:19 +00:00
patchShebangs .
2018-10-12 11:07:58 +00:00
sed -i -e "s|/var|$bin/var|" Makefile
'';
buildPhase = ''
2019-02-28 01:46:32 +00:00
export GOCACHE="$TMPDIR/go-cache";
2018-10-12 11:07:58 +00:00
make -C go/src/${goPackagePath}
'';
installPhase = ''
make install PREFIX="$bin" SYSTEMD_LIB_DIR="$bin/lib" -C go/src/${goPackagePath}
mkdir -p $out/share
mv $bin/share/gocode $out/share/go
remove-references-to -t ${go} $bin/bin/* $bin/lib/deepin-api/*
'';
2018-10-30 22:17:45 +00:00
passthru.updateScript = deepin.updateScript { inherit name; };
2018-10-12 11:07:58 +00:00
meta = with stdenv.lib; {
description = "Go-lang bindings for dde-daemon";
homepage = https://github.com/linuxdeepin/dde-api;
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ romildo ];
};
}