Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.4 KiB
Nix
Raw Permalink Normal View History

2024-06-16 18:08:51 -04:00
{
buildGoModule,
fetchgit,
lib,
}:
buildGoModule rec {
pname = "libcwtch";
2025-02-24 19:22:47 -05:00
version = "0.1.6";
2024-06-16 18:08:51 -04:00
# This Gitea instance has archive downloads disabled, so: fetchgit
src = fetchgit {
url = "https://git.openprivacy.ca/cwtch.im/autobindings.git";
rev = "v${version}";
2025-02-24 19:22:47 -05:00
hash = "sha256-LlnfGHwjZFvygVF1/f9q+q1rD0OpEGIPzt7E6N6HWDc=";
2024-06-16 18:08:51 -04:00
};
2025-02-24 19:22:47 -05:00
vendorHash = "sha256-t9SupYMfWBF0wHY3EFVT1zu0vvcd4OD/aQqlPeExw04=";
2024-06-16 18:08:51 -04:00
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
2024-12-15 15:28:59 -05:00
make libCwtch.so
2024-06-16 18:08:51 -04:00
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D build/linux/libCwtch.h -t $out/include
2024-12-15 15:28:59 -05:00
# * will match either "amd64" or "arm64" depending on the platform.
install -D build/linux/*/libCwtch.so $out/lib/libCwtch.so
2024-06-16 18:08:51 -04:00
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 ];
};
}