1{
2 lib,
3 stdenv,
4 fetchurl,
5 pkg-config,
6 glib,
7 gtk2,
8 dbus-glib,
9}:
10
11stdenv.mkDerivation rec {
12 pname = "libunique";
13 version = "1.1.6";
14
15 src = fetchurl {
16 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
17 sha256 = "1fsgvmncd9caw552lyfg8swmsd6bh4ijjsph69bwacwfxwf09j75";
18 };
19
20 # Don't make deprecated usages hard errors
21 prePatch = ''
22 substituteInPlace configure --replace "-Werror" "";
23 '';
24
25 # glib-2.62 deprecations
26 env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
27
28 # Patches from Gentoo portage
29 patches = [
30 ./1.1.6-compiler-warnings.patch
31 ./1.1.6-fix-test.patch
32 ./1.1.6-G_CONST_RETURN.patch
33 ./1.1.6-include-terminator.patch
34 ]
35 ++ [ ./gcc7-bug.patch ];
36
37 nativeBuildInputs = [ pkg-config ];
38 buildInputs = [
39 glib
40 gtk2
41 dbus-glib
42 ];
43
44 doCheck = true;
45
46 meta = {
47 homepage = "https://gitlab.gnome.org/Archive/unique";
48 description = "Library for writing single instance applications";
49 license = lib.licenses.lgpl21;
50 platforms = with lib.platforms; linux ++ darwin;
51 };
52}