From: Antoine Fontaine Date: Thu, 10 Feb 2022 18:29:44 +0000 (+0100) Subject: Add nix flake support for the repo's quake tools (tools like q3map) X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=262f9943214d562e889769d709af4aa8268f0b89;p=xonotic%2Fnetradiant.git 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. --- 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"; + }; + + }; +}