Turn into flake
This commit is contained in:
parent
6806a90b38
commit
aa8cb1fe2c
6 changed files with 75 additions and 3 deletions
4
Makefile
4
Makefile
|
|
@ -1,4 +1,4 @@
|
|||
export PREFIX = /usr/local
|
||||
export PREFIX = $(out)
|
||||
export DATADIR = $(PREFIX)/share/antigrav
|
||||
|
||||
all:
|
||||
|
|
@ -8,10 +8,10 @@ clean:
|
|||
$(MAKE) -C src clean
|
||||
|
||||
install: all
|
||||
mkdir -p "$(PREFIX)"/bin
|
||||
mkdir -p "$(DATADIR)"
|
||||
mv src/antigrav "$(PREFIX)"/bin/
|
||||
cp data/* "$(DATADIR)"/
|
||||
chown -R root:root "$(PREFIX)"/bin/antigrav "$(DATADIR)"/
|
||||
|
||||
uninstall:
|
||||
rm -rf "$(DATADIR)"
|
||||
|
|
|
|||
24
flake.lock
generated
Normal file
24
flake.lock
generated
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1683408522,
|
||||
"narHash": "sha256-9kcPh6Uxo17a3kK3XCHhcWiV1Yu1kYj22RHiymUhMkU=",
|
||||
"path": "/nix/store/zjpd6dn9kza8zl3l17cwgyifsxbvi3nb-source",
|
||||
"rev": "897876e4c484f1e8f92009fd11b7d988a121a4e7",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
48
flake.nix
Normal file
48
flake.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
outputs = { self, nixpkgs }:
|
||||
let forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
|
||||
in {
|
||||
packages = forAllSystems (system:
|
||||
let pkgs = import nixpkgs { inherit system; };
|
||||
in rec {
|
||||
default = antigrav;
|
||||
antigrav = pkgs.stdenv.mkDerivation {
|
||||
pname = "antigrav";
|
||||
version = "2016-07-13";
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = with pkgs; [ copyDesktopItems ];
|
||||
buildInputs = with pkgs; [ SDL2 openal libpng libGLU freealut ];
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/copy-desktop-items.sh
|
||||
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/make-desktopitem/default.nix
|
||||
#
|
||||
# https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys
|
||||
# https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
|
||||
#
|
||||
# Available categories:
|
||||
# https://specifications.freedesktop.org/menu-spec/latest/apa.html
|
||||
# https://specifications.freedesktop.org/menu-spec/latest/apas02.html
|
||||
desktopItems = [
|
||||
(pkgs.makeDesktopItem {
|
||||
name = "antigravitaattori";
|
||||
icon = "antigravitaattori";
|
||||
exec = "antigrav -f -r 1920";
|
||||
desktopName = "Antigravitaattori";
|
||||
categories = [ "Game" "ArcadeGame" ];
|
||||
})
|
||||
];
|
||||
|
||||
postInstall = "install -D ${./icon_256.png} $out/share/icons/hicolor/256x256/apps/antigravitaattori.png";
|
||||
|
||||
# SDL files are imported directly as "SDL_xyz.h", not as "SDL2/SDL_xyz.h"
|
||||
NIX_CFLAGS_COMPILE = "-I${pkgs.lib.getDev pkgs.SDL2}/include/SDL2";
|
||||
|
||||
# Antigrav calls printf with a string constant instead of a literal.
|
||||
# https://nixos.org/manual/nixpkgs/stable/#sec-hardening-flags-enabled-by-default
|
||||
hardeningDisable = [ "format" ];
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
BIN
icon.xcf
Normal file
BIN
icon.xcf
Normal file
Binary file not shown.
BIN
icon_256.png
Normal file
BIN
icon_256.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
|
|
@ -1,6 +1,6 @@
|
|||
CC = g++
|
||||
CFLAGS = -O2 -D_REENTRANT -I/usr/include/SDL2 -Itinyxml -DTIXML_USE_STL \
|
||||
-DDATADIR="\"$(DATADIR)\""
|
||||
-DDATADIR="\"$(DATADIR)\"" $(NIX_CFLAGS_COMPILE)
|
||||
LDFLAGS = -lpng -lalut -lopenal -lGL -lGLU -lSDL2
|
||||
|
||||
SOURCES = background.cpp \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue