Merge pull request #165009 from fgaz/sfxr-qt/1.5.0

This commit is contained in:
Sandro 2022-03-27 11:39:40 +02:00 committed by GitHub
commit c2bc9e6c56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 2 deletions

View File

@ -472,6 +472,7 @@ in
seafile = handleTest ./seafile.nix {};
searx = handleTest ./searx.nix {};
service-runner = handleTest ./service-runner.nix {};
sfxr-qt = handleTest ./sfxr-qt.nix {};
shadow = handleTest ./shadow.nix {};
shadowsocks = handleTest ./shadowsocks {};
shattered-pixel-dungeon = handleTest ./shattered-pixel-dungeon.nix {};

32
nixos/tests/sfxr-qt.nix Normal file
View File

@ -0,0 +1,32 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "sfxr-qt";
meta = with pkgs.lib.maintainers; {
maintainers = [ fgaz ];
};
machine = { config, pkgs, ... }: {
imports = [
./common/x11.nix
];
services.xserver.enable = true;
sound.enable = true;
environment.systemPackages = [ pkgs.sfxr-qt ];
};
enableOCR = true;
testScript =
''
machine.wait_for_x()
# Add a dummy sound card, or the program won't start
machine.execute("modprobe snd-dummy")
machine.execute("sfxr-qt >&2 &")
machine.wait_for_window(r"sfxr")
machine.sleep(10)
machine.wait_for_text("requency")
machine.screenshot("screen")
'';
})

View File

@ -1,26 +1,36 @@
{ lib
, mkDerivation
, fetchFromGitHub
, fetchpatch
, cmake
, extra-cmake-modules
, qtbase
, qtquickcontrols2
, SDL
, python3
, callPackage
, nixosTests
}:
mkDerivation rec {
pname = "sfxr-qt";
version = "1.4.0";
version = "1.5.0";
src = fetchFromGitHub {
owner = "agateau";
repo = "sfxr-qt";
rev = version;
sha256 = "sha256-Mn+wcwu70BwsTLFlc12sOOe6U1AJ8hR7bCIPlPnCooE=";
sha256 = "sha256-Ce5NJe1f+C4pPmtenHYvtkxste+nPuxJoB+N7K2nyRo=";
fetchSubmodules = true;
};
# Remove on next release
patches = [(fetchpatch {
name = "sfxr-qr-missing-qpainterpath-include";
url = "https://github.com/agateau/sfxr-qt/commit/ef051f473654052112b647df987eb263e38faf47.patch";
sha256 = "sha256-bqMnxHUzdS5oG/2hfr5MvkpwrtZW+GTN5fS2WpV2W2c=";
})];
nativeBuildInputs = [
cmake
extra-cmake-modules
@ -33,6 +43,11 @@ mkDerivation rec {
SDL
];
passthru.tests = {
export-square-wave = callPackage ./test-export-square-wave {};
sfxr-qt-starts = nixosTests.sfxr-qt;
};
meta = with lib; {
homepage = "https://github.com/agateau/sfxr-qt";
description = "A sound effect generator, QtQuick port of sfxr";

View File

@ -0,0 +1,6 @@
{ runCommand, sfxr-qt }:
runCommand "sfxr-qt-test-export-square-wave" ''
mkdir $out
${sfxr-qt}/bin/sfxr-qt --export --output $out/output.wav ${./input.sfxj}
''

View File

@ -0,0 +1,29 @@
{
"properties": {
"attackTime": 0,
"baseFrequency": 1,
"changeAmount": 0,
"changeSpeed": 0,
"decayTime": 1,
"deltaSlide": 0,
"dutySweep": 0,
"hpFilterCutoff": 0,
"hpFilterCutoffSweep": 0,
"lpFilterCutoff": 1,
"lpFilterCutoffSweep": 0,
"lpFilterResonance": 0,
"minFrequency": 0,
"phaserOffset": 0,
"phaserSweep": 0,
"repeatSpeed": 0,
"slide": 0,
"squareDuty": 0,
"sustainPunch": 0,
"sustainTime": 1,
"vibratoDepth": 0,
"vibratoSpeed": 0,
"volume": 1,
"waveForm": "Square"
},
"version": 1
}