From 2e1e7a11928d8e3ef39a4aab4a01f19bdc7c1ccf Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Tue, 24 Sep 2024 22:12:34 -0300 Subject: [PATCH 1/3] ciano: remove arguments in top-level --- pkgs/applications/graphics/ciano/default.nix | 13 ++++++++----- pkgs/top-level/all-packages.nix | 6 +----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/graphics/ciano/default.nix b/pkgs/applications/graphics/ciano/default.nix index 1106bd958194..e6c212d4bbce 100644 --- a/pkgs/applications/graphics/ciano/default.nix +++ b/pkgs/applications/graphics/ciano/default.nix @@ -3,17 +3,20 @@ , fetchFromGitHub , desktop-file-utils , ffmpeg -, granite -, gtk +, pantheon +, gtk3 , imagemagick , meson , ninja , pkg-config -, python +, python3 , vala , wrapGAppsHook3 }: +let + inherit (pantheon) granite; +in stdenv.mkDerivation rec { pname = "ciano"; version = "0.2.4"; @@ -30,7 +33,7 @@ stdenv.mkDerivation rec { meson ninja pkg-config - python + python3 vala wrapGAppsHook3 ]; @@ -39,7 +42,7 @@ stdenv.mkDerivation rec { ffmpeg imagemagick granite - gtk + gtk3 ]; postPatch = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b15df4f0cfde..99bab3c0f5a1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4200,11 +4200,7 @@ with pkgs; burpsuite = callPackage ../tools/networking/burpsuite { }; - ciano = callPackage ../applications/graphics/ciano { - inherit (pantheon) granite; - python = python3; - gtk = gtk3; - }; + ciano = callPackage ../applications/graphics/ciano { }; c3d = callPackage ../applications/graphics/c3d { inherit (darwin.apple_sdk.frameworks) Cocoa; From 9799316c9a2f56d7054285a541f4a2dc3b842da6 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 25 Sep 2024 08:58:49 -0300 Subject: [PATCH 2/3] ciano: migrate to by-name --- .../graphics/ciano/default.nix => by-name/ci/ciano/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{applications/graphics/ciano/default.nix => by-name/ci/ciano/package.nix} (100%) diff --git a/pkgs/applications/graphics/ciano/default.nix b/pkgs/by-name/ci/ciano/package.nix similarity index 100% rename from pkgs/applications/graphics/ciano/default.nix rename to pkgs/by-name/ci/ciano/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 99bab3c0f5a1..418388807c81 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4200,8 +4200,6 @@ with pkgs; burpsuite = callPackage ../tools/networking/burpsuite { }; - ciano = callPackage ../applications/graphics/ciano { }; - c3d = callPackage ../applications/graphics/c3d { inherit (darwin.apple_sdk.frameworks) Cocoa; }; From 476c490fb2d4acaa199d2faf8e0f96a5db3b1e3b Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 25 Sep 2024 09:12:06 -0300 Subject: [PATCH 3/3] ciano: refactor - finalAttrs - strictDeps - no nested with --- pkgs/by-name/ci/ciano/package.nix | 64 ++++++++++++++++--------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/pkgs/by-name/ci/ciano/package.nix b/pkgs/by-name/ci/ciano/package.nix index e6c212d4bbce..b223970625a9 100644 --- a/pkgs/by-name/ci/ciano/package.nix +++ b/pkgs/by-name/ci/ciano/package.nix @@ -1,30 +1,31 @@ -{ lib -, stdenv -, fetchFromGitHub -, desktop-file-utils -, ffmpeg -, pantheon -, gtk3 -, imagemagick -, meson -, ninja -, pkg-config -, python3 -, vala -, wrapGAppsHook3 +{ + lib, + desktop-file-utils, + fetchFromGitHub, + ffmpeg, + gtk3, + imagemagick, + meson, + ninja, + pantheon, + pkg-config, + python3, + stdenv, + vala, + wrapGAppsHook3, }: let inherit (pantheon) granite; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "ciano"; version = "0.2.4"; src = fetchFromGitHub { owner = "robertsanseries"; - repo = pname; - rev = version; + repo = "ciano"; + rev = finalAttrs.version; hash = "sha256-nubm6vBWwsHrrmvFAL/cIzYPxg9B1EhnpC79IJMNuFY="; }; @@ -45,30 +46,33 @@ stdenv.mkDerivation rec { gtk3 ]; + dontWrapGApps = true; + + strictDeps = true; + postPatch = '' chmod +x meson/post_install.py patchShebangs meson/post_install.py ''; - dontWrapGApps = true; - - postFixup = let - binPath = lib.makeBinPath [ - ffmpeg - imagemagick - ]; - in + postFixup = + let + binPath = lib.makeBinPath [ + ffmpeg + imagemagick + ]; + in '' wrapProgram $out/bin/com.github.robertsanseries.ciano \ --prefix PATH : ${binPath} "''${gappsWrapperArgs[@]}" ln -s $out/bin/com.github.robertsanseries.ciano $out/bin/ciano ''; - meta = with lib; { + meta = { homepage = "https://github.com/robertsanseries/ciano"; description = "Multimedia file converter focused on simplicity"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ AndersonTorres ]; - platforms = platforms.linux; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ AndersonTorres ]; + platforms = lib.platforms.linux; }; -} +})