mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 12:15:34 +03:00
dorion: 5.0.1 → 6.7.1; dorion: build from source (#265771)
This commit is contained in:
commit
dfa2b3813e
2 changed files with 195 additions and 37 deletions
31
pkgs/by-name/do/dorion/no-cargo-patch.patch
Normal file
31
pkgs/by-name/do/dorion/no-cargo-patch.patch
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
|
||||||
|
index 13a6b54..f6bd9d6 100644
|
||||||
|
--- a/src-tauri/Cargo.lock
|
||||||
|
+++ b/src-tauri/Cargo.lock
|
||||||
|
@@ -5049,6 +5049,8 @@ dependencies = [
|
||||||
|
[[package]]
|
||||||
|
name = "tauri-plugin-shell"
|
||||||
|
version = "2.2.1"
|
||||||
|
+source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
+checksum = "69d5eb3368b959937ad2aeaf6ef9a8f5d11e01ffe03629d3530707bbcb27ff5d"
|
||||||
|
dependencies = [
|
||||||
|
"encoding_rs",
|
||||||
|
"log",
|
||||||
|
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
|
||||||
|
index 4dcaa86..daef086 100644
|
||||||
|
--- a/src-tauri/Cargo.toml
|
||||||
|
+++ b/src-tauri/Cargo.toml
|
||||||
|
@@ -12,13 +12,6 @@ rust-version = "1.84.1"
|
||||||
|
strip = "debuginfo"
|
||||||
|
lto = false
|
||||||
|
|
||||||
|
-# Patches
|
||||||
|
-[package.metadata.patch]
|
||||||
|
-crates = ["tauri-plugin-shell"]
|
||||||
|
-
|
||||||
|
-[patch.crates-io]
|
||||||
|
-tauri-plugin-shell = { path="./target/patch/tauri-plugin-shell-2.2.1" }
|
||||||
|
-
|
||||||
|
[build-dependencies]
|
||||||
|
tauri-build = { version = "2.0.0", features = [] }
|
||||||
|
|
|
@ -1,66 +1,193 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
stdenv,
|
fetchFromGitHub,
|
||||||
fetchurl,
|
fetchurl,
|
||||||
autoPatchelfHook,
|
rustPlatform,
|
||||||
dpkg,
|
cmake,
|
||||||
|
ninja,
|
||||||
|
wrapGAppsHook4,
|
||||||
glib-networking,
|
glib-networking,
|
||||||
gst_all_1,
|
gst_all_1,
|
||||||
libappindicator,
|
libsysprof-capture,
|
||||||
libayatana-appindicator,
|
libayatana-appindicator,
|
||||||
webkitgtk_4_0,
|
nodejs,
|
||||||
wrapGAppsHook3,
|
openssl,
|
||||||
|
pkg-config,
|
||||||
|
yq-go,
|
||||||
|
pnpm_9,
|
||||||
|
webkitgtk_4_1,
|
||||||
|
cargo-tauri,
|
||||||
|
desktop-file-utils,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
let
|
||||||
pname = "dorion";
|
webkitgtk_4_1' = webkitgtk_4_1.override {
|
||||||
version = "5.0.1";
|
enableExperimental = true;
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://github.com/SpikeHD/Dorion/releases/download/v${finalAttrs.version}/Dorion_${finalAttrs.version}_amd64.deb";
|
|
||||||
hash = "sha256-cCZikTZ+IU3mq/FkJfeggXLyWIsWG+a2qu1GbgW93WQ=";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
unpackCmd = ''
|
shelter = fetchurl {
|
||||||
dpkg -X $curSrc .
|
url = "https://raw.githubusercontent.com/uwu/shelter-builds/fab6f100bd0ab8583d67f792f66722a7d2a14bd1/shelter.js";
|
||||||
'';
|
hash = "sha256-d9vaKLrl8RYNcHnE1iGN49ov6U/Y+9XpEsio+c1Sguc=";
|
||||||
|
meta = {
|
||||||
|
homepage = "https://github.com/uwu/shelter";
|
||||||
|
sourceProvenance = [ lib.sourceTypes.binaryBytecode ]; # actually, minified JS
|
||||||
|
license = lib.licenses.cc0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
|
||||||
runtimeDependencies = [
|
rustPlatform.buildRustPackage (finalAttrs: {
|
||||||
glib-networking
|
pname = "dorion";
|
||||||
libappindicator
|
version = "6.7.1";
|
||||||
libayatana-appindicator
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "SpikeHD";
|
||||||
|
repo = "Dorion";
|
||||||
|
tag = "v${finalAttrs.version}";
|
||||||
|
hash = "sha256-d4G3royqhz+te5wPWVLNqqG/w0qOvTd7dKcWSzxUMUo=";
|
||||||
|
};
|
||||||
|
|
||||||
|
cargoPatches = [
|
||||||
|
./no-cargo-patch.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
cargoRoot = "src-tauri";
|
||||||
|
buildAndTestSubdir = finalAttrs.cargoRoot;
|
||||||
|
|
||||||
|
useFetchCargoVendor = true;
|
||||||
|
cargoHash = "sha256-1xpAJkS31DjrZCY5WJ4/Z1t1ALED5gz7xYLhVR1Qzww=";
|
||||||
|
|
||||||
|
pnpmDeps = pnpm_9.fetchDeps {
|
||||||
|
inherit (finalAttrs) pname version src;
|
||||||
|
hash = "sha256-xBonUzA4+1zbViEsKap6CaG6ZRldW1LjNYIB+FmVRFs=";
|
||||||
|
};
|
||||||
|
|
||||||
|
# CMake (webkit extension)
|
||||||
|
cmakeDir = ".";
|
||||||
|
cmakeBuildDir = "src-tauri/extension_webkit";
|
||||||
|
dontUseCmakeConfigure = true;
|
||||||
|
dontUseNinjaBuild = true;
|
||||||
|
dontUseNinjaCheck = true;
|
||||||
|
dontUseNinjaInstall = true;
|
||||||
|
# cmake's supposed to set this automatically
|
||||||
|
# ... but the detection is based on the presence of ninja build hook
|
||||||
|
cmakeFlags = [
|
||||||
|
"-GNinja"
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
autoPatchelfHook
|
pnpm_9.configHook
|
||||||
dpkg
|
cargo-tauri.hook
|
||||||
wrapGAppsHook3
|
nodejs
|
||||||
|
pkg-config
|
||||||
|
wrapGAppsHook4
|
||||||
|
yq-go
|
||||||
|
desktop-file-utils
|
||||||
|
cmake
|
||||||
|
ninja
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
glib-networking
|
openssl
|
||||||
gst_all_1.gst-plugins-bad
|
webkitgtk_4_1'
|
||||||
gst_all_1.gst-plugins-base
|
gst_all_1.gst-plugins-base
|
||||||
|
gst_all_1.gst-plugins-bad
|
||||||
gst_all_1.gst-plugins-good
|
gst_all_1.gst-plugins-good
|
||||||
webkitgtk_4_0
|
gst_all_1.gst-plugins-rs
|
||||||
|
glib-networking
|
||||||
|
libsysprof-capture
|
||||||
|
libayatana-appindicator
|
||||||
];
|
];
|
||||||
|
|
||||||
installPhase = ''
|
postPatch = ''
|
||||||
runHook preInstall
|
# remove updater
|
||||||
|
rm -rf updater
|
||||||
|
|
||||||
mkdir -pv $out
|
# patch cargo-deps
|
||||||
mv -v {bin,lib,share} $out
|
pushd $cargoDepsCopy/tauri-plugin-shell-*
|
||||||
|
patch -p1 < /build/source/src-tauri/patches/tauri-plugin-shell+*.patch
|
||||||
|
popd
|
||||||
|
|
||||||
runHook postInstall
|
substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
|
||||||
|
--replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
|
||||||
|
|
||||||
|
# disable pre-build script and disable auto-updater
|
||||||
|
yq -iPo=json '
|
||||||
|
.bundle.resources = (.bundle.resources | map(select(. != "updater*")))
|
||||||
|
' src-tauri/tauri.conf.json
|
||||||
|
|
||||||
|
# link shelter injection
|
||||||
|
ln -s ${shelter} src-tauri/injection/shelter.js
|
||||||
|
|
||||||
|
# link html/frontend data
|
||||||
|
ln -s /build/source/src /build/source/src-tauri/html
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
configurePhase = ''
|
||||||
|
cmakeConfigurePhase
|
||||||
|
pnpmConfigHook
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
ninjaBuildPhase
|
||||||
|
cd /build/source
|
||||||
|
tauriBuildHook
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
# Set up the resource directories
|
||||||
|
mkdir -p $out/lib/Dorion
|
||||||
|
ln -s $out/lib/Dorion $out/lib/dorion
|
||||||
|
rm -rf $out/lib/Dorion/injection
|
||||||
|
cp -r src-tauri/injection $out/lib/Dorion
|
||||||
|
cp -r src $out/lib/Dorion
|
||||||
|
|
||||||
|
# Modify the desktop file
|
||||||
|
desktop-file-edit \
|
||||||
|
--set-comment "Tiny alternative Discord client" \
|
||||||
|
--set-key="Exec" --set-value="Dorion %U" \
|
||||||
|
--set-key="TryExec" --set-value="Dorion" \
|
||||||
|
--set-key="StartupWMClass" --set-value="Dorion" \
|
||||||
|
--set-key="StartupNotify" --set-value="true" \
|
||||||
|
--set-key="Categories" --set-value="Network;InstantMessaging;Chat;" \
|
||||||
|
--set-key="Keywords" --set-value="dorion;discord;vencord;chat;im;vc;ds;dc;dsc;tauri;" \
|
||||||
|
--set-key="Terminal" --set-value="false" \
|
||||||
|
--set-key="MimeType" --set-value="x-scheme-handler/discord" \
|
||||||
|
$out/share/applications/Dorion.desktop
|
||||||
|
'';
|
||||||
|
|
||||||
|
# error: failed to run custom build command for `Dorion v6.5.3 (/build/source/src-tauri)`
|
||||||
|
# Permission denied (os error 13)
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
env = {
|
||||||
|
TAURI_RESOURCE_DIR = "${placeholder "out"}/lib";
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://github.com/SpikeHD/Dorion";
|
homepage = "https://spikehd.github.io/projects/dorion/";
|
||||||
description = "Tiny alternative Discord client";
|
description = "Tiny alternative Discord client";
|
||||||
license = lib.licenses.gpl3Only;
|
longDescription = ''
|
||||||
mainProgram = "dorion";
|
Dorion is an alternative Discord client aimed towards lower-spec or
|
||||||
maintainers = with lib.maintainers; [ aleksana ];
|
storage-sensitive PCs that supports themes, plugins, and more!
|
||||||
platforms = lib.intersectLists (lib.platforms.linux) (lib.platforms.x86_64);
|
'';
|
||||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
changelog = "https://github.com/SpikeHD/Dorion/releases/tag/v${finalAttrs.version}";
|
||||||
|
downloadPage = "https://github.com/SpikeHD/Dorion/releases/tag/v${finalAttrs.version}";
|
||||||
|
license = with lib.licenses; [
|
||||||
|
gpl3Only
|
||||||
|
cc0 # Shelter
|
||||||
|
];
|
||||||
|
mainProgram = "Dorion";
|
||||||
|
maintainers = with lib.maintainers; [
|
||||||
|
nyabinary
|
||||||
|
aleksana
|
||||||
|
griffi-gh
|
||||||
|
getchoo
|
||||||
|
];
|
||||||
|
platforms = lib.platforms.linux;
|
||||||
|
sourceProvenance = [
|
||||||
|
lib.sourceTypes.binaryBytecode # actually, minified JS
|
||||||
|
lib.sourceTypes.fromSource
|
||||||
|
];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue