13 stdenv.mkDerivation rec {
17 src = fetchFromGitHub {
21 hash = "sha256-0c7v5tSqYuqtLOFl4sqD7+naJNqX/wlKHVntkZQGJ8A=";
22 fetchSubmodules = true;
25 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
26 # Expects SDL2.framework in specific location, which we don't have
27 # Passing this in cmakeFlags doesn't work because the path is hard-coded for Darwin
28 substituteInPlace cmake/FindSDL2.cmake \
29 --replace 'set(SDL2_LIBRARIES' 'set(SDL2_LIBRARIES "${SDL2}/lib/libSDL2.dylib") #'
30 # Expects plutil, which we don't have
31 sed -i '/plutil/d' CMakeLists.txt
38 ++ lib.optionals stdenv.hostPlatform.isDarwin [
49 cmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [
50 "-DCMAKE_OSX_ARCHITECTURES=${stdenv.hostPlatform.darwinArch}"
51 # Expects SDL2.framework in specific location, which we don't have
52 "-DSDL2_INCLUDE_DIRS=${SDL2.dev}/include/SDL2"
61 if stdenv.hostPlatform.isDarwin then
63 mkdir -p $out/{bin,Applications}
64 mv {,$out/Applications/}Bugdom.app
65 makeWrapper $out/{Applications/Bugdom.app/Contents/MacOS,bin}/Bugdom
69 mkdir -p $out/share/bugdom
70 mv Data $out/share/bugdom
71 install -Dm755 {.,$out/bin}/Bugdom
72 wrapProgram $out/bin/Bugdom --run "cd $out/share/bugdom"
73 install -Dm644 $src/packaging/io.jor.bugdom.desktop $out/share/applications/io.jor.bugdom.desktop
74 install -Dm644 $src/packaging/io.jor.bugdom.png $out/share/pixmaps/io.jor.bugdom.png
83 description = "Port of Bugdom, a 1999 Macintosh game by Pangea Software, for modern operating systems";
84 homepage = "https://github.com/jorio/Bugdom";
85 license = with licenses; [ cc-by-sa-40 ];
86 maintainers = with maintainers; [ lux ];
87 mainProgram = "Bugdom";
88 platforms = platforms.unix;