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