Merge pull request #76192 from worldofpeace/pantheon-update-script

Pantheon update script
This commit is contained in:
worldofpeace 2019-12-22 18:56:13 -05:00 committed by GitHub
commit 144973a7e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 241 additions and 18 deletions

View File

@ -58,6 +58,13 @@ stdenv.mkDerivation rec {
webkitgtk
];
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "The podcast client for the modern free desktop";
longDescription = ''

View File

@ -39,6 +39,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Focus on your writing - designed for elementary OS";
homepage = https://github.com/lainsce/quilter;

View File

@ -63,6 +63,13 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Find the most beautiful wallpapers for your desktop";
homepage = https://github.com/calo001/fondo;

View File

@ -50,6 +50,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Insert emoji anywhere, even in non-native apps - designed for elementary OS";
homepage = https://github.com/cassidyjames/ideogram;

View File

@ -50,6 +50,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Edit the Pantheon desktop application menu";
homepage = https://github.com/donadigo/appeditor;

View File

@ -48,6 +48,12 @@ stdenv.mkDerivation rec {
patchShebangs post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "A simple application for encoding and decoding text, designed for elementary OS";
homepage = "https://github.com/arshubham/cipher";

View File

@ -61,6 +61,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "A simple formatter designed for elementary OS";
homepage = "https://github.com/Djaler/Formatter";

View File

@ -34,6 +34,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Stupidly-simple sticky notes applet";
homepage = https://github.com/lainsce/notejot;

View File

@ -29,6 +29,12 @@ in stdenv.mkDerivation rec {
patchShebangs build-aux/meson_post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Friendly SQL Client";
longDescription = ''

View File

@ -62,6 +62,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Simple Mastodon client designed for elementary OS";
homepage = https://github.com/bleakgrey/tootle;

View File

@ -54,6 +54,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "The always-incognito web browser";
homepage = https://github.com/cassidyjames/ephemeral;

View File

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, vala, gettext, python3
, appstream-glib, desktop-file-utils, wrapGAppsHook, gnome-online-accounts, fetchpatch
, gtk3, libgee, libpeas, librest, webkitgtk, gsettings-desktop-schemas
, gtk3, libgee, libpeas, librest, webkitgtk, gsettings-desktop-schemas, pantheon
, curl, glib, gnome3, gst_all_1, json-glib, libnotify, libsecret, sqlite, gumbo, libxml2
}:
@ -40,6 +40,12 @@ stdenv.mkDerivation rec {
})
];
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "A modern desktop application designed to complement existing web-based RSS accounts";
homepage = https://jangernert.github.io/FeedReader/;

View File

@ -35,6 +35,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "The FTP Client that drives you anywhere";
homepage = https://github.com/Alecaddd/taxi;

View File

@ -50,6 +50,12 @@ stdenv.mkDerivation rec {
pantheon.granite
];
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Download torrents in style with this speedy, minimalist torrent client for elementary OS";
homepage = https://github.com/davidmhewitt/torrential;

View File

@ -49,6 +49,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "A helpful tool that lets you debug what part of your API is causing you issues";
homepage = https://github.com/jeremyvaartjes/ping;

View File

@ -46,6 +46,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "The simplest PDF viewer around";
homepage = https://github.com/lainsce/aesop;

View File

@ -64,6 +64,12 @@ stdenv.mkDerivation rec {
patchShebangs data/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Personal finance manager for elementary OS";
homepage = "https://github.com/cjfloss/envelope";

View File

@ -50,6 +50,12 @@ stdenv.mkDerivation rec {
# Whether to build with contractor support (Pantheon specific)
cmakeFlags = if withPantheon then null else [ "-Dnoele=yes" ];
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Markdown notes editor and manager designed for elementary OS"
+ stdenv.lib.optionalString withPantheon " - built with Contractor support";

View File

@ -60,6 +60,12 @@ stdenv.mkDerivation rec {
})
];
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Create simple and beautiful presentations";
homepage = https://github.com/Philip-Scott/Spice-up;

View File

@ -47,6 +47,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Plot out your own timetable for the week and organize it";
homepage = "https://github.com/lainsce/timetable";

View File

