3
0
Fork 0
forked from mirrors/nixpkgs

deepin: redefine updateScript to use genericUpdater

This commit is contained in:
José Romildo Malaquias 2020-05-03 17:03:55 -03:00
parent 6783884389
commit 593c6247ab
46 changed files with 52 additions and 85 deletions

View file

@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
sed -i -e 's:/share/gocode:/share/go:' Makefile
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Generates static DBus bindings for Golang and QML at build-time";

View file

@ -119,7 +119,7 @@ buildGoPackage rec {
searchHardCodedPaths $out # debugging
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Go-lang bindings for dde-daemon";

View file

@ -45,7 +45,7 @@ mkDerivation rec {
-e "s,/usr/bin/deepin-desktop-ts-convert,deepin-desktop-ts-convert,"
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Calendar for Deepin Desktop Environment";

View file

@ -138,7 +138,7 @@ mkDerivation rec {
searchHardCodedPaths $out
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Control panel of Deepin Desktop Environment";

View file

@ -151,7 +151,7 @@ buildGoPackage rec {
searchHardCodedPaths $out # debugging
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Daemon for handling Deepin Desktop Environment session settings";

View file

@ -96,7 +96,7 @@ let
searchHardCodedPaths $out
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Dock for Deepin Desktop Environment";

View file

@ -286,7 +286,7 @@ mkDerivation rec {
searchHardCodedPaths $out
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "File manager and desktop module for Deepin Desktop Environment";

View file

@ -130,7 +130,7 @@ mkDerivation rec {
enableParallelBuilding = true;
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "KWin configuration for Deepin Desktop Environment";

View file

@ -89,7 +89,7 @@ mkDerivation rec {
searchHardCodedPaths $out
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Deepin Desktop Environment launcher module";

View file

@ -51,7 +51,7 @@ mkDerivation rec {
searchHardCodedPaths $out # for debugging
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Deepin network utils";

View file

@ -48,7 +48,7 @@ mkDerivation rec {
searchHardCodedPaths $out
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "PolicyKit agent for Deepin Desktop Environment";

View file

@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Qt DBus interface library for Deepin software";

View file

@ -145,7 +145,7 @@ mkDerivation rec {
searchHardCodedPaths $out # debugging
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Deepin desktop-environment - Session UI module";

View file

@ -70,7 +70,7 @@ mkDerivation rec {
searchHardCodedPaths $modsrc # for debugging
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Deepin file search tool";

View file

@ -45,7 +45,7 @@ mkDerivation rec {
searchHardCodedPaths $out # debugging
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Easy to use calculator for Deepin Desktop Environment";

View file

@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
ln -s ../lib/deepin/desktop-version $out/etc/deepin-version
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Base assets and definitions for Deepin Desktop Environment";

View file

@ -67,7 +67,7 @@ stdenv.mkDerivation rec {
searchHardCodedPaths $out
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "GSettings deepin desktop-wide schemas";

View file

@ -13,7 +13,6 @@
}:
stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "deepin-editor";
version = "1.2.9.1";
@ -61,7 +60,7 @@ stdenv.mkDerivation rec {
searchHardCodedPaths $out # debugging
'';
passthru.updateScript = deepin.updateScript { inherit name; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Simple editor for Deepin Desktop Environment";

View file

@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/deepin-desktop-ts-convert --set PERL5LIB $PERL5LIB
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Deepin Internationalization utilities";

View file

@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
"PREFIX=${placeholder "out"}"
];
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Deepin GTK Theme";

View file

@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
cp -a ./Sea ./usr/share/icons/hicolor "$out"/share/icons/
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Icons for the Deepin Desktop Environment";

View file

@ -53,7 +53,7 @@ mkDerivation rec {
-e "s,\$\$\[QT_INSTALL_PLUGINS\],$out/$qtPluginPrefix,"
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Image Viewer for Deepin Desktop Environment";

View file

@ -42,7 +42,7 @@ mkDerivation rec {
enableParallelBuilding = true;
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Deepin menu service";

View file

@ -73,7 +73,7 @@ mkDerivation rec {
--replace "Exec=deepin-movie" "Exec=$out/bin/deepin-movie"
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Deepin movie player";

View file

@ -61,7 +61,7 @@ mkDerivation rec {
searchHardCodedPaths $out
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Easy-to-use screenshot tool for Deepin Desktop Environment";

View file

@ -33,7 +33,7 @@ mkDerivation rec {
enableParallelBuilding = true;
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Pop-up shortcut viewer for Deepin applications";

View file

@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
"PREFIX=${placeholder "out"}"
];
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Deepin sound theme";

View file

@ -100,7 +100,7 @@ stdenv.mkDerivation rec {
"-DVERSION=${version}"
];
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Default terminal emulator for Deepin";

View file

@ -38,7 +38,7 @@ mkDerivation rec {
searchHardCodedPaths $out # for debugging
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "A daemon that helps to launch applications faster";

View file

@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
$out/var/cache/image-blur/$(echo -n $out/share/backgrounds/deepin/desktop.jpg | md5sum | cut -d " " -f 1).jpg
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Wallpapers for Deepin Desktop Environment";

View file

@ -3,7 +3,14 @@ let
packages = self: with self; {
setupHook = ./setup-hook.sh;
updateScript = callPackage ./update.nix { };
# Update script tailored to deepin packages from git repository
updateScript = { pname, version, src }:
pkgs.genericUpdater {
inherit pname version;
attrPath = "deepin.${pname}";
versionLister = "${pkgs.common-updater-scripts}/bin/list-git-tags ${src.meta.homepage}";
ignoredVersions = "^2014(\\.|rc)|^v[0-9]+";
};
dbus-factory = callPackage ./dbus-factory { };
dde-api = callPackage ./dde-api { };

View file

@ -37,7 +37,7 @@ mkDerivation rec {
libdisomaster/libdisomaster.pro
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "A libisoburn wrapper for Qt";

View file

@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
fixPath $out /usr dpa-ext-gnomekeyring.pro gnomekeyringextention.cpp
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "GNOME keyring extension for dde-polkit-agent";

View file

@ -51,7 +51,7 @@ mkDerivation rec {
enableParallelBuilding = true;
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Deepin tool kit core library";

View file

@ -53,7 +53,7 @@ mkDerivation rec {
enableParallelBuilding = true;
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Deepin graphical user interface library";

View file

@ -46,7 +46,7 @@ mkDerivation rec {
"LIB_INSTALL_DIR=${outRef}/lib"
];
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Deepin graphical user interface library";

View file

@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
sed -i -e 's:/share/gocode:/share/go:' Makefile
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "GoLang DBus factory for the Deepin Desktop Environment";

View file

@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
"GOCACHE=$(TMPDIR)/go-cache"
];
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Convert dbus interfaces to go-lang or qml wrapper code";

View file

@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
"GOCACHE=$(TMPDIR)/go-cache"
];
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Generate static golang bindings for GObject";

View file

@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
rm -r $out/share/go/src/pkg.deepin.io/lib/debian
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Go bindings for Deepin Desktop Environment development";

View file

@ -114,7 +114,7 @@ mkDerivation rec {
searchHardCodedPaths $out
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version; src = (builtins.head srcs); };
meta = with stdenv.lib; {
description = "Qt5 binding of Chromium Embedded Framework";

View file

@ -53,7 +53,7 @@ mkDerivation rec {
enableParallelBuilding = true;
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version; src = (builtins.head srcs); };
meta = with stdenv.lib; {
description = "Qt platform theme integration plugin for DDE";

View file

@ -53,7 +53,7 @@ mkDerivation rec {
enableParallelBuilding = true;
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "Qt platform theme integration plugins for DDE";

View file

@ -37,7 +37,6 @@
}:
buildGoPackage rec {
name = "${pname}-${version}";
pname = "startdde";
version = "5.0.1";
@ -152,7 +151,7 @@ buildGoPackage rec {
'';
passthru = {
updateScript = deepin.updateScript { inherit name; };
updateScript = deepin.updateScript { inherit pname version src; };
providedSessions = [ "deepin" ];
};

View file

@ -34,7 +34,7 @@ mkDerivation rec {
searchHardCodedPaths $out
'';
passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };
passthru.updateScript = deepin.updateScript { inherit pname version src; };
meta = with stdenv.lib; {
description = "UDisks2 D-Bus interfaces binding for Qt5";

View file

@ -1,38 +0,0 @@
{ stdenv, lib, writeScript, coreutils, curl, gnugrep, gnused, jq, common-updater-scripts, nix }:
{ name, ignored-versions ? "^2014(\\.|rc)|^v[0-9]+" }:
let
nameAndVersion = builtins.parseDrvName name;
packageVersion = nameAndVersion.version;
packageName = nameAndVersion.name;
attrPath = "deepin.${packageName}";
in
writeScript "update-${packageName}" ''
#!${stdenv.shell}
set -o errexit
set -x
# search for the latest version of the package on github
PATH=${lib.makeBinPath [ common-updater-scripts coreutils curl gnugrep gnused jq ]}
tags=$(curl -s https://api.github.com/repos/linuxdeepin/${packageName}/tags)
tags=$(echo "$tags" | jq -r '.[] | .name')
echo "# ${name}" >> git-commits.txt
echo "# available tags:" >> git-commits.txt
echo "$tags" | ${gnused}/bin/sed -e 's/^/# /' >> git-commits.txt
if [ -n "${ignored-versions}" ]; then
tags=$(echo "$tags" | grep -vE "${ignored-versions}")
fi
latest_tag=$(echo "$tags" | sort --version-sort | tail -1)
# generate commands to commit the changes
if [ "${packageVersion}" != "$latest_tag" ]; then
pfile=$(EDITOR=echo ${nix}/bin/nix edit -f. ${attrPath})
echo " git add $pfile " >> git-commits.txt
echo " git commit -m \"${attrPath}: ${packageVersion} -> $latest_tag\"" >> git-commits.txt
fi
# update the nix expression
update-source-version "${attrPath}" "$latest_tag"
echo "" >> git-commits.txt
''