diff --git a/pkgs/tools/graphics/gmic-qt/default.nix b/pkgs/by-name/gm/gmic-qt/package.nix similarity index 87% rename from pkgs/tools/graphics/gmic-qt/default.nix rename to pkgs/by-name/gm/gmic-qt/package.nix index 9ae0454ccd5a..abc2c4d0f037 100644 --- a/pkgs/tools/graphics/gmic-qt/default.nix +++ b/pkgs/by-name/gm/gmic-qt/package.nix @@ -1,10 +1,9 @@ { lib -, stdenv -, fetchzip , cimg , cmake , coreutils , curl +, fetchzip , fftw , gimp , gimpPlugins @@ -14,14 +13,13 @@ , graphicsmagick , libjpeg , libpng +, libsForQt5 , libtiff , ninja , nix-update , openexr , pkg-config -, qtbase -, qttools -, wrapQtAppsHook +, stdenv , writeShellScript , zlib , variant ? "standalone" @@ -38,6 +36,7 @@ let }; standalone = { + extraDeps = []; # Just to keep uniformity and avoid test-for-null description = "Versatile front-end to the image processing framework G'MIC"; }; }; @@ -49,7 +48,7 @@ assert lib.assertMsg "gmic-qt variant \"${variant}\" is not supported. Please use one of ${lib.concatStringsSep ", " (builtins.attrNames variants)}."; assert lib.assertMsg - (builtins.all (d: d != null) variants.${variant}.extraDeps or []) + (builtins.all (d: d != null) variants.${variant}.extraDeps) "gmic-qt variant \"${variant}\" is missing one of its dependencies."; stdenv.mkDerivation (finalAttrs: { @@ -61,30 +60,29 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-/Hh5yzH//i01kyeoqETokvsKUOcY2iZsiYJBEmgw1rU="; }; + sourceRoot = "${finalAttrs.src.name}/gmic-qt"; + nativeBuildInputs = [ cmake - pkg-config + libsForQt5.wrapQtAppsHook ninja - wrapQtAppsHook + pkg-config ]; buildInputs = [ + curl + fftw gmic + graphicsmagick + libjpeg + libpng + libtiff + openexr + zlib + ] ++ (with libsForQt5; [ qtbase qttools - fftw - zlib - libjpeg - libtiff - libpng - openexr - graphicsmagick - curl - ] ++ variants.${variant}.extraDeps or []; - - preConfigure = '' - cd gmic-qt - ''; + ]) ++ variants.${variant}.extraDeps; postPatch = '' patchShebangs \ @@ -93,9 +91,9 @@ stdenv.mkDerivation (finalAttrs: { ''; cmakeFlags = [ - (lib.cmakeFeature "GMIC_QT_HOST" (if variant == "standalone" then "none" else variant)) - (lib.cmakeBool "ENABLE_SYSTEM_GMIC" true) (lib.cmakeBool "ENABLE_DYNAMIC_LINKING" true) + (lib.cmakeBool "ENABLE_SYSTEM_GMIC" true) + (lib.cmakeFeature "GMIC_QT_HOST" (if variant == "standalone" then "none" else variant)) ]; postFixup = lib.optionalString (variant == "gimp") '' @@ -105,8 +103,8 @@ stdenv.mkDerivation (finalAttrs: { passthru = { tests = { + # They need to be update in lockstep. gimp-plugin = gimpPlugins.gmic; - # Needs to update them all in lockstep. inherit cimg gmic; }; @@ -134,10 +132,7 @@ stdenv.mkDerivation (finalAttrs: { inherit (variants.${variant}) description; license = lib.licenses.gpl3Plus; mainProgram = "gmic_qt"; - maintainers = [ - lib.maintainers.AndersonTorres - lib.maintainers.lilyinstarlight - ]; + maintainers = with lib.maintainers; [ AndersonTorres lilyinstarlight ]; platforms = lib.platforms.unix; }; }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1ba9dba64533..6ed982b08aff 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5528,8 +5528,6 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Cocoa; }; - gmic-qt = libsForQt5.callPackage ../tools/graphics/gmic-qt { }; - gpg-tui = callPackage ../tools/security/gpg-tui { inherit (darwin.apple_sdk.frameworks) AppKit Foundation; inherit (darwin) libobjc libresolv;