Files
2026-07-08 12:48:27 +02:00

254 lines
5.2 KiB
Nix

{
lib,
stdenv,
fetchurl,
meson,
ninja,
pkg-config,
SDL2,
alsa-lib,
bullet,
check,
curl,
dbus,
doxygen,
expat,
fontconfig,
freetype,
fribidi,
ghostscript,
giflib,
glib,
gst_all_1,
gtk3,
harfbuzz,
hicolor-icon-theme,
ibus,
jbig2dec,
libGL,
libdrm,
libgbm,
libinput,
libjpeg,
libpng,
libpulseaudio,
libraw,
librsvg,
libsndfile,
libspectre,
libtiff,
libwebp,
libxkbcommon,
lua,
lz4,
mesa-gl-headers,
mint-x-icons,
openjpeg,
openssl,
poppler,
systemd,
udev,
util-linux,
wayland,
wayland-protocols,
wayland-scanner,
writeText,
libxtst,
libxscrnsaver,
libxrender,
libxrandr,
libxi,
libxinerama,
libxfixes,
libxext,
libxdamage,
libxcursor,
libxcomposite,
libx11,
xorgproto,
libxcb,
zlib,
directoryListingUpdater,
}:
let
inherit (lib)
mesonBool
mesonOption
;
in
stdenv.mkDerivation (finalAttrs: {
pname = "efl";
version = "1.28.1";
src = fetchurl {
url = "https://download.enlightenment.org/rel/libs/efl/efl-${finalAttrs.version}.tar.xz";
hash = "sha256-hM9hRfnMgr//aQAFviQ5LI88UvjgD/BNjuo3FCnAlCQ=";
};
nativeBuildInputs = [
meson
ninja
gtk3
pkg-config
check
wayland-scanner
];
buildInputs = [
fontconfig
freetype
giflib
glib
gst_all_1.gst-libav
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gstreamer
ibus
libGL
libpng
libpulseaudio
libsndfile
libtiff
lz4
mesa-gl-headers
openssl
systemd
udev
wayland-protocols
libx11
libxcursor
xorgproto
zlib
# still missing parent icon themes: RAVE-X, Faenza
];
propagatedBuildInputs = [
SDL2
alsa-lib
bullet
curl
dbus
dbus
doxygen
expat
fribidi
ghostscript
harfbuzz
hicolor-icon-theme # for the icon theme
jbig2dec
libdrm
libgbm
libinput
libjpeg
libraw
librsvg
libspectre
libwebp
libxkbcommon
lua
mint-x-icons # Mint-X is a parent icon theme of Enlightenment-X
openjpeg
poppler
util-linux
wayland
libxscrnsaver
libxcomposite
libxdamage
libxext
libxfixes
libxi
libxinerama
libxrandr
libxrender
libxtst
libxcb
];
strictDeps = true;
dontDropIconThemeCache = true;
# Fix build with gcc15 (-std=gnu23)
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-std=gnu17";
mesonFlags = [
"--buildtype=release"
(mesonBool "build-tests" false) # disable build tests, which are not working
(mesonOption "ecore-imf-loaders-disabler" "ibus,scim") # ibus is disabled by default, scim is not available in nixpkgs
(mesonBool "embedded-lz4" false)
(mesonBool "fb" true)
(mesonOption "network-backend" "connman")
(mesonBool "sdl" true)
(mesonBool "elua" true)
(mesonOption "bindings" "lua,cxx")
# for wayland client support
(mesonBool "wl" true)
(mesonBool "drm" true)
];
patches = [
./efl-elua.patch
];
postPatch = ''
patchShebangs src/lib/elementary/config_embed
# fix destination of systemd unit and dbus service
substituteInPlace systemd-services/meson.build --replace-fail "sys_dep.get_pkgconfig_variable('systemduserunitdir')" "'$out/systemd/user'"
substituteInPlace dbus-services/meson.build --replace-fail "dep.get_pkgconfig_variable('session_bus_services_dir')" "'$out/share/dbus-1/services'"
'';
# bin/edje_cc creates $HOME/.run, which would break build of reverse dependencies.
setupHook = writeText "setupHook.sh" ''
export HOME="$TEMPDIR"
'';
preConfigure = ''
# allow ecore_con to find libcurl.so, which is a runtime dependency (it is dlopened)
export LD_LIBRARY_PATH="${curl.out}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
source "$setupHook"
'';
postInstall = ''
# fix use of $out variable
substituteInPlace "$out/share/elua/core/util.lua" --replace-fail '$out' "$out"
rm "$out/share/elua/core/util.lua.orig"
# add all module include dirs to the Cflags field in efl.pc
modules=$(for i in "$out/include/"*/; do printf ' -I''${includedir}/'`basename $i`; done)
substituteInPlace "$out/lib/pkgconfig/efl.pc" \
--replace-fail 'Cflags: -I''${includedir}/efl-1' \
'Cflags: -I''${includedir}/eina-1/eina'"$modules"
# build icon cache
gtk-update-icon-cache "$out"/share/icons/Enlightenment-X
'';
postFixup = ''
# Some libraries are linked at runtime by hand in code (they are dlopened)
patchelf --add-needed ${curl.out}/lib/libcurl.so $out/lib/libecore_con.so
patchelf --add-needed ${libpulseaudio}/lib/libpulse.so $out/lib/libecore_audio.so
patchelf --add-needed ${libsndfile.out}/lib/libsndfile.so $out/lib/libecore_audio.so
'';
passthru.updateScript = directoryListingUpdater { };
__structuredAttrs = true;
meta = {
description = "Enlightenment foundation libraries";
homepage = "https://enlightenment.org/";
license = with lib.licenses; [
bsd2
lgpl2Only
lib.licenses.zlib
];
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
matejc
];
teams = [ lib.teams.enlightenment ];
};
})