Compare commits
No commits in common. "11ca8661fa4314b4c2757241e8a1ac6e154297eb" and "52ae75ca5c7b8e5597b924dc769a82e02381a99d" have entirely different histories.
11ca8661fa
...
52ae75ca5c
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +0,0 @@
|
|||
[workspace]
|
||||
members = [
|
||||
"dashboard",
|
||||
"ifc"
|
||||
]
|
30
build.sh
30
build.sh
|
@ -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
|
|
@ -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
|
||||
|
|
@ -15,7 +15,7 @@ lazy_static = { version = "1.4" }
|
|||
unic-langid = { version = "0.9" }
|
||||
horrorshow = { version = "0.8" }
|
||||
http = { version = "*" }
|
||||
ifc = { path = "../ifc/" }
|
||||
international-fixed-calendar = { 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 ifc;
|
||||
use international_fixed_calendar as 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!(
|
||||
|
|
86
flake.nix
86
flake.nix
|
@ -46,52 +46,56 @@
|
|||
];
|
||||
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;
|
||||
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;
|
||||
# };
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "ifc"
|
||||
name = "international-fixed-calendar"
|
||||
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 ifc as IFC;
|
||||
extern crate international_fixed_calendar 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 ifc as IFC;
|
||||
use international_fixed_calendar as IFC;
|
||||
use iron::headers;
|
||||
use iron::middleware::Handler;
|
||||
use iron::modifiers::Header;
|
||||
|
|
Loading…
Reference in New Issue