diff --git a/README.md b/README.md index 22aa7e8..a2b9f3c 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,17 @@ As WSL does not have an X server built in, you will need to install a 3rd party ``` * Start viz1090 as described below. +#### Nix + +Run without installing + +```bash +nix shell git+https://git.vulpecula.zone/tasiaiso/viz1090 +``` +TODO docs + +A shell is now open with viz1090 in the path + ### RUNNING 1. Start dump1090 (http://www.github.com/MalcolmRobb/dump1090) locally in network mode: diff --git a/nix/viz1090-mapdata.nix b/nix/viz1090-mapdata.nix index a6fd59f..b28d801 100644 --- a/nix/viz1090-mapdata.nix +++ b/nix/viz1090-mapdata.nix @@ -49,7 +49,6 @@ in cp ${provinces}/* mapdata cp ${places}/* mapdata cp ${airports}/* mapdata - # ls -al mapdata python3 mapconverter.py \ --mapfile mapdata/ne_10m_admin_1_states_provinces.shp \ @@ -59,11 +58,13 @@ in ''; installPhase = '' - mkdir -p $out + mkdir -p $out $out/font cp airportdata.bin $out cp airportnames $out cp mapdata.bin $out cp mapnames $out + + cp font/* $out/font ''; } diff --git a/nix/viz1090.nix b/nix/viz1090.nix index 56ee5e6..9031547 100644 --- a/nix/viz1090.nix +++ b/nix/viz1090.nix @@ -79,6 +79,29 @@ index cd798ec..c5736bd 100644 while (std::getline(infile, line)) +diff --git a/View.cpp b/View.cpp +index d5dace7..90f6165 100644 +--- a/View.cpp ++++ b/View.cpp +@@ -174,13 +174,13 @@ void View::closeFont(TTF_Font *font) + + + void View::font_init() { +- mapFont = loadFont(\"font/TerminusTTF-4.46.0.ttf\", 12 * screen_uiscale); +- mapBoldFont = loadFont(\"font/TerminusTTF-Bold-4.46.0.ttf\", 12 * screen_uiscale); ++ mapFont = loadFont(\"${viz1090-mapdata}/font/TerminusTTF-4.46.0.ttf\", 12 * screen_uiscale); ++ mapBoldFont = loadFont(\"${viz1090-mapdata}/font/TerminusTTF-Bold-4.46.0.ttf\", 12 * screen_uiscale); + +- listFont = loadFont(\"font/TerminusTTF-4.46.0.ttf\", 12 * screen_uiscale); ++ listFont = loadFont(\"${viz1090-mapdata}/font/TerminusTTF-4.46.0.ttf\", 12 * screen_uiscale); + +- messageFont = loadFont(\"font/TerminusTTF-Bold-4.46.0.ttf\", 12 * screen_uiscale); +- labelFont = loadFont(\"font/TerminusTTF-Bold-4.46.0.ttf\", 12 * screen_uiscale); ++ messageFont = loadFont(\"${viz1090-mapdata}/font/TerminusTTF-Bold-4.46.0.ttf\", 12 * screen_uiscale); ++ labelFont = loadFont(\"${viz1090-mapdata}/font/TerminusTTF-Bold-4.46.0.ttf\", 12 * screen_uiscale); + + mapFontWidth = 5 * screen_uiscale; + mapFontHeight = 12 * screen_uiscale; " | git apply - cat Map.cpp | grep mapdata