Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 112 lines 2.1 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 SDL2, 6 SDL2_image, 7 SDL2_mixer, 8 SDL2_ttf, 9 boost, 10 cmake, 11 ffmpeg, 12 fuzzylite, 13 innoextract, 14 luajit, 15 minizip, 16 ninja, 17 pkg-config, 18 python3, 19 qtbase, 20 qttools, 21 tbb, 22 unshield, 23 wrapQtAppsHook, 24 xz, 25 zlib, 26 testers, 27 vcmi, 28}: 29 30stdenv.mkDerivation rec { 31 pname = "vcmi"; 32 version = "1.6.8"; 33 34 src = fetchFromGitHub { 35 owner = "vcmi"; 36 repo = "vcmi"; 37 rev = version; 38 fetchSubmodules = true; 39 hash = "sha256-k6tkylNXEzU+zzYoFWtx+AkoHQzAwbBxPB2DVevsryw="; 40 }; 41 42 nativeBuildInputs = [ 43 cmake 44 ninja 45 pkg-config 46 python3 47 wrapQtAppsHook 48 ]; 49 50 buildInputs = [ 51 SDL2 52 SDL2_image 53 SDL2_mixer 54 SDL2_ttf 55 boost 56 ffmpeg 57 fuzzylite 58 luajit 59 minizip 60 qtbase 61 qttools 62 tbb 63 xz 64 zlib 65 ]; 66 67 cmakeFlags = [ 68 "-DENABLE_LUA:BOOL=ON" 69 "-DENABLE_ERM:BOOL=ON" 70 "-DENABLE_GOLDMASTER:BOOL=ON" 71 "-DENABLE_PCH:BOOL=OFF" 72 "-DENABLE_TEST:BOOL=OFF" # Tests require HOMM3 data files. 73 "-DFORCE_BUNDLED_MINIZIP:BOOL=OFF" 74 "-DFORCE_BUNDLED_FL:BOOL=OFF" 75 "-DCMAKE_INSTALL_RPATH:STRING=$out/lib/vcmi" 76 "-DCMAKE_INSTALL_BINDIR:STRING=bin" 77 "-DCMAKE_INSTALL_LIBDIR:STRING=lib" 78 "-DCMAKE_INSTALL_DATAROOTDIR:STRING=share" 79 ]; 80 81 postFixup = '' 82 wrapProgram $out/bin/vcmibuilder \ 83 --prefix PATH : "${ 84 lib.makeBinPath [ 85 innoextract 86 ffmpeg 87 unshield 88 ] 89 }" 90 ''; 91 92 passthru.tests.version = testers.testVersion { 93 package = vcmi; 94 command = '' 95 XDG_DATA_HOME="$TMPDIR" XDG_CACHE_HOME="$TMPDIR" XDG_CONFIG_HOME="$TMPDIR" \ 96 vcmiclient --version 97 ''; 98 }; 99 100 meta = with lib; { 101 description = "Open-source engine for Heroes of Might and Magic III"; 102 homepage = "https://vcmi.eu"; 103 changelog = "https://github.com/vcmi/vcmi/blob/${src.rev}/ChangeLog.md"; 104 license = with licenses; [ 105 gpl2Plus 106 cc-by-sa-40 107 ]; 108 maintainers = with maintainers; [ azahi ]; 109 platforms = platforms.linux; 110 mainProgram = "vcmilauncher"; 111 }; 112}