aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--flake.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..ddaaef2
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,51 @@
+{
+ description = "Wiimms SZS Tools - command line tools for Mario Kart Wii files";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ };
+
+ outputs = { self, nixpkgs, flake-utils }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = import nixpkgs { inherit system; };
+ version = "2.42a";
+ in {
+ packages = {
+ wiimms-szs-tools = pkgs.stdenv.mkDerivation {
+ pname = "wiimms-szs-tools";
+ inherit version;
+
+ src = ./.;
+
+ buildInputs = with pkgs; [ ncurses libpng zlib ];
+
+ postPatch = ''
+ # Fix shebangs: /usr/bin/env doesn't exist in Nix sandbox
+ sed -i '1s|#!/usr/bin/env bash|#!${pkgs.bash}/bin/bash|' \
+ project/gen-template.sh project/gen-text-file.sh
+ '';
+
+ buildPhase = ''
+ make -C project SHELL=bash NOWIIMM=1
+ '';
+
+ installPhase = ''
+ for tool in wszst wbmgt wctct wimgt wkclt wkmpt wlect wmdlt wpatt wstrt; do
+ install -Dm755 "project/$tool" "$out/bin/$tool"
+ done
+ '';
+
+ meta = with pkgs.lib; {
+ description = "Command-line tools to extract, modify and create Mario Kart Wii files";
+ homepage = "https://szs.wiimm.de/";
+ license = licenses.gpl2Plus;
+ maintainers = [ ];
+ platforms = platforms.linux;
+ };
+ };
+ default = self.packages.${system}.wiimms-szs-tools;
+ };
+ });
+}