Skip to content

Instantly share code, notes, and snippets.

@IreneKnapp
Created May 22, 2021 06:23
Show Gist options
  • Save IreneKnapp/a063e061a3a17b5335dacbde1f60e11a to your computer and use it in GitHub Desktop.
Save IreneKnapp/a063e061a3a17b5335dacbde1f60e11a 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
, openssl
, pkgconfig
, 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 = /home/irenes/Projects/weechat-matrix-rs; # DO NOT SUBMIT
#cargoSha256 = "1gx5vxc8391i8cr6d8r6gwywypl0zn3d1xjydg6y6228qcxl3vmm";
cargoSha256 = "0ki59fi6ylsxlzh9bjg50jz09p2vpnxsgx1w5iap9wbqzq9hichk"; # DO NOT SUBMIT
nativeBuildInputs = [ cmake libclang.dev libclang.lib pkgconfig stdenv stdenv.cc weechat-unwrapped.dev ];
buildInputs = [ openssl openssl.dev ];
preConfigure = ''
echo IAK ${clangVersion}
set
'';
#export CPATH="$CPATH:${CLANG_RESOURCE_DIR}/include"
#CPATH = "${stdenv.cc
#CPATH = "${CLANG_RESOURCE_DIR}/include";
CLANG_RESOURCE_DIR = "${libclang.lib}/lib/clang/${clangVersion}";
#CPATH = "${stdenv.cc.dev}/include";
LIBCLANG_PATH = "${libclang.lib}/lib";
WEECHAT_PLUGIN_FILE = "${weechat-unwrapped.dev}/include/weechat/weechat-plugin.h";
installPhase = ''
ls -lr $src/target
'';
meta = with stdenv.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