Skip to content

Instantly share code, notes, and snippets.

@jtojnar
Forked from IreneKnapp/default.nix
Last active May 22, 2021 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtojnar/1e115f666b6bd49dae268ae9d9b16ccd to your computer and use it in GitHub Desktop.
Save jtojnar/1e115f666b6bd49dae268ae9d9b16ccd to your computer and use it in GitHub Desktop.
In-progress attempt to package weechat-matrix-rs for nixpkgs; this is one of several files that would be needed
{ cmake
, fetchFromGitHub
, lib
, libclang
, clang
, openssl
, olm
, glibc
, pkg-config
, rustPlatform
, stdenv
, weechat-unwrapped
}:
let clangVersion = lib.getVersion libclang;
in
rustPlatform.buildRustPackage rec {
pname = "weechat-matrix-rs";
version = "0.1.0";
/*
src = fetchFromGitHub {
owner = "poljar";
repo = "weechat-matrix-rs";
rev = "a846e76b7abf9b70fbcbf955255f99fde185b9cb";
sha256 = "1gx5vxc8391i8cr6d8r6gwywypl0zn3d1xjydg6y6228qcxl3vmm";
};
*/
src = ./weechat-matrix-rs; # DO NOT SUBMIT
#cargoSha256 = "1gx5vxc8391i8cr6d8r6gwywypl0zn3d1xjydg6y6228qcxl3vmm";
cargoSha256 = "0ki59fi6ylsxlzh9bjg50jz09p2vpnxsgx1w5iap9wbqzq9hichk"; # DO NOT SUBMIT
nativeBuildInputs = [
cmake # for libolm-sys
libclang
pkg-config
weechat-unwrapped
];
buildInputs = [
openssl
olm # this is not used since https://gitlab.gnome.org/BrainBlasted/olm-sys/-/commit/fe6eb98d2573b3f21916f73667cd67b57737ec6f builds the vendored libolm
];
preBuild = ''
export BINDGEN_EXTRA_CLANG_ARGS='-I"${clang.out}/resource-root/include" -I"${glibc.dev}/include"'
'';
OLM_LINK_VARIANT = "dylib";
WEECHAT_BUNDLED = "1";
LIBCLANG_PATH = "${libclang.lib}/lib";
WEECHAT_PLUGIN_FILE = "${weechat-unwrapped}/include/weechat/weechat-plugin.h";
meta = with lib; {
description = "A Rust plugin for Weechat that lets Weechat communicate over the Matrix protocol";
homepage = "https://github.com/poljar/weechat-matrix-rs";
license = licenses.isc;
platforms = platforms.unix;
maintainers = with maintainers; [ irenes ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment