summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2020-07-30 12:54:49 +0100
committerGitHub <noreply@github.com>2020-07-30 12:54:49 +0100
commita7888ee7f696092318d0a22ab3b4345ad4cef0be (patch)
tree612a02fa9b3edbb7aa281e816f7425df6dcd562c
parent6eadc11005318fc4eef7da19898cff51689fb723 (diff)
parent4436c0151e661370f0461b996373bdf7d25cdcbc (diff)
downloadnixpkgs-a7888ee7f696092318d0a22ab3b4345ad4cef0be.tar
nixpkgs-a7888ee7f696092318d0a22ab3b4345ad4cef0be.tar.gz
nixpkgs-a7888ee7f696092318d0a22ab3b4345ad4cef0be.tar.bz2
nixpkgs-a7888ee7f696092318d0a22ab3b4345ad4cef0be.tar.lz
nixpkgs-a7888ee7f696092318d0a22ab3b4345ad4cef0be.tar.xz
nixpkgs-a7888ee7f696092318d0a22ab3b4345ad4cef0be.tar.zst
nixpkgs-a7888ee7f696092318d0a22ab3b4345ad4cef0be.zip
Merge pull request #94183 from fgaz/pt2-clone/1.22
pt2-clone: 1.20 -> 1.22, add nixos test
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/pt2-clone.nix35
-rw-r--r--pkgs/applications/audio/pt2-clone/default.nix9
3 files changed, 43 insertions, 2 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 12f3ee30331..19397427b2a 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -285,6 +285,7 @@ in
   prosody = handleTest ./xmpp/prosody.nix {};
   prosodyMysql = handleTest ./xmpp/prosody-mysql.nix {};
   proxy = handleTest ./proxy.nix {};
+  pt2-clone = handleTest ./pt2-clone.nix {};
   qboot = handleTestOn ["x86_64-linux" "i686-linux"] ./qboot.nix {};
   quagga = handleTest ./quagga.nix {};
   quorum = handleTest ./quorum.nix {};
diff --git a/nixos/tests/pt2-clone.nix b/nixos/tests/pt2-clone.nix
new file mode 100644
index 00000000000..b502172e2ee
--- /dev/null
+++ b/nixos/tests/pt2-clone.nix
@@ -0,0 +1,35 @@
+import ./make-test-python.nix ({ pkgs, ... }: {
+  name = "pt2-clone";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ fgaz ];
+  };
+
+  machine = { config, pkgs, ... }: {
+    imports = [
+      ./common/x11.nix
+    ];
+
+    services.xserver.enable = true;
+    sound.enable = true;
+    environment.systemPackages = [ pkgs.pt2-clone ];
+  };
+
+  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("pt2-clone &")
+
+      machine.wait_for_window(r"ProTracker")
+      machine.sleep(5)
+      # One of the few words that actually get recognized
+      if "LENGTH" not in machine.get_screen_text():
+          raise Exception("Program did not start successfully")
+      machine.screenshot("screen")
+    '';
+})
+
diff --git a/pkgs/applications/audio/pt2-clone/default.nix b/pkgs/applications/audio/pt2-clone/default.nix
index 12eb4a39d53..b76be35da29 100644
--- a/pkgs/applications/audio/pt2-clone/default.nix
+++ b/pkgs/applications/audio/pt2-clone/default.nix
@@ -1,24 +1,29 @@
 { stdenv
 , fetchFromGitHub
 , cmake
+, nixosTests
 , alsaLib
 , SDL2
 }:
 
 stdenv.mkDerivation rec {
   pname = "pt2-clone";
-  version = "1.20";
+  version = "1.22";
 
   src = fetchFromGitHub {
     owner = "8bitbubsy";
     repo = "pt2-clone";
     rev = "v${version}";
-    sha256 = "0s4yk8w19qa58n5p558n6m7d5mslr9h9z5q3ayrgqcchdlm8cfky";
+    sha256 = "1w6lbq4366bawy975glvjizk57zhvl562xhxwzn7p5hpm2bvw09b";
   };
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ SDL2 ] ++ stdenv.lib.optional stdenv.isLinux alsaLib;
 
+  passthru.tests = {
+    pt2-clone-opens = nixosTests.pt2-clone;
+  };
+
   meta = with stdenv.lib; {
     description = "A highly accurate clone of the classic ProTracker 2.3D software for Amiga";
     homepage = "https://16-bits.org/pt2.php";