summary refs log tree commit diff
path: root/pkgs/tools/misc/yad
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2019-04-23 15:56:14 +0800
committerPeter Hoeg <peter@hoeg.com>2019-04-23 15:56:14 +0800
commit84419d935dd8a90ed57ef5cfe6e2cebed3a427ce (patch)
tree17811e87726a93fef035c10956f473a4c15d9ede /pkgs/tools/misc/yad
parentd26027792812fbfad4d0f451b5f47fdabf7fdeb9 (diff)
downloadnixpkgs-84419d935dd8a90ed57ef5cfe6e2cebed3a427ce.tar
nixpkgs-84419d935dd8a90ed57ef5cfe6e2cebed3a427ce.tar.gz
nixpkgs-84419d935dd8a90ed57ef5cfe6e2cebed3a427ce.tar.bz2
nixpkgs-84419d935dd8a90ed57ef5cfe6e2cebed3a427ce.tar.lz
nixpkgs-84419d935dd8a90ed57ef5cfe6e2cebed3a427ce.tar.xz
nixpkgs-84419d935dd8a90ed57ef5cfe6e2cebed3a427ce.tar.zst
nixpkgs-84419d935dd8a90ed57ef5cfe6e2cebed3a427ce.zip
yad: 0.40.0 -> 0.42.0
Diffstat (limited to 'pkgs/tools/misc/yad')
-rw-r--r--pkgs/tools/misc/yad/default.nix42
1 files changed, 25 insertions, 17 deletions
diff --git a/pkgs/tools/misc/yad/default.nix b/pkgs/tools/misc/yad/default.nix
index 9992c9db99e..946a07d17b4 100644
--- a/pkgs/tools/misc/yad/default.nix
+++ b/pkgs/tools/misc/yad/default.nix
@@ -1,31 +1,40 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk2, hicolor-icon-theme
-, wrapGAppsHook }:
+{ stdenv, fetchFromGitHub, pkgconfig, intltool, autoreconfHook, wrapGAppsHook
+, gtk3, hicolor-icon-theme, netpbm }:
 
 stdenv.mkDerivation rec {
-  name = "yad-0.40.0";
-
-  src = fetchurl {
-    url = "mirror://sourceforge/yad-dialog/files/${name}.tar.xz";
-    sha256 = "1x0fsv8nfkm8lchdawnf3zw79jaqbnvhv87sk5r8g86knv8vgl62";
+  pname = "yad";
+  version = "0.42.0";
+
+  src = fetchFromGitHub {
+    owner = "v1cont";
+    repo = "yad";
+    rev = "v${version}";
+    sha256 = "0ym8pgbzx7ydk5rmi2kwwdyzi6pdpcps86i0c20cqcjmqh8kdl36";
   };
 
   configureFlags = [
     "--enable-icon-browser"
+    "--with-gtk=gtk3"
+    "--with-rgb=${placeholder "out"}/share/yad/rgb.txt"
   ];
 
-  # for gcc5: c11 inline semantics breaks the build
-  NIX_CFLAGS_COMPILE = "-fgnu89-inline";
-
-  buildInputs = [ gtk2 hicolor-icon-theme ];
+  buildInputs = [ gtk3 hicolor-icon-theme ];
 
-  nativeBuildInputs = [ pkgconfig intltool wrapGAppsHook ];
+  nativeBuildInputs = [ autoreconfHook pkgconfig intltool wrapGAppsHook ];
 
   postPatch = ''
     sed -i src/file.c -e '21i#include <glib/gprintf.h>'
     sed -i src/form.c -e '21i#include <stdlib.h>'
+
+    # there is no point to bring in the whole netpbm package just for this file
+    install -Dm644 ${netpbm}/share/netpbm/misc/rgb.txt $out/share/yad/rgb.txt
   '';
 
-  meta = {
+  postAutoreconf = ''
+    intltoolize
+  '';
+
+  meta = with stdenv.lib; {
     homepage = https://sourceforge.net/projects/yad-dialog/;
     description = "GUI dialog tool for shell scripts";
     longDescription = ''
@@ -34,9 +43,8 @@ stdenv.mkDerivation rec {
       dialogs, pop-up menu in notification icon and more.
     '';
 
-    platforms = with stdenv.lib.platforms; linux;
-    maintainers = with stdenv.lib.maintainers; [ smironov ];
-    license = stdenv.lib.licenses.gpl3;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ smironov ];
+    platforms = with platforms; linux;
   };
 }
-