Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{ stdenv
, lib
, fetchurl
, unzip
, licenseAccepted ? false
}:

if !licenseAccepted then throw ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must accept the Blizzard® Starcraft® II AI and Machine Learning License at
https://blzdistsc2-a.akamaihd.net/AI_AND_MACHINE_LEARNING_LICENSE.html
by setting nixpkgs config option 'sc2-headless.accept_license = true;'
''
else assert licenseAccepted;
stdenv.mkDerivation rec {
version = "3.17";
name = "sc2-headless-${version}";

src = fetchurl {
url = "https://blzdistsc2-a.akamaihd.net/Linux/SC2.${version}.zip";
sha256 = "1biyxpf7n95hali1pw30h91rhzrj6sbwrx6s52d00mlnwdhmf2v0";
};

unpackCmd = ''
unzip -P 'iagreetotheeula' $curSrc
'';

nativeBuildInputs = [ unzip ];

installPhase = ''
mkdir -p $out
cp -r . "$out"
rm -r $out/Libs
'';

preFixup = ''
find $out -type f -print0 | while IFS=''' read -d ''' -r file; do
isELF "$file" || continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

patchelf \
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath ${lib.makeLibraryPath [stdenv.cc.cc stdenv.cc.libc]} \
"$file"
done
'';

meta = {
platforms = stdenv.lib.platforms.linux;
description = "Starcraft II headless linux client for machine learning research";
license = {
fullName = "BLIZZARD® STARCRAFT® II AI AND MACHINE LEARNING LICENSE";
url = "https://blzdistsc2-a.akamaihd.net/AI_AND_MACHINE_LEARNING_LICENSE.html";
};
};
}
6 changes: 6 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18327,6 +18327,12 @@ with pkgs;

bwa = callPackage ../applications/science/biology/bwa/default.nix { };

### SCIENCE/MACHINE LEARNING

sc2-headless = callPackage ../applications/science/machine-learning/sc2-headless {
licenseAccepted = (config.sc2-headless.accept_license or false);
};

### SCIENCE/MATH

arpack = callPackage ../development/libraries/science/math/arpack { };
Expand Down