mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-21 05:25:38 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
60 lines
1.6 KiB
Nix
60 lines
1.6 KiB
Nix
{ lib, stdenv, fetchpatch, fetchFromGitHub, cmake, openssl, sqlite, pkg-config, systemd
|
|
, tlsSupport ? false }:
|
|
|
|
assert tlsSupport -> openssl != null;
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "uhub";
|
|
version = "0.5.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "janvidar";
|
|
repo = "uhub";
|
|
rev = version;
|
|
sha256 = "0zdbxfvw7apmfhqgsfkfp4pn9iflzwdn0zwvzymm5inswfc00pxg";
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
buildInputs = [ sqlite systemd ] ++ stdenv.lib.optional tlsSupport openssl;
|
|
|
|
outputs = [ "out"
|
|
"mod_example"
|
|
"mod_welcome"
|
|
"mod_logging"
|
|
"mod_auth_simple"
|
|
"mod_auth_sqlite"
|
|
"mod_chat_history"
|
|
"mod_chat_only"
|
|
"mod_topic"
|
|
"mod_no_guest_downloads"
|
|
];
|
|
|
|
patches = [
|
|
./plugin-dir.patch
|
|
# fix aarch64 build: https://github.com/janvidar/uhub/issues/46
|
|
(fetchpatch {
|
|
url = "https://github.com/janvidar/uhub/pull/47.patch";
|
|
sha256 = "07yik6za89ar5bxm7m2183i7f6hfbawbxvd4vs02n1zr2fgfxmiq";
|
|
})
|
|
|
|
# Fixed compilation on systemd > 210
|
|
(fetchpatch {
|
|
url = "https://github.com/janvidar/uhub/commit/70f2a43f676cdda5961950a8d9a21e12d34993f8.diff";
|
|
sha256 = "1jp8fvw6f9jh0sdjml9mahkk6p6b96p6rzg2y601mnnbcdj8y8xp";
|
|
})
|
|
];
|
|
|
|
cmakeFlags = [
|
|
"-DSYSTEMD_SUPPORT=ON"
|
|
(if tlsSupport then "-DSSL_SUPPORT=ON" else "-DSSL_SUPPORT=OFF")
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "High performance peer-to-peer hub for the ADC network";
|
|
homepage = "https://www.uhub.org/";
|
|
license = licenses.gpl3;
|
|
maintainers = [ maintainers.ehmry ];
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|