23 version = "unstable-2023-03-21";
25 src = fetchFromGitHub {
28 rev = "af2cfda21b6ce4c0725700e2a01b0597a97dbeff";
29 hash = "sha256-jBWdXzbPpk23elHcs5sWkxXfkekj+aa24VvEHzid8KE=";
56 # Since we bypass the "build-linux/go" wrapper script so we can use nixpkgs'
57 # autotools/make integration, set the release flags manually.
58 # https://github.com/Bithack/principia/issues/98
60 RELEASE_SHARED="-ffast-math -DNDEBUG=1 -s -fomit-frame-pointer -fvisibility=hidden -fdata-sections -ffunction-sections"
62 CFLAGS="$RELEASE_SHARED -O1"
63 CXXFLAGS="$RELEASE_SHARED -O2 -fvisibility-inlines-hidden -fno-rtti"
64 LDFLAGS="-Wl,-O,-s,--gc-sections"
68 # `make install` only installs the binary, and the binary looks for data
69 # files in its same directory, so we override installPhase, install the
70 # binary in $out/share, and link to it from $out/bin
75 mkdir -p $out/share/principia
76 install -Dm755 principia $out/share/principia/principia
77 ln -s $out/share/principia/principia $out/bin/principia
79 cp -r --dereference data-pc data-shared $out/share/principia/
80 install -Dm644 principia.desktop $out/share/applications/principia.desktop
81 install -Dm644 principia-url-handler.desktop $out/share/applications/principia-url-handler.desktop
82 install -Dm644 principia.png $out/share/pixmaps/principia.png
87 # The actual binary is here, see comment above installPhase
88 stripDebugList = [ "share/principia" ];
91 description = "Physics-based sandbox game";
92 homepage = "https://principia-web.se/";
93 downloadPage = "https://principia-web.se/download";
94 license = licenses.bsd3;
95 maintainers = [ maintainers.fgaz ];
96 platforms = platforms.linux;