websurfx: init at 1.20.7 (#359459)

This commit is contained in:
Colin 2024-11-29 17:16:14 +00:00 committed by GitHub
commit 7f33274e2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,60 @@
{
lib,
fetchFromGitHub,
rustPlatform,
openssl,
pkg-config,
}:
let
version = "1.20.7";
in
rustPlatform.buildRustPackage {
pname = "websurfx";
inherit version;
src = fetchFromGitHub {
owner = "neon-mmd";
repo = "websurfx";
rev = "refs/tags/v${version}";
hash = "sha256-fpyelpzskwuVrQB1SZ3llnenox7MiOeF+sSJONSdEf0=";
};
nativeBuildInputs = [
pkg-config
];
buildInputs = [
openssl
];
useFetchCargoVendor = true;
cargoHash = "sha256-LnMVfsKb1oTsEKmD/dDnABbWyrYC52e9ASbcMY7qXMw=";
postPatch = ''
substituteInPlace src/handler/mod.rs \
--replace-fail "/etc/xdg" "$out/etc/xdg" \
--replace-fail "/opt/websurfx" "$out/opt/websurfx"
'';
postInstall = ''
mkdir -p $out/etc/xdg
mkdir -p $out/opt/websurfx
cp -r websurfx $out/etc/xdg/
cp -r public $out/opt/websurfx/
'';
meta = {
description = "Open source alternative to searx";
longDescription = ''
An open source alternative to searx which provides a modern-looking,
lightning-fast, privacy respecting, secure meta search engine.
'';
homepage = "https://github.com/neon-mmd/websurfx";
changelog = "https://github.com/neon-mmd/websurfx/releases";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [ theobori ];
mainProgram = "websurfx";
};
}