{ pkgs ? import {} }: let # We'll depend on Nix packages from bleeding edge channel: # This one is known to work - uncomment if you encounter problems: # pkgs = import (builtins.fetchTarball { # name = "nixos-unstable"; # url = "https://github.com/nixos/nixpkgs/archive/1c0ae9981bda21df665db7f9692562589ef96eb1.tar.gz"; # sha256 = "1jgdiln0zsw4jnfd4pryszyskpadaarabzwgssbi9hs5b7xb4mf6"; # }) {}; version = "3.3.3"; src = ./drovio_3.3.3-antwerp-POC4_amd64.rpm; # Override default libjpeg (turbo) package to also build version 8 of the library (and not just version 9): libjpeg8 = pkgs.libjpeg.override { enableJpeg8 = true; }; # Run-time dependencies buildInputs = with pkgs; ([ glib glibc libgcc glew-egl fontconfig libxkbcommon libva libvdpau libjpeg_original curl xz pcre2 dbus libjpeg8 libuuid libGL icu67 harfbuzz alsa-lib libpulseaudio openssl_1_1 xorg.libXi xorg.libSM xorg.libXtst xorg.libXrandr xorg.xcbutilrenderutil xorg.xcbutilkeysyms xorg.xcbutilimage xorg.xcbutilwm xorg.libX11 xorg.libXext xorg.libXfixes ]); in pkgs.stdenv.mkDerivation { name = "drovio-antwerp-${version}"; system = "x86_64-linux"; inherit src; inherit buildInputs; # Build-time dependencies nativeBuildInputs = with pkgs; [ # In order to extract the RedHat package: python39Packages.rpm cpio makeWrapper autoPatchelfHook # Automatically setup the loader, and do the magic ]; unpackPhase = "true"; installPhase = '' # Basically just extract the RPM archive and move files around: mkdir -p $out rpm2cpio $src | cpio -idmv -D $out mv $out/usr/share $out/share mv $out/opt/drovio $out/bin rm -r $out/usr rmdir $out/opt # Patch .desktop file: substituteInPlace $out/share/applications/drovio.desktop --replace /usr/bin/drovio $out/bin/drovio-gui # The following libraries are not mentioned in the binary, but are loaded at runtime nevertheless: wrapProgram $out/bin/drovio-gui --set LD_LIBRARY_PATH "\$LD_LIBRARY_PATH:${pkgs.libpulseaudio}/lib:${pkgs.alsa-lib}/lib" ''; meta = { description = "Drovio"; homepage = https://www.drovio.com/; license = pkgs.lib.licenses.unfree; maintainers = [ ]; platforms = [ "x86_64-linux" ]; }; }