Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dorion: 5.0.1 → 6.2.0; dorion: build from source #265771

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nyabinary
Copy link
Contributor

@nyabinary nyabinary commented Nov 6, 2023

Description of changes

Build from source
Tauri patched to remove its hard-coded resource directory
Enable WebkitGTK Experimental toggle for WebRTC (To make VCs work)
Added myself to maintainer
Depends on #280554
Obligatory: #327063

Closes #360644

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Huge thanks to @lilyinstarlight this PR wouldn't be possible without her.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Nov 6, 2023
@nyabinary nyabinary force-pushed the dorion branch 3 times, most recently from 25a8866 to 3054e22 Compare November 10, 2023 01:38
Copy link
Member

@pbsds pbsds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive! Considering SpikeHD/Dorion#125 is a thing, I consider this PR a ZHF fix. #265948
Runs fine, but a bit more sluggish than the official client. Likely a tauri issue.

pkgs/by-name/do/dorion/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/do/dorion/package.nix Show resolved Hide resolved
pkgs/by-name/do/dorion/package.nix Outdated Show resolved Hide resolved
@nyabinary nyabinary changed the title dorion: 1.2.1 -> 2.1.0 dorion: 1.2.1 -> 2.2.0 Nov 10, 2023
@nyabinary nyabinary changed the title dorion: 1.2.1 -> 2.2.0 dorion: 1.2.1 -> 2.2.1 Nov 10, 2023
@nyabinary nyabinary force-pushed the dorion branch 2 times, most recently from 5c825e5 to 1fd5b9b Compare November 12, 2023 22:47
Copy link
Member

@pbsds pbsds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for appearing nitpicky, you have done an excellent job. The proposed set of substitutions IMO clearly convey their intent

pkgs/by-name/do/dorion/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/do/dorion/package.nix Outdated Show resolved Hide resolved
@nyabinary nyabinary force-pushed the dorion branch 2 times, most recently from 39c423b to 0b33e13 Compare November 13, 2023 15:50
Copy link
Member

@pbsds pbsds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to have a build failure, the proposed fix works on my end

pkgs/by-name/do/dorion/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/do/dorion/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/do/dorion/package.nix Outdated Show resolved Hide resolved
@pbsds
Copy link
Member

pbsds commented Nov 19, 2023

More build failures: unable to parse JSON Tauri config file at /build/source/src-tauri/tauri.conf.json because trailing comma at line 71 column 7

@nyabinary
Copy link
Contributor Author

More build failures: unable to parse JSON Tauri config file at /build/source/src-tauri/tauri.conf.json because trailing comma at line 71 column 7

pain
what could be causing this tho?

@nyabinary nyabinary marked this pull request as draft December 19, 2023 15:21
@wegank wegank changed the title dorion: 1.2.1 -> 2.2.1 dorion: 1.2.1 -> 2.2.1, build from source Jan 3, 2024
@nyabinary nyabinary force-pushed the dorion branch 2 times, most recently from a1ed935 to 68a67f3 Compare January 12, 2024 15:45
@nyabinary nyabinary force-pushed the dorion branch 2 times, most recently from 05ff166 to 3390773 Compare September 20, 2024 00:26
@nyabinary
Copy link
Contributor Author

Seems to run fine 👍, but the desktop entry and icons are now gone compared to the non-from-source dorion

Do you know how to fix that, can't really debug (or fix it rn) so would appreciate it if you could :3

@nyabinary
Copy link
Contributor Author

@pbsds
Copy link
Member

pbsds commented Sep 23, 2024

postInstall i reckon :)

@Anomalocaridid
Copy link
Contributor

Dorion updated a few times since this PR was made. Its latest version is v6.1.0 and it has also started using Tauri v2 (since v6.0.0), which lets it take advantage of webkitgtk compiled with webrtc support.

Also, would it be possible to override Dorion's webkitgtk dependency to be compiled with experimental features so it can support webrtc?

@nyabinary nyabinary force-pushed the dorion branch 2 times, most recently from ba533da to 076a860 Compare October 6, 2024 16:13
@nyabinary nyabinary changed the title dorion: build from source dorion: 5.0.1 → 5.1.0; dorion: build from source Oct 6, 2024
@nyabinary
Copy link
Contributor Author

There is a permission error now that I can't seem to solve if anyone wants to chip in :P

@nyabinary nyabinary marked this pull request as draft October 14, 2024 20:49
@nyabinary nyabinary force-pushed the dorion branch 3 times, most recently from f3d7371 to a78c369 Compare October 14, 2024 23:56
@nyabinary nyabinary changed the title dorion: 5.0.1 → 5.1.0; dorion: build from source dorion: 5.0.1 → 5.2.0; dorion: build from source Oct 15, 2024
Copy link
Member

