about summary refs log tree commit diff
path: root/pkgs/applications/audio/sfxr-qt
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2022-03-27 15:54:05 +0200
committerMartin Weinelt <hexa@darmstadt.ccc.de>2022-03-27 15:54:05 +0200
commitd68657af92b28ec31bba896ca4cdb6b28598d7fd (patch)
treeac16f87fe44b929d6f6c2c9184e7e6cb4e801dcc /pkgs/applications/audio/sfxr-qt
parentaba0b519c5b0b4ad7856a0a9f83fe0b2f7f0889c (diff)
parentcd1410a7d4672363be38713e40bed80d32759a61 (diff)
Merge remote-tracking branch 'origin/master' into staging-next
Diffstat (limited to 'pkgs/applications/audio/sfxr-qt')
-rw-r--r--pkgs/applications/audio/sfxr-qt/default.nix19
-rw-r--r--pkgs/applications/audio/sfxr-qt/test-export-square-wave/default.nix6
-rw-r--r--pkgs/applications/audio/sfxr-qt/test-export-square-wave/input.sfxj29
3 files changed, 52 insertions, 2 deletions
diff --git a/pkgs/applications/audio/sfxr-qt/default.nix b/pkgs/applications/audio/sfxr-qt/default.nix
index ef83531e43658..2b264cfd56b99 100644
--- a/pkgs/applications/audio/sfxr-qt/default.nix
+++ b/pkgs/applications/audio/sfxr-qt/default.nix
@@ -1,6 +1,7 @@
 { lib
 , mkDerivation
 , fetchFromGitHub
+, fetchpatch
 , cmake
 , extra-cmake-modules
 , qtbase
@@ -8,17 +9,19 @@
 , SDL
 , python3
 , catch2
+, 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;
   };
 
@@ -26,6 +29,13 @@ mkDerivation rec {
     cp ${catch2}/include/catch2/catch.hpp 3rdparty/catch2/single_include/catch2/catch.hpp
   '';
 
+  # 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
@@ -40,6 +50,11 @@ mkDerivation rec {
 
   doCheck = true;
 
+  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";
diff --git a/pkgs/applications/audio/sfxr-qt/test-export-square-wave/default.nix b/pkgs/applications/audio/sfxr-qt/test-export-square-wave/default.nix
new file mode 100644
index 0000000000000..eea0d0743e6a5
--- /dev/null
+++ b/pkgs/applications/audio/sfxr-qt/test-export-square-wave/default.nix
@@ -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}
+''
diff --git a/pkgs/applications/audio/sfxr-qt/test-export-square-wave/input.sfxj b/pkgs/applications/audio/sfxr-qt/test-export-square-wave/input.sfxj
new file mode 100644
index 0000000000000..5ffd33b93f971
--- /dev/null
+++ b/pkgs/applications/audio/sfxr-qt/test-export-square-wave/input.sfxj
@@ -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
+}