Created
October 27, 2018 10:31
-
-
Save mgttlinger/5c8849688940100a30fab0f12393797b to your computer and use it in GitHub Desktop.
MineTime derivation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? import <nixpkgs> {} }: | |
nixpkgs.pkgs.callPackage ./minetime.nix {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, lib, makeWrapper, fetchurl, patchelf, binutils, alsaLib, atk, cairo, cups, dbus, nss, nspr, fontconfig, gtk3-x11, xorg, gdk_pixbuf, glib, gnome2, expat, udev, coreutils, gnome3 }: | |
stdenv.mkDerivation rec { | |
name = "minetime-${version}"; | |
version = "1.4.5"; | |
src = fetchurl { | |
url = "https://github.com/marcoancona/MineTime/releases/download/v${version}/MineTime_${version}_amd64.deb"; | |
sha256 = "021pkdkxa60xa9hrbsl4wy6h8l7h71vazpdb2zqfrdmgnwfmzm3l"; | |
}; | |
unpackCmd = '' | |
ar p "$src" data.tar.xz | tar xJ | |
''; | |
sourceRoot = "."; | |
nativeBuildInputs = [ patchelf makeWrapper coreutils ]; | |
buildInputs = [ binutils coreutils gnome3.gnome-keyring ]; | |
installPhase = '' | |
mkdir -p $out/bin | |
cp -R usr/share opt $out/ | |
# fix the path in the desktop file | |
substituteInPlace \ | |
$out/share/applications/minetime.desktop \ | |
--replace /opt/ $out/opt/ | |
# symlink the binary to bin/ | |
ln -s $out/opt/MineTime/minetime $out/bin/minetime | |
''; | |
preFixup = with stdenv.lib; let | |
lpath = makeLibraryPath [ | |
alsaLib # | |
atk # | |
cairo # | |
cups # | |
dbus # | |
nss # | |
nspr # | |
fontconfig # | |
gtk3-x11 # | |
xorg.libX11 # | |
xorg.libXcursor # | |
xorg.libXdamage # | |
xorg.libXi # | |
xorg.libXext # | |
xorg.libXfixes # | |
xorg.libXrandr # | |
xorg.libXrender # | |
xorg.libXcomposite # | |
xorg.libXtst # | |
xorg.libXScrnSaver # | |
xorg.libxcb # | |
gdk_pixbuf # | |
glib # | |
gnome3.libsecret | |
gnome2.pango # | |
gnome2.GConf # | |
expat # | |
stdenv.cc.cc.lib # | |
udev # | |
]; | |
in '' | |
patchelf \ | |
--set-rpath "$out/opt/MineTime:${lpath}" \ | |
$out/opt/MineTime/libnode.so | |
patchelf \ | |
--set-rpath "$out/opt/MineTime:${lpath}" \ | |
$out/opt/MineTime/libffmpeg.so | |
patchelf \ | |
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ | |
--set-rpath "$out/opt/MineTime:${lpath}" \ | |
$out/opt/MineTime/minetime | |
patchelf \ | |
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ | |
$out/opt/MineTime/resources/app.asar.unpacked/bin/mongo/linux/mongod | |
wrapProgram $out/opt/MineTime/minetime --set LD_LIBRARY_PATH "${xorg.libxkbfile}/lib:${lpath}" | |
''; | |
meta = with stdenv.lib; { | |
homepage = https://minetime.ai/; | |
description = "A modern, intuitive and smart calendar application"; | |
license = licenses.proprietary; | |
platforms = [ "x86_64-linux" ]; | |
maintainers = [ maintainers.mgttlinger ]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment