Skip to content

Commit

Permalink
feat(update): update to v5.11.1 (#50)
Browse files Browse the repository at this point in the history
Co-authored-by: hand7s <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yaroslav Malykh <[email protected]>
  • Loading branch information
4 people authored Feb 26, 2025
1 parent db0210f commit 65df106
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 56 deletions.
1 change: 0 additions & 1 deletion .github/dummy

This file was deleted.

14 changes: 4 additions & 10 deletions .github/workflows/treefmt.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Format Code
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
format:
Expand All @@ -17,7 +14,7 @@ jobs:
- uses: ahmadnassri/action-workflow-queue@v1
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flakehub-cache-action@main
- name: Install formatting tools
run: nix-env -f "<nixpkgs>" -iA nixfmt-rfc-style treefmt yamlfmt jsonfmt markdownlint-cli
- name: Add new branch
Expand All @@ -26,8 +23,8 @@ jobs:
uses: isbecker/treefmt-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: 'latest'
fail_on_change: 'false'
version: "latest"
fail_on_change: "false"
- name: Commit changes
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
Expand All @@ -41,7 +38,4 @@ jobs:
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master



branch: ${{ github.ref_name }}
11 changes: 8 additions & 3 deletions .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ jobs:
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
with:
pr-title: "chore(flake.lock): Update flake.lock" # Title of PR to be created
pr-title: "chore(lock): update flake lock"
pr-reviewers: s0me1newithhand7s
pr-labels: | # Labels to be set on the PR
pr-labels: |
low-prior
automated
dependencies
nixpkgs-update
pr-body: | # Body of PR to be created
This PR updates the flake.lock file using [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock).
# Flake.lock update
## Changelog
- Update flake.lock with flake at ${{ github.sha }}
token: ${{ secrets.LOCK_UPDATE }}
21 changes: 16 additions & 5 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
lib,
stdenv,
pname ? "ayugram-desktop",
unwrapped ? callPackage ./unwrapped.nix { inherit stdenv; },
qtbase,
qtimageformats,
qtsvg,
Expand All @@ -12,7 +11,14 @@
wrapQtAppsHook,
glib-networking,
webkitgtk_4_1,

withWebkit ? true,
isDebug ? false,

unwrapped ? callPackage ./unwrapped.nix {
inherit stdenv;
isDebug = isDebug;
},
}:
stdenv.mkDerivation (finalAttrs: {
inherit pname;
Expand Down Expand Up @@ -50,6 +56,7 @@ stdenv.mkDerivation (finalAttrs: {

dontUnpack = true;
dontWrapGApps = true;
dontWrapQtApps = stdenv.hostPlatform.isDarwin;

installPhase = ''
runHook preInstall
Expand All @@ -61,8 +68,12 @@ stdenv.mkDerivation (finalAttrs: {
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';

postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace $out/share/dbus-1/services/* \
--replace-fail "$unwrapped" "$out"
'';
postFixup =
lib.optionalString stdenv.hostPlatform.isDarwin ''
wrapQtApp "$out/Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS/${finalAttrs.meta.mainProgram}"
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace $out/share/dbus-1/services/* \
--replace-fail "$unwrapped" "$out"
'';
})
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
};
};
nixConfig = {
sandbox = true;
extra-substituters = [
"https://cache.garnix.io"
];
Expand All @@ -27,6 +26,7 @@
nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
] (system: function nixpkgs.legacyPackages.${system});
in
{
Expand Down
7 changes: 0 additions & 7 deletions garnix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,3 @@ builds:
# linux
- '*.x86_64-linux.*'
- '*.aarch64-linux.*'
# darwin
# - '*.x86_64-darwin.*'
# - '*.aarch64-darwin.*'
# configurations
- darwinConfigurations.*
- nixosConfigurations.*
- homeConfigurations.*
45 changes: 19 additions & 26 deletions unwrapped.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,31 @@
apple-sdk_15,
nix-update-script,
fetchpatch,
gitUpdater,
isDebug ? false,
tg_owt ? callPackage ./lib/tg_owt.nix { inherit stdenv; },
}:

stdenv.mkDerivation (finalAttrs: {
pname = "ayugram-desktop-unwrapped";
version = "5.10.3";
version = "5.11.1";

src = fetchFromGitHub {
owner = "AyuGram";
repo = "AyuGramDesktop";
rev = "v${finalAttrs.version}";

fetchSubmodules = true;
hash = "sha256-ieHIBBm97ZZ+5EK4k3QTkhrazHnhiLNXpQoQFtzn8KY=";
hash = "sha256-AiMPbcEvbyhGd1V9mg95Q+mLrBH0DqTEFpC3D9ziCy8=";
};

patches = [
./patch/cstring.patch
# Fixes linux builds
(fetchpatch {
url = "https://github.com/AyuGram/AyuGramDesktop/pull/32/commits/15287ad6ed162c209d9772fc592e959d793f63b9.patch";
hash = "sha256-3yt502TsytJtpBn8iSJySN+UAQQ23c1hYNPIFLSogVA=";
})
];

postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
Expand Down Expand Up @@ -115,24 +122,13 @@ stdenv.mkDerivation (finalAttrs: {
];

cmakeFlags = [
(lib.cmakeBool "CMAKE_EXPORT_COMPILE_COMMANDS" true)
(lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release")
(lib.cmakeFeature "CMAKE_GENERATOR" "Ninja")

(lib.cmakeBool "DESKTOP_APP_DISABLE_AUTOUPDATE" true)
(lib.cmakeBool "DESKTOP_APP_DISABLE_SCUDO" true)
(lib.cmakeBool "DESKTOP_APP_USE_GTK3" true)

(lib.cmakeBool "DESKTOP_APP_USE_PACKAGED_FONTS" false)

(lib.cmakeFeature "TDESKTOP_API_HASH" "b18441a1ff607e10a989891a5462e627")
(lib.cmakeFeature "TDESKTOP_API_ID" "2040")
];

# for cppgir to locate gir files
preBuild = ''
export GI_GIR_PATH="$XDG_DATA_DIRS"
'';
(lib.cmakeFeature "CMAKE_BUILD_TYPE" (if isDebug then "Debug" else "Release"))
];

installPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
runHook preInstall
Expand All @@ -144,23 +140,20 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';

preFixup = ''
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';

passthru = {
inherit tg_owt;
updateScript = nix-update-script { };
passthru.updateScript = gitUpdater {
rev-prefix = "v";
url = "https://github.com/AyuGram/AyuGramDesktop.git";
};

meta = with lib; {
mainProgram = "ayugram-desktop";

# inherit from AyuGramDesktop
maintainers = with maintainers; [ ];
platforms = lib.platforms.all;
broken = stdenv.isDarwin; # temporary
badPlatforms = [ stdenv.isDarwin ];
maintainers = with maintainers; [
kaeeraa
s0me1newithhand7s
];
platforms = lib.platforms.linux;
description = "Desktop Telegram client with good customization and Ghost mode.";
license = licenses.gpl3Only;
homepage = "https://ayugram.one";
Expand Down

0 comments on commit 65df106

Please sign in to comment.