diff options
author | Dan Haraj <dan@obsidian.systems> | 2017-10-16 15:56:07 -0400 |
---|---|---|
committer | Dan Haraj <dan@obsidian.systems> | 2017-10-16 16:34:00 -0400 |
commit | 188a413ebc0d89f67cb239255ea97f5d147f3b35 (patch) | |
tree | 44bd389c89057ead730ed6b2aaaaf0ff7e263eaf /pkgs | |
parent | 38ffe0e1f6bcce05c7f209666354f3487b512149 (diff) | |
download | nixpkgs-188a413ebc0d89f67cb239255ea97f5d147f3b35.tar nixpkgs-188a413ebc0d89f67cb239255ea97f5d147f3b35.tar.gz nixpkgs-188a413ebc0d89f67cb239255ea97f5d147f3b35.tar.bz2 nixpkgs-188a413ebc0d89f67cb239255ea97f5d147f3b35.tar.lz nixpkgs-188a413ebc0d89f67cb239255ea97f5d147f3b35.tar.xz nixpkgs-188a413ebc0d89f67cb239255ea97f5d147f3b35.tar.zst nixpkgs-188a413ebc0d89f67cb239255ea97f5d147f3b35.zip |
sc2-headless: init at 3.17
This packages up the Starcraft II headless Linux client provided by Blizzard for machine learning research.
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/applications/science/machine-learning/sc2-headless/default.nix | 53 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 6 |
2 files changed, 59 insertions, 0 deletions
diff --git a/pkgs/applications/science/machine-learning/sc2-headless/default.nix b/pkgs/applications/science/machine-learning/sc2-headless/default.nix new file mode 100644 index 00000000000..cf6c3f89920 --- /dev/null +++ b/pkgs/applications/science/machine-learning/sc2-headless/default.nix @@ -0,0 +1,53 @@ +{ stdenv +, lib +, fetchurl +, unzip +, licenseAccepted ? false +}: + +if !licenseAccepted then throw '' + 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 + 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"; + }; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5396e984b91..6057489c565 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { }; |