aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2021-03-09 21:19:12 +0100
committerKatharina Fey <kookie@spacekookie.de>2021-03-09 21:19:12 +0100
commitbb5f28a3db3d798270b26f428da7239c6060437a (patch)
tree4f34d27ce994c487d17ff17de6883053ea42c2a5
parent5ffd5328dbe8e00718ca229b8a113fd617c5dfd1 (diff)
koffice: various project updates
-rw-r--r--apps/koffice/.envrc1
-rw-r--r--apps/koffice/.projectile0
-rw-r--r--apps/koffice/libko/src/log_util.rs36
-rw-r--r--apps/koffice/rustfmt.toml1
-rw-r--r--apps/koffice/shell.nix8
5 files changed, 46 insertions, 0 deletions
diff --git a/apps/koffice/.envrc b/apps/koffice/.envrc
new file mode 100644
index 000000000000..051d09d292a8
--- /dev/null
+++ b/apps/koffice/.envrc
@@ -0,0 +1 @@
+eval "$(lorri direnv)"
diff --git a/apps/koffice/.projectile b/apps/koffice/.projectile
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/apps/koffice/.projectile
diff --git a/apps/koffice/libko/src/log_util.rs b/apps/koffice/libko/src/log_util.rs
new file mode 100644
index 000000000000..b87dbe83df41
--- /dev/null
+++ b/apps/koffice/libko/src/log_util.rs
@@ -0,0 +1,36 @@
+#[macro_export]
+macro_rules! fatal {
+ () => {
+ error!("Unknown failure!");
+ std::process::exit(2)
+ };
+ ($($arg:tt)*) => ({
+ error!($($arg)*);
+ std::process::exit(2)
+ })
+}
+
+use colored::*;
+use env_logger::Builder;
+use log::Level;
+use std::io::Write;
+
+pub fn initialise() {
+ let mut b = Builder::from_default_env();
+ b.format(|buf, record| {
+ let lvl = record.level().to_string();
+ write!(
+ buf,
+ "[{}]: {}\n",
+ match record.level() {
+ Level::Error => lvl.red(),
+ Level::Warn => lvl.yellow(),
+ Level::Info => lvl.green(),
+ Level::Debug => lvl.purple(),
+ Level::Trace => lvl.cyan(),
+ },
+ record.args()
+ )
+ })
+ .init();
+}
diff --git a/apps/koffice/rustfmt.toml b/apps/koffice/rustfmt.toml
new file mode 100644
index 000000000000..f25acec201e1
--- /dev/null
+++ b/apps/koffice/rustfmt.toml
@@ -0,0 +1 @@
+inline_attribute_width = 50 \ No newline at end of file
diff --git a/apps/koffice/shell.nix b/apps/koffice/shell.nix
new file mode 100644
index 000000000000..eb45853d461f
--- /dev/null
+++ b/apps/koffice/shell.nix
@@ -0,0 +1,8 @@
+with import <nixpkgs> {};
+
+stdenv.mkDerivation {
+ name = "koffice";
+ buildInputs = with pkgs; [
+ rustc cargo rust-analyzer rustfmt clangStdenv
+ ];
+}