diff options
author | Naoki Pross <np@0hm.ch> | 2021-10-20 22:57:30 +0200 |
---|---|---|
committer | Naoki Pross <np@0hm.ch> | 2021-10-20 22:57:30 +0200 |
commit | dbc71b6cbf7bf42b6f223fffbcd7158c41fb9558 (patch) | |
tree | 3d4333fda737c6fed0017a3c1db3da81c8952168 | |
parent | Remove useless folders in video/ (diff) | |
download | Fading-dbc71b6cbf7bf42b6f223fffbcd7158c41fb9558.tar.gz Fading-dbc71b6cbf7bf42b6f223fffbcd7158c41fb9558.zip |
Prepare nix env for dearpygui ui
-rw-r--r-- | src/dearpygui.nix | 37 | ||||
-rw-r--r-- | src/demo.py | 12 | ||||
-rw-r--r-- | src/shell.nix | 25 |
3 files changed, 74 insertions, 0 deletions
diff --git a/src/dearpygui.nix b/src/dearpygui.nix new file mode 100644 index 0000000..1b26eaf --- /dev/null +++ b/src/dearpygui.nix @@ -0,0 +1,37 @@ +{ lib, pkgs, buildPythonPackage, fetchPypi, isPy38, autoPatchelfHook }: + +assert isPy38; + +buildPythonPackage rec { + pname = "dearpygui"; + version = "1.0.2"; + format = "wheel"; + + # src = fetchFromGitHub { + # owner = "hoffstadt"; + # repo = "DearPyGui"; + # rev = "v${version}"; + # sha256 = "094s1r1jjgj6512dp5z5gn50m5g5b7qg6c2wgxhjsn38mxivpd2h"; + # fetchSubmodules = true; + # }; + + src = fetchPypi { + inherit pname version format; + python = "cp38"; + abi = "cp38"; + platform = "manylinux1_x86_64"; + sha256 = "10y8a3v135pziknnrzg8x5q5l6p7jvxgva8r8l5vjhdq9p5mxnab"; + }; + + # dontUseCmakeConfigure = false; + # nativeBuildInputs = with pkgs; [ cmake ]; + nativeBuildInputs = [ autoPatchelfHook ]; + + buildInputs = (with pkgs; [ + libGL libGL_driver + ]) ++ (with pkgs.xorg; [ + libX11 libXrandr libXinerama libXcursor libXi + ]); + + meta = with lib; {}; +} diff --git a/src/demo.py b/src/demo.py new file mode 100644 index 0000000..01e2d96 --- /dev/null +++ b/src/demo.py @@ -0,0 +1,12 @@ +from dearpygui import dearpygui as dpg +from dearpygui.demo import show_demo + +dpg.create_context() +dpg.create_viewport() +dpg.setup_dearpygui() + +show_demo() + +dpg.show_viewport() +dpg.start_dearpygui() +dpg.destroy_context() diff --git a/src/shell.nix b/src/shell.nix new file mode 100644 index 0000000..4503a49 --- /dev/null +++ b/src/shell.nix @@ -0,0 +1,25 @@ +# vim: set ts=2 sw=2 et: +with import <nixpkgs> {}; +let + dearpygui = callPackage ./dearpygui.nix { + buildPythonPackage = pkgs.python38Packages.buildPythonPackage; + fetchPypi = pkgs.python38Packages.fetchPypi; + isPy38 = pkgs.python38Packages.isPy38; + }; + +in mkShell { + buildInputs = [ dearpygui ] ++ (with pkgs; []); +} + +# (pkgs.buildFHSUserEnv { +# name = "pipzone"; +# targetPkgs = pkgs: (with pkgs; [ +# python38 +# python38Packages.pip +# python38Packages.virtualenv +# libGL +# libGL_driver +# xorg.libX11 +# ]); +# runScript = "bash"; +# }).env |