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

qbittorrent: 5.0.1 -> 5.0.2; move to by-name; modernize derivation #358115

Merged
merged 4 commits into from
Dec 12, 2024
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
100 changes: 0 additions & 100 deletions pkgs/applications/networking/p2p/qbittorrent/default.nix

This file was deleted.

96 changes: 96 additions & 0 deletions pkgs/by-name/qb/qbittorrent/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
apple-sdk_11,
boost,
cmake,
dbus,
fetchFromGitHub,
guiSupport ? true,
lib,
libtorrent-rasterbar,
nix-update-script,
openssl,
pkg-config,
python3,
qt6,
stdenv,
trackerSearch ? true,
webuiSupport ? true,
wrapGAppsHook3,
zlib,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "qbittorrent" + lib.optionalString (!guiSupport) "-nox";
version = "5.0.2";

src = fetchFromGitHub {
owner = "qbittorrent";
repo = "qBittorrent";
rev = "release-${finalAttrs.version}";
hash = "sha256-JIURzAkVNYjHAx8yY0WaKNK4N/z9ndqjk0EXkJH9AzY=";
};

nativeBuildInputs = [
cmake
pkg-config
wrapGAppsHook3
qt6.wrapQtAppsHook
];

buildInputs =
[
boost
libtorrent-rasterbar
openssl
qt6.qtbase
qt6.qtsvg
qt6.qttools
zlib
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_11 ]
++ lib.optionals guiSupport [ dbus ]
++ lib.optionals (guiSupport && stdenv.hostPlatform.isLinux) [ qt6.qtwayland ]
++ lib.optionals trackerSearch [ python3 ];

cmakeFlags =
[ "-DVERBOSE_CONFIGURE=ON" ]
++ lib.optionals (!guiSupport) [
"-DGUI=OFF"
"-DSYSTEMD=ON"
"-DSYSTEMD_SERVICES_INSTALL_DIR=${placeholder "out"}/lib/systemd/system"
]
++ lib.optionals (!webuiSupport) [ "-DWEBUI=OFF" ];

qtWrapperArgs = lib.optionals trackerSearch [ "--prefix PATH : ${lib.makeBinPath [ python3 ]}" ];

dontWrapGApps = true;

postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
APP_NAME=qbittorrent${lib.optionalString (!guiSupport) "-nox"}
mkdir -p $out/{Applications,bin}
mv $out/$APP_NAME.app $out/Applications
makeWrapper $out/{Applications/$APP_NAME.app/Contents/MacOS,bin}/$APP_NAME
'';

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

passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=release-(.*)" ]; };

meta = {
description = "Featureful free software BitTorrent client";
homepage = "https://www.qbittorrent.org";
changelog = "https://github.com/qbittorrent/qBittorrent/blob/release-${finalAttrs.version}/Changelog";
license = with lib.licenses; [
gpl2Only
gpl3Only
];
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [
Anton-Latukha
kashw2
];
mainProgram = "qbittorrent" + lib.optionalString (!guiSupport) "-nox";
};
})
3 changes: 0 additions & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15231,9 +15231,6 @@ with pkgs;

pure-maps = libsForQt5.callPackage ../applications/misc/pure-maps { };

qbittorrent = qt6Packages.callPackage ../applications/networking/p2p/qbittorrent {
inherit (darwin.apple_sdk.frameworks) Cocoa;
};
qbittorrent-nox = qbittorrent.override { guiSupport = false; };

qcad = libsForQt5.callPackage ../applications/misc/qcad { };
Expand Down
Loading