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

quick-serve: init at 0.2.0 #304618

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
101 changes: 101 additions & 0 deletions pkgs/by-name/qu/quick-serve/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
makeBinaryWrapper,
copyDesktopItems,
makeDesktopItem,
libxkbcommon,
vulkan-loader,
zstd,
stdenv,
darwin,
wayland,
gtk3,
libGL,
wget,
tftp-hpa,
}:
rustPlatform.buildRustPackage rec {
pname = "quick-serve";
version = "0.2.0";

src = fetchFromGitHub {
owner = "joaofl";
repo = "quick-serve";
rev = "v${version}";
hash = "sha256-yO2D3w+aURLX8caFuadzRPdQDlI37ZB4CFzvO4J/zq8=";
};

cargoHash = "sha256-Cogt3eS97CM0Ym0k1C74NfIzNeC3ajIWdTsvwZtRL0U=";

patches = [ ./remove-e2e-test-path.patch ];

nativeBuildInputs = [
pkg-config
makeBinaryWrapper
copyDesktopItems
];

nativeCheckInputs = [
wget
kirillrdy marked this conversation as resolved.
Show resolved Hide resolved
tftp-hpa
];

buildInputs =
[
libxkbcommon
vulkan-loader
zstd
gtk3
libGL
]
++ lib.optionals stdenv.isDarwin (
with darwin.apple_sdk.frameworks;
[
CoreGraphics
Foundation
Metal
QuartzCore
Security
]
)
++ lib.optionals stdenv.isLinux [ wayland ];

runtimeDependencies = [
libxkbcommon
libGL
] ++ lib.optionals stdenv.isLinux [ wayland ];

env = {
ZSTD_SYS_USE_PKG_CONFIG = true;
};

postInstall = ''
wrapProgram $out/bin/quick-serve \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDependencies}"
'';

desktopItems = [
(makeDesktopItem {
name = "Quick Serve";
exec = "quick-serve";
desktopName = "Quick Serve";
comment = "Standalone server for a prompt file serving";
categories = [
"Network"
"Utility"
];
})
];

meta = {
description = "Zero-config, multi-platform, multi-protocol standalone server for a prompt file serving";
homepage = "https://github.com/joaofl/quick-serve";
changelog = "https://github.com/joaofl/quick-serve/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.vinnymeller ];
mainProgram = "quick-serve";
};
}
11 changes: 11 additions & 0 deletions pkgs/by-name/qu/quick-serve/remove-e2e-test-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/src/tests/common.rs
+++ b/src/tests/common.rs
@@ -74,7 +74,6 @@ pub mod tests {
cmd.timeout(Duration::from_secs(3));
cmd.arg("-c");
cmd.arg(&dl_cmd);
- cmd.env("PATH", "/bin");
cmd.unwrap()
});