diff options
author | Daniel Prosser | 2024-05-09 02:21:21 +0200 |
---|---|---|
committer | Willy Sudiarto Raharjo | 2024-05-11 01:51:54 +0200 |
commit | 52e25c6635b93596ced11affa886dfaad7c73c44 (patch) | |
tree | 73e2b243744fb2bc4fea60738c3fab49274d050e | |
parent | db02fbbe2e23e6662da8c4d685cd382bde4907f7 (diff) | |
download | slackbuilds-52e25c6635b93596ced11affa886dfaad7c73c44.tar.gz |
games/LucasChess: Updated for version R2.14g.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | games/LucasChess/Configuration.py | 125 | ||||
-rw-r--r-- | games/LucasChess/LucasChess.SlackBuild | 22 | ||||
-rw-r--r-- | games/LucasChess/LucasChess.info | 6 | ||||
-rw-r--r-- | games/LucasChess/README | 5 |
4 files changed, 100 insertions, 58 deletions
diff --git a/games/LucasChess/Configuration.py b/games/LucasChess/Configuration.py index 3ba3ae4208..49fd4f2df3 100644 --- a/games/LucasChess/Configuration.py +++ b/games/LucasChess/Configuration.py @@ -61,7 +61,7 @@ def change_folder(nueva): class BoxRooms: def __init__(self, configuration): - self.file = os.path.join(configuration.carpeta_config, "boxrooms.pk") + self.file = Util.opj(configuration.carpeta_config, "boxrooms.pk") self._list = self.read() def read(self): @@ -90,22 +90,22 @@ class Configuration: self.carpetaBase = active_folder() - self.carpetaUsers = os.path.join(self.carpetaBase, "users") + self.carpetaUsers = Util.opj(self.carpetaBase, "users") self.first_run = False if user: Util.create_folder(self.carpetaUsers) - self.carpeta = os.path.join(self.carpetaUsers, str(user.number)) + self.carpeta = Util.opj(self.carpetaUsers, str(user.number)) Util.create_folder(self.carpeta) else: self.first_run = Util.create_folder(self.carpetaBase) self.carpeta = self.carpetaBase - self.carpeta_config = os.path.join(self.carpeta, "__Config__") + self.carpeta_config = Util.opj(self.carpeta, "__Config__") Util.create_folder(self.carpeta_config) - self.carpeta_results = os.path.join(self.carpeta, "Results") + self.carpeta_results = Util.opj(self.carpeta, "Results") Util.create_folder(self.carpeta_results) self.user = user @@ -156,10 +156,13 @@ class Configuration: self.x_director_icon = False self.x_direct_graphics = False + self.x_sizefont_messages = 14 + self.x_sizefont_infolabels = 11 + self.x_sizefont_players = 16 self.x_pgn_width = 348 - self.x_pgn_fontpoints = 10 + self.x_pgn_fontpoints = 11 self.x_pgn_rowheight = 24 self.x_pgn_withfigurines = True @@ -170,7 +173,7 @@ class Configuration: self.x_copy_ctrl = True # False = Alt C self.x_font_family = "" - self.x_font_points = 10 + self.x_font_points = 11 self.x_menu_points = 11 self.x_menu_bold = False @@ -200,6 +203,7 @@ class Configuration: self.x_analyzer_priority = Priorities.priorities.low self.x_analyzer_depth_ab = 24 self.x_analyzer_mstime_ab = 0 + self.x_analyzer_autorotate_ab = True self.x_analyzer_mstime_refresh_ab = 200 self.x_analyzer_activate_ab = False @@ -241,6 +245,8 @@ class Configuration: self.x_interval_replay = 1400 self.x_beep_replay = False + self.x_margin_pieces = 7 + self.x_engine_notbackground = False self.x_check_for_update = False @@ -267,7 +273,17 @@ class Configuration: self._dic_books = None - self.__theme_num = 2 + self.__theme_num = 1 # 1=red 2=old + + def get_folder_default(self, folder): + return folder if folder else self.carpeta + + def save_folder(self): + return self.get_folder_default(self.x_save_folder) + + def set_save_folder(self, folder): + self.x_save_folder = folder + self.graba() @property def dic_books(self): @@ -285,7 +301,7 @@ class Configuration: add_folder(Code.path_resource("Openings")) for engine in ("foxcub", "fox", "maia", "irina", "rodentii"): - add_folder(os.path.join(Code.folder_engines, engine)) + add_folder(Util.opj(Code.folder_engines, engine)) return self._dic_books def path_book(self, alias): @@ -321,13 +337,13 @@ class Configuration: } def folder_translations(self): - folder = os.path.join(self.carpetaBase, "Translations") + folder = Util.opj(self.carpetaBase, "Translations") if not os.path.isdir(folder): Util.create_folder(folder) return folder def carpeta_sounds(self): - return os.path.join(self.carpeta, "Sounds") + return Util.opj(self.carpeta, "Sounds") def relee_engines(self): self.dic_engines = OSEngines.read_engines(Code.folder_engines) @@ -349,13 +365,13 @@ class Configuration: return Code.path_resource("Gaviota") def folder_gaviota(self): - if not Util.exist_file(os.path.join(self.x_carpeta_gaviota, "kbbk.gtb.cp4")): + if not Util.exist_file(Util.opj(self.x_carpeta_gaviota, "kbbk.gtb.cp4")): self.x_carpeta_gaviota = self.carpeta_gaviota_defecto() self.graba() return self.x_carpeta_gaviota def pieces_gaviota(self): - if Util.exist_file(os.path.join(self.folder_gaviota(), "kbbkb.gtb.cp4")): + if Util.exist_file(Util.opj(self.folder_gaviota(), "kbbkb.gtb.cp4")): return 5 return 4 @@ -372,7 +388,7 @@ class Configuration: def language(self): tr_actual = self.translator() dlang = Code.path_resource("Locale") - fini = os.path.join(dlang, tr_actual, "lang.ini") + fini = Util.opj(dlang, tr_actual, "lang.ini") dic = Util.ini_dic(fini) return dic["NAME"] @@ -389,7 +405,7 @@ class Configuration: self.lee() self.relee_engines() self.rival = self.buscaRival(self.x_rival_inicial) - self.leeConfBoards() + self.read_conf_boards() def changeActiveFolder(self, nueva): change_folder(nueva) @@ -397,12 +413,12 @@ class Configuration: self.lee() def create_base_folder(self, folder): - folder = os.path.realpath(os.path.join(self.carpeta, folder)) + folder = os.path.realpath(Util.opj(self.carpeta, folder)) Util.create_folder(folder) return folder def file_competition_with_tutor(self): - return os.path.join(self.carpeta_results, "CompetitionWithTutor.db") + return Util.opj(self.carpeta_results, "CompetitionWithTutor.db") def folder_userdata(self): return self.carpeta @@ -431,37 +447,37 @@ class Configuration: self.write_variables("OPENING_LINES", dic) def file_mate(self, mate): - return os.path.join(self.carpeta_results, "Mate%d.pk" % mate) + return Util.opj(self.carpeta_results, "Mate%d.pk" % mate) def file_endings_gtb(self): - return os.path.join(self.carpeta_results, "EndingsGTB.db") + return Util.opj(self.carpeta_results, "EndingsGTB.db") def file_external_engines(self): - return os.path.join(self.carpeta_config, "ExtEngines.pk") + return Util.opj(self.carpeta_config, "ExtEngines.pk") def file_kibitzers(self): - return os.path.join(self.carpeta_config, "kibitzers.pk") + return Util.opj(self.carpeta_config, "kibitzers.pk") def file_adjournments(self): - return os.path.join(self.carpeta_config, "Adjournments.ddb") + return Util.opj(self.carpeta_config, "Adjournments.ddb") def file_index_polyglots(self): - return os.path.join(self.carpeta_config, "index_polyglots.pk") + return Util.opj(self.carpeta_config, "index_polyglots.pk") def file_pers_openings(self): - return os.path.join(self.carpeta_config, "persaperturas.pkd") + return Util.opj(self.carpeta_config, "persaperturas.pkd") def file_captures(self): - return os.path.join(self.carpeta_results, "Captures.db") + return Util.opj(self.carpeta_results, "Captures.db") def file_counts(self): - return os.path.join(self.carpeta_results, "Counts.db") + return Util.opj(self.carpeta_results, "Counts.db") def file_mate15(self): - return os.path.join(self.carpeta_results, "Mate15.db") + return Util.opj(self.carpeta_results, "Mate15.db") def file_coordinates(self): - return os.path.join(self.carpeta_results, "Coordinates.db") + return Util.opj(self.carpeta_results, "Coordinates.db") def folder_tactics(self): return self.create_base_folder("Tactics") @@ -470,7 +486,10 @@ class Configuration: return self.create_base_folder("Databases") def file_autosave(self): - return os.path.join(self.folder_databases(), "__Autosave__.lcdb") + return Util.opj(self.folder_databases(), "__Autosave__.lcdb") + + def file_selected_positions(self): + return Util.opj(self.folder_databases(), "__Selected Positions__.lcdb") def folder_databases_pgn(self): return self.create_base_folder("TemporaryDatabases") @@ -479,7 +498,7 @@ class Configuration: return self.create_base_folder("PolyglotsFactory") def opj_config(self, file): - return os.path.join(self.carpeta_config, file) + return Util.opj(self.carpeta_config, file) def file_video(self): return self.opj_config("confvid.pkd") @@ -507,7 +526,7 @@ class Configuration: def set_folders(self): - self.file = os.path.join(self.carpeta_config, "lk.pk2") + self.file = Util.opj(self.carpeta_config, "lk.pk2") self.is_first_time = not Util.exist_file(self.file) @@ -568,11 +587,11 @@ class Configuration: if not Util.exist_file(self.file_sounds()): Util.file_copy(Code.path_resource("IntFiles", "sounds.pkd"), self.file_sounds()) - self.folder_base_openings = os.path.join(self.carpeta, "OpeningLines") + self.folder_base_openings = Util.opj(self.carpeta, "OpeningLines") Util.create_folder(self.folder_base_openings) def file_colors(self): - return os.path.join(self.carpeta_config, "personal.colors") + return Util.opj(self.carpeta_config, "personal.colors") def compruebaBMT(self): if not Util.exist_file(self.ficheroBMT): @@ -641,7 +660,7 @@ class Configuration: li = [] for key, cm in self.dic_engines.items(): li.append((cm.nombre_ext(), key)) - li.sort(key=lambda x: x[0]) + li.sort(key=lambda x: x[0].upper()) return li def combo_engines_multipv10(self, minimo=10): # %# @@ -674,6 +693,8 @@ class Configuration: if x in dic: setattr(self, x, dic[x]) + if "x_sizefont_players" not in dic: + self.x_sizefont_players = self.x_sizefont_infolabels + 2 # self.palette = dic.get("PALETTE", self.palette) self.li_personalities = dic.get("PERSONALITIES", self.li_personalities) @@ -683,9 +704,10 @@ class Configuration: self.x_translator = x[:2] self.load_translation() - TrListas.ponPiecesLNG(self.x_pgn_english or self.translator() == "en") + TrListas.pon_pieces_lng(self.x_pgn_english or self.translator() == "en") Code.analysis_eval = AnalysisEval.AnalysisEval() + Code.factor_big_fonts = max(1.0, self.x_font_points / 11) IconosBase.icons.reset(self.x_style_icons) @@ -700,7 +722,7 @@ class Configuration: def get_favoritos(self): if self.li_favoritos is None: - file = os.path.join(self.carpeta_config, "Favoritos.pkd") + file = Util.opj(self.carpeta_config, "Favoritos.pkd") lista = Util.restore_pickle(file) if lista is None: lista = [] @@ -709,12 +731,12 @@ class Configuration: def save_favoritos(self, lista): self.li_favoritos = lista - file = os.path.join(self.carpeta_config, "Favoritos.pkd") + file = Util.opj(self.carpeta_config, "Favoritos.pkd") Util.save_pickle(file, lista) def load_translation(self): dlang = Code.path_resource("Locale") - fini = os.path.join(dlang, self.x_translator, "lang.ini") + fini = Util.opj(dlang, self.x_translator, "lang.ini") if not os.path.isfile(fini): self.x_translator = "en" Translate.install(self.x_translator) @@ -724,7 +746,7 @@ class Configuration: li = [] dlang = Code.path_resource("Locale") for uno in Util.listdir(dlang): - fini = os.path.join(dlang, uno.name, "lang.ini") + fini = Util.opj(dlang, uno.name, "lang.ini") if os.path.isfile(fini): dic = Util.ini_dic(fini) if others: @@ -771,7 +793,7 @@ class Configuration: self.x_lichess = elo def po_saved(self): - return os.path.join(self.folder_translations(), "%s.po" % self.x_translator) + return Util.opj(self.folder_translations(), "%s.po" % self.x_translator) def list_internal_engines(self): li = [cm for k, cm in self.dic_engines.items() if not cm.is_external] @@ -861,13 +883,13 @@ class Configuration: return self.engine_analyzer() def temporary_folder(self): - dirTmp = os.path.join(self.carpeta, "tmp") - Util.create_folder(dirTmp) - return dirTmp + dir_tmp = Util.opj(self.carpeta, "tmp") + Util.create_folder(dir_tmp) + return dir_tmp def ficheroTemporal(self, extension): - dirTmp = os.path.join(self.carpeta, "tmp") - return Util.temporary_file(dirTmp, extension) + dir_tmp = Util.opj(self.carpeta, "tmp") + return Util.temporary_file(dir_tmp, extension) def clean_tmp_folder(self): try: @@ -957,7 +979,7 @@ class Configuration: def change_theme_num(self, num): self.__theme_num = num - def leeConfBoards(self): + def read_conf_boards(self): with UtilSQL.DictSQL(self.ficheroConfBoards) as db: self.dic_conf_boards_pk = db.as_dictionary() if not ("BASE" in self.dic_conf_boards_pk): @@ -993,7 +1015,7 @@ class Configuration: db = UtilSQL.DictSQL(self.ficheroConfBoards) del db[key] db.close() - self.leeConfBoards() + self.read_conf_boards() return self.config_board(key, tamDef) def cambiaConfBoard(self, config_board): @@ -1002,14 +1024,14 @@ class Configuration: db = UtilSQL.DictSQL(self.ficheroConfBoards) self.dic_conf_boards_pk[xid] = db[xid] = config_board.graba() db.close() - self.leeConfBoards() + self.read_conf_boards() def config_board(self, xid, tam_def, padre="BASE"): if xid == "BASE": ct = ConfBoards.ConfigBoard(xid, tam_def) else: ct = ConfBoards.ConfigBoard(xid, tam_def, padre=padre) - ct.anchoPieza(tam_def) + ct.width_piece(tam_def) if xid in self.dic_conf_boards_pk: ct.lee(self.dic_conf_boards_pk[xid]) @@ -1034,10 +1056,7 @@ class Configuration: return dic def pgn_folder(self): - resp = self.x_save_pgn_folder - if not resp: - resp = self.carpeta - return resp + return self.get_folder_default(self.x_save_pgn_folder) def save_pgn_folder(self, new_folder): if self.x_save_pgn_folder != new_folder: diff --git a/games/LucasChess/LucasChess.SlackBuild b/games/LucasChess/LucasChess.SlackBuild index dfd10af1a3..56d316f738 100644 --- a/games/LucasChess/LucasChess.SlackBuild +++ b/games/LucasChess/LucasChess.SlackBuild @@ -30,11 +30,11 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=LucasChess -VERSION=${VERSION:-R2.11g} +VERSION=${VERSION:-R2.14g} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} -SRCNAM=${SRCNAM:-LucasChessR2_11g_LINUX.sh} +SRCNAM=${SRCNAM:-LucasChessR2_14g_LINUX.sh} ARCHIVELINE=716 if [ -z "$ARCH" ]; then @@ -59,6 +59,18 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} +LUCASGRP=${LUCASGRP:-lucaschess} +LUCASGID=${LUCASGID:-385} + +# Check for lucaschess group here +if ! getent group | grep -q ^${LUCASGRP}: 2>/dev/null; then + echo "You must have a ${LUCASGRP} group to run this script." + echo " # groupadd -g ${LUCASGID} ${LUCASGRP}" + echo "Then add your user to this group (then have them log out and back in):" + echo " # usermod -a -G ${LUCASGRP} your_username" + echo "Exiting..." ; exit 1 +fi + set -e rm -rf $PKG @@ -104,6 +116,12 @@ ln -sf Fox Fox.exe rm $PKG/opt/$PRGNAM-$VERSION/bin/Code/Config/Configuration.pyc cat $CWD/Configuration.py > $PKG/opt/$PRGNAM-$VERSION/bin/Code/Config/Configuration.py +# stockfish directory needs to be writable by ${LUCASGRP} group. This is for the +# setup step on first use where it detects the appropriate stockfish build for +# your system. +chgrp -R ${LUCASGRP} $PKG/opt/$PRGNAM-$VERSION +chmod g+w $PKG/opt/$PRGNAM-$VERSION/bin/OS/linux/Engines/stockfish + # Install desktop launcher sed "s/VERSION/${VERSION}/g" $CWD/LucasChessR.desktop.in \ > $PKG/usr/share/applications/LucasChessR.desktop diff --git a/games/LucasChess/LucasChess.info b/games/LucasChess/LucasChess.info index 28529562e7..7077fdde0c 100644 --- a/games/LucasChess/LucasChess.info +++ b/games/LucasChess/LucasChess.info @@ -1,10 +1,10 @@ PRGNAM="LucasChess" -VERSION="R2.11g" +VERSION="R2.14g" HOMEPAGE="https://lucaschess.pythonanywhere.com/" DOWNLOAD="UNSUPPORTED" MD5SUM="" -DOWNLOAD_x86_64="https://downloads.sourceforge.net/project/lucaschessr/Version_R2/LucasChessR2_11g_LINUX.sh" -MD5SUM_x86_64="6e73747c9fb8170066bde5535fa37c99" +DOWNLOAD_x86_64="https://psychz.dl.sourceforge.net/project/lucaschessr/Version_R2/LucasChessR2_14g_LINUX.sh" +MD5SUM_x86_64="d7bbe8f59043244790ea380b246242e9" REQUIRES="" MAINTAINER="Daniel Prosser" EMAIL="dpross1100@msn.com" diff --git a/games/LucasChess/README b/games/LucasChess/README index b715c73478..32f5db3600 100644 --- a/games/LucasChess/README +++ b/games/LucasChess/README @@ -8,3 +8,8 @@ PGN files, and study openings. This SlackBuild repackages the binary distribution provided by upstream. It requires about 700 MB of space when installed. + +You will need a special group and to add at least the first user of +Lucas Chess to this group. By default, the group name is called +"lucaschess" with a group id of 385, but you can change this if you wish. +See the build script for more information. |