1{ stdenv
2, lib
3, fetchFromGitHub
4, cmake
5, pkg-config
6, wayland
7, wayland-protocols
8, libwpe
9, libwpe-fdo
10, glib-networking
11, webkitgtk
12, makeWrapper
13, wrapGAppsHook
14, gnome
15, gdk-pixbuf
16}:
17
18stdenv.mkDerivation rec {
19 pname = "cog";
20 version = "0.8.1";
21
22 src = fetchFromGitHub {
23 owner = "igalia";
24 repo = "cog";
25 rev = "v${version}";
26 sha256 = "sha256-eF7rvOjZntcMmn622342yqfp4ksZ6R/FFBT36bYCViE=";
27 };
28
29 buildInputs = [
30 wayland-protocols
31 wayland
32 libwpe
33 libwpe-fdo
34 webkitgtk
35 glib-networking
36 gdk-pixbuf
37 gnome.adwaita-icon-theme
38 ];
39
40 nativeBuildInputs = [
41 cmake
42 pkg-config
43 wayland
44 makeWrapper
45 wrapGAppsHook
46 ];
47
48 depsBuildsBuild = [
49 pkg-config
50 ];
51
52 cmakeFlags = [
53 "-DCOG_USE_WEBKITGTK=ON"
54 ];
55
56 # https://github.com/Igalia/cog/issues/438
57 postPatch = ''
58 substituteInPlace core/cogcore.pc.in \
59 --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
60 '';
61
62 # not ideal, see https://github.com/WebPlatformForEmbedded/libwpe/issues/59
63 preFixup = ''
64 wrapProgram $out/bin/cog \
65 --prefix LD_LIBRARY_PATH : ${libwpe-fdo}/lib
66 '';
67
68 meta = with lib; {
69 description = "A small single “window” launcher for the WebKit WPE port";
70 license = licenses.mit;
71 maintainers = [ maintainers.matthewbauer ];
72 platforms = platforms.linux;
73 };
74}