2023-02-22 10:55:15 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2024-01-02 11:29:13 +00:00
|
|
|
, fetchpatch
|
|
|
|
, buildGoModule
|
2023-02-22 10:55:15 +00:00
|
|
|
, pkg-config
|
|
|
|
, deepin-gettext-tools
|
2024-01-02 11:29:13 +00:00
|
|
|
, wrapQtAppsHook
|
|
|
|
, wrapGAppsHook
|
2023-02-22 10:55:15 +00:00
|
|
|
, alsa-lib
|
2024-01-02 11:29:13 +00:00
|
|
|
, gtk3
|
2023-02-22 10:55:15 +00:00
|
|
|
, libcanberra
|
|
|
|
, libgudev
|
|
|
|
, librsvg
|
|
|
|
, poppler
|
|
|
|
, pulseaudio
|
|
|
|
, gdk-pixbuf-xlib
|
|
|
|
, coreutils
|
2024-01-02 11:29:13 +00:00
|
|
|
, dbus
|
2023-02-22 10:55:15 +00:00
|
|
|
}:
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
buildGoModule rec {
|
2023-02-22 10:55:15 +00:00
|
|
|
pname = "dde-api";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "6.0.7";
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linuxdeepin";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-kdf1CoZUyda6bOTW0WJTgaXYhocrjRU9ptj7i+k8aaQ=";
|
2023-02-22 10:55:15 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "modify_PKGBUILD_to_support_OBS.patch";
|
|
|
|
url = "https://github.com/linuxdeepin/dde-api/commit/1399522d032c6c649db79a33348cdb1a233bc23a.patch";
|
|
|
|
hash = "sha256-kSHnYaOxIvv7lAJnvxpSwyRDPyDxpAq9x+gJcBdU3T8=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
vendorHash = "sha256-4Yscw3QjWG1rlju6sMRHGn3dSe65b1nx10B3KeyAzBM=";
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace misc/systemd/system/deepin-shutdown-sound.service \
|
|
|
|
--replace "/usr/bin/true" "${coreutils}/bin/true"
|
|
|
|
|
|
|
|
substituteInPlace sound-theme-player/main.go \
|
|
|
|
--replace "/usr/sbin/alsactl" "alsactl"
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
substituteInPlace misc/{scripts/deepin-boot-sound.sh,systemd/system/deepin-login-sound.service} \
|
2023-04-12 12:48:02 +00:00
|
|
|
--replace "/usr/bin/dbus-send" "${dbus}/bin/dbus-send"
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
substituteInPlace lunar-calendar/huangli.go adjust-grub-theme/main.go \
|
|
|
|
--replace "/usr/share/dde-api" "$out/share/dde-api"
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
substituteInPlace themes/{theme.go,settings.go} \
|
|
|
|
--replace "/usr/share" "/run/current-system/sw/share"
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
for file in $(grep "/usr/lib/deepin-api" * -nR |awk -F: '{print $1}')
|
|
|
|
do
|
|
|
|
sed -i 's|/usr/lib/deepin-api|/run/current-system/sw/lib/deepin-api|g' $file
|
|
|
|
done
|
2023-02-22 10:55:15 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
deepin-gettext-tools
|
|
|
|
wrapQtAppsHook
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
alsa-lib
|
2024-01-02 11:29:13 +00:00
|
|
|
gtk3
|
2023-02-22 10:55:15 +00:00
|
|
|
libcanberra
|
|
|
|
libgudev
|
|
|
|
librsvg
|
|
|
|
poppler
|
|
|
|
pulseaudio
|
|
|
|
gdk-pixbuf-xlib
|
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
2024-01-02 11:29:13 +00:00
|
|
|
make GOBUILD_OPTIONS="$GOFLAGS"
|
2023-02-22 10:55:15 +00:00
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2024-01-02 11:29:13 +00:00
|
|
|
make install DESTDIR="$out" PREFIX="/"
|
2023-02-22 10:55:15 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
for binary in $out/lib/deepin-api/*; do
|
|
|
|
wrapProgram $binary "''${qtWrapperArgs[@]}"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Dbus interfaces used for screen zone detecting, thumbnail generating, sound playing, etc";
|
|
|
|
homepage = "https://github.com/linuxdeepin/dde-api";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = teams.deepin.members;
|
|
|
|
};
|
|
|
|
}
|