about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/graphics/dippi/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/graphics/dippi/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/graphics/dippi/default.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/graphics/dippi/default.nix b/nixpkgs/pkgs/tools/graphics/dippi/default.nix
new file mode 100644
index 000000000000..9e3cc25327f8
--- /dev/null
+++ b/nixpkgs/pkgs/tools/graphics/dippi/default.nix
@@ -0,0 +1,64 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, meson
+, ninja
+, pkg-config
+, python3
+, vala
+, glib
+, gtk3
+, gtk4
+, libadwaita
+, wrapGAppsHook4
+, appstream-glib
+, desktop-file-utils
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dippi";
+  version = "4.0.2";
+
+  src = fetchFromGitHub {
+    owner = "cassidyjames";
+    repo = "dippi";
+    rev = version;
+    hash = "sha256-OYeSPh3m3udmGbIKoithCdsqWSAFnRhnAtQ0nTzFxzs=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    vala
+    pkg-config
+    wrapGAppsHook4
+    appstream-glib
+    desktop-file-utils
+    # For post_install.py
+    python3
+    glib
+    gtk3
+  ];
+
+  buildInputs = [
+    glib
+    gtk4
+    libadwaita
+  ];
+
+  postPatch = ''
+    patchShebangs build-aux/meson/post_install.py
+  '';
+
+  postInstall = ''
+    ln -s $out/bin/com.github.cassidyjames.dippi $out/bin/dippi
+  '';
+
+  meta = with lib; {
+    description = "Calculate display info like DPI and aspect ratio";
+    homepage = "https://github.com/cassidyjames/dippi";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ zendo ];
+  };
+}