From 860472df032c79678cd3dcb1109f6ea33aa1e634 Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Mon, 30 Dec 2024 19:40:11 +0100 Subject: [PATCH 1/2] qownnotes: move package to by-name directory Signed-off-by: Patrizio Bekerle --- .../qo/qownnotes/package.nix} | 24 +++++++------------ pkgs/top-level/all-packages.nix | 4 ---- 2 files changed, 9 insertions(+), 19 deletions(-) rename pkgs/{applications/office/qownnotes/default.nix => by-name/qo/qownnotes/package.nix} (89%) diff --git a/pkgs/applications/office/qownnotes/default.nix b/pkgs/by-name/qo/qownnotes/package.nix similarity index 89% rename from pkgs/applications/office/qownnotes/default.nix rename to pkgs/by-name/qo/qownnotes/package.nix index 12da21cfd6fe..f3b8d8fc3e08 100644 --- a/pkgs/applications/office/qownnotes/default.nix +++ b/pkgs/by-name/qo/qownnotes/package.nix @@ -1,15 +1,9 @@ { lib , stdenv , fetchurl +, qt6Packages , cmake -, qttools -, qtbase -, qtdeclarative -, qtsvg -, qtwayland -, qtwebsockets , makeWrapper -, wrapQtAppsHook , botan2 , pkg-config , nixosTests @@ -22,7 +16,7 @@ let appname = "QOwnNotes"; version = "24.12.7"; in -stdenv.mkDerivation { +qt6Packages.stdenv.mkDerivation { inherit pname version; src = fetchurl { @@ -32,19 +26,19 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake - qttools - wrapQtAppsHook + qt6Packages.qttools + qt6Packages.wrapQtAppsHook pkg-config installShellFiles ] ++ lib.optionals stdenv.hostPlatform.isLinux [ xvfb-run ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeWrapper ]; buildInputs = [ - qtbase - qtdeclarative - qtsvg - qtwebsockets + qt6Packages.qtbase + qt6Packages.qtdeclarative + qt6Packages.qtsvg + qt6Packages.qtwebsockets botan2 - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ]; + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ qt6Packages.qtwayland ]; cmakeFlags = [ "-DQON_QT6_BUILD=ON" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f2036862232f..0ab8656290ac 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4951,10 +4951,6 @@ with pkgs; qosmic = libsForQt5.callPackage ../applications/graphics/qosmic { }; - qownnotes = qt6Packages.callPackage ../applications/office/qownnotes { - stdenv = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; - }; - qtikz = libsForQt5.callPackage ../applications/graphics/ktikz { }; qtspim = libsForQt5.callPackage ../development/tools/misc/qtspim { }; From 37c70872d669f87bcf50e4dbb740573f333f1f7b Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Mon, 30 Dec 2024 20:00:20 +0100 Subject: [PATCH 2/2] qownnotes: format with nixfmt Signed-off-by: Patrizio Bekerle --- pkgs/by-name/qo/qownnotes/package.nix | 76 +++++++++++++++------------ 1 file changed, 42 insertions(+), 34 deletions(-) diff --git a/pkgs/by-name/qo/qownnotes/package.nix b/pkgs/by-name/qo/qownnotes/package.nix index f3b8d8fc3e08..78608b0b53e0 100644 --- a/pkgs/by-name/qo/qownnotes/package.nix +++ b/pkgs/by-name/qo/qownnotes/package.nix @@ -1,14 +1,15 @@ -{ lib -, stdenv -, fetchurl -, qt6Packages -, cmake -, makeWrapper -, botan2 -, pkg-config -, nixosTests -, installShellFiles -, xvfb-run +{ + lib, + stdenv, + fetchurl, + qt6Packages, + cmake, + makeWrapper, + botan2, + pkg-config, + nixosTests, + installShellFiles, + xvfb-run, }: let @@ -24,13 +25,16 @@ qt6Packages.stdenv.mkDerivation { hash = "sha256-48puEyScG6EIrsXZpFc62dl4a23p+TO2buzuwq9m3Sw="; }; - nativeBuildInputs = [ - cmake - qt6Packages.qttools - qt6Packages.wrapQtAppsHook - pkg-config - installShellFiles - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ xvfb-run ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeWrapper ]; + nativeBuildInputs = + [ + cmake + qt6Packages.qttools + qt6Packages.wrapQtAppsHook + pkg-config + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ xvfb-run ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeWrapper ]; buildInputs = [ qt6Packages.qtbase @@ -46,30 +50,31 @@ qt6Packages.stdenv.mkDerivation { ]; # Install shell completion on Linux (with xvfb-run) - postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' + postInstall = + lib.optionalString stdenv.hostPlatform.isLinux '' installShellCompletion --cmd ${appname} \ --bash <(xvfb-run $out/bin/${appname} --completion bash) \ --fish <(xvfb-run $out/bin/${appname} --completion fish) installShellCompletion --cmd ${pname} \ --bash <(xvfb-run $out/bin/${appname} --completion bash) \ --fish <(xvfb-run $out/bin/${appname} --completion fish) - '' - # Install shell completion on macOS - + lib.optionalString stdenv.isDarwin '' + '' + # Install shell completion on macOS + + lib.optionalString stdenv.isDarwin '' installShellCompletion --cmd ${pname} \ --bash <($out/bin/${appname} --completion bash) \ --fish <($out/bin/${appname} --completion fish) - '' - # Create a lowercase symlink for Linux - + lib.optionalString stdenv.hostPlatform.isLinux '' - ln -s $out/bin/${appname} $out/bin/${pname} - '' - # Rename application for macOS as lowercase binary - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Prevent "same file" error - mv $out/bin/${appname} $out/bin/${pname}.bin - mv $out/bin/${pname}.bin $out/bin/${pname} - ''; + '' + # Create a lowercase symlink for Linux + + lib.optionalString stdenv.hostPlatform.isLinux '' + ln -s $out/bin/${appname} $out/bin/${pname} + '' + # Rename application for macOS as lowercase binary + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Prevent "same file" error + mv $out/bin/${appname} $out/bin/${pname}.bin + mv $out/bin/${pname}.bin $out/bin/${pname} + ''; # Tests QOwnNotes using the NixOS module by launching xterm: passthru.tests.basic-nixos-module-functionality = nixosTests.qownnotes; @@ -80,7 +85,10 @@ qt6Packages.stdenv.mkDerivation { changelog = "https://www.qownnotes.org/changelog.html"; downloadPage = "https://github.com/pbek/QOwnNotes/releases/tag/v${version}"; license = licenses.gpl2Only; - maintainers = with maintainers; [ pbek totoroot ]; + maintainers = with maintainers; [ + pbek + totoroot + ]; platforms = platforms.unix; }; }