1{
2 lib,
3 stdenv,
4 fetchurl,
5 meson,
6 ninja,
7 pkg-config,
8 SDL2,
9 alsa-lib,
10 bullet,
11 check,
12 curl,
13 dbus,
14 doxygen,
15 expat,
16 fontconfig,
17 freetype,
18 fribidi,
19 ghostscript,
20 giflib,
21 glib,
22 gst_all_1,
23 gtk3,
24 harfbuzz,
25 hicolor-icon-theme,
26 ibus,
27 jbig2dec,
28 libGL,
29 libdrm,
30 libgbm,
31 libinput,
32 libjpeg,
33 libpng,
34 libpulseaudio,
35 libraw,
36 librsvg,
37 libsndfile,
38 libspectre,
39 libtiff,
40 libwebp,
41 libxkbcommon,
42 lua,
43 lz4,
44 mesa-gl-headers,
45 mint-x-icons,
46 openjpeg,
47 openssl,
48 poppler,
49 systemd,
50 udev,
51 util-linux,
52 wayland,
53 wayland-protocols,
54 wayland-scanner,
55 writeText,
56 xorg,
57 zlib,
58 directoryListingUpdater,
59}:
60
61stdenv.mkDerivation rec {
62 pname = "efl";
63 version = "1.28.1";
64
65 src = fetchurl {
66 url = "http://download.enlightenment.org/rel/libs/${pname}/${pname}-${version}.tar.xz";
67 sha256 = "sha256-hM9hRfnMgr//aQAFviQ5LI88UvjgD/BNjuo3FCnAlCQ=";
68 };
69
70 nativeBuildInputs = [
71 meson
72 ninja
73 gtk3
74 pkg-config
75 check
76 wayland-scanner
77 ];
78
79 buildInputs = [
80 fontconfig
81 freetype
82 giflib
83 glib
84 gst_all_1.gst-libav
85 gst_all_1.gst-plugins-base
86 gst_all_1.gst-plugins-good
87 gst_all_1.gstreamer
88 ibus
89 libGL
90 libpng
91 libpulseaudio
92 libsndfile
93 libtiff
94 lz4
95 mesa-gl-headers
96 openssl
97 systemd
98 udev
99 wayland-protocols
100 xorg.libX11
101 xorg.libXcursor
102 xorg.xorgproto
103 zlib
104 # still missing parent icon themes: RAVE-X, Faenza
105 ];
106
107 propagatedBuildInputs = [
108 SDL2
109 alsa-lib
110 bullet
111 curl
112 dbus
113 dbus
114 doxygen
115 expat
116 fribidi
117 ghostscript
118 harfbuzz
119 hicolor-icon-theme # for the icon theme
120 jbig2dec
121 libdrm
122 libgbm
123 libinput
124 libjpeg
125 libraw
126 librsvg
127 libspectre
128 libwebp
129 libxkbcommon
130 lua
131 mint-x-icons # Mint-X is a parent icon theme of Enlightenment-X
132 openjpeg
133 poppler
134 util-linux
135 wayland
136 xorg.libXScrnSaver
137 xorg.libXcomposite
138 xorg.libXdamage
139 xorg.libXext
140 xorg.libXfixes
141 xorg.libXi
142 xorg.libXinerama
143 xorg.libXrandr
144 xorg.libXrender
145 xorg.libXtst
146 xorg.libxcb
147 ];
148
149 dontDropIconThemeCache = true;
150
151 mesonFlags = [
152 "--buildtype=release"
153 "-D build-tests=false" # disable build tests, which are not working
154 "-D ecore-imf-loaders-disabler=ibus,scim" # ibus is disabled by default, scim is not available in nixpkgs
155 "-D embedded-lz4=false"
156 "-D fb=true"
157 "-D network-backend=connman"
158 "-D sdl=true"
159 "-D elua=true"
160 "-D bindings=lua,cxx"
161 # for wayland client support
162 "-D wl=true"
163 "-D drm=true"
164 ];
165
166 patches = [
167 ./efl-elua.patch
168 ];
169
170 postPatch = ''
171 patchShebangs src/lib/elementary/config_embed
172
173 # fix destination of systemd unit and dbus service
174 substituteInPlace systemd-services/meson.build --replace "sys_dep.get_pkgconfig_variable('systemduserunitdir')" "'$out/systemd/user'"
175 substituteInPlace dbus-services/meson.build --replace "dep.get_pkgconfig_variable('session_bus_services_dir')" "'$out/share/dbus-1/services'"
176 '';
177
178 # bin/edje_cc creates $HOME/.run, which would break build of reverse dependencies.
179 setupHook = writeText "setupHook.sh" ''
180 export HOME="$TEMPDIR"
181 '';
182
183 preConfigure = ''
184 # allow ecore_con to find libcurl.so, which is a runtime dependency (it is dlopened)
185 export LD_LIBRARY_PATH="${curl.out}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
186
187 source "$setupHook"
188 '';
189
190 postInstall = ''
191 # fix use of $out variable
192 substituteInPlace "$out/share/elua/core/util.lua" --replace '$out' "$out"
193 rm "$out/share/elua/core/util.lua.orig"
194
195 # add all module include dirs to the Cflags field in efl.pc
196 modules=$(for i in "$out/include/"*/; do printf ' -I''${includedir}/'`basename $i`; done)
197 substituteInPlace "$out/lib/pkgconfig/efl.pc" \
198 --replace 'Cflags: -I''${includedir}/efl-1' \
199 'Cflags: -I''${includedir}/eina-1/eina'"$modules"
200
201 # build icon cache
202 gtk-update-icon-cache "$out"/share/icons/Enlightenment-X
203 '';
204
205 postFixup = ''
206 # Some libraries are linked at runtime by hand in code (they are dlopened)
207 patchelf --add-needed ${curl.out}/lib/libcurl.so $out/lib/libecore_con.so
208 patchelf --add-needed ${libpulseaudio}/lib/libpulse.so $out/lib/libecore_audio.so
209 patchelf --add-needed ${libsndfile.out}/lib/libsndfile.so $out/lib/libecore_audio.so
210 '';
211
212 passthru.updateScript = directoryListingUpdater { };
213
214 meta = with lib; {
215 description = "Enlightenment foundation libraries";
216 homepage = "https://enlightenment.org/";
217 license = with licenses; [
218 bsd2
219 lgpl2Only
220 licenses.zlib
221 ];
222 platforms = platforms.linux;
223 maintainers = with maintainers; [
224 matejc
225 ftrvxmtrx
226 ];
227 teams = [ teams.enlightenment ];
228 };
229}