system/pkgs/derivations/polycat/default.nix
2025-06-16 13:06:21 -07:00

89 lines
2.3 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ stdenv, fetchFromGitHub, fetchgit, cmake, lib }:
let
ls = "ls -alR";
in
stdenv.mkDerivation rec {
pname = "polycat";
version = "1.2.0"; # replace with actual version if applicable
src = fetchgit {
# owner = "2IMT";
# repo = "polycat";
# rev = "main"; # or a specific commit/tag
# fetchSubmodules = true;
# deepClone = true;
# leaveDotGit = false;
url = "https://github.com/2IMT/polycat.git";
hash = "sha256-wpDx6hmZe/dLv+F+kbo+YUIZ2A8XgnrZP0amkz6I5IQ="; # replace this with the correct sha256 for the download
};
nativeBuildInputs = [ cmake ];
# argparse = fetchFromGitHub {
# owner = "p-ranav";
# repo = "argparse";
# rev = "v2.9"; # Replace with the version needed by polycat
# sha256 = "1wdpy45qcipfyw9bbr9s42v67b88bkyniy76yvh0grp2wf8zidxx"; # Replace with correct hash
# };
# unpackPhase = ''
# cp -r ${src} ./source
# '';
# sourceRoot = "./source";
# Use this phase to link the argparse dependency
# patchPhase = ''
# # If the `argparse` dependency isnt fetched automatically, fetch it here
# if [ ! -d dep/argparse ]; then
# mkdir -p dep/argparse
# cp -r ${fetchFromGitHub {
# owner = "p-ranav";
# repo = "argparse";
# rev = "v2.9";
# sha256 = "1wdpy45qcipfyw9bbr9s42v67b88bkyniy76yvh0grp2wf8zidxx"; # Replace with actual hash
# }}/* dep/argparse
# fi
# '';
# Unpack and link argparse manually
# unpackPhase = ''
# # Unpack main source
# runHook preUnpack
# tar xzf ${src} --strip-components=1
# runHook postUnpack
# # Unpack argparse and link it
# mkdir -p dep
# tar xzf ${argparse} -C dep --strip-components=1
# ln -s ${argparse} dep/argparse
# '';
# Skip the problematic updateAutotoolsGnuConfigScriptsPhase
configurePhase = ''
# mkdir -p build
# cd polycat
echo ls .
cmake -DCMAKE_BUILD_TYPE=Release .
'';
buildPhase = ''
# mkdir -p build
# cd build
# cmake -DCMAKE_BUILD_TYPE=Release .
cmake --build .
'';
installPhase = ''
mkdir -p $out/bin
cp polycat $out/bin/
'';
meta = with lib; {
description = "runcat module for polybar (or waybar).";
license = licenses.mit; # Replace with correct license
maintainers = with maintainers; [ "2IMT" ];
};
}