From 262f9943214d562e889769d709af4aa8268f0b89 Mon Sep 17 00:00:00 2001 From: Antoine Fontaine Date: Thu, 10 Feb 2022 19:29:44 +0100 Subject: [PATCH] Add nix flake support for the repo's quake tools (tools like q3map) A nix flake allows building and running the software with the Nix package manager, used in NixOS or standalone. You can consider as a package or repo description. In this case, this only packages the quake tool binaries, that is h2data, q2map, q3data, q3map2 and qdata3. --- flake.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..cdfed9f4 --- /dev/null +++ b/flake.nix @@ -0,0 +1,42 @@ +{ + #description = "a toolset to manage and build `pk3` or `dpk` source directories"; + + inputs = { + nixpkgs.url = "flake:nixpkgs"; + }; + + outputs = { self, nixpkgs }: + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + in { + + packages.x86_64-linux.quake-tools = + pkgs.stdenv.mkDerivation { + name = "quake-tools"; + + src = pkgs.lib.cleanSource ./.; + + cmakeFlags = [ + "-DGIT_VERSION=nix" # meh + "-DDOWNLOAD_GAMEPACKS=OFF" + "-DBUNDLE_LIBRARIES=OFF" + "-DBUILD_CRUNCH=OFF" + "-DBUILD_DAEMONMAP=OFF" + "-DBUILD_RADIANT=OFF" + "-DBUILD_TOOLS=ON" + "-DFHS_INSTALL=ON" + ]; + + buildInputs = with pkgs; [ + pkg-config gtk2 glib libwebp libxml2 minizip + ]; + nativeBuildInputs = with pkgs; [ + cmake subversion unzip + python3 python38Packages.pyyaml + ]; + + postInstall = "rm -r $out/share"; + }; + + }; +} -- 2.39.2