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

116 lines
2.9 KiB
Nix
Raw Normal View History

2018-10-31 00:16:19 +00:00
{ stdenv, buildGoPackage, fetchFromGitHub, pkgconfig,
2018-11-27 17:23:55 +00:00
alsaLib,
bc,
blur-effect,
coreutils,
dbus-factory,
deepin,
deepin-gettext-tools,
fontconfig,
glib,
go,
go-dbus-factory,
go-gir-generator,
go-lib,
grub2,
gtk3,
libcanberra,
libgudev,
librsvg,
poppler,
pulseaudio,
rfkill,
xcur2png
}:
2018-10-12 12:07:58 +01:00
buildGoPackage rec {
name = "${pname}-${version}";
pname = "dde-api";
2019-05-04 12:41:59 +01:00
version = "3.18.3";
2018-10-12 12:07:58 +01:00
goPackagePath = "pkg.deepin.io/dde/api";
src = fetchFromGitHub {
owner = "linuxdeepin";
repo = pname;
rev = version;
2019-05-04 12:41:59 +01:00
sha256 = "0sbzjpjy2d7j22v5sw3mf472lcnsy81n2rgly87k79r5gk9x89ar";
2018-10-12 12:07:58 +01:00
};
goDeps = ./deps.nix;
2018-11-27 17:23:55 +00:00
outputs = [ "out" ];
2018-10-12 12:07:58 +01:00
nativeBuildInputs = [
pkgconfig
2018-11-27 17:23:55 +00:00
deepin-gettext-tools # build
dbus-factory # build
go-dbus-factory # needed
go-gir-generator # needed
go-lib # build
deepin.setupHook
2018-10-12 12:07:58 +01:00
];
buildInputs = [
2018-11-27 17:23:55 +00:00
alsaLib # needed
bc # run (to adjust grub theme?)
blur-effect # run (is it really needed?)
coreutils # run (is it really needed?)
fontconfig # run (is it really needed?)
#glib # ? arch
grub2 # run (is it really needed?)
gtk3 # build run
libcanberra # build run
libgudev # needed
librsvg # build run
poppler # build run
pulseaudio # needed
rfkill # run
xcur2png # run
#locales # run (locale-helper needs locale-gen, which is unavailable on NixOS?)
];
2018-10-12 12:07:58 +01:00
postPatch = ''
2018-11-27 17:23:55 +00:00
searchHardCodedPaths # debugging
sed -i -e "s|/var|$out/var|" Makefile
# TODO: confirm where to install grub themes
sed -i -e "s|/boot/grub|$out/boot/grub|" Makefile
fixPath $out /usr/lib/deepin-api \
lunar-calendar/main.go \
misc/services/com.deepin.api.CursorHelper.service \
misc/services/com.deepin.api.Graphic.service \
misc/services/com.deepin.api.LunarCalendar.service \
misc/services/com.deepin.api.Pinyin.service \
misc/system-services/com.deepin.api.Device.service \
misc/system-services/com.deepin.api.LocaleHelper.service \
misc/system-services/com.deepin.api.SoundThemePlayer.service \
misc/systemd/system/deepin-shutdown-sound.service \
theme_thumb/gtk/gtk.go \
thumbnails/gtk/gtk.go
2018-10-12 12:07:58 +01:00
'';
buildPhase = ''
2019-02-28 01:46:32 +00:00
export GOCACHE="$TMPDIR/go-cache";
2018-10-12 12:07:58 +01:00
make -C go/src/${goPackagePath}
'';
installPhase = ''
2018-11-27 17:23:55 +00:00
make install PREFIX="$out" SYSTEMD_LIB_DIR="$out/lib" -C go/src/${goPackagePath}
mv $out/share/gocode $out/share/go
remove-references-to -t ${go} $out/bin/* $out/lib/deepin-api/*
2018-10-12 12:07:58 +01:00
'';
2018-10-30 22:17:45 +00:00
passthru.updateScript = deepin.updateScript { inherit name; };
2018-10-12 12:07:58 +01: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 ];
};
}