diff --git a/pkgs/by-name/pi/piscope/package.nix b/pkgs/by-name/pi/piscope/package.nix new file mode 100644 index 000000000000..8191f53aa1c9 --- /dev/null +++ b/pkgs/by-name/pi/piscope/package.nix @@ -0,0 +1,56 @@ +{ + lib, + stdenv, + fetchFromGitHub, + + # nativeBuildInputs + pkg-config, + wrapGAppsHook3, + installShellFiles, + + # buildInputs + gtk3, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "piscope"; + version = "0.8"; + + src = fetchFromGitHub { + owner = "joan2937"; + repo = "piscope"; + tag = "V${finalAttrs.version}"; + hash = "sha256-VDrx/RLSpMhyD64PmdeWVacb9LleHakcy7D6zFxeyhw="; + }; + # Fix FHS paths + postConfigure = '' + substituteInPlace piscope.c \ + --replace /usr/share/piscope $out/share/piscope + ''; + + nativeBuildInputs = [ + pkg-config + wrapGAppsHook3 + installShellFiles + ]; + buildInputs = [ + gtk3 + ]; + # Upstream's Makefile assumes FHS + installPhase = '' + runHook preInstall + + installBin piscope + install -D -m 0644 piscope.glade $out/share/piscope/piscope.glade + + runHook postInstall + ''; + + meta = { + homepage = "http://abyz.me.uk/rpi/pigpio/piscope.html"; + description = "A logic analyser (digital waveform viewer) for the Raspberry"; + license = lib.licenses.unlicense; + maintainers = with lib.maintainers; [ doronbehar ]; + platforms = lib.platforms.linux; + }; +})