self: super: { _1tracker = super.callPackage ( { stdenv, lib, fetchzip , writeText , SDL2, runtimeShell }: let wrapper = writeText "1tracker-wrapper.sh" '' #!@runtime_shell@ cfgdir=''${XDG_DATA_HOME:-$HOME/.local/share}/Shiru/1tracker if [ ! -d $cfgdir ]; then mkdir -p $cfgdir fi if [ ! -f $cfgdir/1tracker.cfg ]; then cp --no-preserve=all @out@/lib/1tracker/1tracker.cfg $cfgdir/1tracker.cfg fi exec @out@/lib/1tracker/1tracker "$@" ''; in stdenv.mkDerivation rec { pname = "1tracker"; version = "0.31"; src = fetchzip { url = "http://shiru.untergrund.net/files/src/1tracker_src.zip"; sha256 = "1wvagmr93pn6r2m0l8pikpbj979diz4xw94445fz8alcf9ay8bca"; }; postPatch = '' substituteInPlace makefile \ --replace '/usr/include/SDL2' '${SDL2.dev}/include/SDL2' substituteInPlace main.cpp \ --replace 'configFileName, baseDirectory' 'configFileName, SDL_GetPrefPath("Shiru", "1tracker")' \ --replace 'logFileName, baseDirectory' 'logFileName, SDL_GetPrefPath("Shiru", "1tracker")' ''; buildInputs = [ SDL2 ]; makeFlags = [ "CXXFLAGS=-DFALSE=false" ]; enableParallelBuilding = true; installPhase = '' runHook preInstall mkdir -p $out/{bin,lib/1tracker} mv colors/ docs/ engines/ examples/ fonts/ 1tracker{.cfg,} $out/lib/1tracker/ substitute ${wrapper} $out/bin/1tracker \ --subst-var-by runtime_shell ${runtimeShell} \ --subst-var out chmod 755 $out/bin/1tracker # Write list and hash files for the tracker pushd $out/lib/1tracker/engines for engine in *; do echo $engine # Ignore non-engines for list, but not for hash if [[ "$engine" == *.1te ]]; then echo $engine >> list grep 'SetTitle' $engine | cut -d'"' -f2 >> list grep 'SetAbout' $engine | cut -d'"' -f2 | sed -e 's/\\n/\n/g' >> list echo "###" >> list fi printf '%-8s' ''${engine:0:8} >> hash done printf '\0' >> hash popd runHook postInstall ''; } ) { }; }