Compare commits

..

No commits in common. "11ca8661fa4314b4c2757241e8a1ac6e154297eb" and "52ae75ca5c7b8e5597b924dc769a82e02381a99d" have entirely different histories.

10 changed files with 60 additions and 1890 deletions

1766
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
[workspace]
members = [
"dashboard",
"ifc"
]

View File

@ -1,30 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
RUST_ALL_TARGETS="dashboard ifc"
build_rust_targets() {
local CMD=$1
local TARGETS=${@/$CMD}
for target in $TARGETS; do
MODULE=$target CMD=$CMD ./builders/rust.sh
done
}
export CARGO=`which cargo`
if [ -z "${TARGET-}" ]; then
TARGET="all"
fi
if [ -z "${CMD-}" ]; then
CMD="release"
fi
if [ "${TARGET}" == "all" ]; then
build_rust_targets $CMD $RUST_ALL_TARGETS
else
build_rust_targets $CMD $TARGET
fi

View File

@ -1,33 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
if [ ! -z "$MODULE" ]; then
MODULE="-p $MODULE"
fi
if [ -z "${PARAMS-}" ]; then
PARAMS=""
fi
case $CMD in
build)
$CARGO build $MODULE $PARAMS
;;
test)
$CARGO test $MODULE $PARAMS
;;
release)
$CARGO build --release $MODULE $PARAMS
;;
clean)
$CARGO clean $MODULE
;;
"")
echo "No command specified. Use build | test | release | clean"
;;
*)
echo "$CMD is unknown. Use build | test | release | clean"
;;
esac

View File

@ -15,7 +15,7 @@ lazy_static = { version = "1.4" }
unic-langid = { version = "0.9" } unic-langid = { version = "0.9" }
horrorshow = { version = "0.8" } horrorshow = { version = "0.8" }
http = { version = "*" } http = { version = "*" }
ifc = { path = "../ifc/" } international-fixed-calendar = { path = "../ifc/" }
memorycache = { path = "../memory_cache" } memorycache = { path = "../memory_cache" }
reqwest = { version = "0.11", features = ["json"] } reqwest = { version = "0.11", features = ["json"] }
serde_derive = { version = "1" } serde_derive = { version = "1" }

View File

