+/config

my dotfiles and nix configuration

git clone https://git.julia.blue/+/config

Julia RyanUpdate and fix lints387acb1

main
1.7 KiB76 linesraw
1# TODO: scale down icon for other sizes
2{ stdenv, fetchFromGitea, meson, ninja, cmake, python3, xxd, pkg-config,
3  libopus, SDL2, SDL2_mixer, libogg, zlib, makeWrapper,
4  libxscrnsaver, libxcursor, libxi, libxfixes, libxrandr,
5  makeDesktopItem, copyDesktopItems}:
6stdenv.mkDerivation rec {
7  pname = "Apotris";
8  version = "4.0.2";
9
10  src = fetchFromGitea {
11    domain = "gitea.com";
12    owner = "akouzoukos";
13    repo = "apotris";
14    rev = "v${version}";
15    hash = "sha256-w9uv7A1UIn82ORyyvT8dxWHUK9chVfJ191bnI53sANU=";
16    fetchSubmodules = true;
17  };
18
19  nativeBuildInputs = [
20    cmake
21    meson
22    ninja
23    python3
24    xxd
25    pkg-config
26    makeWrapper
27    copyDesktopItems
28  ];
29
30  buildInputs = [
31    SDL2
32    SDL2_mixer
33    libopus
34    libogg
35    zlib
36    libxscrnsaver
37    libxcursor
38    libxi
39    libxfixes
40    libxrandr
41  ];
42
43  desktopItems = [ (makeDesktopItem {
44    desktopName = pname; name = pname; exec = pname; icon = pname;
45    comment = "Block stacking game";
46    type = "Application";
47    categories = [ "Game" ];
48  }) ];
49
50  dontUseCmakeConfigure = true;
51
52  postPatch = ''
53    patchShebangs tools/bin2s.py
54    substituteInPlace source/liba_window.cpp \
55      --replace 'loadAudio("")' 'loadAudio("${builtins.placeholder "out"}/")'
56  '';
57
58  installPhase = let
59    runDir = ''"''${XDG_DATA_HOME-~/.local/share}/apotris"'';
60  in ''
61    runHook preInstall
62
63    mkdir -p $out/bin
64    mv $pname $out/bin/
65    mv assets $out/
66
67    mkdir -p $out/share/icons/hicolor/256x256/apps/
68    mv ../dist/Apotris-switch.jpg $out/share/icons/hicolor/256x256/apps/
69
70    wrapProgram $out/bin/Apotris --run 'mkdir -p ${runDir}' --run 'cd ${runDir}'
71
72    runHook postInstall
73  '';
74
75  meta.broken = stdenv.hostPlatform.isDarwin;
76}