From 9167461eb35687872a7670b2e7105a56244f7a48 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 1 Aug 2020 01:11:24 +0000 Subject: [PATCH] Fix crates.io publishing restrictions This works around the problem that crates pushed to crates.io cannot reference files outside of their crate directory. --- alacritty/Cargo.toml | 2 +- alacritty/README.md | 1 + alacritty/alacritty.ico | 1 + {res => alacritty/res}/rect.f.glsl | 0 {res => alacritty/res}/rect.v.glsl | 0 {res => alacritty/res}/text.f.glsl | 0 {res => alacritty/res}/text.v.glsl | 0 alacritty/src/renderer/mod.rs | 20 ++++++++------------ alacritty/src/window.rs | 2 +- 9 files changed, 12 insertions(+), 14 deletions(-) create mode 120000 alacritty/README.md create mode 120000 alacritty/alacritty.ico rename {res => alacritty/res}/rect.f.glsl (100%) rename {res => alacritty/res}/rect.v.glsl (100%) rename {res => alacritty/res}/text.f.glsl (100%) rename {res => alacritty/res}/text.v.glsl (100%) diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml index 7a3a043e..eab8f227 100644 --- a/alacritty/Cargo.toml +++ b/alacritty/Cargo.toml @@ -4,7 +4,7 @@ version = "0.6.0-dev" authors = ["Christian Duerr ", "Joe Wilm "] license = "Apache-2.0" description = "GPU-accelerated terminal emulator" -readme = "../README.md" +readme = "README.md" homepage = "https://github.com/alacritty/alacritty" edition = "2018" diff --git a/alacritty/README.md b/alacritty/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/alacritty/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/alacritty/alacritty.ico b/alacritty/alacritty.ico new file mode 120000 index 00000000..55cd1859 --- /dev/null +++ b/alacritty/alacritty.ico @@ -0,0 +1 @@ +../extra/windows/alacritty.ico \ No newline at end of file diff --git a/res/rect.f.glsl b/alacritty/res/rect.f.glsl similarity index 100% rename from res/rect.f.glsl rename to alacritty/res/rect.f.glsl diff --git a/res/rect.v.glsl b/alacritty/res/rect.v.glsl similarity index 100% rename from res/rect.v.glsl rename to alacritty/res/rect.v.glsl diff --git a/res/text.f.glsl b/alacritty/res/text.f.glsl similarity index 100% rename from res/text.f.glsl rename to alacritty/res/text.f.glsl diff --git a/res/text.v.glsl b/alacritty/res/text.v.glsl similarity index 100% rename from res/text.v.glsl rename to alacritty/res/text.v.glsl diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs index 58d43406..79df6b34 100644 --- a/alacritty/src/renderer/mod.rs +++ b/alacritty/src/renderer/mod.rs @@ -35,20 +35,16 @@ use crate::renderer::rects::RenderRect; pub mod rects; // Shader paths for live reload. -static TEXT_SHADER_F_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../res/text.f.glsl"); -static TEXT_SHADER_V_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../res/text.v.glsl"); -static RECT_SHADER_F_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../res/rect.f.glsl"); -static RECT_SHADER_V_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../res/rect.v.glsl"); +static TEXT_SHADER_F_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/res/text.f.glsl"); +static TEXT_SHADER_V_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/res/text.v.glsl"); +static RECT_SHADER_F_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/res/rect.f.glsl"); +static RECT_SHADER_V_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/res/rect.v.glsl"); // Shader source which is used when live-shader-reload feature is disable. -static TEXT_SHADER_F: &str = - include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../res/text.f.glsl")); -static TEXT_SHADER_V: &str = - include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../res/text.v.glsl")); -static RECT_SHADER_F: &str = - include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../res/rect.f.glsl")); -static RECT_SHADER_V: &str = - include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../res/rect.v.glsl")); +static TEXT_SHADER_F: &str = include_str!("../../res/text.f.glsl"); +static TEXT_SHADER_V: &str = include_str!("../../res/text.v.glsl"); +static RECT_SHADER_F: &str = include_str!("../../res/rect.f.glsl"); +static RECT_SHADER_V: &str = include_str!("../../res/rect.v.glsl"); /// `LoadGlyph` allows for copying a rasterized glyph into graphics memory. pub trait LoadGlyph { diff --git a/alacritty/src/window.rs b/alacritty/src/window.rs index 6659a9e0..172d5acc 100644 --- a/alacritty/src/window.rs +++ b/alacritty/src/window.rs @@ -42,7 +42,7 @@ use crate::gl; // It's required to be in this directory due to the `windows.rc` file. #[cfg(not(any(target_os = "macos", windows)))] -static WINDOW_ICON: &[u8] = include_bytes!("../../extra/windows/alacritty.ico"); +static WINDOW_ICON: &[u8] = include_bytes!("../alacritty.ico"); // This should match the definition of IDI_ICON from `windows.rc`. #[cfg(windows)]