@ -10,7 +10,7 @@ use fluent::{FluentArgs, FluentValue};
use geo_types::{Latitude, Longitude}; use geo_types::{Latitude, Longitude};
use horrorshow::helper::doctype; use horrorshow::helper::doctype;
use horrorshow::prelude::*; use horrorshow::prelude::*;
use ifc; use international_fixed_calendar as IFC;
use std::{ use std::{
borrow::Cow, borrow::Cow,
net::{IpAddr, Ipv4Addr, SocketAddr}, net::{IpAddr, Ipv4Addr, SocketAddr},
@ -58,7 +58,7 @@ autumn_equinox = Aŭtuna Ekvinokso
winter_solstice = Vintra Solstico winter_solstice = Vintra Solstico
"; ";
fn date(fluent: Arc<fluent_ergonomics::FluentErgo>, today: ifc::IFC) -> impl Render { fn date(fluent: Arc<fluent_ergonomics::FluentErgo>, today: IFC::IFC) -> impl Render {
let mut day_args = FluentArgs::new(); let mut day_args = FluentArgs::new();
day_args.set( day_args.set(
"day", "day",
@ -126,7 +126,7 @@ fn astronomia_eventa_desegno(
/* /*
fn page_template( fn page_template(
fluent: Arc<fluent_ergonomics::FluentErgo>, fluent: Arc<fluent_ergonomics::FluentErgo>,
today: ifc::IFC, today: IFC::IFC,
sun_moon: SunMoon, sun_moon: SunMoon,
event: Option<solstices::Event>, event: Option<solstices::Event>,
) -> String { ) -> String {
@ -156,7 +156,7 @@ async fn page(
longitude: Longitude, longitude: Longitude,
) -> Result<Html<String>, Rejection> { ) -> Result<Html<String>, Rejection> {
let now = Utc::now(); let now = Utc::now();
let d = ifc::IFC::from(now.with_timezone(&New_York).date()); let d = IFC::IFC::from(now.with_timezone(&New_York).date());
let sun_moon = solar_client let sun_moon = solar_client
.request(latitude, longitude, now.with_timezone(&New_York).date()) .request(latitude, longitude, now.with_timezone(&New_York).date())
.await; .await;
@ -170,7 +170,7 @@ async fn page(
#[tokio::main] #[tokio::main]
pub async fn main() { pub async fn main() {
let now = Local::now(); let now = Local::now();
let ifc = ifc::IFC::from(now.date_naive().with_year(12023).unwrap()); let ifc = IFC::IFC::from(now.date_naive().with_year(12023).unwrap());
let next_event = EVENTS.next_event(now.with_timezone(&Utc)).unwrap(); let next_event = EVENTS.next_event(now.with_timezone(&Utc)).unwrap();
println!( println!(

View File

@ -46,52 +46,56 @@
]; ];
LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib"; LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
}; };
# packages."x86_64-linux" = packages."x86_64-linux" =
# let let
# pkgs = import nixpkgs { system = "x86_64-linux"; }; pkgs = import nixpkgs { system = "x86_64-linux"; };
# standardOverride = attrs: { standardOverride = attrs: {
# nativeBuildInputs = [ nativeBuildInputs = [
# pkgs.pkg-config pkgs.pkg-config
# pkgs.gtk4 pkgs.gtk4
# ]; ];
# verbose = true; verbose = true;
# }; };
# customBuildInfo = pkgs: pkgs.buildRustCrate.override { customBuildInfo = pkgs: pkgs.buildRustCrate.override {
# defaultCrateOverrides = pkgs.defaultCrateOverrides // { defaultCrateOverrides = pkgs.defaultCrateOverrides // {
# cairo-sys-rs = standardOverride; cairo-sys-rs = standardOverride;
# graphene-sys = standardOverride; graphene-sys = standardOverride;
# gobject-sys = standardOverride; gobject-sys = standardOverride;
# pango-sys = standardOverride; pango-sys = standardOverride;
# gio-sys = standardOverride; gio-sys = standardOverride;
# gdk-pixbuf-sys = standardOverride; gdk-pixbuf-sys = standardOverride;
# gdk4-sys = standardOverride; gdk4-sys = standardOverride;
# gsk4-sys = standardOverride; gsk4-sys = standardOverride;
# gtk4-sys = standardOverride; gtk4-sys = standardOverride;
# kifu-gtk = attrs: { kifu-gtk = attrs: {
# nativeBuildInputs = [ nativeBuildInputs = [
# pkgs.glib pkgs.glib
# ]; ];
# }; };
# }; };
# }; };
# in { in {
# # gobject-sys = pkgs.buildRustCrate cargo.internal.crates.gobject-sys; # gobject-sys = pkgs.buildRustCrate cargo.internal.crates.gobject-sys;
# kifu-gtk = (import ./kifu/kifu-gtk/Cargo.nix { # kifu-gtk = (import ./kifu/kifu-gtk/Cargo.nix {
# inherit pkgs; # inherit pkgs;
# buildRustCrateForPkgs = customBuildInfo; # buildRustCrateForPkgs = customBuildInfo;
# rootFeatures = [ "screenplay" ]; # rootFeatures = [ "screenplay" ];
# release = true; # release = true;
# }).rootCrate.build; # }).rootCrate.build;
# cyberpunk-splash = (import ./cyberpunk-splash/Cargo.nix { cyberpunk-splash = (import ./cyberpunk-splash/Cargo.nix {
# inherit pkgs; inherit pkgs;
# buildRustCrateForPkgs = customBuildInfo; buildRustCrateForPkgs = customBuildInfo;
# release = true; release = true;
# }).rootCrate.build; }).rootCrate.build;
#
# dashboard = (import ./dashboard/Cargo.nix { dashboard = (import ./dashboard/Cargo.nix {
# inherit pkgs; inherit pkgs;
# release = true; release = true;
# }).rootCrate.build; }).rootCrate.build;
# }; };
hydraJobs = {
inherit (self) packages;
};
}; };
} }

View File

@ -1,5 +1,5 @@
[package] [package]
name = "ifc" name = "international-fixed-calendar"
description = "chrono-compatible-ish date objects for the International Fixed Calendar" description = "chrono-compatible-ish date objects for the International Fixed Calendar"
version = "0.1.0" version = "0.1.0"
authors = ["Savanni D'Gerinel <savanni@luminescent-dreams.com>"] authors = ["Savanni D'Gerinel <savanni@luminescent-dreams.com>"]

View File

@ -12,7 +12,7 @@ You should have received a copy of the GNU General Public License along with Lum
extern crate chrono; extern crate chrono;
extern crate chrono_tz; extern crate chrono_tz;
extern crate ifc as IFC; extern crate international_fixed_calendar as IFC;
use chrono::{Datelike, Utc}; use chrono::{Datelike, Utc};

View File

@ -11,7 +11,7 @@ You should have received a copy of the GNU General Public License along with Lum
*/ */
use chrono::{Datelike, Utc}; use chrono::{Datelike, Utc};
use ifc as IFC; use international_fixed_calendar as IFC;
use iron::headers; use iron::headers;
use iron::middleware::Handler; use iron::middleware::Handler;
use iron::modifiers::Header; use iron::modifiers::Header;