nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub, SDL2, cmake, makeWrapper }:
2
3stdenv.mkDerivation rec {
4 pname = "nanosaur2";
5 version = "2.1.0";
6
7 src = fetchFromGitHub {
8 owner = "jorio";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "sha256-UY+fyn8BA/HfCd2LCj5cfGmQACKUICH6CDCW4q6YDkg=";
12 fetchSubmodules = true;
13 };
14
15 nativeBuildInputs = [
16 cmake
17 makeWrapper
18 ];
19 buildInputs = [
20 SDL2
21 ];
22
23 cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
24
25 installPhase = ''
26 runHook preInstall
27 mkdir -p "$out/bin"
28 mkdir -p "$out/share/Nanosaur2"
29 mv Data ReadMe.txt "$out/share/Nanosaur2/"
30 install -Dm755 {.,$out/bin}/Nanosaur2
31 wrapProgram $out/bin/Nanosaur2 --chdir "$out/share/Nanosaur2"
32 install -Dm644 $src/packaging/nanosaur2.desktop $out/share/applications/nanosaur2.desktop
33 install -Dm644 $src/packaging/nanosaur2-desktopicon.png $out/share/pixmaps/nanosaur2-desktopicon.png
34 runHook postInstall
35 '';
36
37 meta = with lib; {
38 description = "A port of Nanosaur2, a 2004 Macintosh game by Pangea Software, for modern operating systems";
39 longDescription = ''
40 Nanosaur is a 2004 Macintosh game by Pangea Software.
41
42 Is a continuation of the original Nanosaur storyline, only this time you get to fly a pterodactyl who’s loaded with hi-tech weaponry.
43 '';
44 homepage = "https://github.com/jorio/Nanosaur2";
45 license = licenses.cc-by-sa-40;
46 maintainers = with maintainers; [ lux ];
47 platforms = platforms.linux;
48 };
49}