From 3584894b4847b839afdfb1b8f17a3b0ca3a9c50f Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 25 Aug 2024 13:50:10 -0300 Subject: [PATCH 1/6] onedrive: migrate to by-name --- .../onedrive/default.nix => by-name/on/onedrive/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{applications/networking/sync/onedrive/default.nix => by-name/on/onedrive/package.nix} (100%) diff --git a/pkgs/applications/networking/sync/onedrive/default.nix b/pkgs/by-name/on/onedrive/package.nix similarity index 100% rename from pkgs/applications/networking/sync/onedrive/default.nix rename to pkgs/by-name/on/onedrive/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ed9d4fbf23c9..38c01b4a52c0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22886,8 +22886,6 @@ with pkgs; oneDNN_2 = callPackage ../development/libraries/oneDNN/2.nix { }; - onedrive = callPackage ../applications/networking/sync/onedrive { }; - oneko = callPackage ../applications/misc/oneko { }; oniguruma = callPackage ../development/libraries/oniguruma { }; From 9a04423c504a1f94aca0f3a9a2a440891b9783d6 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 25 Aug 2024 13:48:12 -0300 Subject: [PATCH 2/6] onedrive: remove srgom from meta.maintainers srgom is inactive --- pkgs/by-name/on/onedrive/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/on/onedrive/package.nix b/pkgs/by-name/on/onedrive/package.nix index d7dd30b106c8..89faea0f5657 100644 --- a/pkgs/by-name/on/onedrive/package.nix +++ b/pkgs/by-name/on/onedrive/package.nix @@ -51,7 +51,7 @@ stdenv.mkDerivation rec { mainProgram = "onedrive"; homepage = "https://github.com/abraunegg/onedrive"; license = licenses.gpl3Only; - maintainers = with maintainers; [ srgom peterhoeg bertof ]; + maintainers = with maintainers; [ peterhoeg bertof ]; platforms = platforms.linux; }; } From 2842021bf9d21bc50ed4f61d1faf9c254f3c08ef Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 25 Aug 2024 14:00:09 -0300 Subject: [PATCH 3/6] onedrive: rework - finalAttrs - lib.enable* flags - ghet rid of pname - test version - get rid of nested with - nixfmt-rfc-style --- pkgs/by-name/on/onedrive/package.nix | 88 +++++++++++++++++----------- 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/pkgs/by-name/on/onedrive/package.nix b/pkgs/by-name/on/onedrive/package.nix index 89faea0f5657..8a10eaa2dddb 100644 --- a/pkgs/by-name/on/onedrive/package.nix +++ b/pkgs/by-name/on/onedrive/package.nix @@ -1,57 +1,79 @@ -{ stdenv -, lib -, fetchFromGitHub -, autoreconfHook -, ldc -, installShellFiles -, pkg-config -, curl -, sqlite -, libnotify -, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd -, systemd +{ + lib, + autoreconfHook, + curl, + fetchFromGitHub, + installShellFiles, + ldc, + libnotify, + pkg-config, + sqlite, + stdenv, + systemd, + testers, + # Boolean flags + withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "onedrive"; version = "2.4.25"; src = fetchFromGitHub { owner = "abraunegg"; - repo = pname; - rev = "v${version}"; + repo = "onedrive"; + rev = "v${finalAttrs.version}"; hash = "sha256-M6EOJiykmAKWIuAXdm9ebTSX1eVoO+1axgzxlAmuI8U="; }; - nativeBuildInputs = [ autoreconfHook ldc installShellFiles pkg-config ]; + outputs = [ + "out" + "doc" + "man" + ]; + + nativeBuildInputs = [ + autoreconfHook + installShellFiles + ldc + pkg-config + ]; buildInputs = [ curl - sqlite libnotify - ] ++ lib.optional withSystemd systemd; + sqlite + ] ++ lib.optionals withSystemd [ systemd ]; configureFlags = [ - "--enable-notifications" - ] ++ lib.optionals withSystemd [ - "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user" + (lib.enableFeature true "notifications") + (lib.withFeatureAs withSystemd "systemdsystemunitdir" "${placeholder "out"}/lib/systemd/system") + (lib.withFeatureAs withSystemd "systemduserunitdir" "${placeholder "out"}/lib/systemd/user") ]; # we could also pass --enable-completions to configure but we would then have to # figure out the paths manually and pass those along. postInstall = '' - installShellCompletion --bash --name ${pname} contrib/completions/complete.bash - installShellCompletion --zsh --name _${pname} contrib/completions/complete.zsh - installShellCompletion --fish --name ${pname} contrib/completions/complete.fish + installShellCompletion --bash --name onedrive contrib/completions/complete.bash + installShellCompletion --fish --name onedrive contrib/completions/complete.fish + installShellCompletion --zsh --name _onedrive contrib/completions/complete.zsh ''; - meta = with lib; { - description = "Complete tool to interact with OneDrive on Linux"; - mainProgram = "onedrive"; - homepage = "https://github.com/abraunegg/onedrive"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ peterhoeg bertof ]; - platforms = platforms.linux; + passthru = { + tests.version = testers.testVersion { + package = finalAttrs.finalPackage; + }; }; -} + + meta = { + homepage = "https://github.com/abraunegg/onedrive"; + description = "Complete tool to interact with OneDrive on Linux"; + license = lib.licenses.gpl3Only; + mainProgram = "onedrive"; + maintainers = with lib.maintainers; [ + peterhoeg + bertof + ]; + platforms = lib.platforms.linux; + }; +}) From 8a5c948e7701cfec724df430448a0e1b84d0be4f Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 25 Aug 2024 21:34:32 -0300 Subject: [PATCH 4/6] onedrive: add AndersonTorres as maintainer --- pkgs/by-name/on/onedrive/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/on/onedrive/package.nix b/pkgs/by-name/on/onedrive/package.nix index 8a10eaa2dddb..d1046b4a1611 100644 --- a/pkgs/by-name/on/onedrive/package.nix +++ b/pkgs/by-name/on/onedrive/package.nix @@ -71,6 +71,7 @@ stdenv.mkDerivation (finalAttrs: { license = lib.licenses.gpl3Only; mainProgram = "onedrive"; maintainers = with lib.maintainers; [ + AndersonTorres peterhoeg bertof ]; From 07a1d0fb2f246c3dc0f68c6a54145fddce8ebc7d Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 25 Aug 2024 21:06:16 -0300 Subject: [PATCH 5/6] onedrive: 2.4.25 -> 2.5.0-rc3 --- pkgs/by-name/on/onedrive/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/on/onedrive/package.nix b/pkgs/by-name/on/onedrive/package.nix index d1046b4a1611..78c7ffef9c5d 100644 --- a/pkgs/by-name/on/onedrive/package.nix +++ b/pkgs/by-name/on/onedrive/package.nix @@ -17,13 +17,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "onedrive"; - version = "2.4.25"; + version = "2.5.0-rc3"; src = fetchFromGitHub { owner = "abraunegg"; repo = "onedrive"; rev = "v${finalAttrs.version}"; - hash = "sha256-M6EOJiykmAKWIuAXdm9ebTSX1eVoO+1axgzxlAmuI8U="; + hash = "sha256-UOtCRCHTBpPScFB/OcGalGFjVUslULBO3KIED+0Hs+M="; }; outputs = [ From dadebd9140ebad4b291629845c40ae5b46eae14b Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 28 Aug 2024 12:37:43 -0300 Subject: [PATCH 6/6] onedrive: fixup version test Since the test uses `grep --word-regexp --fixed-string`, we should use the full version style. --- pkgs/by-name/on/onedrive/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/on/onedrive/package.nix b/pkgs/by-name/on/onedrive/package.nix index 78c7ffef9c5d..db108ec5057c 100644 --- a/pkgs/by-name/on/onedrive/package.nix +++ b/pkgs/by-name/on/onedrive/package.nix @@ -62,6 +62,7 @@ stdenv.mkDerivation (finalAttrs: { passthru = { tests.version = testers.testVersion { package = finalAttrs.finalPackage; + version = "v${finalAttrs.version}"; }; };