seamus

commit aa12ec91b5afc3a10b88be78a0da1cf1dce98877

Author: Winston Weinert <git@winny.tech>

packaging: nix flake for use in any x86_64 linux nix setup

 flake.lock | 26 ++++++++++++++++++++++++++
 flake.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++


diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000000000000000000000000000000000000..312af2c341aa9f58bdbcc492fa7b6f68202e6818
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,26 @@
+{
+  "nodes": {
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1685573264,
+        "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "380be19fbd2d9079f677978361792cb25e8a3635",
+        "type": "github"
+      },
+      "original": {
+        "id": "nixpkgs",
+        "ref": "nixos-22.05",
+        "type": "indirect"
+      }
+    },
+    "root": {
+      "inputs": {
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}




diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000000000000000000000000000000000000..8dd54f7af5bbeff49f82a856924d553b98097c5e
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,44 @@
+{
+  inputs.nixpkgs.url = "nixpkgs/nixos-22.05";
+
+  description = "A simple and minimal music player. Uses mpd as backend.";
+
+  outputs = { self, nixpkgs }:
+    let pkgs = import nixpkgs { system = "x86_64-linux"; };
+        libtickit = let
+          name = "libtickit";
+          version = "0.4.3";
+        in
+          with pkgs; stdenv.mkDerivation {
+            inherit name;
+            inherit version;
+            src = fetchurl {
+              url = "http://www.leonerd.org.uk/code/${name}/${name}-${version}.tar.gz";
+              sha256="sha256-qDBYj6H0yZ1UjBHm31AoHCPfoB914quVFR8CcV22vWM=";
+
+            };
+            buildInputs = [ pkg-config libtool ];
+            nativeBuildInputs = [ unibilium libtermkey ];
+            installPhase = ''
+	      runHook preInstall
+              make install PREFIX="$out" DESTDIR=""
+	      runHook postInstall
+            '';
+          };
+        seamus = with pkgs; stdenv.mkDerivation {
+          name = "seamus";
+          src = ./.;
+          nativeBuildInputs = [ pkg-config ];
+          buildInputs = [ libtickit libmpdclient ];
+	  configurePhase = ''
+	    runHook preConfigure
+	    env PREFIX=$out ./configure
+	    runHook postConfigure
+	  '';
+        };
+    in {
+      packages.x86_64-linux.libtickit = libtickit;
+      packages.x86_64-linux.seamus = seamus;
+      packages.x86_64-linux.default = seamus;
+    };
+}