Merge pull request #201671 from Myaats/steamos-devkit

authored by

Sandro and committed by
GitHub
3f09bb9d 5547af22

+219
+6
maintainers/maintainer-list.nix
··· 9675 9675 githubId = 43796009; 9676 9676 name = "Max Wilson"; 9677 9677 }; 9678 + myaats = { 9679 + email = "mats@mats.sh"; 9680 + github = "Myaats"; 9681 + githubId = 6295090; 9682 + name = "Mats"; 9683 + }; 9678 9684 myrl = { 9679 9685 email = "myrl.0xf@gmail.com"; 9680 9686 github = "Myrl";
+48
pkgs/development/python-modules/signalslot/default.nix
··· 1 + { stdenv 2 + , lib 3 + , buildPythonPackage 4 + , fetchPypi 5 + , contexter 6 + , eventlet 7 + , mock 8 + , pytestCheckHook 9 + , six 10 + , weakrefmethod 11 + }: 12 + 13 + buildPythonPackage rec { 14 + pname = "signalslot"; 15 + version = "0.1.2"; 16 + 17 + src = fetchPypi { 18 + inherit pname version; 19 + sha256 = "sha256-Z26RPNau+4719e82jMhb2LyIR6EvsANI8r3+eKuw494="; 20 + }; 21 + 22 + propagatedBuildInputs = [ 23 + contexter 24 + six 25 + weakrefmethod 26 + ]; 27 + 28 + checkInputs = [ 29 + eventlet 30 + mock 31 + pytestCheckHook 32 + ]; 33 + 34 + pythonImportsCheck = [ "signalslot" ]; 35 + 36 + postPatch = '' 37 + substituteInPlace setup.cfg \ 38 + --replace "--pep8 --cov" "" \ 39 + --replace "--cov-report html" "" 40 + ''; 41 + 42 + meta = with lib; { 43 + description = "Simple Signal/Slot implementation"; 44 + homepage = "https://github.com/numergy/signalslot"; 45 + license = licenses.mit; 46 + maintainers = with maintainers; [ myaats ]; 47 + }; 48 + }
+24
pkgs/development/python-modules/weakrefmethod/default.nix
··· 1 + { stdenv, lib, buildPythonPackage, fetchPypi, unittest2 }: 2 + 3 + buildPythonPackage rec { 4 + pname = "weakrefmethod"; 5 + version = "1.0.3"; 6 + 7 + src = fetchPypi { 8 + inherit pname version; 9 + sha256 = "sha256-N7wfu1V1rPghctTre2/EQS131aHXDf8sH4pFdDAc2mY="; 10 + }; 11 + 12 + checkInputs = [ 13 + unittest2 14 + ]; 15 + 16 + pythonImportsCheck = [ "weakrefmethod" ]; 17 + 18 + meta = with lib; { 19 + description = "A WeakMethod class for storing bound methods using weak references"; 20 + homepage = "https://github.com/twang817/weakrefmethod"; 21 + license = licenses.psfl; 22 + maintainers = with maintainers; [ myaats ]; 23 + }; 24 + }
+135
pkgs/development/tools/steamos-devkit/default.nix
··· 1 + { lib 2 + , fetchFromGitHub 3 + , fetchFromGitLab 4 + , writeScript 5 + , python3 6 + , copyDesktopItems 7 + , makeDesktopItem 8 + , pkg-config 9 + , SDL2 10 + }: 11 + let 12 + # steamos-devkit requires a build of the unreleased pyimgui 2.0 branch, move to pythonPackages when 2.0 is released. 13 + pyimgui = python3.pkgs.buildPythonPackage { 14 + pname = "pyimgui"; 15 + version = "unstable-2022-03-06"; 16 + 17 + src = fetchFromGitHub { 18 + owner = "pyimgui"; 19 + repo = "pyimgui"; 20 + rev = "1f095af5886f424ee12f26fa93b108b6420fafa4"; # dev/version-2.0 branch 21 + fetchSubmodules = true; 22 + sha256 = "sha256-k070ue132m8H1Zm8bo7J7spCS5dSTGOj689ci7vJ+aw="; 23 + }; 24 + 25 + nativeBuildInputs = with python3.pkgs; [ 26 + cython 27 + pkg-config 28 + SDL2 29 + ]; 30 + 31 + propagatedBuildInputs = with python3.pkgs; [ 32 + click 33 + pyopengl 34 + pysdl2 35 + ]; 36 + 37 + # Requires OpenGL acceleration 38 + doCheck = false; 39 + pythonImportsCheck = [ "imgui" ]; 40 + }; 41 + steamos-devkit-script = '' 42 + #!${python3.interpreter} 43 + import os 44 + 45 + # Change the cwd to avoid imgui using cwd which often is ~ to store the state, use the same location as the settings 46 + path = os.path.expanduser(os.path.join("~", ".devkit-client-gui")) 47 + os.makedirs(path, exist_ok=True) 48 + os.chdir(path) 49 + 50 + # Workaround to get pysdl to work on wayland, remove when https://gitlab.steamos.cloud/devkit/steamos-devkit/-/issues/1 is solved. 51 + if os.environ.get("XDG_SESSION_TYPE") == "wayland": 52 + os.environ["SDL_VIDEODRIVER"] = "wayland" 53 + 54 + import devkit_client.gui2 55 + devkit_client.gui2.main() 56 + ''; 57 + in 58 + python3.pkgs.buildPythonPackage rec { 59 + pname = "steamos-devkit"; 60 + version = "0.20221101"; 61 + 62 + src = fetchFromGitLab { 63 + domain = "gitlab.steamos.cloud"; 64 + owner = "devkit"; 65 + repo = "steamos-devkit"; 66 + rev = "v${version}"; 67 + sha256 = "sha256-VKnfcMF3WxkvqxlhJF+5j4Hso/TZpSS4dMOmSrWagRU="; 68 + }; 69 + 70 + propagatedBuildInputs = with python3.pkgs; [ 71 + appdirs 72 + bcrypt 73 + cffi 74 + cryptography 75 + idna 76 + ifaddr 77 + netifaces 78 + numpy 79 + paramiko 80 + pycparser 81 + pyimgui 82 + pynacl 83 + pysdl2 84 + signalslot 85 + six 86 + ]; 87 + 88 + nativeBuildInputs = [ 89 + copyDesktopItems 90 + ]; 91 + 92 + postUnpack = '' 93 + # Find the absolute source root to link correctly to the previous root 94 + prevRoot=$(realpath $sourceRoot) 95 + 96 + # Update the source root to the devkit_client package 97 + sourceRoot="$sourceRoot/client" 98 + 99 + # Link the setup script into the new source root 100 + ln -s $prevRoot/setup/shiv-linux-setup.py $sourceRoot/setup.py 101 + ''; 102 + 103 + postInstall = '' 104 + mkdir -p $out/bin 105 + 106 + # These are various assets like scripts that steamos-devkit will copy to the remote device 107 + cp -R ./devkit-utils $out/${python3.sitePackages}/devkit-utils 108 + 109 + # writeScript + symlink will be ignored by wrapPythonPrograms 110 + # Copying it is undesirable too, just write it directly to a script instead 111 + cat << EOF > $out/bin/steamos-devkit 112 + ${steamos-devkit-script} 113 + EOF 114 + chmod +x $out/bin/steamos-devkit 115 + ''; 116 + 117 + # There are no checks for steamos-devkit 118 + doCheck = false; 119 + pythonImportsCheck = [ "devkit_client" ]; 120 + 121 + desktopItems = [ 122 + (makeDesktopItem { 123 + name = "SteamOS-Devkit"; 124 + exec = "steamos-devkit"; 125 + desktopName = "SteamOS Devkit Client"; 126 + }) 127 + ]; 128 + 129 + meta = with lib; { 130 + description = "SteamOS Devkit Client"; 131 + homepage = "https://gitlab.steamos.cloud/devkit/steamos-devkit"; 132 + license = licenses.mit; 133 + maintainers = with maintainers; [ myaats ]; 134 + }; 135 + }
+2
pkgs/top-level/all-packages.nix
··· 25869 25869 25870 25870 statifier = callPackage ../os-specific/linux/statifier { }; 25871 25871 25872 + steamos-devkit = callPackage ../development/tools/steamos-devkit { }; 25873 + 25872 25874 swiftdefaultapps = callPackage ../os-specific/darwin/swiftdefaultapps { }; 25873 25875 25874 25876 sysdig = callPackage ../os-specific/linux/sysdig {
+4
pkgs/top-level/python-packages.nix
··· 10253 10253 10254 10254 sievelib = callPackage ../development/python-modules/sievelib { }; 10255 10255 10256 + signalslot = callPackage ../development/python-modules/signalslot { }; 10257 + 10256 10258 signedjson = callPackage ../development/python-modules/signedjson { }; 10257 10259 10258 10260 sigrok = callPackage ../development/python-modules/sigrok { }; ··· 11888 11890 wcmatch = callPackage ../development/python-modules/wcmatch { }; 11889 11891 11890 11892 wcwidth = callPackage ../development/python-modules/wcwidth { }; 11893 + 11894 + weakrefmethod = callPackage ../development/python-modules/weakrefmethod { }; 11891 11895 11892 11896 weasyprint = callPackage ../development/python-modules/weasyprint { }; 11893 11897