Merge pull request #59 from librekeys/build/nix-package

build(package.nix): revert to stable version '0.3.1'
This commit is contained in:
Suyog Tandel
2026-02-15 23:31:47 +05:30
committed by GitHub
+44 -41
View File
@@ -1,80 +1,83 @@
{
lib,
stdenv,
rustPlatform,
buildNpmPackage,
fetchFromGitHub,
makeDesktopItem,
pkg-config,
cargo-tauri,
wrapGAppsHook3,
copyDesktopItems,
makeWrapper,
glib,
gtk3,
openssl,
hidapi,
pcsclite,
udev,
alsa-lib,
libxkbcommon,
wayland,
libGL,
vulkan-loader,
libx11,
libxcb,
withGLES ? false,
webkitgtk_4_1,
}:
assert withGLES -> stdenv.hostPlatform.isLinux;
rustPlatform.buildRustPackage (finalAttrs: {
pname = "picoforge";
version = "0.3.1-unstable-2026-02-08";
version = "0.3.1";
src = fetchFromGitHub {
owner = "librekeys";
repo = "picoforge";
rev = "430aec1f3429ee8b89470f78d6db8c22c5de7db4";
hash = "sha256-BWLLmINoKC+nIuY8KWfzhOnYtuo2KrbHd2jdappPyuE=";
rev = "v${finalAttrs.version}";
hash = "sha256-v3N/E80mS8KZafWJ5T6BD3+O9LL+iwNXFEThbo4Lf0Y=";
};
cargoHash = "sha256-be0ycwwDxlBaKxQsTGidZC0loFh91HXMpr0jMHfbAd4=";
cargoRoot = "src-tauri";
buildAndTestSubdir = finalAttrs.cargoRoot;
cargoHash = "sha256-DB54egPebUniP/yjEZc+/AY9vOChJRBA+tqnbISmEgg=";
postPatch = ''
sed -i src-tauri/tauri.conf.json -e '/beforeBuildCommand/d'
'';
nativeBuildInputs = [
pkg-config
cargo-tauri.hook
wrapGAppsHook3
copyDesktopItems
]
++ lib.optionals stdenv.hostPlatform.isLinux [
makeWrapper
];
gpu-lib = if withGLES then libGL else vulkan-loader;
buildInputs = [
glib
gtk3
openssl
hidapi
pcsclite
udev
]
++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
libxkbcommon
wayland
finalAttrs.gpu-lib
libx11
libxcb
webkitgtk_4_1
];
postInstall = ''
install -Dm644 ${finalAttrs.src}/static/appIcons/in.suyogtandel.picoforge.svg $out/share/icons/hicolor/scalable/apps/picoforge.svg
frontendDist = buildNpmPackage {
name = "${finalAttrs.pname}-${finalAttrs.version}-frontend-dist";
inherit (finalAttrs) src;
npmDepsHash = "sha256-yCs/Fvtf0m5eW/m+Revzn3q1P7wwkwinUBHLOcV06/M=";
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r build/* $out
runHook postInstall
'';
};
preBuild = ''
cp -r ${finalAttrs.frontendDist} build
'';
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
wrapProgram $out/bin/picoforge --prefix LD_LIBRARY_PATH : "${
lib.makeLibraryPath [
wayland
libxkbcommon
finalAttrs.gpu-lib
libx11
libxcb
]
}"
postInstall = ''
install -Dm644 ${finalAttrs.src}/static/in.suyogtandel.picoforge.svg $out/share/icons/hicolor/scalable/apps/picoforge.svg
'';
desktopItems = [