Unverified Commit 329f924f authored by Lily Foster's avatar Lily Foster Committed by GitHub
Browse files

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

gmic-qt: refactor
parents 41298a0d a47a4508
Loading
Loading
Loading
Loading
+22 −27
Original line number Diff line number Diff line
{ 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 = [
    gmic
    qtbase
    qttools
    curl
    fftw
    zlib
    gmic
    graphicsmagick
    libjpeg
    libtiff
    libpng
    libtiff
    openexr
    graphicsmagick
    curl
  ] ++ variants.${variant}.extraDeps or [];

  preConfigure = ''
    cd gmic-qt
  '';
    zlib
  ] ++ (with libsForQt5; [
    qtbase
    qttools
  ]) ++ 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;
  };
})
+0 −2
Original line number Diff line number Diff line
@@ -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;