summary refs log tree commit diff
diff options
context:
space:
mode:
authorKier Davis <kierdavis@gmail.com>2017-11-24 00:03:22 +0000
committerFrederik Rietdijk <fridh@fridh.nl>2017-11-25 09:43:42 +0100
commitcb9bf1c8541f68513eb446c89e763657a6a9a1ef (patch)
treed431f1a6d734ec644a05f51d288c27434b442121
parente2349070aca95bc96f1091c9142634c065f2925b (diff)
downloadnixpkgs-cb9bf1c8541f68513eb446c89e763657a6a9a1ef.tar
nixpkgs-cb9bf1c8541f68513eb446c89e763657a6a9a1ef.tar.gz
nixpkgs-cb9bf1c8541f68513eb446c89e763657a6a9a1ef.tar.bz2
nixpkgs-cb9bf1c8541f68513eb446c89e763657a6a9a1ef.tar.lz
nixpkgs-cb9bf1c8541f68513eb446c89e763657a6a9a1ef.tar.xz
nixpkgs-cb9bf1c8541f68513eb446c89e763657a6a9a1ef.tar.zst
nixpkgs-cb9bf1c8541f68513eb446c89e763657a6a9a1ef.zip
PySolFC: init at 2.0
PySolFC is a solitaire game written in Python, supporting thousands of
solitaire variants.
-rw-r--r--pkgs/games/pysolfc/default.nix39
-rw-r--r--pkgs/games/pysolfc/pysolfc-datadir.patch19
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/games/pysolfc/default.nix b/pkgs/games/pysolfc/default.nix
new file mode 100644
index 00000000000..85424ebea9b
--- /dev/null
+++ b/pkgs/games/pysolfc/default.nix
@@ -0,0 +1,39 @@
+{ fetchurl, python2, stdenv }:
+
+with python2.pkgs;
+
+buildPythonApplication rec {
+  pname = "PySolFC";
+  version = "2.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/pysolfc/${pname}-${version}.tar.bz2";
+    sha256 = "0v0v8iflw55f5mghglkw80j8b7lv1hffjassfhqc4y84dmz8xjyv";
+  };
+
+  patches = [
+    ./pysolfc-datadir.patch
+  ];
+
+  propagatedBuildInputs = [
+    tkinter
+  ];
+
+  # No tests in archive
+  doCheck = false;
+
+  postInstall = ''
+    # executables should not have an extension
+    pushd $out/bin
+    mv pysol.py pysol
+    rm pysol.pyc
+    popd
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A collection of more than 1000 solitaire card games";
+    homepage = http://pysolfc.sourceforge.net/;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ kierdavis ];
+  };
+}
diff --git a/pkgs/games/pysolfc/pysolfc-datadir.patch b/pkgs/games/pysolfc/pysolfc-datadir.patch
new file mode 100644
index 00000000000..d9f1cf4e09f
--- /dev/null
+++ b/pkgs/games/pysolfc/pysolfc-datadir.patch
@@ -0,0 +1,19 @@
+diff --git a/pysollib/util.py b/pysollib/util.py
+index 8de3f00..26f4bc7 100644
+--- a/pysollib/util.py
++++ b/pysollib/util.py
+@@ -110,13 +110,7 @@ class DataLoader:
+         head, tail = os.path.split(argv0)
+         if not head:
+             head = os.curdir
+-        # dir where placed startup script
+-        path.append(head)
+-        path.append(os.path.join(head, "data"))
+-        path.append(os.path.join(head, os.pardir, "data"))
+-        # dir where placed pysol package
+-        path.append(os.path.join(sys.path[0], "data"))
+-        path.append(os.path.join(sys.path[0], "pysollib", "data"))
++        path.append(os.path.join(head, "..", "share", "PySolFC"))
+         # from settings.py
+         path.extend(DATA_DIRS)
+         # check path for valid directories
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 8db247dfec9..831cf45b511 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -18080,6 +18080,8 @@ with pkgs;
 
   privateer = callPackage ../games/privateer { };
 
+  pysolfc = callPackage ../games/pysolfc { };
+
   qweechat = callPackage ../applications/networking/irc/qweechat { };
 
   qqwing = callPackage ../games/qqwing { };