|
| 1 | +{ |
| 2 | + lib, |
| 3 | + stdenv, |
| 4 | + fetchFromGitHub, |
| 5 | + makeDesktopItem, |
| 6 | + imagemagick, |
| 7 | + glew110, |
| 8 | + SDL_compat, |
| 9 | + nix-update-script, |
| 10 | +}: |
| 11 | + |
| 12 | +stdenv.mkDerivation (finalAttrs: { |
| 13 | + pname = "blackvoxel"; |
| 14 | + version = "2.5"; |
| 15 | + |
| 16 | + src = fetchFromGitHub { |
| 17 | + owner = "Blackvoxel"; |
| 18 | + repo = "Blackvoxel"; |
| 19 | + tag = finalAttrs.version; |
| 20 | + hash = "sha256-Uj3TfxAsLddsPiWDcLKjpduqvgVjnESZM4YPHT90YYY="; |
| 21 | + }; |
| 22 | + |
| 23 | + nativeBuildInputs = [ imagemagick ]; |
| 24 | + |
| 25 | + buildInputs = [ |
| 26 | + glew110 |
| 27 | + SDL_compat |
| 28 | + ]; |
| 29 | + |
| 30 | + enableParallelBuilding = true; |
| 31 | + |
| 32 | + postPatch = '' |
| 33 | + substituteInPlace src/sc_Squirrel3/sq/Makefile --replace-fail " -m64" "" |
| 34 | + substituteInPlace src/sc_Squirrel3/sqstdlib/Makefile --replace-fail " -m64" "" |
| 35 | + substituteInPlace src/sc_Squirrel3/squirrel/Makefile --replace-fail " -m64" "" |
| 36 | + ''; |
| 37 | + |
| 38 | + buildFlags = [ "BV_DATA_LOCATION_DIR=${placeholder "out"}/data" ]; |
| 39 | + |
| 40 | + # data/gui/gametype_back.bmp isn't exactly the official icon but since |
| 41 | + # there is no official icon we use that one |
| 42 | + postBuild = '' |
| 43 | + convert gui/gametype_back.bmp blackvoxel.png |
| 44 | + ''; |
| 45 | + |
| 46 | + installFlags = [ |
| 47 | + "doinstall=true" |
| 48 | + "BV_DATA_INSTALL_DIR=${placeholder "out"}/data" |
| 49 | + "BV_BINARY_INSTALL_DIR=${placeholder "out"}/bin" |
| 50 | + ]; |
| 51 | + |
| 52 | + postInstall = '' |
| 53 | + install -Dm644 blackvoxel.png $out/share/icons/hicolor/1024x1024/apps/blackvoxel.png |
| 54 | + ''; |
| 55 | + |
| 56 | + desktopItems = [ |
| 57 | + (makeDesktopItem { |
| 58 | + name = "blackvoxel"; |
| 59 | + desktopName = "Blackvoxel"; |
| 60 | + exec = "blackvoxel"; |
| 61 | + icon = "blackvoxel"; |
| 62 | + categories = [ "Game" ]; |
| 63 | + }) |
| 64 | + ]; |
| 65 | + |
| 66 | + passthru.updateScript = nix-update-script { }; |
| 67 | + |
| 68 | + meta = { |
| 69 | + description = "A Sci-Fi game with industry and automation"; |
| 70 | + homepage = "https://www.blackvoxel.com"; |
| 71 | + changelog = "https://github.com/Blackvoxel/Blackvoxel/releases/tag/${finalAttrs.version}"; |
| 72 | + license = with lib.licenses; [ |
| 73 | + # blackvoxel |
| 74 | + gpl3Plus |
| 75 | + # Squirrel |
| 76 | + mit |
| 77 | + ]; |
| 78 | + maintainers = with lib.maintainers; [ |
| 79 | + ethancedwards8 |
| 80 | + marcin-serwin |
| 81 | + ]; |
| 82 | + platforms = lib.platforms.linux; |
| 83 | + }; |
| 84 | +}) |
0 commit comments