mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 15:27:20 +03:00
Merge pull request #76192 from worldofpeace/pantheon-update-script
Pantheon update script
This commit is contained in:
commit
144973a7e0
@ -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 = ''
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
|
@ -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 = ''
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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/;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
|
@ -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(),
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
@ -0,0 +1 @@
|
||||
ExUnit.start()
|
@ -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;
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
|
@ -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 = ''
|
||||
|
Loading…
Reference in New Issue
Block a user