Skip to content

Commit

Permalink
release v5.8.6 (#40)
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 Jan 5, 2025
1 parent 79a2720 commit 6bb0d9a
Show file tree
Hide file tree
Showing 10 changed files with 260 additions and 173 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/treefmt.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,46 @@
name: Format Code
on: [push, pull_request]
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
format:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ahmadnassri/action-workflow-queue@v1
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-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
run: git checkout -b treefmt-code
- name: Run treefmt
uses: isbecker/treefmt-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: 'latest'
fail_on_change: 'false'
- name: Commit changes
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
if ! git diff --quiet; then
git add .
git commit -m "refactor(*): automated formatting"
fi
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master



12 changes: 9 additions & 3 deletions .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ name: update-flake-lock
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
- cron: "0 0 * * 0" # runs weekly on Sunday at 00:00
jobs:
lockfile:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -19,8 +20,13 @@ jobs:
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
with:
pr-title: "Update flake.lock" # Title of PR to be created
pr-reviewers: kaeeraa,s0me1newithhand7s
pr-title: "chore(flake.lock): Update flake.lock" # Title of PR to be created
pr-reviewers: s0me1newithhand7s
pr-labels: | # Labels to be set on the PR
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).
token: ${{ secrets.LOCK_UPDATE }}
6 changes: 3 additions & 3 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"default": true,
"MD033": false,
"MD013": false
"default": true,
"MD033": false,
"MD013": false
}
56 changes: 31 additions & 25 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
lib,
fetchFromGitHub,
fetchpatch,
callPackage,
pkg-config,
cmake,
Expand Down Expand Up @@ -30,7 +31,7 @@
range-v3,
tl-expected,
hunspell,
webkitgtk_6_0,
webkitgtk_4_1,
jemalloc,
rnnoise,
protobuf,
Expand Down Expand Up @@ -62,7 +63,6 @@
sources ? import ./nix/sources.nix,
system ? builtins.currentSystem,
}:

let
tg_owt = callPackage ./lib/tg_owt.nix {
inherit stdenv; # oh no, stdenv
Expand All @@ -72,42 +72,44 @@ let
in
stdenv.mkDerivation (finalAttrs: {
pname = "ayugram-desktop";
version = "5.6.3";
version = "5.8.3";

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

fetchSubmodules = true;
hash = "sha256-Hon5qVJeQF/6y55lVKB0O87Du+DvCUYVdMjibgU0YM4=";
hash = "sha256-bgfqYI77kxHmFZB6LCdLzeIFv6bfsXXJrrkbz5MD6Q0=";
};

patches =
[ ./patch/desktop.patch ]
[
./patch/cstring.patch
(fetchpatch {
url = "https://github.com/AyuGram/AyuGramDesktop/commit/8847034217487d992cd070c0ab791baa213b4141.patch";
hash = "sha256-8q+K06wmG6TuBRomDSS9zWuM3PYQfMHpmIokw+bC3EY=";
})
]
++ lib.optionals stdenv.isDarwin [
./patch/macos.patch
./patch/macos-opengl.patch
];

postPatch =
lib.optionalString stdenv.isLinux ''
for file in \
Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp \
Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp \
Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp \
Telegram/lib_webview/webview/platform/linux/webview_linux_webkitgtk_library.cpp
do
substituteInPlace "$file" \
--replace '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"' \
--replace '"libpulse.so.0"' '"${libpulseaudio}/lib/libpulse.so.0"' \
--replace '"libwebkitgtk-6.0.so.4"' '"${webkitgtk_6_0}/lib/libwebkitgtk-6.0.so.4"'
done
''
+ lib.optionalString stdenv.isDarwin ''
substituteInPlace Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm \
--replace kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster
'';
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp \
--replace-fail '"libasound.so.2"' '"${lib.getLib alsa-lib}/lib/libasound.so.2"'
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp \
--replace-fail '"libasound.so.2"' '"${lib.getLib alsa-lib}/lib/libasound.so.2"'
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp \
--replace-fail '"libpulse.so.0"' '"${lib.getLib libpulseaudio}/lib/libpulse.so.0"'
'';

qtWrapperArgs = lib.optionals stdenv.hostPlatform.isLinux [
"--prefix"
"LD_LIBRARY_PATH"
":"
(lib.makeLibraryPath [ webkitgtk_4_1 ])
];

# We want to run wrapProgram manually (with additional parameters)
dontWrapGApps = true;
Expand Down Expand Up @@ -172,7 +174,7 @@ stdenv.mkDerivation (finalAttrs: {
libpulseaudio
pipewire
hunspell
webkitgtk_6_0
webkitgtk_4_1
jemalloc
tg_owt
glib
Expand Down Expand Up @@ -254,6 +256,10 @@ stdenv.mkDerivation (finalAttrs: {
ln -s $out/Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS/${finalAttrs.meta.mainProgram} $out/bin/${finalAttrs.meta.mainProgram}
'';

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

# This is necessary to run Telegram in a pure environment.
# We also use gappsWrapperArgs from wrapGAppsHook.
postFixup =
Expand Down
31 changes: 18 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
url = "github:nixos/nixpkgs/nixos-unstable";
};
};
nixConfig = {
sandbox = true;
extra-substituters = [
"https://cache.garnix.io"
];
extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
};
outputs =
{
self,
Expand All @@ -21,28 +30,24 @@
] (system: function nixpkgs.legacyPackages.${system});
in
{
overlays.ayugaram-desktop = (
final: _prev: {
ayugram-desktop = self.packages;
}
);

nixosModules = {
default = self.nixosModules;
ayugram-desktop = self.overlays;
default = self.overlays;
};

homeManagerModules = {
default = self.nixosModules;
ayugram-desktop = self.overlays;
default = self.overlays;
};

packages = forAllSystems (pkgs: {
ayugram-desktop = pkgs.libsForQt5.callPackage ./default.nix { };
});

nixConfig = {
sandbox = nixpkgs.stdenv.isLinux;
extra-substituters = [
"https://cache.garnix.io"
];
extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
};
};

}
24 changes: 12 additions & 12 deletions nix/sources.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"nixpkgs": {
"branch": "master",
"description": "Nix Packages collection & NixOS",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5785b6bb5eaae44e627d541023034e1601455827",
"sha256": "19zq0d0n2j47kqg8i3wana4vqv5xn5qvvm5bv7wh3fp4yd8x7r18",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5785b6bb5eaae44e627d541023034e1601455827.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
"nixpkgs": {
"branch": "master",
"description": "Nix Packages collection & NixOS",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5785b6bb5eaae44e627d541023034e1601455827",
"sha256": "19zq0d0n2j47kqg8i3wana4vqv5xn5qvvm5bv7wh3fp4yd8x7r18",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5785b6bb5eaae44e627d541023034e1601455827.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
Loading

0 comments on commit 6bb0d9a

Please sign in to comment.