Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 16 additions & 53 deletions pkgs/by-name/rq/rquickshare/package.nix
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
{
lib,
cargo-tauri,
cargo-tauri_1,
fetchFromGitHub,
glib-networking,
libayatana-appindicator,
libsoup_2_4,
libsoup_3,
nix-update,
nix-update-script,
nodejs,
openssl,
pkg-config,
pnpm_9,
protobuf,
rustPlatform,
stdenv,
webkitgtk_4_0,
webkitgtk_4_1,
wrapGAppsHook4,
writeShellScript,

# This package provides can be built using tauri v1 or v2.
# Try legacy (v1) version if main (v2) doesn't work.
app-type ? "main", # main or legacy
}:
let
app-type-either =
arg1: arg2:
if app-type == "main" then
arg1
else if app-type == "legacy" then
arg2
else
throw "Wrong argument for app-type in rquickshare package";

proper-cargo-tauri = app-type-either cargo-tauri cargo-tauri_1;
in
rustPlatform.buildRustPackage rec {
pname = "rquickshare" + (app-type-either "" "-legacy");
pname = "rquickshare";
version = "0.11.5";

src = fetchFromGitHub {
Expand All @@ -55,7 +35,7 @@ rustPlatform.buildRustPackage rec {
--replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
'';

pnpmRoot = "app/${app-type}";
pnpmRoot = "app/main";
pnpmDeps = pnpm_9.fetchDeps {
inherit
pname
Expand All @@ -65,19 +45,19 @@ rustPlatform.buildRustPackage rec {
;
postPatch = "cd ${pnpmRoot}";
fetcherVersion = 1;
hash = app-type-either "sha256-V46V/VPwCKEe3sAp8zK0UUU5YigqgYh1GIOorqIAiNE=" "sha256-8QRigYNtxirXidFFnTzA6rP0+L64M/iakPqe2lZKegs=";
hash = "sha256-V46V/VPwCKEe3sAp8zK0UUU5YigqgYh1GIOorqIAiNE=";
};

cargoRoot = "app/${app-type}/src-tauri";
cargoRoot = "app/main/src-tauri";
buildAndTestSubdir = cargoRoot;
cargoPatches = [
./remove-duplicate-versions-of-sys-metrics.patch
./remove-code-signing-darwin.patch
];
cargoHash = app-type-either "sha256-XfN+/oC3lttDquLfoyJWBaFfdjW/wyODCIiZZksypLM=" "sha256-4vBHxuKg4P9H0FZYYNUT+AVj4Qvz99q7Bhd7x47UC2w=";
cargoHash = "sha256-XfN+/oC3lttDquLfoyJWBaFfdjW/wyODCIiZZksypLM=";

nativeBuildInputs = [
proper-cargo-tauri.hook
cargo-tauri.hook

# Setup pnpm
nodejs
Expand All @@ -90,41 +70,24 @@ rustPlatform.buildRustPackage rec {
wrapGAppsHook4
];

buildInputs = lib.optionals stdenv.hostPlatform.isLinux (
[
glib-networking
libayatana-appindicator
openssl
]
++ lib.optionals (app-type == "main") [
libsoup_3
webkitgtk_4_1
]
++ lib.optionals (app-type == "legacy") [
libsoup_2_4
webkitgtk_4_0
]
);
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
glib-networking
libayatana-appindicator
libsoup_3
openssl
webkitgtk_4_1
];

env.OPENSSL_NO_VENDOR = 1;

passthru =
# Don't set an update script for the legacy version
# so r-ryantm won't create two duplicate PRs
lib.optionalAttrs (app-type == "main") {
updateScript = writeShellScript "update-rquickshare.sh" ''
${lib.getExe nix-update} rquickshare
sed -i 's/version = "0.0.0";/' pkgs/by-name/rq/rquickshare/package.nix
${lib.getExe nix-update} rquickshare-legacy
'';
};
passthru.updateScript = nix-update-script;

meta = {
description = "Rust implementation of NearbyShare/QuickShare from Android for Linux and macOS";
homepage = "https://github.com/Martichou/rquickshare";
changelog = "https://github.com/Martichou/rquickshare/blob/v${version}/CHANGELOG.md";
license = lib.licenses.gpl3Plus;
mainProgram = app-type-either "rquickshare" "r-quick-share";
mainProgram = "rquickshare";
maintainers = with lib.maintainers; [
perchun
luftmensch-luftmensch
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2345,6 +2345,7 @@ mapAliases {
rote = throw "rote has been removed due to lack of upstream maintenance"; # Added 2025-09-10
rnix-hashes = throw "'rnix-hashes' has been removed due to lack of upstream maintenance"; # Added 2025-01-25
rpiboot-unstable = throw "'rpiboot-unstable' has been renamed to/replaced by 'rpiboot'"; # Converted to throw 2024-10-17
rquickshare-legacy = throw "The legacy version depends on insecure package libsoup2, please use the main version"; # Added 2025-10-09
rr-unstable = rr; # Added 2022-09-17
rtx = mise; # Added 2024-01-05
ruby-zoom = throw "'ruby-zoom' has been removed due to lack of maintaince and had not been updated since 2020"; # Added 2025-08-24
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11957,8 +11957,6 @@ with pkgs;
x11Support = true;
};

rquickshare-legacy = rquickshare.override { app-type = "legacy"; };

# a somewhat more maintained fork of ympd
memento = qt6Packages.callPackage ../applications/video/memento { };

Expand Down
Loading