diff --git a/pkgs/applications/misc/siglo/default.nix b/pkgs/applications/misc/siglo/default.nix new file mode 100644 index 000000000000..ad849bf6992d --- /dev/null +++ b/pkgs/applications/misc/siglo/default.nix @@ -0,0 +1,70 @@ +{ stdenv +, lib +, fetchFromGitHub +, glib +, meson +, ninja +, wrapGAppsHook +, desktop-file-utils +, gobject-introspection +, gtk3 +, python3 +}: + +stdenv.mkDerivation rec { + pname = "siglo"; + version = "0.9.9"; + + src = fetchFromGitHub { + owner = "theironrobin"; + repo = "siglo"; + rev = "v${version}"; + hash = "sha256-4jKsRpzuyHH31LXndC3Ua4TYcI0G0v9qqe0cbvLuCDA="; + }; + + patches = [ + ./siglo-no-user-install.patch + ]; + + postPatch = '' + chmod +x build-aux/meson/postinstall.py # patchShebangs requires an executable file + patchShebangs build-aux/meson/postinstall.py + ''; + + nativeBuildInputs = [ + glib + meson + ninja + wrapGAppsHook + python3.pkgs.wrapPython + python3 + desktop-file-utils + gtk3 + ]; + + buildInputs = [ + gtk3 + python3.pkgs.gatt + gobject-introspection + ]; + + pythonPath = with python3.pkgs; [ + gatt + pybluez + requests + ]; + + preFixup = '' + buildPythonPath "$out $pythonPath" + gappsWrapperArgs+=(--prefix PYTHONPATH : "$program_PYTHONPATH") + ''; + + meta = with lib; { + description = "GTK app to sync InfiniTime watch with PinePhone"; + homepage = "https://github.com/theironrobin/siglo"; + changelog = "https://github.com/theironrobin/siglo/tags/v${version}"; + license = licenses.mpl20; + maintainers = with maintainers; [ tomfitzhenry ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/misc/siglo/siglo-no-user-install.patch b/pkgs/applications/misc/siglo/siglo-no-user-install.patch new file mode 100644 index 000000000000..11cd472d7eb5 --- /dev/null +++ b/pkgs/applications/misc/siglo/siglo-no-user-install.patch @@ -0,0 +1,13 @@ +diff --git a/data/meson.build b/data/meson.build +index 62a00fe..5319974 100644 +--- a/data/meson.build ++++ b/data/meson.build +@@ -18,8 +18,6 @@ install_data(join_paths('icons', 'com.github.alexr4535.siglo.svg'), + install_dir: join_paths(get_option('datadir'), 'icons') + ) + +-install_data('siglo.service', install_dir: '/etc/systemd/user/') +- + appstream_file = i18n.merge_file( + input: 'com.github.alexr4535.siglo.appdata.xml.in', + output: 'com.github.alexr4535.siglo.appdata.xml', diff --git a/pkgs/development/python-modules/gatt/default.nix b/pkgs/development/python-modules/gatt/default.nix new file mode 100644 index 000000000000..6242011b312f --- /dev/null +++ b/pkgs/development/python-modules/gatt/default.nix @@ -0,0 +1,32 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, dbus-python +, pygobject3 +}: + +buildPythonPackage rec { + pname = "gatt"; + version = "0.2.6"; + + src = fetchFromGitHub { + owner = "getsenic"; + repo = "gatt-python"; + rev = "${version}"; + hash = "sha256-GMLqQ9ojQ649hbbJB+KiQoOhiTWweOgv6zaCDzhIB5A="; + }; + + propagatedBuildInputs = [ + dbus-python + pygobject3 + ]; + + pythonImportsCheck = [ "gatt" ]; + + meta = with lib; { + description = "Bluetooth (Generic Attribute Profile) GATT SDK for Python"; + homepage = "https://github.com/getsenic/gatt-python/"; + license = licenses.mit; + maintainers = with maintainers; [ tomfitzhenry ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c21a4e3bcec7..a1cea4bfb16d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4447,6 +4447,8 @@ with pkgs; shisho = callPackage ../tools/security/shisho { }; + siglo = callPackage ../applications/misc/siglo { }; + simg2img = callPackage ../tools/filesystems/simg2img { }; snazy = callPackage ../development/tools/snazy { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 226d8673e02e..f0ce1547508a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3416,6 +3416,8 @@ in { garages-amsterdam = callPackage ../development/python-modules/garages-amsterdam { }; + gatt = callPackage ../development/python-modules/gatt { }; + gattlib = callPackage ../development/python-modules/gattlib { inherit (pkgs) bluez glib pkg-config; };