Files
nixpkgs/pkgs/by-name/cw/cwtch/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

54 lines
1.4 KiB
Nix

{
buildGoModule,
fetchgit,
lib,
}:
buildGoModule rec {
pname = "libcwtch";
version = "0.1.7";
# This Gitea instance has archive downloads disabled, so: fetchgit
src = fetchgit {
url = "https://git.openprivacy.ca/cwtch.im/autobindings.git";
rev = "v${version}";
hash = "sha256-QHEaf3xm6SIHLnQamf0cUrKJ/A1v0iFaaGsMg33uIBs=";
};
vendorHash = "sha256-pnAdUFG1G0Bi/e9KNVX0WwloJy8xQ25YVFnGerRGy9A=";
overrideModAttrs = (
old: {
preBuild = ''
make lib.go
'';
}
);
postPatch = ''
substituteInPlace Makefile \
--replace-fail '$(shell git describe --tags)' v${version} \
--replace-fail '$(shell git log -1 --format=%cd --date=format:%G-%m-%d-%H-%M)' 1980-01-01-00-00
'';
buildPhase = ''
runHook preBuild
make libCwtch.so
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D build/linux/libCwtch.h -t $out/include
# * will match either "amd64" or "arm64" depending on the platform.
install -D build/linux/*/libCwtch.so $out/lib/libCwtch.so
runHook postInstall
'';
meta = {
description = "Decentralized, privacy-preserving, multi-party messaging protocol";
homepage = "https://cwtch.im/";
changelog = "https://docs.cwtch.im/changelog";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.gmacon ];
};
}