1 {lib, stdenv, fetchurl, fetchpatch, gtk2, perlPackages, pkg-config } :
3 let version = "0.4"; in
7 arch = if stdenv.hostPlatform.system == "x86_64-linux" then "amd64" else "386";
10 url = "mirror://sourceforge/project/gcolor2/gcolor2/${version}/gcolor2-${version}.tar.bz2";
11 sha256 = "1siv54vwx9dbfcflklvf7pkp5lk6h3nn63flg6jzifz9wp0c84q6";
15 sed -i 's/\[:space:\]/[&]/g' configure
18 # from https://github.com/PhantomX/slackbuilds/tree/master/gcolor2/patches
19 patches = (if stdenv.hostPlatform.system == "x86_64-linux" then
20 [ ./gcolor2-amd64.patch ] else
23 # Pull patch pending upstream inclusion for -fno-common toolchains:
24 # https://sourceforge.net/p/gcolor2/patches/8/
26 name = "fno-common.patch";
27 url = "https://sourceforge.net/p/gcolor2/patches/8/attachment/0001-gcolor2-fix-build-on-gcc-10-fno-common.patch";
28 sha256 = "0187zc8as9g3d6mpm3isg87jfpryj0hajb4inwvii8gxrzbi5l5f";
32 nativeBuildInputs = [ pkg-config ];
33 buildInputs = [ gtk2 ]
34 ++ (with perlPackages; [ perl XMLParser ]);
37 description = "Simple GTK 2 color selector";
38 homepage = "https://gcolor2.sourceforge.net/";
39 license = lib.licenses.gpl2Plus;
40 maintainers = with lib.maintainers; [ notthemessiah ];
41 platforms = with lib.platforms; unix;
42 mainProgram = "gcolor2";