summary refs log tree commit diff
path: root/pkgs/games/pioneer
diff options
context:
space:
mode:
authorR. RyanTM <ryantm-bot@ryantm.com>2022-02-17 13:21:12 -0800
committerGitHub <noreply@github.com>2022-02-17 22:21:12 +0100
commit2ba87397c1764946db46a44feccc94394e778a2f (patch)
tree752fadf9bdd01a4b10aa1139f5f3be80f4829a54 /pkgs/games/pioneer
parent97aeab9782a1bb107d4456c6950d6b6630555aff (diff)
downloadnixpkgs-2ba87397c1764946db46a44feccc94394e778a2f.tar
nixpkgs-2ba87397c1764946db46a44feccc94394e778a2f.tar.gz
nixpkgs-2ba87397c1764946db46a44feccc94394e778a2f.tar.bz2
nixpkgs-2ba87397c1764946db46a44feccc94394e778a2f.tar.lz
nixpkgs-2ba87397c1764946db46a44feccc94394e778a2f.tar.xz
nixpkgs-2ba87397c1764946db46a44feccc94394e778a2f.tar.zst
nixpkgs-2ba87397c1764946db46a44feccc94394e778a2f.zip
pioneer: 20210723 -> 20220203
* pioneer: 20210723 -> 20220203 (#159679)

add missing deps mesa and lua5_2
use CMake flags to use Lua from nixpkgs
patch to use version tag instead of build date
use SPDX 3.0 license identifier

Co-authored-by: Renaud <c0bw3b@users.noreply.github.com>
Diffstat (limited to 'pkgs/games/pioneer')
-rw-r--r--pkgs/games/pioneer/default.nix55
1 files changed, 43 insertions, 12 deletions
diff --git a/pkgs/games/pioneer/default.nix b/pkgs/games/pioneer/default.nix
index 82879d0a9d2..b70ef8c3dab 100644
--- a/pkgs/games/pioneer/default.nix
+++ b/pkgs/games/pioneer/default.nix
@@ -1,37 +1,68 @@
-{ fetchFromGitHub, lib, stdenv, cmake, pkg-config, curl, libsigcxx, SDL2
-, SDL2_image, freetype, libvorbis, libpng, assimp, libGLU, libGL
-, glew
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, assimp
+, curl
+, freetype
+#, glew
+, libGL
+, libGLU
+, libpng
+, libsigcxx
+, libvorbis
+, lua5_2
+, mesa
+, SDL2
+, SDL2_image
 }:
 
 stdenv.mkDerivation rec {
   pname = "pioneer";
-  version = "20210723";
+  version = "20220203";
 
   src = fetchFromGitHub{
     owner = "pioneerspacesim";
     repo = "pioneer";
     rev = version;
-    sha256 = "sha256-w+ECVv96MoS69815+X0PqguDiGDhHoTnAnnYtLpMScI=";
+    hash = "sha256-HNVg8Lq6k6gQDmgOdpnBwJ57WSEnn5XwtqzmkDU1WGI=";
   };
 
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace 'string(TIMESTAMP PROJECT_VERSION "%Y%m%d")' 'set(PROJECT_VERSION ${version})'
+  '';
+
   nativeBuildInputs = [ cmake pkg-config ];
 
   buildInputs = [
-    curl libsigcxx SDL2 SDL2_image freetype libvorbis libpng
-    assimp libGLU libGL glew
+    assimp
+    curl
+    freetype
+    libGL
+    libGLU
+    libpng
+    libsigcxx
+    libvorbis
+    lua5_2
+    mesa
+    SDL2
+    SDL2_image
   ];
 
-  preConfigure = ''
-    export PIONEER_DATA_DIR="$out/share/pioneer/data";
-  '';
+  cmakeFlags = [
+    "-DPIONEER_DATA_DIR:PATH=${placeholder "out"}/share/pioneer/data"
+    "-DUSE_SYSTEM_LIBLUA:BOOL=YES"
+  ];
 
-  makeFlags = [ "build-data" ];
+  makeFlags = [ "all" "build-data" ];
 
   meta = with lib; {
     description = "A space adventure game set in the Milky Way galaxy at the turn of the 31st century";
     homepage = "https://pioneerspacesim.net";
     license = with licenses; [
-        gpl3 cc-by-sa-30
+        gpl3Only cc-by-sa-30
     ];
     platforms = [ "x86_64-linux" "i686-linux" ];
   };