summaryrefslogtreecommitdiffstats
path: root/games/scrabbleai/unix.diff
blob: 945a80989a88be4da2d5cecab602d7b0f651ee22 (plain)
diff -Naur scrabbleai-20150324_6f8db6b/lib/ScrabbleAI/Backend/Library.pm scrabbleai-20150324_6f8db6b.patched/lib/ScrabbleAI/Backend/Library.pm
--- scrabbleai-20150324_6f8db6b/lib/ScrabbleAI/Backend/Library.pm	2023-03-20 18:35:20.752358098 -0400
+++ scrabbleai-20150324_6f8db6b.patched/lib/ScrabbleAI/Backend/Library.pm	2023-03-20 23:37:16.993653190 -0400
@@ -25,7 +25,7 @@
 use warnings;
 
 use Data::Dumper;
-use Storable;
+use Storable qw(nstore retrieve);
 
 use ScrabbleAI::Backend::Utils;
 use ScrabbleAI::Backend::Node;
@@ -38,7 +38,7 @@
 use constant {
 	OSPD => ScrabbleAI::Backend::Utils::abs_path('Backend/ospd.txt'),
 	ENABLE => ScrabbleAI::Backend::Utils::abs_path('Backend/enable.txt'),
-	LIBRARY => ScrabbleAI::Backend::Utils::abs_path('Backend/library'),
+	LIBRARY => "$ENV{HOME}/.config/ScrabbleAI/library",
 };
 
 # If a Backend/Library file exists, attempts to load the Library from it using Storable.
@@ -76,7 +76,7 @@
 			$self->{treewords}{$word} = 1;
 		}
 		
-		store({
+		nstore({
 			wordtree => $self->{wordtree},
 			treewords => $self->{treewords},
 			longwords => $self->{longwords},
diff -Naur scrabbleai-20150324_6f8db6b/lib/ScrabbleAI/Backend/Utils.pm scrabbleai-20150324_6f8db6b.patched/lib/ScrabbleAI/Backend/Utils.pm
--- scrabbleai-20150324_6f8db6b/lib/ScrabbleAI/Backend/Utils.pm	2023-03-20 18:35:20.752358098 -0400
+++ scrabbleai-20150324_6f8db6b.patched/lib/ScrabbleAI/Backend/Utils.pm	2023-03-20 20:45:44.221621837 -0400
@@ -23,8 +23,6 @@
 use strict;
 use warnings;
 
-use FindBin;
-
 # Given an arrayref of coordinates '(i,j)' and a position 0 or 1,
 # returns an array of only the coordinates of that position.
 sub coord_position {
@@ -80,7 +78,7 @@
 sub abs_path {
 	my ($path) = @_;
 
-	return $FindBin::Bin . "/lib/ScrabbleAI/$path";
+	return "/usr/share/games/scrabbleai/ScrabbleAI/$path";
 }
 
 1;
diff -Naur scrabbleai-20150324_6f8db6b/lib/ScrabbleAI/GUI/SettingsManager.pm scrabbleai-20150324_6f8db6b.patched/lib/ScrabbleAI/GUI/SettingsManager.pm
--- scrabbleai-20150324_6f8db6b/lib/ScrabbleAI/GUI/SettingsManager.pm	2023-03-20 18:35:20.764358097 -0400
+++ scrabbleai-20150324_6f8db6b.patched/lib/ScrabbleAI/GUI/SettingsManager.pm	2023-03-20 23:37:24.279652505 -0400
@@ -28,10 +28,10 @@
 use ScrabbleAI::Backend::Utils;
 
 use Data::Dumper;
-use Storable;
+use Storable qw(nstore retrieve);
 
 # File where the settings are saved
-use constant FILENAME => ScrabbleAI::Backend::Utils::abs_path('GUI/settings');
+use constant FILENAME => "$ENV{HOME}/.config/ScrabbleAI/settings";
 
 # Creates a new instance of this class; if the settings file exists on disk,
 # loads the settings (key => value pairs as a hashref) from that file.
@@ -90,7 +90,7 @@
 sub save {
 	my ($self) = @_;
 
-	store($self->{settings}, FILENAME);
+	nstore($self->{settings}, FILENAME);
 }
 
 1;
diff -Naur scrabbleai-20150324_6f8db6b/scrabbleai.pl scrabbleai-20150324_6f8db6b.patched/scrabbleai.pl
--- scrabbleai-20150324_6f8db6b/scrabbleai.pl	2023-03-20 18:35:20.764358097 -0400
+++ scrabbleai-20150324_6f8db6b.patched/scrabbleai.pl	2023-03-20 20:52:53.461581441 -0400
@@ -1,3 +1,5 @@
+#!/usr/bin/perl
+
 ##########################################################################
 # ScrabbleAI
 # A program that lets you play the popular word game Scrabble against a
@@ -22,8 +24,9 @@
 use strict;
 use warnings;
 
-use FindBin;
-use lib $FindBin::Bin . '/lib';
+system("mkdir -p $ENV{HOME}/.config/ScrabbleAI");
+
+use lib '/usr/share/games/scrabbleai';
 
 use Gtk2 '-init';