Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 alsa-lib, 3 autoPatchelfHook, 4 copyDesktopItems, 5 fetchurl, 6 fetchzip, 7 lib, 8 libGL, 9 libXScrnSaver, 10 libXcursor, 11 libXi, 12 libXinerama, 13 libXrandr, 14 libXxf86vm, 15 libpulseaudio, 16 libudev0-shim, 17 makeDesktopItem, 18 nix-update-script, 19 stdenv, 20 vulkan-loader, 21 pname ? "daggerfall-unity", 22 includeUnfree ? false, 23}: 24let 25 docFiles = [ 26 (fetchurl { 27 url = "https://www.dfworkshop.net/static_files/daggerfallunity/Daggerfall%20Unity%20Manual.pdf"; 28 hash = "sha256-FywlD0K5b4vUWzyzANlF9575XTDLivbsym7F+qe0Dm8="; 29 name = "Daggerfall Unity Manual.pdf"; 30 meta.license = lib.licenses.mit; 31 }) 32 ] 33 ++ lib.optionals includeUnfree [ 34 (fetchurl { 35 url = "https://cdn.bethsoft.com/bethsoft.com/manuals/Daggerfall/daggerfall-en.pdf"; 36 hash = "sha256-24KSP/E7+KvSRTMDq63NVlVWTFZnQj1yya8wc36yrC0="; 37 meta.license = lib.licenses.unfree; 38 }) 39 ]; 40in 41stdenv.mkDerivation (finalAttrs: { 42 inherit pname; 43 version = "1.1.1"; 44 45 src = fetchzip { 46 url = "https://github.com/Interkarma/daggerfall-unity/releases/download/v${finalAttrs.version}/dfu_linux_64bit-v${finalAttrs.version}.zip"; 47 hash = "sha256-JuhhVLpREM9e9UtlDttvFUhHWpH7Sh79OEo1OM4ggKA="; 48 stripRoot = false; 49 }; 50 51 nativeBuildInputs = [ 52 autoPatchelfHook 53 copyDesktopItems 54 ]; 55 56 buildInputs = [ 57 alsa-lib 58 libGL 59 libXScrnSaver 60 libXcursor 61 libXi 62 libXinerama 63 libXrandr 64 libXxf86vm 65 libpulseaudio 66 libudev0-shim 67 vulkan-loader 68 ]; 69 70 strictDeps = true; 71 72 installPhase = '' 73 runHook preInstall 74 75 mkdir --parents "$out/bin" "$out/share/doc" "$out/share/pixmaps/" 76 cp --recursive * "$out" 77 ln --symbolic "../${finalAttrs.meta.mainProgram}" "$out/bin/" 78 ln --symbolic ../../DaggerfallUnity_Data/Resources/UnityPlayer.png "$out/share/pixmaps/" 79 80 ${lib.strings.concatMapStringsSep "\n" (file: '' 81 cp "${file}" "$out/share/doc/${file.name}" 82 '') docFiles} 83 84 runHook postInstall 85 ''; 86 87 appendRunpaths = [ (lib.makeLibraryPath finalAttrs.buildInputs) ]; 88 89 desktopItems = [ 90 (makeDesktopItem { 91 name = "daggerfall-unity"; 92 desktopName = "Daggerfall Unity"; 93 comment = finalAttrs.meta.description; 94 icon = "UnityPlayer"; 95 exec = finalAttrs.meta.mainProgram; 96 categories = [ "Game" ]; 97 }) 98 ]; 99 100 passthru.updateScript = nix-update-script { 101 extraArgs = [ "--version-regex=^v(\\d+(\\.\\d+)*)$" ]; 102 }; 103 104 meta = { 105 homepage = "https://www.dfworkshop.net/"; 106 description = "Open source recreation of Daggerfall in the Unity engine"; 107 longDescription = '' 108 Daggerfall Unity is an open source recreation of Daggerfall in the Unity engine created by Daggerfall Workshop. 109 110 Experience the adventure and intrigue of Daggerfall with all of its original charm along with hundreds of fixes, quality of life enhancements, and extensive mod support. 111 112 Includes Daggerfall Unity manual. 113 114 ${lib.optionalString includeUnfree '' 115 This "unfree" variant also includes the manual for Daggerfall (the game, not the open source engine). 116 ''} 117 ''; 118 changelog = "https://github.com/Interkarma/daggerfall-unity/releases/tag/v${finalAttrs.version}"; 119 mainProgram = "DaggerfallUnity.x86_64"; 120 license = lib.licenses.mit; 121 maintainers = with lib.maintainers; [ l0b0 ]; 122 platforms = [ "x86_64-linux" ]; 123 }; 124})