eSlovensko work

Signed-off-by: main <magic_rb@redalder.org>
This commit is contained in:
main 2022-11-30 18:52:15 +01:00
parent bf870601a0
commit e9a426aeee
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E
2 changed files with 34 additions and 18 deletions

View file

@ -101,7 +101,7 @@
do \
echo "--ro-bind $path $path" ; \
done) \
$([ "$CWD" = "" ] && echo "--cwd $CWD") \
`# $([ "$CWD" = "" ] && echo "--cwd $CWD")` \
\
\
$([ "$ENABLE_PULSEAUDIO" == "1" ] && echo "${concatStringsSep " " [
@ -115,7 +115,7 @@
"--bind /tmp/.X11-unix/X0 /tmp/.X11-unix/X0"
"--ro-bind /home/main/.Xauthority /home/main/.Xauthority"
"--bind /run/nvidia-xdriver-e0a0641b /run/nvidia-xdriver-e0a0641b"
"--bind /run/nvidia-xdriver-27b66c93 /run/nvidia-xdriver-27b66c93"
"--ro-bind /run/opengl-driver-32 /run/opengl-driver-32"
"--ro-bind /run/opengl-driver /run/opengl-driver"
"--ro-bind /sys/dev/char /sys/dev/char"
@ -124,14 +124,14 @@
"$(for dev in /dev/nvidia* ; do echo \"--dev-bind $dev $dev\" ; done)"
]}") \
\
$([ "ENABLE_NETWORK" == "1" ] && echo "${concatStringsSep " " [
$([ "$ENABLE_NETWORK" == "1" ] && echo "${concatStringsSep " " [
"--ro-bind /etc/ssl /etc/ssl"
"--ro-bind /etc/static/ssl /etc/static/ssl"
"--ro-bind /etc/resolv.conf /etc/resolv.conf"
"--share-net"
]}") \
--setenv LD_LIBRARY_PATH "$(echo "''${preload_libraries_new[@]}" | tr ' ' ':')" \
${bwrapArgsPost}
${bwrapArgsPost} \
${exec} ${concatStringsSep " " args}
'';
};

View file

@ -11,21 +11,18 @@
version = "unknown";
src = prev.fetchurl {
url = "https://www.slovensko.sk/static/kep/apps/dlauncher2_2.x/DLauncher2.linux.x86_64.run";
sha256 = "sha256-h2WFm9bUGmc7qSKrO4NOhOvwPsVu85+rGYn5Rs+Kw00=";
url = "https://download.disigcdn.sk/cdn/products/websigner2/disig-web-signer.debian_amd64.deb";
sha256 = "sha256-ryn6Z/4h/ZKpWFq2tYiH3YYmXoAD8t7M8PhIJXCeuv0=";
};
nativeBuildInputs = with prev; [
strace
patchelf
unar
];
phases = [ "installPhase" ];
phases = [ "unpackPhase" ];
installPhase = ''
tmpdir=$(mktemp -d)
cp $src $tmpdir/dlauncher.run
patchelf --debug --set-interpreter ${prev.glibc}/lib64/ld-linux-x86-64.so.2 $tmpdir/dlauncher.run
${prev.glibc}/lib64/ld-linux-x86-64.so.2 $tmpdir/dlauncher.run
unpackPhase = ''
mkdir -p $out
ar p $src data.tar.xz | tar -xJ -C $out
'';
};
unwrapped = prev.stdenv.mkDerivation {
@ -66,22 +63,41 @@
dbus.lib
lzlib
zlib
# openssl_1_1.out
libgcrypt
libsForQt5.qt5.qtsvg
libsForQt5.qt5.qtbase.out
];
bwrapArgsPost = ''
--ro-bind ${unwrapped}/lib/eac_mw_klient/ /usr/lib/eac_mw_klient/ \
--ro-bind ${unwrapped}/bin/EAC_MW_klient /usr/bin/EAC_MW_klient \
--ro-bind /etc/resolv.conf /etc/resolv.conf \
--ro-bind /run/pcscd/ /run/pcscd \
'';
script = ''
export ENABLE_XORG=1 ENABLE_NETWORK=1 QT_DEBUG_PLUGINS=1 QT_QPA_PLATFORM_PLUGIN_PATH=${unwrapped}/lib/eac_mw_klient/platforms/
export BIND_PATHS="$BIND_PATHS /etc/localtime"
preload_libraries+=("${unwrapped}/lib/eac_mw_klient")
preload_libraries+=("${dlauncher}/opt/disig/websigner/lib")
'';
exec = "${prev.strace}/bin/strace";
args = prev.lib.singleton (prev.writeShellScript "eid-bwrap" ''
${prev.ungoogled-chromium} &
${prev.glibc}/lib64/ld-linux-x86-64.so.2 ${unwrapped}/bin/EAC_MW_klient
# exec = "${prev.strace}/bin/strace";
exec = (prev.writeShellScript "eid-bwrap" ''
set -xe
function killstuff {
jobs -p | ${prev.findutils}/bin/xargs kill
}
trap killstuff SIGINT
# ${prev.librewolf}/bin/librewolf &
mkdir -p $HOME/.local/share/Disig/WebSigner/Logs
touch $HOME/.local/share/Disig/WebSigner/Logs/WebSignerLog.txt
${prev.strace}/bin/strace -f ${prev.glibc}/lib64/ld-linux-x86-64.so.2 ${dlauncher}/opt/disig/websigner/bin/WebSigner
cat $HOME/.local/share/Disig/WebSigner/Logs/WebSignerLog.txt
exit 1
# ${prev.glibc}/lib64/ld-linux-x86-64.so.2 ${unwrapped}/bin/EAC_MW_klient
killstuff
'');
name = "eslovensko-eid";
};