uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,16 @@
{ callPackage, pkgs }:
{
#### CORE EFL
efl = callPackage ./efl { };
#### WINDOW MANAGER
enlightenment = callPackage ./enlightenment { };
#### APPLICATIONS
econnman = callPackage ./econnman { };
ecrire = callPackage ./ecrire { };
ephoto = callPackage ./ephoto { };
evisum = callPackage ./evisum { };
rage = callPackage ./rage { };
terminology = callPackage ./terminology { };
}

View file

@ -0,0 +1,29 @@
{ lib, stdenv, fetchurl, pkg-config, efl, python3Packages, dbus, makeWrapper }:
stdenv.mkDerivation rec {
pname = "econnman";
version = "1.1";
src = fetchurl {
url = "http://download.enlightenment.org/rel/apps/econnman/${pname}-${version}.tar.gz";
sha256 = "057pwwavlvrrq26bncqnfrf449zzaim0zq717xv86av4n940gwv0";
};
nativeBuildInputs = [ makeWrapper pkg-config python3Packages.wrapPython ];
buildInputs = [ efl python3Packages.python dbus ];
pythonPath = [ python3Packages.pythonefl python3Packages.dbus-python ];
postInstall = ''
wrapPythonPrograms
'';
meta = with lib; {
description = "A user interface for the connman network connection manager";
homepage = "https://enlightenment.org/";
license = licenses.lgpl3;
platforms = platforms.linux;
maintainers = with lib.maintainers; [ matejc tstrobel ftrvxmtrx ] ++ teams.enlightenment.members;
};
}

View file

@ -0,0 +1,36 @@
{ lib
, stdenv
, fetchurl
, meson
, ninja
, pkg-config
, efl
}:
stdenv.mkDerivation rec {
pname = "ecrire";
version = "0.2.0";
src = fetchurl {
url = "http://download.enlightenment.org/rel/apps/${pname}/${pname}-${version}.tar.xz";
sha256 = "1pszk583rzclfqy3dyjh1m9pz1hnr84vqz8vw9kngcnmj23mjr6r";
};
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
efl
];
meta = with lib; {
description = "EFL simple text editor";
homepage = "https://www.enlightenment.org/";
license = licenses.gpl3Only;
platforms = platforms.linux;
maintainers = teams.enlightenment.members;
};
}

View file

@ -0,0 +1,213 @@
{ 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
, libinput
, libjpeg
, libpng
, libpulseaudio
, libraw
, librsvg
, libsndfile
, libspectre
, libtiff
, libwebp
, libxkbcommon
, luajit
, lz4
, mesa
, mint-x-icons
, openjpeg
, openssl
, poppler
, python3Packages
, systemd
, udev
, util-linux
, wayland
, wayland-protocols
, writeText
, xorg
, zlib
}:
stdenv.mkDerivation rec {
pname = "efl";
version = "1.26.2";
src = fetchurl {
url = "http://download.enlightenment.org/rel/libs/${pname}/${pname}-${version}.tar.xz";
sha256 = "071h0pscbd8g341yy5rz9mk1xn8yhryldhl6mmr1y6lafaycyy99";
};
nativeBuildInputs = [
meson
ninja
gtk3
pkg-config
check
];
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
openssl
systemd
udev
wayland-protocols
xorg.libX11
xorg.libXcursor
xorg.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
libinput
libjpeg
libraw
librsvg
libspectre
libwebp
libxkbcommon
luajit
mint-x-icons # Mint-X is a parent icon theme of Enlightenment-X
openjpeg
poppler
util-linux
wayland
xorg.libXScrnSaver
xorg.libXcomposite
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXinerama
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.libxcb
];
dontDropIconThemeCache = true;
mesonFlags = [
"--buildtype=release"
"-D build-tests=false" # disable build tests, which are not working
"-D ecore-imf-loaders-disabler=ibus,scim" # ibus is disabled by default, scim is not availabe in nixpkgs
"-D embedded-lz4=false"
"-D fb=true"
"-D network-backend=connman"
"-D sdl=true"
"-D elua=true"
"-D bindings=lua,cxx"
# for wayland client support
"-D wl=true"
"-D 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 "sys_dep.get_pkgconfig_variable('systemduserunitdir')" "'$out/systemd/user'"
substituteInPlace dbus-services/meson.build --replace "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 '$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 '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
'';
meta = with lib; {
description = "Enlightenment foundation libraries";
homepage = "https://enlightenment.org/";
license = with licenses; [ bsd2 lgpl2Only licenses.zlib ];
platforms = platforms.linux;
maintainers = with maintainers; [ matejc tstrobel ftrvxmtrx ] ++ teams.enlightenment.members;
};
}

View file

@ -0,0 +1,14 @@
--- ./src/scripts/elua/core/util.lua.old 2015-05-17 11:59:57.307743243 +0200
+++ ./src/scripts/elua/core/util.lua 2015-05-17 12:39:11.906797377 +0200
@@ -159,7 +159,10 @@
local ev = os.getenv("ELUA_" .. libname:upper() .. "_LIBRARY_PATH")
local succ, v = load_lib(libname, ev)
if not succ then
- error(v, 2)
+ succ, v = load_lib(libname, "$out/lib")
+ if not succ then
+ error(v, 2)
+ end
end
lib = v
loaded_libs[libname] = lib

View file

@ -0,0 +1,115 @@
From 2c563889fcad37df4ee4251bf0a63316d8b7b612 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= <malaquias@gmail.com>
Date: Thu, 14 May 2020 16:36:34 -0300
Subject: [PATCH] wrapped setuid executables
Installing programs with root ownership and setuid/setgid permissions
in /nix/store is not allowed. They should be wrapped in the
enlightenment service module, and the wrapped ones should be used
instead.
---
meson/meson_inst.sh | 4 ++--
src/bin/e_auth.c | 6 ++----
src/bin/e_fm/e_fm_main_eeze.c | 6 +++---
src/bin/e_start_main.c | 3 +--
src/bin/e_system.c | 2 +-
5 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/meson/meson_inst.sh b/meson/meson_inst.sh
index 321143e40..cd2399306 100755
--- a/meson/meson_inst.sh
+++ b/meson/meson_inst.sh
@@ -1,6 +1,6 @@
#!/bin/sh
for x in "$@" ; do
- chown root "$DESTDIR/$x"
- chmod a=rx,u+xs "$DESTDIR/$x"
+ echo TODO: chown root "$DESTDIR/$x"
+ echo TODO: chmod a=rx,u+xs "$DESTDIR/$x"
done
diff --git a/src/bin/e_auth.c b/src/bin/e_auth.c
index 6d07a0ac3..d519f0649 100644
--- a/src/bin/e_auth.c
+++ b/src/bin/e_auth.c
@@ -38,8 +38,7 @@ e_auth_begin(char *passwd)
pwlen = strlen(passwd);
snprintf(buf, sizeof(buf),
- "%s/enlightenment/utils/enlightenment_ckpasswd pw",
- e_prefix_lib_get());
+ "/run/wrappers/bin/enlightenment_ckpasswd pw");
exe = ecore_exe_pipe_run(buf, ECORE_EXE_PIPE_WRITE, NULL);
if (!exe) goto out;
snprintf(buf, sizeof(buf), "pw %s", passwd);
@@ -75,8 +74,7 @@ e_auth_polkit_begin(char *passwd, const char *cookie, unsigned int uid)
pwlen = strlen(passwd);
snprintf(buf, sizeof(buf),
- "%s/enlightenment/utils/enlightenment_ckpasswd pk",
- e_prefix_lib_get());
+ "/run/wrappers/bin/enlightenment_ckpasswd pk");
exe = ecore_exe_pipe_run(buf, ECORE_EXE_PIPE_WRITE, NULL);
if (!exe) goto out;
snprintf(buf, sizeof(buf), "%s %u %s", cookie, uid, passwd);
diff --git a/src/bin/e_fm/e_fm_main_eeze.c b/src/bin/e_fm/e_fm_main_eeze.c
index 9b10b3117..0f0aa5b53 100644
--- a/src/bin/e_fm/e_fm_main_eeze.c
+++ b/src/bin/e_fm/e_fm_main_eeze.c
@@ -318,7 +318,7 @@ _e_fm_main_eeze_volume_eject(E_Volume *v)
{
char buf[PATH_MAX];
- snprintf(buf, sizeof(buf), "%s/enlightenment/utils/enlightenment_sys", eina_prefix_lib_get(pfx));
+ snprintf(buf, sizeof(buf), "/run/wrappers/bin/enlightenment_sys");
eeze_disk_mount_wrapper_set(v->disk, buf);
}
v->guard = ecore_timer_loop_add(E_FM_EJECT_TIMEOUT, (Ecore_Task_Cb)_e_fm_main_eeze_vol_eject_timeout, v);
@@ -512,7 +512,7 @@ _e_fm_main_eeze_volume_unmount(E_Volume *v)
{
char buf[PATH_MAX];
- snprintf(buf, sizeof(buf), "%s/enlightenment/utils/enlightenment_sys", eina_prefix_lib_get(pfx));
+ snprintf(buf, sizeof(buf), "/run/wrappers/bin/enlightenment_sys");
eeze_disk_mount_wrapper_set(v->disk, buf);
}
v->guard = ecore_timer_loop_add(E_FM_UNMOUNT_TIMEOUT, (Ecore_Task_Cb)_e_fm_main_eeze_vol_unmount_timeout, v);
@@ -548,7 +548,7 @@ _e_fm_main_eeze_volume_mount(E_Volume *v)
{
char buf2[PATH_MAX];
- snprintf(buf2, sizeof(buf2), "%s/enlightenment/utils/enlightenment_sys", eina_prefix_lib_get(pfx));
+ snprintf(buf2, sizeof(buf2), "/run/wrappers/bin/enlightenment_sys");
eeze_disk_mount_wrapper_set(v->disk, buf2);
}
v->guard = ecore_timer_loop_add(E_FM_MOUNT_TIMEOUT, (Ecore_Task_Cb)_e_fm_main_eeze_vol_mount_timeout, v);
diff --git a/src/bin/e_start_main.c b/src/bin/e_start_main.c
index 722063339..ee85aa9f1 100644
--- a/src/bin/e_start_main.c
+++ b/src/bin/e_start_main.c
@@ -596,8 +596,7 @@ main(int argc, char **argv)
eina_prefix_data_get(pfx));
putenv(buf2);
myasprintf(&buf3,
- "E_ALERT_SYSTEM_BIN=%s/enlightenment/utils/enlightenment_system",
- eina_prefix_lib_get(pfx));
+ "E_ALERT_SYSTEM_BIN=/run/wrappers/bin/enlightenment_system");
putenv(buf3);
home = getenv("HOME");
diff --git a/src/bin/e_system.c b/src/bin/e_system.c
index bfd43e7e2..6bf48e31f 100644
--- a/src/bin/e_system.c
+++ b/src/bin/e_system.c
@@ -133,7 +133,7 @@ _system_spawn(void)
else _respawn_count = 0;
if (_respawn_count > 5) return;
snprintf(buf, sizeof(buf),
- "%s/enlightenment/utils/enlightenment_system", e_prefix_lib_get());
+ "/run/wrappers/bin/enlightenment_system");
_system_exe = ecore_exe_pipe_run
(buf, ECORE_EXE_NOT_LEADER | ECORE_EXE_TERM_WITH_PARENT |
ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_WRITE, NULL);
--
2.34.0

View file

@ -0,0 +1,25 @@
From b7ef2a0d3f31db55a12b2b8c2e1c60ba62b971c8 Mon Sep 17 00:00:00 2001
From: Matt Bagnara <mbagnara@fastmail.com>
Date: Wed, 1 Jul 2020 15:30:40 -0500
Subject: [PATCH] add nixos path
---
src/bin/e_util_suid.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bin/e_util_suid.h b/src/bin/e_util_suid.h
index b01ff792b..88c2a0f17 100644
--- a/src/bin/e_util_suid.h
+++ b/src/bin/e_util_suid.h
@@ -246,7 +246,7 @@ e_setuid_setup(uid_t *caller_uid, gid_t *caller_gid, char **caller_user, char **
# endif
#endif
// pass 3 - set path and ifs to minimal defaults
- putenv("PATH=/bin:/usr/bin:/sbin:/usr/sbin");
+ putenv("PATH=/bin:/usr/bin:/sbin:/usr/sbin:/run/current-system/sw/bin");
putenv("IFS= \t\n");
return 0;
}
--
2.27.0

View file

@ -0,0 +1,80 @@
{ lib, stdenv
, fetchurl
, meson
, ninja
, pkg-config
, gettext
, alsa-lib
, acpid
, bc
, ddcutil
, efl
, libexif
, pam
, xkeyboard_config
, udisks2
, waylandSupport ? false, wayland-protocols, xwayland
, bluetoothSupport ? true, bluez5
, pulseSupport ? !stdenv.isDarwin, libpulseaudio
}:
stdenv.mkDerivation rec {
pname = "enlightenment";
version = "0.25.3";
src = fetchurl {
url = "http://download.enlightenment.org/rel/apps/${pname}/${pname}-${version}.tar.xz";
sha256 = "1xngwixp0cckfq3jhrdmmk6zj67125amr7g6xwc6l89pnpmlkz9p";
};
nativeBuildInputs = [
gettext
meson
ninja
pkg-config
];
buildInputs = [
alsa-lib
acpid # for systems with ACPI for lid events, AC/Battery plug in/out etc
bc # for the Everything module calculator mode
ddcutil # specifically libddcutil.so.2 for backlight control
efl
libexif
pam
xkeyboard_config
udisks2 # for removable storage mounting/unmounting
]
++ lib.optional bluetoothSupport bluez5 # for bluetooth configuration and control
++ lib.optional pulseSupport libpulseaudio # for proper audio device control and redirection
++ lib.optionals waylandSupport [ wayland-protocols xwayland ]
;
patches = [
# Executables cannot be made setuid in nix store. They should be
# wrapped in the enlightenment service module, and the wrapped
# executables should be used instead.
./0001-wrapped-setuid-executables.patch
./0003-setuid-missing-path.patch
];
postPatch = ''
substituteInPlace src/modules/everything/evry_plug_calc.c \
--replace "ecore_exe_pipe_run(\"bc -l\"" "ecore_exe_pipe_run(\"${bc}/bin/bc -l\""
'';
mesonFlags = [
"-D systemdunitdir=lib/systemd/user"
] ++ lib.optional waylandSupport "-Dwl=true";
passthru.providedSessions = [ "enlightenment" ];
meta = with lib; {
description = "The Compositing Window Manager and Desktop Shell";
homepage = "https://www.enlightenment.org";
license = licenses.bsd2;
platforms = platforms.linux;
maintainers = with maintainers; [ matejc tstrobel ftrvxmtrx ] ++ teams.enlightenment.members;
};
}

