Compare commits
3 Commits
52ae75ca5c
...
11ca8661fa
Author | SHA1 | Date |
---|---|---|
Savanni D'Gerinel | 11ca8661fa | |
Savanni D'Gerinel | 7ebbbfd03b | |
Savanni D'Gerinel | 38443f4120 |
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,5 @@
|
|||
[workspace]
|
||||
members = [
|
||||
"dashboard",
|
||||
"ifc"
|
||||
]
|
|
@ -0,0 +1,30 @@
|
|||
#!/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
|
|
@ -0,0 +1,33 @@
|
|||
#!/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
|
||||
|
|
@ -15,7 +15,7 @@ lazy_static = { version = "1.4" }
|
|||
unic-langid = { version = "0.9" }
|
||||
horrorshow = { version = "0.8" }
|
||||
http = { version = "*" }
|
||||
international-fixed-calendar = { path = "../ifc/" }
|
||||
ifc = { path = "../ifc/" }
|
||||
memorycache = { path = "../memory_cache" }
|
||||
reqwest = { version = "0.11", features = ["json"] }
|
||||
serde_derive = { version = "1" }
|
||||
|
|
|
@ -10,7 +10,7 @@ use fluent::{FluentArgs, FluentValue};
|
|||
use geo_types::{Latitude, Longitude};
|
||||
use horrorshow::helper::doctype;
|
||||
use horrorshow::prelude::*;
|
||||
use international_fixed_calendar as IFC;
|
||||
use ifc;
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
net::{IpAddr, Ipv4Addr, SocketAddr},
|
||||
|
@ -58,7 +58,7 @@ autumn_equinox = Aŭtuna Ekvinokso
|
|||
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();
|
||||
day_args.set(
|
||||
"day",
|
||||
|
@ -126,7 +126,7 @@ fn astronomia_eventa_desegno(
|
|||
/*
|
||||
fn page_template(
|
||||
fluent: Arc<fluent_ergonomics::FluentErgo>,
|
||||
today: IFC::IFC,
|
||||
today: ifc::IFC,
|
||||
sun_moon: SunMoon,
|
||||
event: Option<solstices::Event>,
|
||||
) -> String {
|
||||
|
@ -156,7 +156,7 @@ async fn page(
|
|||
longitude: Longitude,
|
||||
) -> Result<Html<String>, Rejection> {
|
||||
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
|
||||
.request(latitude, longitude, now.with_timezone(&New_York).date())
|
||||
.await;
|
||||
|
@ -170,7 +170,7 @@ async fn page(
|
|||
#[tokio::main]
|
||||
pub async fn main() {
|
||||
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();
|
||||
|
||||
println!(
|
||||
|
|
98
flake.nix
98
flake.nix
|
@ -46,56 +46,52 @@
|
|||
];
|
||||
LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
|
||||
};
|
||||
packages."x86_64-linux" =
|
||||
let
|
||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||
standardOverride = attrs: {
|
||||
nativeBuildInputs = [
|
||||
pkgs.pkg-config
|
||||
pkgs.gtk4
|
||||
];
|
||||
verbose = true;
|
||||
};
|
||||
customBuildInfo = pkgs: pkgs.buildRustCrate.override {
|
||||
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
|
||||
cairo-sys-rs = standardOverride;
|
||||
graphene-sys = standardOverride;
|
||||
gobject-sys = standardOverride;
|
||||
pango-sys = standardOverride;
|
||||
gio-sys = standardOverride;
|
||||
gdk-pixbuf-sys = standardOverride;
|
||||
gdk4-sys = standardOverride;
|
||||
gsk4-sys = standardOverride;
|
||||
gtk4-sys = standardOverride;
|
||||
kifu-gtk = attrs: {
|
||||
nativeBuildInputs = [
|
||||
pkgs.glib
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
# gobject-sys = pkgs.buildRustCrate cargo.internal.crates.gobject-sys;
|
||||
# kifu-gtk = (import ./kifu/kifu-gtk/Cargo.nix {
|
||||
# inherit pkgs;
|
||||
# buildRustCrateForPkgs = customBuildInfo;
|
||||
# rootFeatures = [ "screenplay" ];
|
||||
# release = true;
|
||||
# }).rootCrate.build;
|
||||
cyberpunk-splash = (import ./cyberpunk-splash/Cargo.nix {
|
||||
inherit pkgs;
|
||||
buildRustCrateForPkgs = customBuildInfo;
|
||||
release = true;
|
||||
}).rootCrate.build;
|
||||
|
||||
dashboard = (import ./dashboard/Cargo.nix {
|
||||
inherit pkgs;
|
||||
release = true;
|
||||
}).rootCrate.build;
|
||||
};
|
||||
|
||||
hydraJobs = {
|
||||
inherit (self) packages;
|
||||
};
|
||||
# packages."x86_64-linux" =
|
||||
# let
|
||||
# pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||
# standardOverride = attrs: {
|
||||
# nativeBuildInputs = [
|
||||
# pkgs.pkg-config
|
||||
# pkgs.gtk4
|
||||
# ];
|
||||
# verbose = true;
|
||||
# };
|
||||
# customBuildInfo = pkgs: pkgs.buildRustCrate.override {
|
||||
# defaultCrateOverrides = pkgs.defaultCrateOverrides // {
|
||||
# cairo-sys-rs = standardOverride;
|
||||
# graphene-sys = standardOverride;
|
||||
# gobject-sys = standardOverride;
|
||||
# pango-sys = standardOverride;
|
||||
# gio-sys = standardOverride;
|
||||
# gdk-pixbuf-sys = standardOverride;
|
||||
# gdk4-sys = standardOverride;
|
||||
# gsk4-sys = standardOverride;
|
||||
# gtk4-sys = standardOverride;
|
||||
# kifu-gtk = attrs: {
|
||||
# nativeBuildInputs = [
|
||||
# pkgs.glib
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# in {
|
||||
# # gobject-sys = pkgs.buildRustCrate cargo.internal.crates.gobject-sys;
|
||||
# kifu-gtk = (import ./kifu/kifu-gtk/Cargo.nix {
|
||||
# inherit pkgs;
|
||||
# buildRustCrateForPkgs = customBuildInfo;
|
||||
# rootFeatures = [ "screenplay" ];
|
||||
# release = true;
|
||||
# }).rootCrate.build;
|
||||
# cyberpunk-splash = (import ./cyberpunk-splash/Cargo.nix {
|
||||
# inherit pkgs;
|
||||
# buildRustCrateForPkgs = customBuildInfo;
|
||||
# release = true;
|
||||
# }).rootCrate.build;
|
||||
#
|
||||
# dashboard = (import ./dashboard/Cargo.nix {
|
||||
# inherit pkgs;
|
||||
# release = true;
|
||||
# }).rootCrate.build;
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "international-fixed-calendar"
|
||||
name = "ifc"
|
||||
description = "chrono-compatible-ish date objects for the International Fixed Calendar"
|
||||
version = "0.1.0"
|
||||
authors = ["Savanni D'Gerinel <savanni@luminescent-dreams.com>"]
|
||||
|
|
|
@ -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_tz;
|
||||
extern crate international_fixed_calendar as IFC;
|
||||
extern crate ifc as IFC;
|
||||
|
||||
use chrono::{Datelike, Utc};
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ You should have received a copy of the GNU General Public License along with Lum
|
|||
*/
|
||||
|
||||
use chrono::{Datelike, Utc};
|
||||
use international_fixed_calendar as IFC;
|
||||
use ifc as IFC;
|
||||
use iron::headers;
|
||||
use iron::middleware::Handler;
|
||||
use iron::modifiers::Header;
|
||||
|
|
Loading…
Reference in New Issue