anchor.diff:      runHook preInstall
   
       mkdir -p $out/bin
  -    rm -r jre_linux # remove jre7
  +    rm -r jre_linux # remove bundled jre7
       rm starfarer.api.zip
       cp -r ./* $out
   
  
positive.code: { lib
  , alsa-lib
  , fetchzip
  , libXxf86vm
  , makeWrapper
  , openjdk
  , stdenv
  , xorg
  , copyDesktopItems
  , makeDesktopItem
  }:
  
  stdenv.mkDerivation rec {
    pname = "starsector";
    version = "0.95.1a-RC5";
  
    src = fetchzip {
      url = "https://s3.amazonaws.com/fractalsoftworks/starsector/starsector_linux-${version}.zip";
      sha256 = "sha256-V8/WQPvPIrF3Tg7JVO+GfeYqWhkWWrnHSVcFXGQqDAA=";
    };
  
    nativeBuildInputs = [
      copyDesktopItems
      makeWrapper
    ];
    buildInputs = with xorg; [
      alsa-lib
      libXxf86vm
    ];
  
    dontBuild = true;
  
  
negative.code:     license = licenses.unfree;
      maintainers = with maintainers; [ bbigras ];
    };
  
    passthru.updateScript = writeScript "starsector-update-script" ''
      #!/usr/bin/env nix-shell
      #!nix-shell -i bash -p curl gnugrep common-updater-scripts
      set -eou pipefail;
      version=$(curl -s https://fractalsoftworks.com/preorder/ | grep -oP "https://s3.amazonaws.com/fractalsoftworks/starsector/starsector_linux-\K.*?(?=\.zip)" | head -1)
      update-source-version ${pname} "$version" --file=./pkgs/games/starsector/default.nix
    '';
  }
  