View file

@ -0,0 +1,36 @@
{ lib
, stdenv
, fetchurl
, meson
, ninja
, pkg-config
, efl
}:
stdenv.mkDerivation rec {
pname = "ephoto";
version = "1.6.0";
src = fetchurl {
url = "http://download.enlightenment.org/rel/apps/${pname}/${pname}-${version}.tar.xz";
sha256 = "1lvhcs4ba8h3z78nyycbww8mj4cscb8k200dcc3cdy8vrvrp7g1n";
};
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
efl
];
meta = with lib; {
description = "Image viewer and editor written using the Enlightenment Foundation Libraries";
homepage = "https://www.smhouston.us/ephoto/";
license = licenses.bsd2;
platforms = platforms.linux;
maintainers = teams.enlightenment.members;
};
}

View file

@ -0,0 +1,36 @@
{ lib
, stdenv
, fetchurl
, meson
, ninja
, pkg-config
, efl
}:
stdenv.mkDerivation rec {
pname = "evisum";
version = "0.6.0";
src = fetchurl {
url = "https://download.enlightenment.org/rel/apps/${pname}/${pname}-${version}.tar.xz";
sha256 = "1ip3rmp0hcn0pk6lv089cayx18p1b2wycgvwpnf7ghbdxg7n4q15";
};
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
efl
];
meta = with lib; {
description = "System and process monitor written with EFL";
homepage = "https://www.enlightenment.org";
license = with licenses; [ isc ];
platforms = platforms.linux;
maintainers = teams.enlightenment.members;
};
}

View file

@ -0,0 +1,44 @@
{ lib
, stdenv
, fetchurl
, meson
, ninja
, pkg-config
, efl
, gst_all_1
, wrapGAppsHook
}:
stdenv.mkDerivation rec {
pname = "rage";
version = "0.4.0";
src = fetchurl {
url = "http://download.enlightenment.org/rel/apps/${pname}/${pname}-${version}.tar.xz";
sha256 = "03yal7ajh57x2jhmygc6msf3gzvqkpmzkqzj6dnam5sim8cq9rbw";
};
nativeBuildInputs = [
meson
ninja
pkg-config
wrapGAppsHook
];
buildInputs = [
efl
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad
gst_all_1.gst-libav
];
meta = with lib; {
description = "Video and audio player along the lines of mplayer";
homepage = "https://enlightenment.org/";
license = licenses.bsd2;
platforms = platforms.linux;
maintainers = with maintainers; [ matejc ftrvxmtrx ] ++ teams.enlightenment.members;
};
}

View file

@ -0,0 +1,36 @@
{ lib, stdenv, fetchurl, meson, ninja, pkg-config, python3, efl, nixosTests }:
stdenv.mkDerivation rec {
pname = "terminology";
version = "1.12.1";
src = fetchurl {
url = "https://download.enlightenment.org/rel/apps/${pname}/${pname}-${version}.tar.xz";
sha256 = "1aasddf2343qj798b5s8qwif3lxj4pyjax6fa9sfi6if9icdkkpq";
};
nativeBuildInputs = [
meson
ninja
pkg-config
python3
];
buildInputs = [
efl
];
postPatch = ''
patchShebangs data/colorschemes/*.py
'';
passthru.tests.test = nixosTests.terminal-emulators.terminology;
meta = with lib; {
description = "Powerful terminal emulator based on EFL";
homepage = "https://www.enlightenment.org/about-terminology";
license = licenses.bsd2;
platforms = platforms.linux;
maintainers = with maintainers; [ matejc tstrobel ftrvxmtrx ] ++ teams.enlightenment.members;
};
}