@ -1,4 +1,4 @@
{ mkDerivation, lib, fetchFromGitHub, cmake, ninja, qtbase }:
{ mkDerivation, lib, fetchFromGitHub, cmake, ninja, qtbase, pantheon }:
mkDerivation rec {
pname = "adwaita-qt";
@ -26,6 +26,12 @@ mkDerivation rec {
--replace "DESTINATION \"\''${QT_PLUGINS_DIR}/styles" "DESTINATION \"$qtPluginPrefix/styles"
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with lib; {
description = "A style to bend Qt applications to look like they belong into GNOME Shell";
homepage = https://github.com/FedoraQt/adwaita-qt;

View File

@ -3,15 +3,9 @@ defmodule NixpkgsGitHubUpdate.GitHubLatestVersion do
def fetch({owner, repo}) do
endpoint = releases_endpoint(owner, repo)
headers = construct_headers()
oauth_token = String.to_charlist("#{System.get_env("OAUTH_TOKEN")}")
headers = %{
'User-Agent' => @user_agent,
'Authorization' => 'token #{oauth_token}'
}
:httpc.request(:get, {endpoint, Map.to_list(headers)}, [], [])
:httpc.request(:get, {endpoint, headers}, [], [])
|> handle_response
end
@ -19,6 +13,23 @@ defmodule NixpkgsGitHubUpdate.GitHubLatestVersion do
'https://api.github.com/repos/#{owner}/#{repo}/releases/latest'
end
def construct_headers do
headers = %{'User-Agent' => @user_agent}
put_token(headers, get_token())
|> Map.to_list
end
defp get_token do
String.to_charlist("#{System.get_env("OAUTH_TOKEN")}")
end
defp put_token(headers, token) when is_binary(token) do
Map.put_new(headers, 'Authorization', 'token #{token}')
end
defp put_token(headers, _), do: headers
def handle_response({_, {{_httpv, status_code, _}, _headers, response}}) do
{
status_code |> check_for_error(),

View File

@ -2,7 +2,7 @@ defmodule NixpkgsGitHubUpdate.Nix do
def executable do
nix = System.find_executable("nix")
if nil === nix do
if nix == nil do
raise RuntimeError, message: "missing executable for 'nix'"
end
@ -22,19 +22,29 @@ defmodule NixpkgsGitHubUpdate.Nix do
|> handle_eval
end
def handle_eval({eval_result, 0}) do
defp handle_eval({eval_result, 0}) do
case eval_result do
"" -> eval_result
_ -> Poison.Parser.parse!(eval_result, %{})
end
end
def handle_eval({eval_result, _}) do
IO.puts("Error running nix eval: #{eval_result}")
defp handle_eval({eval_result, _}) do
raise RuntimeError, message: "Error running nix eval: #{eval_result}"
end
def attribute_exists?(attribute) do
eval!("(with import <nixpkgs> {}; lib.isDerivation #{attribute})")
attr_exist_expression = """
with import <nixpkgs> {};
let
attrSet = pkgs.lib.attrByPath (pkgs.lib.splitString "." "#{attribute}") null pkgs;
in
if attrSet == null then false
else true
"""
eval!("(#{attr_exist_expression})")
end
def update_source_version(attribute, version) do
@ -45,9 +55,9 @@ defmodule NixpkgsGitHubUpdate.Nix do
end
def get_url_attr(attribute) do
case eval!("nixpkgs.#{attribute}.src.fetchSubmodules") do
case attribute_exists?("#{attribute}.src.fetchSubmodules") do
true -> "url"
_ -> "urls"
false -> "urls"
end
end

View File

@ -0,0 +1,49 @@
defmodule NixTest do
@fake_package "asanotehhhuh"
@fetchgit_package "polybar"
@fetchgithub_package "notes-up"
use ExUnit.Case
import NixpkgsGitHubUpdate.Nix
def check_for_nix(_context) do
try do
executable()
rescue
RuntimeError ->
IO.puts("You need Nix installed to run these tests.")
System.halt(127)
end
:ok
end
setup_all :check_for_nix
describe "evaluation tests" do
test "evaluation handling" do
exists_attr = "nixpkgs.#{@fetchgithub_package}"
assert is_binary(eval!(exists_attr)) == true
catch_error(eval!(@fake_package) == 1)
end
# This should always be true or false
test "package exists?" do
assert attribute_exists?(@fetchgithub_package) == true
assert attribute_exists?(@fake_package) == false
end
end
test "owner repo" do
assert get_url_attr(@fetchgit_package) == "url"
assert get_url_attr(@fetchgithub_package) == "urls"
assert get_owner_repo(@fetchgit_package) ==
{@fetchgit_package, @fetchgit_package}
assert get_owner_repo(@fetchgithub_package) ==
{"Philip-Scott", String.capitalize(@fetchgithub_package)}
end
end

View File

@ -0,0 +1 @@
ExUnit.start()

View File

@ -1,4 +1,4 @@
{ mkDerivation, lib, fetchFromGitHub, pkgconfig, gtk3, qtbase, qmake, qtx11extras }:
{ mkDerivation, lib, fetchFromGitHub, pkgconfig, gtk3, qtbase, qmake, qtx11extras, pantheon }:
mkDerivation rec {
pname = "qgnomeplatform";
@ -30,6 +30,12 @@ mkDerivation rec {
--replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix"
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with lib; {
description = "QPlatformTheme for a better Qt application inclusion in GNOME";
homepage = https://github.com/FedoraQt/QGnomePlatform;

View File

@ -64,6 +64,12 @@ stdenv.mkDerivation rec {
${glib.dev}/bin/glib-compile-schemas $out/share/glib-2.0/schemas
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
homepage = https://github.com/the-cavalry/light-locker;
description = "A simple session-locker for LightDM";

View File

@ -33,6 +33,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "A simple app for checking usual checksums - Designed for elementary OS";
homepage = https://github.com/artemanufrij/hashit;

View File

@ -64,6 +64,12 @@ stdenv.mkDerivation rec {
patchShebangs meson/post_install.py
'';
passthru = {
updateScript = pantheon.updateScript {
attrPath = pname;
};
};
meta = with stdenv.lib; {
description = "Your little expandable text snippet helper";
longDescription = ''