Skip to content

Instantly share code, notes, and snippets.

@ckiee
Created December 10, 2022 20:50
Show Gist options
  • Save ckiee/de4331c485beed9521ef0aa580fa8224 to your computer and use it in GitHub Desktop.
Save ckiee/de4331c485beed9521ef0aa580fa8224 to your computer and use it in GitHub Desktop.
{ stdenv, fetchurl, autoPatchelfHook, libstdcxx5, libX11, libXrender, libXt
, libXext, glib, freetype, fontconfig, alsaLib, dbus-glib, dbus, cairo, pango
, atk, gdk-pixbuf, gtk2, gtk3, gcc49, writeShellScript, coreutils, lib }:
let
version = "2.5";
binary = stdenv.mkDerivation {
pname = "kaiosrt-inner";
inherit version;
src = fetchurl {
url =
"https://s3.amazonaws.com/kaicloudsimulatordl/developer-portal/simulator/Kaiosrt_ubuntu.tar.bz2";
sha256 = "1f7q7iq4azini8aa7fi697awwfrgf6lf7qmizd52w41vnvm1dxll";
};
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [
libX11
libXrender
libXt
libXext
glib
freetype
fontconfig
alsaLib
dbus-glib
dbus
cairo
pango
atk
gdk-pixbuf
gtk2
gtk3
gcc49
];
dontBuild = true;
installPhase = ''
tar -xf kaiosrt-v${version}.en-US.linux-x86_64.tar.bz2
mkdir -p $out/share
cp -r kaiosrt $out/share
'';
};
in stdenv.mkDerivation {
pname = "kaiosrt";
inherit version;
inherit binary;
script = writeShellScript "kaiosrt" ''
export PATH=${lib.makeBinPath [ coreutils ]}
prof="''${XDG_DATA_HOME:-$HOME/.local/share}/kaiosrt"
if [ ! -e "$prof" ]; then
cp -rv ${binary}/share/kaiosrt/gaia/profile "$prof"
chown -R $(id -u) "$prof"
chmod -R 700 "$prof"
fi
${binary}/share/kaiosrt/kaiosrt-bin --profile "$prof"
'';
dontConfigure = true;
dontBuild = true;
dontUnpack = true;
installPhase = ''
install -Dm755 $script $out/bin/kaiosrt
mkdir $out/share
ln -s $binary/share/kaiosrt $out/share
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment