Skip to content

Instantly share code, notes, and snippets.

@myme
Last active September 28, 2019 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myme/51d30b6c61dbb7ab8f63448e9e4b6124 to your computer and use it in GitHub Desktop.
Save myme/51d30b6c61dbb7ab8f63448e9e4b6124 to your computer and use it in GitHub Desktop.
Hiri on NixOS
~/tmp/hiri 17s
❯ nix-build hiri-fhs.nix && ./result/bin/hiri
/nix/store/7frna9nf8ak0p9ra8g909w5j0m4jyd15-hiri
Traceback (most recent call last):
File "site-packages/PyInstaller/loader/pyiboot01_bootstrap.py", line 149, in __init__
File "ctypes/__init__.py", line 347, in __init__
OSError: /usr/lib/libgobject-2.0.so.0: undefined symbol: g_date_time_unref
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages/OpenGL/platform/glx.py", line 17, in GL
File "site-packages/OpenGL/platform/ctypesloader.py", line 45, in loadLibrary
File "site-packages/PyInstaller/loader/pyiboot01_bootstrap.py", line 151, in __init__
__main__.PyInstallerImportError: ("Failed to load dynlib/dll 'libGL.so.1'. Most probably this dynlib/dll was not found when the application was frozen.", 'libGL.so.1', 'libGL.so.1')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "hiriapp.py", line 94, in <module>
File "/home/ubuntu/.virtualenvs/hiri/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
File "site-packages/OpenGL/GL/__init__.py", line 3, in <module>
File "/home/ubuntu/.virtualenvs/hiri/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
File "site-packages/OpenGL/error.py", line 12, in <module>
File "/home/ubuntu/.virtualenvs/hiri/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
File "site-packages/OpenGL/platform/__init__.py", line 35, in <module>
File "site-packages/OpenGL/platform/__init__.py", line 32, in _load
File "site-packages/OpenGL/platform/baseplatform.py", line 92, in install
File "site-packages/OpenGL/platform/baseplatform.py", line 14, in __get__
File "site-packages/OpenGL/platform/glx.py", line 96, in GetCurrentContext
File "site-packages/OpenGL/platform/baseplatform.py", line 14, in __get__
File "site-packages/OpenGL/platform/glx.py", line 20, in GL
ImportError: ('Unable to load OpenGL library', "Failed to load dynlib/dll 'libGL.so.1'. Most probably this dynlib/dll was not found when the application was frozen.", 'libGL.so.1', 'libGL.so.1')
[9136] Failed to execute script hiriapp
~/tmp/hiri
❯ nix-build hiri-fhs.nix && ./result/bin/hiri --debug
/nix/store/7frna9nf8ak0p9ra8g909w5j0m4jyd15-hiri
HIRI: /nix/store/y75g1dxijhkp5f4d1yj2iw08xq5dzwhm-source/hiri.sh
bash-4.4$ objdump -t /usr/lib/libgobject-2.0.so.0 | grep date_time_unref
0000000000000000 F *UND* 0000000000000000 g_date_time_unref
bash-4.4$ ldd /usr/lib/libgobject-2.0.so.0
linux-vdso.so.1 (0x00007fff759cb000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f7a3b734000)
libffi.so.6 => /nix/store/a0rz4s781sw9gfi2hvncw577ahh74x3r-libffi-3.2.1/lib/../lib64/libffi.so.6 (0x00007f7a3b727000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f7a3b706000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f7a3b550000)
libpcre.so.1 => /nix/store/0j1sc30kjf9b3j7j0sp68jns2v34apr0-pcre-8.42/lib/libpcre.so.1 (0x00007f7a3b4dc000)
/nix/store/v1dks37jzwmy7r7sfd1famp99508sln6-glibc-multi-2.27/lib/ld-linux-x86-64.so.2 (0x00007f7a3b8d3000)
bash-4.4$ objdump -t /usr/lib/libglib-2.0.so.0 | grep date_time_unref
000000000003c970 g F .text 0000000000000073 g_date_time_unref
bash-4.4$
{
pkgs ? import <nixpkgs> {},
stdenv ? pkgs.stdenv
}:
let
version = "1.4.0.5";
mpdec = pkgs.callPackage ./mpdec.nix {};
in stdenv.mkDerivation {
name = "hiri-${version}";
inherit version;
src = builtins.fetchurl {
url = "https://feedback.hiri.com/downloads/Hiri.tar.gz";
sha256 = "0zz7rvizggvji3n9zzdl91i5zsa56spbarsq7hzx9vgc3vyg2pjk";
};
builder = ./builder.sh;
xkb_config = with pkgs; "${xkeyboard_config}/share/X11/xkb";
buildInputs = with pkgs; [
alsaLib
makeWrapper
autoPatchelfHook
bzip2
cairo
cups
fontconfig
glib
gtk3
libGL
mpdec
nss
qt5.qtconnectivity
qt5.qtmultimedia
qt5.qtquick1
qt5.qtwebsockets
readline
sqlite
stdenv.cc.cc
xkeyboard_config
strace
] ++ (with xorg; [
libX11
libXScrnSaver
libXcomposite
libXcursor
libXdamage
libXi
libXrandr
libXtst
]);
meta = {
description = "Hiri, A linux email client for Exchange and Office 365";
homepage = https://www.hiri.com;
license = stdenv.lib.licenses.unfree;
};
}
{
pkgs ? import <nixpkgs> {},
stdenv ? pkgs.stdenv,
}:
let
version = "1.4.0.5";
hiri-src = builtins.fetchTarball {
url = "https://feedback.hiri.com/downloads/Hiri-x86_64-${version}.tar.gz";
sha256 = "1vs0cz4jccn8kya89z7gc961dghl53mkz0gmv8vwwn293v8qqwsr";
};
in pkgs.buildFHSUserEnv {
name = "hiri";
targetPkgs = ps: with ps; [
# For Python ctypes to find dynlibs (ld, objdump, ..)
binutils
stdenv.cc
# Actual deps
expat
glib
libGL
xkeyboard_config
zlib
];
runScript = pkgs.writeScript "hiri" ''
if [ "$1" = "--debug" ]; then
echo HIRI: ${hiri-src}/hiri.sh
bash
else
${hiri-src}/hiri.sh "$@"
fi
'';
meta = with stdenv.lib; {
description = "Hiri, An email client for Exchange and Office 365";
homepage = https://www.hiri.com;
license = licenses.unfree;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment