From 72dc6e15cb97e03151b2929858fed3c46edcff5e Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 31 Dec 2014 13:07:17 +0100 Subject: Move everything into /humblebundle/. We don't just want HumbleBundle games, so let's try to keep the directory structure that way very early. Signed-off-by: aszlig --- bastion.nix | 25 -------- cavestoryplus.nix | 39 ------------- default.nix | 24 -------- fetch-humble-bundle/default.nix | 87 ---------------------------- fez.nix | 35 ----------- ftl.nix | 38 ------------ hammerwatch.nix | 40 ------------- humblebundle/bastion.nix | 25 ++++++++ humblebundle/cavestoryplus.nix | 39 +++++++++++++ humblebundle/default.nix | 24 ++++++++ humblebundle/fetch-humble-bundle/default.nix | 87 ++++++++++++++++++++++++++++ humblebundle/fez.nix | 35 +++++++++++ humblebundle/ftl.nix | 38 ++++++++++++ humblebundle/hammerwatch.nix | 40 +++++++++++++ humblebundle/jamestown.nix | 55 ++++++++++++++++++ humblebundle/megabytepunch.nix | 18 ++++++ humblebundle/rocketbirds.nix | 11 ++++ humblebundle/spaz.nix | 39 +++++++++++++ humblebundle/swordsandsoldiers.nix | 43 ++++++++++++++ jamestown.nix | 55 ------------------ megabytepunch.nix | 18 ------ rocketbirds.nix | 11 ---- spaz.nix | 39 ------------- swordsandsoldiers.nix | 43 -------------- 24 files changed, 454 insertions(+), 454 deletions(-) delete mode 100644 bastion.nix delete mode 100644 cavestoryplus.nix delete mode 100644 default.nix delete mode 100644 fetch-humble-bundle/default.nix delete mode 100644 fez.nix delete mode 100644 ftl.nix delete mode 100644 hammerwatch.nix create mode 100644 humblebundle/bastion.nix create mode 100644 humblebundle/cavestoryplus.nix create mode 100644 humblebundle/default.nix create mode 100644 humblebundle/fetch-humble-bundle/default.nix create mode 100644 humblebundle/fez.nix create mode 100644 humblebundle/ftl.nix create mode 100644 humblebundle/hammerwatch.nix create mode 100644 humblebundle/jamestown.nix create mode 100644 humblebundle/megabytepunch.nix create mode 100644 humblebundle/rocketbirds.nix create mode 100644 humblebundle/spaz.nix create mode 100644 humblebundle/swordsandsoldiers.nix delete mode 100644 jamestown.nix delete mode 100644 megabytepunch.nix delete mode 100644 rocketbirds.nix delete mode 100644 spaz.nix delete mode 100644 swordsandsoldiers.nix diff --git a/bastion.nix b/bastion.nix deleted file mode 100644 index 652b8011..00000000 --- a/bastion.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ stdenv, fetchHumbleBundle, lzma, mono }: - -let - arch = if stdenv.system == "i686-linux" then "x86" - else if stdenv.system == "x86_64-linux" then "x86_64" - else throw "Unsupported architecture ${stdenv.system}!"; -in stdenv.mkDerivation rec { - name = "bastion-1.4"; - - src = fetchHumbleBundle { - name = "Bastion-HIB-2012-06-20.sh"; - md5 = "aa6ccaead3b4b8a5fbd156f4019e8c8b"; - }; - - unpackCmd = '' - mkdir "${name}" - - sh "$src" --tar xf ./instarchive_all -O | ${lzma}/bin/lzcat \ - | tar x -C "${name}" Bastion.exe - ''; - - installPhase = '' - install -vD "Bastion.bin.${arch}" "$out/bin/bastion" - ''; -} diff --git a/cavestoryplus.nix b/cavestoryplus.nix deleted file mode 100644 index 6f343c0c..00000000 --- a/cavestoryplus.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ stdenv, fetchHumbleBundle, makeWrapper, SDL, mesa }: - -stdenv.mkDerivation rec { - name = "cave-story-plus-${version}"; - version = "r100"; - - src = fetchHumbleBundle { - machineName = "cavestoryplus_linux"; - downloadName = ".tar.bz2"; - suffix = "tar.bz2"; - md5 = "b7ecd65644b8607bc177d7ce670f2185"; - }; - - buildInputs = [ makeWrapper ]; - - patchPhase = let - rpath = stdenv.lib.makeLibraryPath [ - SDL "$out" stdenv.cc.gcc mesa - ]; - in '' - patchelf \ - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${rpath}" CaveStory+_64 - ''; - - installPhase = '' - install -vD CaveStory+_64 "$out/libexec/cave-story-plus/cave-story-plus" - mkdir -p "$out/bin" - makeWrapper \ - "$out/libexec/cave-story-plus/cave-story-plus" \ - "$out/bin/cave-story-plus" \ - --run "cd '$out/share/cave-story-plus'" - - mkdir -p "$out/share/cave-story-plus" - cp -vrt "$out/share/cave-story-plus" data - ''; - - dontStrip = true; -} diff --git a/default.nix b/default.nix deleted file mode 100644 index 30d341f3..00000000 --- a/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ email, password }: - -with import {}; - -let - self = rec { - callPackage = pkgs.lib.callPackageWith (pkgs // self); - - fetchHumbleBundle = callPackage ./fetch-humble-bundle { - inherit email password; - }; - - bastion = callPackage ./bastion.nix {}; - cavestoryplus = callPackage ./cavestoryplus.nix {}; - fez = callPackage ./fez.nix {}; - ftl = callPackage ./ftl.nix {}; - hammerwatch = callPackage ./hammerwatch.nix {}; - jamestown = callPackage ./jamestown.nix {}; - megabytepunch = callPackage ./megabytepunch.nix {}; - rocketbirds = callPackage ./rocketbirds.nix {}; - spaz = callPackage ./spaz.nix {}; - swordsandsoldiers = callPackage ./swordsandsoldiers.nix {}; - }; -in self diff --git a/fetch-humble-bundle/default.nix b/fetch-humble-bundle/default.nix deleted file mode 100644 index 3ef2cbe6..00000000 --- a/fetch-humble-bundle/default.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ stdenv, curl, cacert, email, password, writeText, fetchFromGitHub -, python, buildPythonPackage, pythonPackages, fetchpatch -}: - -{ machineName, downloadName ? "Download", suffix ? "humblebundle", md5 }: let - cafile = "${cacert}/etc/ca-bundle.crt"; - - humbleAPI = buildPythonPackage rec { - name = "humblebundle-${version}"; - version = "0.1.0"; - - src = fetchFromGitHub { - owner = "saik0"; - repo = "humblebundle-python"; - rev = version; - sha256 = "04kwghlwgdrhhr8dzc7avr5banpcwcaflh1v81r35jm0yf8inzsa"; - }; - - patches = stdenv.lib.singleton (fetchpatch { - url = "https://github.com/saik0/humblebundle-python/pull/7.patch"; - sha256 = "106306029drs6pi8jp520bm3903w06j7sh1hq57ncbd85h15fzzx"; - }); - - propagatedBuildInputs = with pythonPackages; [ requests2 ]; - }; - - getDownloadURL = writeText "gethburl.py" '' - import sys, humblebundle - - def get_products(client): - gamekeys = client.get_gamekeys() - for gamekey in gamekeys: - order = hb.get_order(gamekey) - if order.subproducts is None: - continue - for subproduct in order.subproducts: - prodname = subproduct.human_name.encode('ascii', 'replace') - downloads = [(download.machine_name, download.download_struct) - for download in subproduct.downloads] - yield (prodname, downloads) - - def find_download(downloads): - for machine_name, dstruct in sum(downloads.values(), []): - if machine_name == '${machineName}': - for ds in dstruct: - if ds.name == '${downloadName}': - return ds - print >>sys.stderr, \ - 'Unable to find ${downloadName} for ${machineName}!' - print >>sys.stderr, 'Available download types:' - for ds in dstruct: - print >>sys.stderr, " " + ds.name - raise SystemExit(1) - - hb = humblebundle.HumbleApi() - hb.login('${email}', '${password}') - products = dict(get_products(hb)) - dstruct = find_download(products) - - if dstruct is None: - print >>sys.stderr, 'Cannot find download for ${machineName}!' - print >>sys.stderr, 'Available machine names:' - for name, dstructs in sorted(products.items(), key=lambda x: x[0]): - print >>sys.stderr, " * " + name - print >>sys.stderr, " " + ', '.join(map(lambda x: x[0], dstructs)) - raise SystemExit(1) - elif dstruct.md5 != '${md5}': - print >>sys.stderr, \ - 'MD5 for ${machineName} is not ${md5} but ' + dstruct.md5 + '.' - raise SystemExit(1) - else: - print dstruct.url.web - ''; -in stdenv.mkDerivation { - name = "${machineName}.${suffix}"; - outputHashAlgo = "md5"; - outputHash = md5; - - buildInputs = [ python humbleAPI ]; - - buildCommand = '' - url="$(python "${getDownloadURL}")" - header "downloading $name from $url" - ${curl}/bin/curl --cacert "${cafile}" --fail --output "$out" "$url" - stopNest - ''; -} diff --git a/fez.nix b/fez.nix deleted file mode 100644 index 5f23b97c..00000000 --- a/fez.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ stdenv, fetchHumbleBundle, unzip, mono, openal, SDL2 }: - -let - version = "1.0.2"; - usVersion = stdenv.lib.replaceChars ["."] ["_"] version; -in stdenv.mkDerivation rec { - name = "fez-${version}"; - version = "09152013"; - - src = fetchHumbleBundle { - name = "${name}-bin"; - md5 = "4ac954101835311f3528f5369e1fecb7"; - }; - - unpackPhase = '' - ${unzip}/bin/unzip -qq "$src" 'data/*' || true - sourceRoot=data - ''; - - dontStrip = true; - - buildPhase = '' - patchelf \ - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${stdenv.lib.makeLibraryPath [ mono openal SDL2 ]}" \ - FEZ.bin.x86_64 - ''; - - installPhase = '' - ensureDir "$out/bin" "$out/libexec/fez/mono/2.0" - install -vD FEZ.bin.x86_64 "$out/libexec/fez/fez" - install -vt "$out/libexec/fez/mono/2.0" *.dll - ln -s "$out/libexec/fez/fez" "$out/bin/fez" - ''; -} diff --git a/ftl.nix b/ftl.nix deleted file mode 100644 index 17d484dc..00000000 --- a/ftl.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ stdenv, fetchHumbleBundle, makeWrapper, SDL, mesa, libdevil, freetype }: - -stdenv.mkDerivation rec { - name = "ftl-${version}"; - version = "1.5.13"; - - src = fetchHumbleBundle { - machineName = "ftlfasterthanlight_soundtrack_linux"; - downloadName = ".tar.gz"; - suffix = "tar.gz"; - md5 = "791e0bc8de73fcdcd5f461a4548ea2d8"; - }; - - buildInputs = [ makeWrapper ]; - - patchPhase = let - rpath = stdenv.lib.makeLibraryPath [ - SDL "$out" stdenv.cc.gcc mesa libdevil freetype - ]; - in '' - patchelf \ - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${rpath}" data/amd64/bin/FTL - ''; - - installPhase = '' - install -vD "data/amd64/bin/FTL" "$out/libexec/ftl/FTL" - install -vD "data/amd64/lib/libbass.so" "$out/lib/libbass.so" - install -vD "data/amd64/lib/libbassmix.so" "$out/lib/libbassmix.so" - - mkdir -p "$out/bin" "$out/share/ftl" - cp -vrt "$out/share/ftl" data/resources - makeWrapper "$out/libexec/ftl/FTL" "$out/bin/ftl" \ - --run "cd '$out/share/ftl'" - ''; - - dontStrip = true; -} diff --git a/hammerwatch.nix b/hammerwatch.nix deleted file mode 100644 index 8cf65211..00000000 --- a/hammerwatch.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ stdenv, fetchHumbleBundle, makeWrapper, unzip, mono, SDL2, mesa, openal -, pulseaudio -}: - -# FIXME: Dosn't support the XDG Base Directory Specification, -# so enforce it using LD_PRELOAD maybe? - -stdenv.mkDerivation rec { - name = "hammerwatch-${version}"; - version = "1.3"; - - src = fetchHumbleBundle { - machineName = "hammerwatch_linux"; - suffix = "zip"; - md5 = "7cd77e4395f394c3062322c96e418732"; - }; - - buildInputs = [ unzip makeWrapper ]; - - installPhase = let - rpath = stdenv.lib.makeLibraryPath [ SDL2 mesa openal pulseaudio ]; - monoNoLLVM = mono.override { withLLVM = false; }; - in '' - mkdir -p "$out/lib" - cp -rt "$out/lib" SDL2-CS.dll SDL2-CS.dll.config \ - TiltedEngine.dll Lidgren.Network.dll FarseerPhysicsOTK.dll \ - ICSharpCode.SharpZipLib.dll SteamworksManaged.dll NVorbis.dll - - libexec="$out/libexec/hammerwatch" - install -vD Hammerwatch.exe "$libexec/hammerwatch.exe" - cp -rt "$libexec" assets.bin editor levels - - makeWrapper "${monoNoLLVM}/bin/mono" "$out/bin/hammerwatch" \ - --add-flags "$libexec/hammerwatch.exe" \ - --set MONO_PATH "$out/lib" \ - --set LD_LIBRARY_PATH "${rpath}" - ''; - - dontStrip = true; -} diff --git a/humblebundle/bastion.nix b/humblebundle/bastion.nix new file mode 100644 index 00000000..652b8011 --- /dev/null +++ b/humblebundle/bastion.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchHumbleBundle, lzma, mono }: + +let + arch = if stdenv.system == "i686-linux" then "x86" + else if stdenv.system == "x86_64-linux" then "x86_64" + else throw "Unsupported architecture ${stdenv.system}!"; +in stdenv.mkDerivation rec { + name = "bastion-1.4"; + + src = fetchHumbleBundle { + name = "Bastion-HIB-2012-06-20.sh"; + md5 = "aa6ccaead3b4b8a5fbd156f4019e8c8b"; + }; + + unpackCmd = '' + mkdir "${name}" + + sh "$src" --tar xf ./instarchive_all -O | ${lzma}/bin/lzcat \ + | tar x -C "${name}" Bastion.exe + ''; + + installPhase = '' + install -vD "Bastion.bin.${arch}" "$out/bin/bastion" + ''; +} diff --git a/humblebundle/cavestoryplus.nix b/humblebundle/cavestoryplus.nix new file mode 100644 index 00000000..6f343c0c --- /dev/null +++ b/humblebundle/cavestoryplus.nix @@ -0,0 +1,39 @@ +{ stdenv, fetchHumbleBundle, makeWrapper, SDL, mesa }: + +stdenv.mkDerivation rec { + name = "cave-story-plus-${version}"; + version = "r100"; + + src = fetchHumbleBundle { + machineName = "cavestoryplus_linux"; + downloadName = ".tar.bz2"; + suffix = "tar.bz2"; + md5 = "b7ecd65644b8607bc177d7ce670f2185"; + }; + + buildInputs = [ makeWrapper ]; + + patchPhase = let + rpath = stdenv.lib.makeLibraryPath [ + SDL "$out" stdenv.cc.gcc mesa + ]; + in '' + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${rpath}" CaveStory+_64 + ''; + + installPhase = '' + install -vD CaveStory+_64 "$out/libexec/cave-story-plus/cave-story-plus" + mkdir -p "$out/bin" + makeWrapper \ + "$out/libexec/cave-story-plus/cave-story-plus" \ + "$out/bin/cave-story-plus" \ + --run "cd '$out/share/cave-story-plus'" + + mkdir -p "$out/share/cave-story-plus" + cp -vrt "$out/share/cave-story-plus" data + ''; + + dontStrip = true; +} diff --git a/humblebundle/default.nix b/humblebundle/default.nix new file mode 100644 index 00000000..30d341f3 --- /dev/null +++ b/humblebundle/default.nix @@ -0,0 +1,24 @@ +{ email, password }: + +with import {}; + +let + self = rec { + callPackage = pkgs.lib.callPackageWith (pkgs // self); + + fetchHumbleBundle = callPackage ./fetch-humble-bundle { + inherit email password; + }; + + bastion = callPackage ./bastion.nix {}; + cavestoryplus = callPackage ./cavestoryplus.nix {}; + fez = callPackage ./fez.nix {}; + ftl = callPackage ./ftl.nix {}; + hammerwatch = callPackage ./hammerwatch.nix {}; + jamestown = callPackage ./jamestown.nix {}; + megabytepunch = callPackage ./megabytepunch.nix {}; + rocketbirds = callPackage ./rocketbirds.nix {}; + spaz = callPackage ./spaz.nix {}; + swordsandsoldiers = callPackage ./swordsandsoldiers.nix {}; + }; +in self diff --git a/humblebundle/fetch-humble-bundle/default.nix b/humblebundle/fetch-humble-bundle/default.nix new file mode 100644 index 00000000..3ef2cbe6 --- /dev/null +++ b/humblebundle/fetch-humble-bundle/default.nix @@ -0,0 +1,87 @@ +{ stdenv, curl, cacert, email, password, writeText, fetchFromGitHub +, python, buildPythonPackage, pythonPackages, fetchpatch +}: + +{ machineName, downloadName ? "Download", suffix ? "humblebundle", md5 }: let + cafile = "${cacert}/etc/ca-bundle.crt"; + + humbleAPI = buildPythonPackage rec { + name = "humblebundle-${version}"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "saik0"; + repo = "humblebundle-python"; + rev = version; + sha256 = "04kwghlwgdrhhr8dzc7avr5banpcwcaflh1v81r35jm0yf8inzsa"; + }; + + patches = stdenv.lib.singleton (fetchpatch { + url = "https://github.com/saik0/humblebundle-python/pull/7.patch"; + sha256 = "106306029drs6pi8jp520bm3903w06j7sh1hq57ncbd85h15fzzx"; + }); + + propagatedBuildInputs = with pythonPackages; [ requests2 ]; + }; + + getDownloadURL = writeText "gethburl.py" '' + import sys, humblebundle + + def get_products(client): + gamekeys = client.get_gamekeys() + for gamekey in gamekeys: + order = hb.get_order(gamekey) + if order.subproducts is None: + continue + for subproduct in order.subproducts: + prodname = subproduct.human_name.encode('ascii', 'replace') + downloads = [(download.machine_name, download.download_struct) + for download in subproduct.downloads] + yield (prodname, downloads) + + def find_download(downloads): + for machine_name, dstruct in sum(downloads.values(), []): + if machine_name == '${machineName}': + for ds in dstruct: + if ds.name == '${downloadName}': + return ds + print >>sys.stderr, \ + 'Unable to find ${downloadName} for ${machineName}!' + print >>sys.stderr, 'Available download types:' + for ds in dstruct: + print >>sys.stderr, " " + ds.name + raise SystemExit(1) + + hb = humblebundle.HumbleApi() + hb.login('${email}', '${password}') + products = dict(get_products(hb)) + dstruct = find_download(products) + + if dstruct is None: + print >>sys.stderr, 'Cannot find download for ${machineName}!' + print >>sys.stderr, 'Available machine names:' + for name, dstructs in sorted(products.items(), key=lambda x: x[0]): + print >>sys.stderr, " * " + name + print >>sys.stderr, " " + ', '.join(map(lambda x: x[0], dstructs)) + raise SystemExit(1) + elif dstruct.md5 != '${md5}': + print >>sys.stderr, \ + 'MD5 for ${machineName} is not ${md5} but ' + dstruct.md5 + '.' + raise SystemExit(1) + else: + print dstruct.url.web + ''; +in stdenv.mkDerivation { + name = "${machineName}.${suffix}"; + outputHashAlgo = "md5"; + outputHash = md5; + + buildInputs = [ python humbleAPI ]; + + buildCommand = '' + url="$(python "${getDownloadURL}")" + header "downloading $name from $url" + ${curl}/bin/curl --cacert "${cafile}" --fail --output "$out" "$url" + stopNest + ''; +} diff --git a/humblebundle/fez.nix b/humblebundle/fez.nix new file mode 100644 index 00000000..5f23b97c --- /dev/null +++ b/humblebundle/fez.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchHumbleBundle, unzip, mono, openal, SDL2 }: + +let + version = "1.0.2"; + usVersion = stdenv.lib.replaceChars ["."] ["_"] version; +in stdenv.mkDerivation rec { + name = "fez-${version}"; + version = "09152013"; + + src = fetchHumbleBundle { + name = "${name}-bin"; + md5 = "4ac954101835311f3528f5369e1fecb7"; + }; + + unpackPhase = '' + ${unzip}/bin/unzip -qq "$src" 'data/*' || true + sourceRoot=data + ''; + + dontStrip = true; + + buildPhase = '' + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${stdenv.lib.makeLibraryPath [ mono openal SDL2 ]}" \ + FEZ.bin.x86_64 + ''; + + installPhase = '' + ensureDir "$out/bin" "$out/libexec/fez/mono/2.0" + install -vD FEZ.bin.x86_64 "$out/libexec/fez/fez" + install -vt "$out/libexec/fez/mono/2.0" *.dll + ln -s "$out/libexec/fez/fez" "$out/bin/fez" + ''; +} diff --git a/humblebundle/ftl.nix b/humblebundle/ftl.nix new file mode 100644 index 00000000..17d484dc --- /dev/null +++ b/humblebundle/ftl.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchHumbleBundle, makeWrapper, SDL, mesa, libdevil, freetype }: + +stdenv.mkDerivation rec { + name = "ftl-${version}"; + version = "1.5.13"; + + src = fetchHumbleBundle { + machineName = "ftlfasterthanlight_soundtrack_linux"; + downloadName = ".tar.gz"; + suffix = "tar.gz"; + md5 = "791e0bc8de73fcdcd5f461a4548ea2d8"; + }; + + buildInputs = [ makeWrapper ]; + + patchPhase = let + rpath = stdenv.lib.makeLibraryPath [ + SDL "$out" stdenv.cc.gcc mesa libdevil freetype + ]; + in '' + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${rpath}" data/amd64/bin/FTL + ''; + + installPhase = '' + install -vD "data/amd64/bin/FTL" "$out/libexec/ftl/FTL" + install -vD "data/amd64/lib/libbass.so" "$out/lib/libbass.so" + install -vD "data/amd64/lib/libbassmix.so" "$out/lib/libbassmix.so" + + mkdir -p "$out/bin" "$out/share/ftl" + cp -vrt "$out/share/ftl" data/resources + makeWrapper "$out/libexec/ftl/FTL" "$out/bin/ftl" \ + --run "cd '$out/share/ftl'" + ''; + + dontStrip = true; +} diff --git a/humblebundle/hammerwatch.nix b/humblebundle/hammerwatch.nix new file mode 100644 index 00000000..8cf65211 --- /dev/null +++ b/humblebundle/hammerwatch.nix @@ -0,0 +1,40 @@ +{ stdenv, fetchHumbleBundle, makeWrapper, unzip, mono, SDL2, mesa, openal +, pulseaudio +}: + +# FIXME: Dosn't support the XDG Base Directory Specification, +# so enforce it using LD_PRELOAD maybe? + +stdenv.mkDerivation rec { + name = "hammerwatch-${version}"; + version = "1.3"; + + src = fetchHumbleBundle { + machineName = "hammerwatch_linux"; + suffix = "zip"; + md5 = "7cd77e4395f394c3062322c96e418732"; + }; + + buildInputs = [ unzip makeWrapper ]; + + installPhase = let + rpath = stdenv.lib.makeLibraryPath [ SDL2 mesa openal pulseaudio ]; + monoNoLLVM = mono.override { withLLVM = false; }; + in '' + mkdir -p "$out/lib" + cp -rt "$out/lib" SDL2-CS.dll SDL2-CS.dll.config \ + TiltedEngine.dll Lidgren.Network.dll FarseerPhysicsOTK.dll \ + ICSharpCode.SharpZipLib.dll SteamworksManaged.dll NVorbis.dll + + libexec="$out/libexec/hammerwatch" + install -vD Hammerwatch.exe "$libexec/hammerwatch.exe" + cp -rt "$libexec" assets.bin editor levels + + makeWrapper "${monoNoLLVM}/bin/mono" "$out/bin/hammerwatch" \ + --add-flags "$libexec/hammerwatch.exe" \ + --set MONO_PATH "$out/lib" \ + --set LD_LIBRARY_PATH "${rpath}" + ''; + + dontStrip = true; +} diff --git a/humblebundle/jamestown.nix b/humblebundle/jamestown.nix new file mode 100644 index 00000000..15900bba --- /dev/null +++ b/humblebundle/jamestown.nix @@ -0,0 +1,55 @@ +{ stdenv, fetchHumbleBundle, unzip, pkgsi686Linux, expect, makeWrapper +, SDL, openal +}: + +let + version = "1.0.2"; + usVersion = stdenv.lib.replaceChars ["."] ["_"] version; +in stdenv.mkDerivation rec { + name = "jamestown-${version}"; + + src = fetchHumbleBundle { + machineName = "jamestown_linux"; + downloadName = ".zip"; + suffix = "zip"; + md5 = "dcfb4348aba89f0f26bf5b4c7e05d936"; + }; + + buildInputs = [ makeWrapper ]; + + unpackPhase = '' + ${unzip}/bin/unzip -q "$src" + patchelf --set-interpreter "${pkgsi686Linux.glibc}"/lib/ld-linux.so.* \ + "JamestownInstaller_${usVersion}-bin" + ${expect}/bin/expect <