Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiny-dfr: init at 0.2.0 #277549

Merged
merged 1 commit into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions pkgs/by-name/ti/tiny-dfr/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{ lib, rustPlatform, fetchFromGitHub, pkg-config
, cairo, gdk-pixbuf, glib, libinput, libxml2, pango, udev
}:

rustPlatform.buildRustPackage rec {
pname = "tiny-dfr";
version = "0.2.0";

src = fetchFromGitHub {
owner = "WhatAmISupposedToPutHere";
repo = "tiny-dfr";
rev = "v${version}";
hash = "sha256-oawKYrfXAQ5RFMdUCG7F12wHcnFif++44s2KsX9ns6U=";
};

cargoHash = "sha256-QOkztErJLFXPxCb8MvaXi7jGXeI5A0q8LwZtYddzUZE=";

nativeBuildInputs = [ pkg-config ];
buildInputs = [ cairo gdk-pixbuf glib libinput libxml2 pango udev ];

postConfigure = ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
postConfigure = ''
postPatch = ''

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? I think this makes more semantic sense in configurePhase, since that's where build systems (when they actually support it like autoconf, cmake or meson, and unlike cargo) will do this sort of substitution based on configuration.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's kinda a patch, so it should live in patchPhase

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this blocking an addition of this pkg? I would personally go with patch phase since there is no real support for configuration upstream, however I don't think it's really essential

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no real support for patching upstream either, but the fact is that we have a configure phase, and replacing placeholder paths with environment-specific ones is exactly what the configure phase is for. I don't intend to change it.

substituteInPlace etc/systemd/system/tiny-dfr.service \
--replace-fail /usr/bin $out/bin
substituteInPlace src/*.rs --replace-quiet /usr/share $out/share
'';

postInstall = ''
cp -R etc $out/lib
cp -R share $out
'';

meta = with lib; {
homepage = "https://github.com/WhatAmISupposedToPutHere/tiny-dfr";
description = "The most basic dynamic function row daemon possible";
license = [ licenses.asl20 licenses.mit ];
mainProgram = "tiny-dfr";
maintainers = [ maintainers.qyliss ];
platforms = platforms.linux;
alyssais marked this conversation as resolved.
Show resolved Hide resolved
};
}