mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 10:23:29 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
77 lines
1.6 KiB
Nix
77 lines
1.6 KiB
Nix
{ lib, stdenv
|
|
, autoreconfHook
|
|
, bison
|
|
, fetchFromGitHub
|
|
, flex
|
|
, lksctp-tools
|
|
, openssl
|
|
, pkg-config
|
|
, sqlite
|
|
, util-linux
|
|
, nixosTests
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "solanum";
|
|
version = "unstable-2022-07-12";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "solanum-ircd";
|
|
repo = pname;
|
|
rev = "860187d02895fc953de3475da07a7a06b9380254";
|
|
hash = "sha256-g8hXmxTfcPDmQ/cu4AI/iJfrhPLaQJEAeMdDhNDsVXs=";
|
|
};
|
|
|
|
patches = [
|
|
./dont-create-logdir.patch
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace include/defaults.h --replace 'ETCPATH "' '"/etc/solanum'
|
|
'';
|
|
|
|
configureFlags = [
|
|
"--enable-epoll"
|
|
"--enable-ipv6"
|
|
"--enable-openssl=${openssl.dev}"
|
|
"--with-program-prefix=solanum-"
|
|
"--localstatedir=/var/lib"
|
|
"--with-rundir=/run"
|
|
"--with-logdir=/var/log"
|
|
] ++ lib.optionals (stdenv.hostPlatform.isLinux) [
|
|
"--enable-sctp=${lksctp-tools.out}/lib"
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
autoreconfHook
|
|
bison
|
|
flex
|
|
pkg-config
|
|
util-linux
|
|
];
|
|
|
|
buildInputs = [
|
|
openssl
|
|
sqlite
|
|
];
|
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin;
|
|
|
|
enableParallelBuilding = true;
|
|
# Missing install depends:
|
|
# ...-binutils-2.40/bin/ld: cannot find ./.libs/libircd.so: No such file or directory
|
|
# collect2: error: ld returned 1 exit status
|
|
# make[4]: *** [Makefile:634: solanum] Error 1
|
|
enableParallelInstalling = false;
|
|
|
|
passthru.tests = { inherit (nixosTests) solanum; };
|
|
|
|
meta = with lib; {
|
|
description = "IRCd for unified networks";
|
|
homepage = "https://github.com/solanum-ircd/solanum";
|
|
license = licenses.gpl2Plus;
|
|
maintainers = with maintainers; [ hexa ];
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|