Merge pull request #294522 from atorres1985-contrib/gmic-qt

gmic-qt: refactor

authored by Lily Foster and committed by GitHub 329f924f 41298a0d

+22 -29
+22 -27
pkgs/tools/graphics/gmic-qt/default.nix pkgs/by-name/gm/gmic-qt/package.nix
··· 1 1 { lib 2 - , stdenv 3 - , fetchzip 4 2 , cimg 5 3 , cmake 6 4 , coreutils 7 5 , curl 6 + , fetchzip 8 7 , fftw 9 8 , gimp 10 9 , gimpPlugins ··· 14 13 , graphicsmagick 15 14 , libjpeg 16 15 , libpng 16 + , libsForQt5 17 17 , libtiff 18 18 , ninja 19 19 , nix-update 20 20 , openexr 21 21 , pkg-config 22 - , qtbase 23 - , qttools 24 - , wrapQtAppsHook 22 + , stdenv 25 23 , writeShellScript 26 24 , zlib 27 25 , variant ? "standalone" ··· 38 36 }; 39 37 40 38 standalone = { 39 + extraDeps = []; # Just to keep uniformity and avoid test-for-null 41 40 description = "Versatile front-end to the image processing framework G'MIC"; 42 41 }; 43 42 }; ··· 49 48 "gmic-qt variant \"${variant}\" is not supported. Please use one of ${lib.concatStringsSep ", " (builtins.attrNames variants)}."; 50 49 51 50 assert lib.assertMsg 52 - (builtins.all (d: d != null) variants.${variant}.extraDeps or []) 51 + (builtins.all (d: d != null) variants.${variant}.extraDeps) 53 52 "gmic-qt variant \"${variant}\" is missing one of its dependencies."; 54 53 55 54 stdenv.mkDerivation (finalAttrs: { ··· 60 59 url = "https://gmic.eu/files/source/gmic_${finalAttrs.version}.tar.gz"; 61 60 hash = "sha256-/Hh5yzH//i01kyeoqETokvsKUOcY2iZsiYJBEmgw1rU="; 62 61 }; 62 + 63 + sourceRoot = "${finalAttrs.src.name}/gmic-qt"; 63 64 64 65 nativeBuildInputs = [ 65 66 cmake 66 - pkg-config 67 + libsForQt5.wrapQtAppsHook 67 68 ninja 68 - wrapQtAppsHook 69 + pkg-config 69 70 ]; 70 71 71 72 buildInputs = [ 72 - gmic 73 - qtbase 74 - qttools 73 + curl 75 74 fftw 76 - zlib 75 + gmic 76 + graphicsmagick 77 77 libjpeg 78 + libpng 78 79 libtiff 79 - libpng 80 80 openexr 81 - graphicsmagick 82 - curl 83 - ] ++ variants.${variant}.extraDeps or []; 84 - 85 - preConfigure = '' 86 - cd gmic-qt 87 - ''; 81 + zlib 82 + ] ++ (with libsForQt5; [ 83 + qtbase 84 + qttools 85 + ]) ++ variants.${variant}.extraDeps; 88 86 89 87 postPatch = '' 90 88 patchShebangs \ ··· 93 91 ''; 94 92 95 93 cmakeFlags = [ 94 + (lib.cmakeBool "ENABLE_DYNAMIC_LINKING" true) 95 + (lib.cmakeBool "ENABLE_SYSTEM_GMIC" true) 96 96 (lib.cmakeFeature "GMIC_QT_HOST" (if variant == "standalone" then "none" else variant)) 97 - (lib.cmakeBool "ENABLE_SYSTEM_GMIC" true) 98 - (lib.cmakeBool "ENABLE_DYNAMIC_LINKING" true) 99 97 ]; 100 98 101 99 postFixup = lib.optionalString (variant == "gimp") '' ··· 105 103 106 104 passthru = { 107 105 tests = { 106 + # They need to be update in lockstep. 108 107 gimp-plugin = gimpPlugins.gmic; 109 - # Needs to update them all in lockstep. 110 108 inherit cimg gmic; 111 109 }; 112 110 ··· 134 132 inherit (variants.${variant}) description; 135 133 license = lib.licenses.gpl3Plus; 136 134 mainProgram = "gmic_qt"; 137 - maintainers = [ 138 - lib.maintainers.AndersonTorres 139 - lib.maintainers.lilyinstarlight 140 - ]; 135 + maintainers = with lib.maintainers; [ AndersonTorres lilyinstarlight ]; 141 136 platforms = lib.platforms.unix; 142 137 }; 143 138 })
-2
pkgs/top-level/all-packages.nix
··· 5528 5528 inherit (darwin.apple_sdk.frameworks) Cocoa; 5529 5529 }; 5530 5530 5531 - gmic-qt = libsForQt5.callPackage ../tools/graphics/gmic-qt { }; 5532 - 5533 5531 gpg-tui = callPackage ../tools/security/gpg-tui { 5534 5532 inherit (darwin.apple_sdk.frameworks) AppKit Foundation; 5535 5533 inherit (darwin) libobjc libresolv;