@getchoo getchoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR: Try moving this to cargo-tauri.hook. It should make some things here much easier

libappindicator
libayatana-appindicator
];
frontend = stdenv.mkDerivation {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't recommend splitting this derivation. In most cases, it's much easier to pull pnpmDeps, pnpm.configHook, etc., into the main derivation and let cargo-tauri build as intended. You can see an example of this in the test app

Comment on lines 108 to 93
runtimeDependencies = [
libappindicator
libayatana-appindicator
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tauri apps will only use one or the other, so there's no need to have both of these. I believe the upstream recommendation is libayatana-appindicator

We also shouldn't be using patchelf here at all as we are compiling from source. Instead, we can patch the crate to use the proper path like this

Comment on lines 120 to 121
.build.beforeBuildCommand = "" |
.build.frontendDist = "src" |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.build.beforeBuildCommand = "" |
.build.frontendDist = "src" |

These should be able to be removed when using cargo-tauri.hook

Comment on lines 132 to 138
postInstall = ''
mkdir -p $out/lib/dorion
cp -r {injection,html} $out/lib/dorion
install -Dm644 "$out/share/icons/hicolor/32x32/apps/dorion.png" "./${src.name}/src-tauri/icons/32x32icon.png"
install -Dm644 "$out/share/icons/hicolor/128x128/apps/dorion.png" "./${src.name}/src-tauri/icons/128x128.png"
install -Dm644 "$out/share/icons/hicolor/256x256/apps/dorion.png" "./${src.name}/src-tauri/icons/[email protected]"
install -Dm644 "$out/share/icons/hicolor/512x512/apps/dorion.png" "./${src.name}/src-tauri/icons/icon.png"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment on lines 141 to 165
desktopItems = [
(makeDesktopItem {
name = "dorion";
genericName = "Internet Messenger";
desktopName = "Dorion";
exec = "dorion %U";
tryExec = "dorion %U";
icon = "dorion";
comment = "Tiny alternative Discord client";
keywords = [
"discord"
"vencord"
"tauri"
"chat"
];
categories = [
"Network"
"InstantMessaging"
"Chat"
];
mimeTypes = [ "x-scheme-handler/discord" ];
startupWMClass = "Dorion";
terminal = false;
})
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto -- though, you may still want to final one as Tauri's generated .desktop files may be lacking in metainfo. See

postInstall =
lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p "$out"/bin
mv "$out"/Applications/Modrinth\ App.app/Contents/MacOS/Modrinth\ App "$out"/bin/modrinth-app
ln -s "$out"/bin/modrinth-app "$out"/Applications/Modrinth\ App.app/Contents/MacOS/Modrinth\ App
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
desktop-file-edit \
--set-comment "Modrinth's game launcher" \
--set-key="StartupNotify" --set-value="true" \
--set-key="Categories" --set-value="Game;ActionGame;AdventureGame;Simulation;" \
--set-key="Keywords" --set-value="game;minecraft;mc;" \
--set-key="StartupWMClass" --set-value="ModrinthApp" \
$out/share/applications/modrinth-app.desktop
'';
for example

@nyabinary
Copy link
Contributor Author

nyabinary commented Nov 17, 2024

TL;DR: Try moving this to cargo-tauri.hook. It should make some things here much easier

I thought that supported only Tauri v1? Dorion is using Tauri v2 currently.

EDIT: Nvm, saw V2 support got merged recently.

@nyabinary
Copy link
Contributor Author

nyabinary commented Nov 18, 2024

Def doing something wrong, but what me and @griffi-gh has so far :3

@ofborg ofborg bot requested a review from griffi-gh November 18, 2024 16:41
Comment on lines +91 to +93
runtimeDependencies = [
libayatana-appindicator
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
runtimeDependencies = [
libayatana-appindicator
];

gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
webkitgtk_4_0
glib-networking
libayatana-appindicator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libayatana-appindicator

];

buildInputs = [
glib-networking
openssl
webkitgtk_4_1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these dependencies should be optional if this app supports both Linux and Darwin

wrapGAppsHook3
yq-go
desktop-file-utils
copyDesktopItems
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
copyDesktopItems

No longer needed since we're editing the generated file

maintainers = with lib.maintainers; [
nyabinary
aleksana
griffi-gh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
griffi-gh
griffi-gh
getchoo

Feel free to add me as well. I like this as an edge case for cargo-tauri.hook

@getchoo getchoo added the backport release-24.11 Backport PR automatically label Nov 19, 2024
@Aleksanaa Aleksanaa changed the title dorion: 5.0.1 → 5.2.0; dorion: build from source dorion: 5.0.1 → 6.2.0; dorion: build from source Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 11.by: package-maintainer This PR was created by the maintainer of the package it changes backport release-24.11 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update request: dorion 5.0.1 → 6.2.0