package.nix (1706B)
1 { 2 lib, 3 stdenv, 4 rustPlatform, 5 fetchFromGitHub, 6 copyDesktopItems, 7 makeDesktopItem, 8 pkg-config, 9 gtk3, 10 openssl, 11 webkitgtk_4_1, 12 }: 13 14 rustPlatform.buildRustPackage (finalAttrs: { 15 pname = "arnis"; 16 version = "2.4.0"; 17 18 src = fetchFromGitHub { 19 owner = "louis-e"; 20 repo = "arnis"; 21 tag = "v${finalAttrs.version}"; 22 hash = "sha256-A/nDVqv0XA8TD6tfHo9dEknTuhuGmsrv9PqgV7oLPek="; 23 }; 24 25 cargoHash = "sha256-aRrWdTNZV9/ev//pGkOOR8dKUWZG/fk1tLyZzMTbm6Y="; 26 27 nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ 28 copyDesktopItems 29 pkg-config 30 ]; 31 32 buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ 33 gtk3 34 openssl 35 webkitgtk_4_1 36 ]; 37 38 desktopItems = [ 39 (makeDesktopItem { 40 name = "arnis"; 41 type = "Application"; 42 desktopName = "Arnis"; 43 comment = "Generate cities from real life in Minecraft"; 44 exec = "arnis"; 45 icon = "arnis"; 46 terminal = false; 47 startupWMClass = "arnis"; 48 categories = [ 49 "Game" 50 "Utility" 51 "Geoscience" 52 ]; 53 }) 54 ]; 55 56 checkFlags = [ 57 # requires network access 58 "--skip=map_transformation::translate::translator::tests::test_translate_by_vector" 59 ]; 60 61 postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' 62 install -Dm644 assets/icons/icon.png $out/share/icons/hicolor/512x512/apps/arnis.png 63 install -Dm644 assets/icons/128x128.png $out/share/icons/hicolor/128x128/apps/arnis.png 64 ''; 65 66 meta = { 67 description = "Generate real life cities in Minecraft"; 68 homepage = "https://github.com/louis-e/arnis"; 69 license = lib.licenses.asl20; 70 maintainers = [ lib.maintainers.sikmir ]; 71 mainProgram = "arnis"; 72 }; 73 })
