diff -Nru laby-0.6.4/AUTHORS laby-0.7.0/AUTHORS --- laby-0.6.4/AUTHORS 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/AUTHORS 2020-05-13 11:15:09.000000000 +0000 @@ -15,6 +15,7 @@ Vala: Jens Mühlenhoff (antichorus) Javascript: suxiaojack Pascal: Sergey Roganov + PHP and Go: Hammed Oyedele (devhammed) (translations) @@ -31,7 +32,7 @@ Italian: Alessio Cecchin, Luca Incarbone Polish: Mateusz Mikos, Karol Sieńkowski, Piotr Szymański Portuguese: Vicente Machado - Russian: Dmitry Antonyuk, Sergey Roganov + Russian: Dmitry Antonyuk, Sergey Roganov, Alexey Loginov Spanish: Alexandro Colorado, "ultrarregistro", "aripm" Swedish: "diggan", "135" Turkish: Furkan Er diff -Nru laby-0.6.4/build laby-0.7.0/build --- laby-0.6.4/build 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/build 2020-05-13 11:15:09.000000000 +0000 @@ -6,8 +6,8 @@ source build.conf || exit 1 export PREFIX=${PREFIX-/usr} -export SYSDATADIR=${SYSDATADIR-${PREFIX}/share} -export SYSTMPDIR=${SYSTMPDIR-/tmp} +export DATADIR=${DATADIR-${PREFIX}/share} +export TMPDIR=${TMPDIR-/tmp} export PROJECT_NAME=${PROJECT_NAME-unknown} export PROJECT_VERSION=${PROJECT_VERSION-unknown} @@ -35,15 +35,7 @@ [ -n "${TAGLINE}" ] && OCBF="${OCBF} -tag-line ${TAGLINE}" [ -n "${JOBS}" ] && OCBF="${OCBF} -j ${JOBS}" -## compatibility for ocamlbuild<3.12 which lacks -use-ocamlfind -IFS=$', \n'; -PKGDIRS=$(${OCAMLFIND} query -r -format -I,%d $PACKAGES) -[ $? = 0 ] || exit 1 -for i in ${PKGDIRS}; do OCBF="${OCBF} -cflags $i -lflags $i"; done -for i in ${LIBRARIES}; do OCBF="${OCBF} -lib $i"; done -for i in ${SRCDIRS}; do OCBF="${OCBF} -I $i"; done -unset IFS -#OCBF="${OCBF} -use-ocamlfind -pkgs $PACKAGES -libs $LIBRARIES -Is $SRCDIRS" +OCBF="${OCBF} -use-ocamlfind -pkgs $PACKAGES -libs $LIBRARIES -Is $SRCDIRS" OCBI="${OCAMLBUILD} -no-sanitize -no-hygiene -build-dir ${BUILDDIR} ${OCBF}" diff -Nru laby-0.6.4/build.conf laby-0.7.0/build.conf --- laby-0.6.4/build.conf 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/build.conf 2020-05-13 11:15:09.000000000 +0000 @@ -1,7 +1,9 @@ -PACKAGES="lablgtk2" -LIBRARIES="unix,str,lablgtk,lablgtksourceview2" +PACKAGES="lablgtk3,lablgtk3-sourceview3" +LIBRARIES="str,lablgtk3,lablgtk3_sourceview3" TAGS="debug" +OCBF="-cflag -thread -lflag -thread" + SRCDIRS="src,src/dtools" CONF="src/config" BINS="src/laby" diff -Nru laby-0.6.4/data/conf laby-0.7.0/data/conf --- laby-0.6.4/data/conf 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/data/conf 2020-05-13 11:15:09.000000000 +0000 @@ -1,6 +1,6 @@ #int gfx.tile-size :40 -#int gfx.window.width :1000 -#int gfx.window.height :750 +#int gfx.window.width :640 +#int gfx.window.height :480 #string gfx.source-style :classic #string mod.selected :ocaml #bool mod.exclusive :false diff -Nru laby-0.6.4/data/levels/4a.laby laby-0.7.0/data/levels/4a.laby --- laby-0.6.4/data/levels/4a.laby 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/data/levels/4a.laby 2020-05-13 11:15:09.000000000 +0000 @@ -10,9 +10,7 @@ o . o . o o o o . o . o . o o . o . . . . . . o . o . o o . o o o o o o o o . o . o -o . . . . . . . . . . o . o -o o o o o o o o o o o o . o -o → . . . . . . . . . . . o +o . . . . . . . . . . o ↑ o o o o o o o o o o o o o o o title: diff -Nru laby-0.6.4/data/mods/go/help laby-0.7.0/data/mods/go/help --- laby-0.6.4/data/mods/go/help 1970-01-01 00:00:00.000000000 +0000 +++ laby-0.7.0/data/mods/go/help 2020-05-13 11:15:09.000000000 +0000 @@ -0,0 +1,26 @@ +basic: +laby_name_forward() +laby_name_left() +laby_name_right() +laby_name_escape() + +rocks: +laby_name_take() +laby_name_drop() + +loop: +for laby_name_look() == laby_name_Void { + ... +} + +function: +func fn_name() { + ... +} + +conditional: +if laby_name_look() == laby_name_Web { + ... +} else { + ... +} diff -Nru laby-0.6.4/data/mods/go/lib/dummy.go laby-0.7.0/data/mods/go/lib/dummy.go --- laby-0.6.4/data/mods/go/lib/dummy.go 1970-01-01 00:00:00.000000000 +0000 +++ laby-0.7.0/data/mods/go/lib/dummy.go 2020-05-13 11:15:09.000000000 +0000 @@ -0,0 +1,4 @@ +package main + +// this is needed to remove 'main function not declared in package main' error in `robot.go` +func main() {} diff -Nru laby-0.6.4/data/mods/go/lib/robot.go laby-0.7.0/data/mods/go/lib/robot.go --- laby-0.6.4/data/mods/go/lib/robot.go 1970-01-01 00:00:00.000000000 +0000 +++ laby-0.7.0/data/mods/go/lib/robot.go 2020-05-13 11:15:09.000000000 +0000 @@ -0,0 +1,90 @@ +package main + +import ( + "bufio" + "fmt" + "os" + "strings" +) + +const ( + laby_name_Void = "Void" + laby_name_Wall = "Wall" + laby_name_Rock = "Rock" + laby_name_Web = "Web" + laby_name_Exit = "Exit" + laby_name_Unknown = "Unknown" +) + +func input() string { + reader := bufio.NewReader(os.Stdin) + text, _ := reader.ReadString('\n') + input := strings.TrimSpace(text) + + if input == "quit" { + os.Exit(0) + } + + return input +} + +func laby_name_left() { + fmt.Println("left") + input() +} + +func laby_name_right() { + fmt.Println("right") + input() +} + +func laby_name_forward() { + fmt.Println("forward") + input() +} + +func laby_name_take() { + fmt.Println("take") + input() +} + +func laby_name_drop() { + fmt.Println("drop") + input() +} + +func laby_name_escape() { + fmt.Println("escape") + input() +} + +func laby_name_say(s string) { + fmt.Println("say " + s) + input() +} + +func laby_name_look() string { + fmt.Println("look") + + ans := input() + + switch ans { + case "void": + return laby_name_Void + case "wall": + return laby_name_Wall + case "rock": + return laby_name_Rock + case "web": + return laby_name_Web + case "exit": + return laby_name_Exit + default: + return laby_name_Unknown + } +} + +func init() { + fmt.Println("start") + input() +} diff -Nru laby-0.6.4/data/mods/go/rules laby-0.7.0/data/mods/go/rules --- laby-0.6.4/data/mods/go/rules 1970-01-01 00:00:00.000000000 +0000 +++ laby-0.7.0/data/mods/go/rules 2020-05-13 11:15:09.000000000 +0000 @@ -0,0 +1,7 @@ +info: +need go + +run: +fetch robot.go +dump program.go +spawn go run program.go robot.go diff -Nru laby-0.6.4/data/mods/go/skel laby-0.7.0/data/mods/go/skel --- laby-0.6.4/data/mods/go/skel 1970-01-01 00:00:00.000000000 +0000 +++ laby-0.7.0/data/mods/go/skel 2020-05-13 11:15:09.000000000 +0000 @@ -0,0 +1,17 @@ +package main + +func main() { + laby_name_right() + laby_name_forward() + laby_name_take() + laby_name_left() + laby_name_forward() + laby_name_drop() + laby_name_right() + laby_name_forward() + laby_name_left() + laby_name_forward() + laby_name_forward() + laby_name_right() + laby_name_escape() +} diff -Nru laby-0.6.4/data/mods/php/help laby-0.7.0/data/mods/php/help --- laby-0.6.4/data/mods/php/help 1970-01-01 00:00:00.000000000 +0000 +++ laby-0.7.0/data/mods/php/help 2020-05-13 11:15:09.000000000 +0000 @@ -0,0 +1,27 @@ +basic: +laby_name_forward(); +laby_name_left(); +laby_name_right(); +laby_name_escape(); + +rocks: +laby_name_take(); +laby_name_drop(); + +loop: +while ( laby_name_look() == laby_name_Void ) { + ... +} + +function: +function fn_name() { + ... +} + +conditional: +if ( laby_name_look() == laby_name_Web ) { + ... +} else { + ... +} + diff -Nru laby-0.6.4/data/mods/php/lib/robot.php laby-0.7.0/data/mods/php/lib/robot.php --- laby-0.6.4/data/mods/php/lib/robot.php 1970-01-01 00:00:00.000000000 +0000 +++ laby-0.7.0/data/mods/php/lib/robot.php 2020-05-13 11:15:09.000000000 +0000 @@ -0,0 +1,92 @@ + diff -Nru laby-0.6.4/data/texts laby-0.7.0/data/texts --- laby-0.6.4/data/texts 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/data/texts 2020-05-13 11:15:09.000000000 +0000 @@ -579,6 +579,7 @@ en_US.UTF-8 Menu es_MX.UTF-8 Menu fr_FR.UTF-8 Menu +ru_RU.UTF-8 Меню text Level ca_ES.UTF-8 Nivell @@ -1363,6 +1364,7 @@ it_IT.UTF-8 atteso valore sq_AL.UTF-8 pritej një vlerë sv_SV.UTF-8 värde förväntades +ru_RU.UTF-8 ожидается значение text the given configuration key has type ca_ES.UTF-8 la clau de configuració indicada és de tipus @@ -1374,6 +1376,7 @@ it_IT.UTF-8 la chiave di configurazione è di tipo sq_AL.UTF-8 çelësi i dhënë i konfigurimit ka tip sv_SV.UTF-8 viss konfiguration nyckeln typ +ru_RU.UTF-8 данный ключ настройки имеет тип text the given configuration key cannot be assigned a value ca_ES.UTF-8 no pot assignar-se un valor a la clau de configuració indicada @@ -1385,6 +1388,7 @@ it_IT.UTF-8 impossibile assegnare un valore a questa chiave di configurazione sq_AL.UTF-8 çelësit të dhënë të konfigurimit nuk mund ti jepet një vlerë sv_SV.UTF-8 den givna konfiguration nyckeln kan inte få värdet +ru_RU.UTF-8 данному ключу настройки нельзя присвоить значение text assignation syntax is ca_ES.UTF-8 la sintaxi per a una assignació és @@ -1395,6 +1399,7 @@ hu_HU.UTF-8 jogosultsági szintaxis: it_IT.UTF-8 la sintassi di assegnazione è sq_AL.UTF-8 sintaksa e vlerëdhënies është +ru_RU.UTF-8 синтаксис присваивания text set a configuration key ca_ES.UTF-8 estableix una clau de configuració @@ -1405,6 +1410,7 @@ hu_HU.UTF-8 konfigurációs billentyű beállítása it_IT.UTF-8 imposta una chiave di configurazione sq_AL.UTF-8 vendos një çelës konfigurimi +ru_RU.UTF-8 задайте ключ настройки text describe a configuration key ca_ES.UTF-8 descriu una clau de configuració @@ -1415,6 +1421,7 @@ hu_HU.UTF-8 írd le a konfigurációs billentyűt it_IT.UTF-8 descrivi una chiave di configurazione sq_AL.UTF-8 përshkruaj një çelës konfigurimi +ru_RU.UTF-8 опишите ключ настройки text dump a configuration key ca_ES.UTF-8 volcar una clau de configuració @@ -1425,6 +1432,7 @@ hu_HU.UTF-8 nyomd le a konfigurációs billentyűt it_IT.UTF-8 restituisci una chiave di configurazione sq_AL.UTF-8 zbraz një çelës konfigurimi +ru_RU.UTF-8 сохраните ключ конфигурации text log configuration ca_ES.UTF-8 configuració dels registres @@ -1435,6 +1443,7 @@ hu_HU.UTF-8 ‘log’ konfiguráció it_IT.UTF-8 log di configurazione sq_AL.UTF-8 konfigurimi i shënimeve +ru_RU.UTF-8 настройка журналов text general log level ca_ES.UTF-8 nivell de registre general @@ -1445,6 +1454,7 @@ hu_HU.UTF-8 általános ‘log’ szint it_IT.UTF-8 log generale di livello sq_AL.UTF-8 niveli i shënimeve të përgjithshme +ru_RU.UTF-8 общий уровень журнала text subordinate log level ca_ES.UTF-8 nivell de registre subordinat @@ -1455,6 +1465,7 @@ hu_HU.UTF-8 alárendelt ‘log’ szint it_IT.UTF-8 log del sottolivello sq_AL.UTF-8 niveli i shënimeve të varura +ru_RU.UTF-8 подчинённый уровень журнала # opt.ml @@ -1468,6 +1479,7 @@ hu_HU.UTF-8 rossz opció: it_IT.UTF-8 opzione non valida: sq_AL.UTF-8 zgjedhje të pavlefshme: +ru_RU.UTF-8 неверные опции: text unknown option ca_ES.UTF-8 : opció desconeguda @@ -1478,6 +1490,7 @@ hu_HU.UTF-8 ismeretlen opció it_IT.UTF-8 opzione sconosciuta sq_AL.UTF-8 zgjedhje e panjohur +ru_RU.UTF-8 неизвестная опция text option does not take an argument ca_ES.UTF-8 la opció no permet arguments @@ -1488,6 +1501,7 @@ hu_HU.UTF-8 opciónak nincs argumentuma it_IT.UTF-8 l'opzione non accetta argomenti sq_AL.UTF-8 zgjedhja nuk merr argument +ru_RU.UTF-8 опция не имеет аргумента text option requires an argument ca_ES.UTF-8 la opció requereix un argument @@ -1498,6 +1512,7 @@ hu_HU.UTF-8 opciónak argumentumra van szüksége it_IT.UTF-8 l'opzione richiede un argomento sq_AL.UTF-8 zgjedhja kërkon një argument +ru_RU.UTF-8 опция требует аргумента text multiple exclusive actions specified ca_ES.UTF-8 múltiples accions exclusives especificades @@ -1508,6 +1523,7 @@ hu_HU.UTF-8 több kizárólagos akció van leírva it_IT.UTF-8 selezionate operazioni esclusive multiple sq_AL.UTF-8 janë dhënë veprime që përjashtojnë njëri-tjetrin +ru_RU.UTF-8 указано несколько исключающих действий text invalid argument in : ca_ES.UTF-8 argument invalid a : @@ -1517,6 +1533,7 @@ hu_HU.UTF-8 helytelen argumentum: : it_IT.UTF-8 argomento non valido in : sq_AL.UTF-8 argument i pavlefshëm në : +ru_RU.UTF-8 неверный аргумент в : text this key cannot be assigned a value ca_ES.UTF-8 No és possible assignar un valor a aquesta clau @@ -1527,6 +1544,7 @@ hu_HU.UTF-8 ez a billentyű nem rendelhető értékhez it_IT.UTF-8 impossibile assegnare un valore a questa chiave sq_AL.UTF-8 këtij çelësi nuk mund ti jepet vlerë +ru_RU.UTF-8 этому ключу нельзя присвоить значение text expected type for this key is ca_ES.UTF-8 El tipus esperat per a aquesta clau és @@ -1537,6 +1555,7 @@ hu_HU.UTF-8 várt érték ehhez a billentyűhöz: it_IT.UTF-8 questa chiave accetta valori di tipo sq_AL.UTF-8 tipi që pritet për këtë çelës është +ru_RU.UTF-8 ожидаемый тип для этого ключа text display help message ca_ES.UTF-8 mostrar missatge d'ajuda @@ -1547,6 +1566,7 @@ hu_HU.UTF-8 segítő szöveg megjelenítése it_IT.UTF-8 mostra messaggio di aiuto sq_AL.UTF-8 shfaq një mesazh ndihme +ru_RU.UTF-8 показать сообщение справки text output debug information ca_ES.UTF-8 informació sortida de la depuració @@ -1557,6 +1577,7 @@ hu_HU.UTF-8 kimeneti hibakereső információ it_IT.UTF-8 output delle informazioni di debug sq_AL.UTF-8 nxirr mesazhe korrigjimi +ru_RU.UTF-8 выходная информация отладки text log output to a file ca_ES.UTF-8 guardar la sortida a un fitxer @@ -1567,6 +1588,7 @@ hu_HU.UTF-8 ‘log’ kimenet egy fájlba it_IT.UTF-8 log dell'output su file sq_AL.UTF-8 rregjistro daljet në një skedar +ru_RU.UTF-8 сохраните вывод в файл text select theme file ca_ES.UTF-8 escull un fitxer de tema @@ -1577,6 +1599,7 @@ hu_HU.UTF-8 válassz témafájlt it_IT.UTF-8 seleziona un file di tema sq_AL.UTF-8 zgjidh skedarin e temës +ru_RU.UTF-8 выберите файл темы # version.ml @@ -1589,6 +1612,7 @@ hu_HU.UTF-8 vercióinformációk megjelenítése it_IT.UTF-8 mostra informazioni sulla versione sq_AL.UTF-8 shfaq versionin +ru_RU.UTF-8 показать данные о версиях text this option accepts the following arguments: ca_ES.UTF-8 aquesta opció accepta els següents arguments: @@ -1599,6 +1623,7 @@ hu_HU.UTF-8 ez a beállítás a következő argumentumokat fogadja el: it_IT.UTF-8 questa opzione accetta i seguenti argomenti: sq_AL.UTF-8 kjo zgjedhje pranon argumentat e mëposhtëm: +ru_RU.UTF-8 опция принимает следующие аргументы: # data.ml @@ -1612,6 +1637,7 @@ hu_HU.UTF-8 ismeretlen operációs rendszer it_IT.UTF-8 sistema operativo sconosciuto sq_AL.UTF-8 sistem shfrytëzimi i panjohur +ru_RU.UTF-8 неизвестный тип ОС text cannot access ca_ES.UTF-8 impossible accedir a @@ -1622,6 +1648,7 @@ hu_HU.UTF-8 nincs jogosultságod hozzáférni ehhez: it_IT.UTF-8 non posos accedere al percorso sq_AL.UTF-8 nuk mund të hapet +ru_RU.UTF-8 нет доступа к text cannot find resource in: ca_ES.UTF-8 no pot trobar-se el recurs a: @@ -1632,6 +1659,7 @@ hu_HU.UTF-8 nem található eszköz ebben: it_IT.UTF-8 non posso trovare il file di risorse in: sq_AL.UTF-8 nuk mund të gjendet në: +ru_RU.UTF-8 не найден ресурс в: # run.ml @@ -1645,3 +1673,4 @@ hu_HU.UTF-8 hibakereső mód aktiválása it_IT.UTF-8 attiva il modo di debug sq_AL.UTF-8 aktivizo mënyrën e korrigjimit +ru_RU.UTF-8 включить режим отладки diff -Nru laby-0.6.4/debian/changelog laby-0.7.0/debian/changelog --- laby-0.6.4/debian/changelog 2019-09-03 13:23:14.000000000 +0000 +++ laby-0.7.0/debian/changelog 2020-07-02 07:59:10.000000000 +0000 @@ -1,3 +1,15 @@ +laby (0.7.0-1) unstable; urgency=medium + + * Team upload + * New upstream release + - this version uses lablgtksourceview3 + - add support for Go and PHP + * Use upstream desktop file + * Bump Standards-Version to 4.5.0 + * Bump debhelper compat level to 13 + + -- Stéphane Glondu Thu, 02 Jul 2020 09:59:10 +0200 + laby (0.6.4-3) unstable; urgency=medium * Team upload diff -Nru laby-0.6.4/debian/compat laby-0.7.0/debian/compat --- laby-0.6.4/debian/compat 2019-09-03 13:23:14.000000000 +0000 +++ laby-0.7.0/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -10 diff -Nru laby-0.6.4/debian/control laby-0.7.0/debian/control --- laby-0.6.4/debian/control 2019-09-03 13:23:14.000000000 +0000 +++ laby-0.7.0/debian/control 2020-07-02 07:59:10.000000000 +0000 @@ -1,17 +1,18 @@ Source: laby Section: games -Priority: extra +Priority: optional Maintainer: Debian OCaml Maintainers Uploaders: Mehdi Dogguy Build-Depends: - debhelper (>= 10), - ocaml-nox (>= 3.11.1), + debhelper-compat (= 13), + ocaml-nox (>= 4.08.1), ocaml-findlib, ocamlbuild, - dh-ocaml (>= 0.9.0), - liblablgtk2-ocaml-dev (>= 2.14), - liblablgtksourceview2-ocaml-dev (>= 2.14) -Standards-Version: 3.9.2 + dh-ocaml, + liblablgtk3-ocaml-dev (>= 3.1.0), + liblablgtksourceview3-ocaml-dev (>= 3.1.0) +Standards-Version: 4.5.0 +Rules-Requires-Root: no Homepage: https://sgimenez.github.io/laby/ Vcs-Browser: https://salsa.debian.org/ocaml-team/laby Vcs-Git: https://salsa.debian.org/ocaml-team/laby.git @@ -22,7 +23,7 @@ ${shlibs:Depends}, ${misc:Depends}, ${ocaml:Depends}, - ocaml-nox | java-compiler | c-compiler | c++-compiler | ruby | gprolog | valac | fp-compiler | rhino | guile | python3 | lua + ocaml-nox | java-compiler | c-compiler | c++-compiler | ruby | gprolog | valac | fp-compiler | rhino | guile | python3 | lua | golang | php Recommends: alsa-utils Suggests: java-compiler, @@ -36,6 +37,8 @@ guile, python3, lua, + golang, + php, ocaml-nox Description: Learn how to program with ants and spider webs Laby is a small program to learn how to program with ants and spider webs. @@ -43,5 +46,5 @@ etc. . Using Laby, you can learn OCaml, C, C++, Java, Prolog, Ruby, Pascal, - JavaScript, Python, Lua, Vala and Scheme. Other bindings can easily be - added to support new programming languages. + JavaScript, Python, Lua, Vala, Scheme, Go and PHP. Other bindings can + easily be added to support new programming languages. diff -Nru laby-0.6.4/debian/copyright laby-0.7.0/debian/copyright --- laby-0.6.4/debian/copyright 2019-09-03 13:23:14.000000000 +0000 +++ laby-0.7.0/debian/copyright 2020-07-02 07:59:10.000000000 +0000 @@ -1,15 +1,16 @@ -Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat - -Packaged-By: Mehdi Dogguy Packaged-Date: Mon, 11 May 2009 15:11:37 +0200 Original-Source: https://sgimenez.github.io/laby/ -Upstream-Author: Stéphane Gimenez (and al.) +Upstream-Author: Stéphane Gimenez et al. Files: * Copyright: © 2007-2014 The laby team -Licence: GPL-3+ - See `/usr/share/common-licenses/GPL-3'. +License: GPL-3+ Files: debian/* -Copyright: © 2009-2016 Mehdi Dogguy +Copyright: © 2009-2016 Mehdi Dogguy License: GPL-3+ + +License: GPL-3+ + See `/usr/share/common-licenses/GPL-3'. diff -Nru laby-0.6.4/debian/laby.desktop laby-0.7.0/debian/laby.desktop --- laby-0.6.4/debian/laby.desktop 2019-09-03 13:23:14.000000000 +0000 +++ laby-0.7.0/debian/laby.desktop 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -[Desktop Entry] -Name=Laby -Comment=Learn how to program with ants and spider webs -Comment[fr]=Apprendre à programmer avec des fourmis -Exec=/usr/games/laby -Icon=laby -Terminal=false -Type=Application -Categories=GNOME;GTK;Game;LogicGame; -StartupNotify=true diff -Nru laby-0.6.4/debian/menu laby-0.7.0/debian/menu --- laby-0.6.4/debian/menu 2019-09-03 13:23:14.000000000 +0000 +++ laby-0.7.0/debian/menu 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -?package(laby):needs="X11" section="Games/Puzzles" \ - title="Laby" command="/usr/games/laby" \ - icon="/usr/share/pixmaps/laby.xpm" diff -Nru laby-0.6.4/debian/patches/0001-Fix-compilation-with-OCaml-4.08.0.patch laby-0.7.0/debian/patches/0001-Fix-compilation-with-OCaml-4.08.0.patch --- laby-0.6.4/debian/patches/0001-Fix-compilation-with-OCaml-4.08.0.patch 2019-09-03 13:23:14.000000000 +0000 +++ laby-0.7.0/debian/patches/0001-Fix-compilation-with-OCaml-4.08.0.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -From: Stephane Glondu -Date: Tue, 3 Sep 2019 15:13:22 +0200 -Subject: Fix compilation with OCaml 4.08.0 - ---- - src/mod.ml | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/mod.ml b/src/mod.ml -index 47ca540..e86f3f1 100644 ---- a/src/mod.ml -+++ b/src/mod.ml -@@ -98,13 +98,13 @@ let buffer = String.create bufsize - let buf_read fd f = - begin match Unix.read fd buffer 0 bufsize with - | 0 -> false -- | i -> f (String.sub buffer 0 i); true -+ | i -> f (Bytes.sub_string buffer 0 i); true - end - - let output fd s = - let str = s ^ "\n" in - let len = String.length str in -- ignore (Unix.write fd str 0 len) -+ ignore (Unix.write fd (Bytes.of_string str) 0 len) - - let input ?(timeout=0.5) err h = - let collect s = diff -Nru laby-0.6.4/debian/patches/series laby-0.7.0/debian/patches/series --- laby-0.6.4/debian/patches/series 2019-09-03 13:23:14.000000000 +0000 +++ laby-0.7.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -0001-Fix-compilation-with-OCaml-4.08.0.patch diff -Nru laby-0.6.4/debian/rules laby-0.7.0/debian/rules --- laby-0.6.4/debian/rules 2019-09-03 13:23:14.000000000 +0000 +++ laby-0.7.0/debian/rules 2020-07-02 07:59:10.000000000 +0000 @@ -17,7 +17,7 @@ find $(CURDIR)/debian/laby/usr/share/laby/mods/ -type f -name defs -print0 2>/dev/null | xargs -0r chmod a+x cp data/tiles/ant-e.svg $(CURDIR)/debian/laby/usr/share/icons/hicolor/scalable/apps/laby.svg cp debian/laby.xpm $(CURDIR)/debian/laby/usr/share/pixmaps/ - cp debian/laby.desktop $(CURDIR)/debian/laby/usr/share/applications/ + cp packaging/laby.desktop $(CURDIR)/debian/laby/usr/share/applications/ %: dh $@ --with ocaml diff -Nru laby-0.6.4/INSTALL laby-0.7.0/INSTALL --- laby-0.6.4/INSTALL 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/INSTALL 2020-05-13 11:15:09.000000000 +0000 @@ -1,9 +1,9 @@ Linux or Unix-like: - To compile laby, you need ocaml >= 3.10.0 and lablgtk >= 2.14.0 - (with support for gtksourceview >= 2.10). + To compile laby, you need ocaml >= 4.10.0, lablgtk3 >= 3.1.0 and + lablgtk3-sourceview3 >= 3.1.0). - Execute the following commands in the archive main directory: + Execute the following commands in the archive's main directory: make ln -s ${PWD}/data ${HOME}/.config/laby @@ -25,9 +25,6 @@ probably need patience and a lot of good luck and the following software: - - ocaml >= 3.10.0 : - http://caml.inria.fr/download.en.html - - lablgtk >= 2.14.0 : - http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html - - gtksourceview >= 2.10 : - http://projects.gnome.org/gtksourceview/download.html + - ocaml: http://caml.inria.fr/download.en.html + - lablgtk: http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html + - gtksourceview: http://projects.gnome.org/gtksourceview/download.html diff -Nru laby-0.6.4/Makefile laby-0.7.0/Makefile --- laby-0.6.4/Makefile 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/Makefile 2020-05-13 11:15:09.000000000 +0000 @@ -3,6 +3,11 @@ include project.conf PROJECT_ARCHIVE=$(PROJECT_NAME)-$(PROJECT_VERSION) +DESTDIR ?= +PREFIX ?= /usr +BINDIR ?= $(PREFIX)/bin +DATADIR ?= $(PREFIX)/share + default: all all: @@ -14,8 +19,20 @@ byte native byte-debug native-profile: @./build --$@ +install: + install -Dp --mode=0755 laby \ + "$(DESTDIR)$(BINDIR)/laby" + install -d "$(DESTDIR)$(DATADIR)/laby/" + cp -pr data/* "$(DESTDIR)$(DATADIR)/laby/" + install -Dp --mode=0644 data/tiles/ant-e.svg \ + "$(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps/laby.svg" + desktop-file-install packaging/laby.desktop \ + --dir="$(DESTDIR)$(DATADIR)/applications" + install -Dp --mode=0644 packaging/laby.appdata.xml \ + "$(DESTDIR)$(DATADIR)/appdata/laby.appdata.xml" + dist: @mkdir _dist @git archive --prefix="$(PROJECT_ARCHIVE)/" HEAD \ - | gzip >_dist/"$(PROJECT_ARCHIVE)".tar.gz + | gzip >"_dist/$(PROJECT_ARCHIVE).tar.gz" @echo archive stored in "_dist/$(PROJECT_ARCHIVE).tar.gz" diff -Nru laby-0.6.4/packaging/laby.appdata.xml laby-0.7.0/packaging/laby.appdata.xml --- laby-0.6.4/packaging/laby.appdata.xml 1970-01-01 00:00:00.000000000 +0000 +++ laby-0.7.0/packaging/laby.appdata.xml 2020-05-13 11:15:09.000000000 +0000 @@ -0,0 +1,31 @@ + + + + laby.desktop + CC0-1.0 + GPL-3.0+ + Laby + Learn programming, playing with ants and spider webs + +

+ Laby is a small program to learn how to program with ants and spider webs. + You have to move an ant out of a labyrinth, avoid spider webs, move rocks, etc. +

+
+ + + https://sgimenez.github.io/laby/laby.png + The main window showing the application in action + + + https://sgimenez.github.io/laby/ + + + + + + + laby + + i.gnatenko.brain@gmail.com +
diff -Nru laby-0.6.4/packaging/laby.desktop laby-0.7.0/packaging/laby.desktop --- laby-0.6.4/packaging/laby.desktop 1970-01-01 00:00:00.000000000 +0000 +++ laby-0.7.0/packaging/laby.desktop 2020-05-13 11:15:09.000000000 +0000 @@ -0,0 +1,73 @@ +[Desktop Entry] +Name=Laby +Exec=laby +Icon=laby +Terminal=false +Type=Application +Categories=GNOME;GTK;Game;LogicGame; +StartupNotify=true +GenericName=Programming Game +GenericName[bs]=Igra programiranja +GenericName[ca]=Joc de programació +GenericName[cs]=Programovací hra +GenericName[da]=Programmering spil +GenericName[de]=Programmierspiel +GenericName[el]=Προγραμματιστικό παιχνίδι +GenericName[es]=Juego de programación +GenericName[fr]=Jeu de programmation +GenericName[gl]=Xogo de programación +GenericName[it]=Gioco di programmazione +GenericName[ja]=プログラミングゲーム +GenericName[ms]=Permainan pengaturcaraan +GenericName[pl]=Gra w programowanie +GenericName[pt]=Jogo de programação +GenericName[pt_BR]=Jogo de programação +GenericName[ru]=Игра в программирование +GenericName[sl]=Igra programiranja +GenericName[sv]=Programmeringsspel +GenericName[tr]=Oyun programlama +GenericName[uk]=Гра у програмування +Comment=Learn how to program with ants and spider webs +Comment[af]=Leer om te programmeer met miere en spinnerakke +Comment[ast]=Deprendi a programar con formigues y redes de arañes +Comment[bg]=Научете се да програмирате с мравки и паяжини +Comment[bn]=শিখুন কিভাবে এন্ট এবং স্পাইডার ওয়েবের সঙ্গে প্রোগ্রাম +Comment[bs]=Naučite se kako programirati pomoću mrava i paukovih mreža +Comment[ca@valencia]=Apreneu a programar amb formigues i teles d'aranya +Comment[ca]=Apreneu a programar amb formigues i teles d'aranya +Comment[crh]=Karıncalar ve örümcek ağları ile programlamayı öğrenin +Comment[cs]=Naučte se programovat s pomocí mravenců a pavučin +Comment[da]=Lær at programmere med myrer og spindelvæv +Comment[de]=Lernen Sie Programmieren, mit Ameisen und Spinnennetzen +Comment[el]=Μάθετε προγραμματισμό με μυρμηγκάκια και ιστούς αράχνης +Comment[es]=Aprende a programar con hormigas y redes de arañas +Comment[es_MX]=Aprenda a programar con hormigas y telarañas +Comment[fi]=Opettele ohjelmoimaan muurahaisilla ja hämähäkkien verkoilla +Comment[fr]=Apprenez à programmer avec des fourmis et des toiles d'araignées +Comment[gl]=Aprenda a programar con formigas e arañeiras +Comment[hu]=Tanulj programozni hangyákkal és pókhálókkal +Comment[hy]=Ինչպես ծրագրավորել մրջունների և սարդերի ցանցերի միջոցով +Comment[id]=Belajar memprogram dengan ants dan spider web +Comment[it]=Imparare a programmare con ant e spider web +Comment[ja]=クモの巣を避けるアリプログラムを作ろう +Comment[ky]=Кумурскалардын жана жөргөмүштөрдун желелерин үлгү кылып программалоого үйрөтүү +Comment[lv]=Iemācīties programmēt ar skudru un zirnekli +Comment[ms]=Pelajari bagaimana lakukan pengaturcaraan +Comment[nb]=Lær å programmere med maur og edderkoppnett +Comment[nl]=Leren programmeren met mieren en spinnenwebben +Comment[oc]=Aprene a programar amb de formigas e de telaranhas +Comment[pl]=Nauka programowania z udziałem mrówek i pajęczyn +Comment[pt]=Aprende a programar com as formigas e as teias de aranha +Comment[pt_BR]=Aprenda a programar com formigas e teias de aranha +Comment[ro]=Învățați programare cu furnici și păianjeni virtuali +Comment[ru]=Обучение программированию на примере муравьёв и паучьих сетей +Comment[sl]=Naučite se programiranja s pomočjo mravelj in pajkovih mrež +Comment[sq]=Mësoni si të programoni me milingona dhe rrjeta merimange +Comment[sr]=Научите како да се програм са мравима и паука Вебс +Comment[sv]=Lär dig att programmera med myror och spindelnät +Comment[th]=เรียนรู้วิธีการเขียนโปรแกรมที่มีมดและใยแมงมุม +Comment[tr]=Karıncalar ve örümcek ağları ile programlamayı öğrenin +Comment[uk]=Навчання програмуванню на прикладі мурашок та павукових мереж +Comment[vi]=Học cách để lập trình với kiến và mạng nhện +Comment[zh_CN]=了解如何使用蚂蚁和蜘蛛网进行编程 +Comment[zh_TW]=學習如何用 ants 和 spider webs 寫程式 diff -Nru laby-0.6.4/packaging/laby.spec laby-0.7.0/packaging/laby.spec --- laby-0.6.4/packaging/laby.spec 1970-01-01 00:00:00.000000000 +0000 +++ laby-0.7.0/packaging/laby.spec 2020-05-13 11:15:09.000000000 +0000 @@ -0,0 +1,106 @@ +Name: laby +Version: 0.6.4 +Release: 4%{?dist} +Summary: Learn programming, playing with ants and spider webs + +License: GPLv3+ +URL: https://sgimenez.github.io/laby/ +Source0: https://github.com/sgimenez/%{name}/archive/%{name}-%{version}.tar.gz +Patch1: 0001-Adapts-to-smaller-screens.patch +Patch2: 0002-Packaging-Metadata.patch +Patch3: 0003-Use-proper-Makefile-syntax.patch +Patch4: 0004-src-gfx.ml-Fix-height-of-help-sourceview.patch +Patch5: 0005-Tweaking-the-vertical-split-to-avoid-scroll-bars.patch +Patch7: 0007-Desktop-file-translations-provided-by-glixx.patch +Patch8: 0008-Translation-for-desktop-entry-GenericName.patch +Patch9: 0009-Fix-the-FSF-address.patch + +# All above patches have been already merged in upstream master +# For genertating them: +# git clone https://github.com/sgimenez/laby.git +# git format-patch e6d783468b6d1273e6c7b40015367d81467c0205 +# note patch 0006 has been skipped since it cause build failure on CentOS + +BuildRequires: ocaml >= 3.10.0 +BuildRequires: ocaml-findlib-devel +BuildRequires: ocaml-lablgtk-devel >= 2.14.0 +BuildRequires: ocaml-ocamldoc +BuildRequires: chrpath +BuildRequires: gtksourceview2-devel >= 2.10 +BuildRequires: libappstream-glib +BuildRequires: desktop-file-utils + +%if 0%{?fedora} >= 26 +BuildRequires: ocaml-ocamlbuild +%endif + +# Note: rpmlint suggest to add +# BuildRequires: python2-devel +# or +# BuildRequires: python3-devel +# but they're not used during the build so they've not been added. + +%description +Laby is a small program to learn how to program with ants and spider webs. +You have to move an ant out of a labyrinth, avoid spider webs, move rocks, etc. + + +%prep +%setup -q -n %{name}-%{name}-%{version} +%autosetup -n %{name}-%{name}-%{version} -p1 + +%build +make %{?_smp_mflags} native + +%install +export DESTDIR=%{buildroot} +make install + +appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata.xml +desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop + +%post +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +%postun +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : +fi + +%posttrans +/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + + +%files +%license COPYRIGHT +%license gpl-3.0.txt +%doc AUTHORS +%{_bindir}/%{name} +%{_datadir}/%{name}/ + +# Note above contains also: +# /usr/share/laby/mods/c/lib/robot.h +# /usr/share/laby/mods/cpp/lib/robot.h +# Which rpmlint suggest to have in -devel subpackage. +# This is intentional. The game teach you also how to program in C and in order +# to move the ant, you'll need the robot.h header file. It isn't the use case +# addressed by -devel subpackages. + +%{_datadir}/appdata/%{name}.appdata.xml +%{_datadir}/applications/%{name}.desktop +%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg + + +%changelog +* Sun May 21 2017 Sandro Bonazzola - 0.6.4-4 +- Addressed comment #10 from rhbz#1450679 + +* Fri May 19 2017 Sandro Bonazzola - 0.6.4-3 +- Addressed comments #3-7 from rhbz#1450679 + +* Tue May 16 2017 Sandro Bonazzola - 0.6.4-2 +- Add Fedora >= 26 support + +* Sun May 14 2017 Sandro Bonazzola - 0.6.4-1 +- Initial packaging diff -Nru laby-0.6.4/project.conf laby-0.7.0/project.conf --- laby-0.6.4/project.conf 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/project.conf 2020-05-13 11:15:09.000000000 +0000 @@ -1,2 +1,2 @@ PROJECT_NAME=laby -PROJECT_VERSION=0.6.4 +PROJECT_VERSION=0.7.0 diff -Nru laby-0.6.4/src/config.mli laby-0.7.0/src/config.mli --- laby-0.6.4/src/config.mli 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/src/config.mli 2020-05-13 11:15:09.000000000 +0000 @@ -16,3 +16,4 @@ val build_arch : string val build_ocaml : string val build_lablgtk : string +val build_lablgtk_sourceview : string diff -Nru laby-0.6.4/src/config.sh laby-0.7.0/src/config.sh --- laby-0.6.4/src/config.sh 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/src/config.sh 2020-05-13 11:15:09.000000000 +0000 @@ -11,7 +11,8 @@ VERSION_STATUS="unknown" fi -BUILD_LABLGTK=$(${PKG_VERSION} lablgtk2) +BUILD_LABLGTK=$(${PKG_VERSION} lablgtk3) +BUILD_LABLGTKSV=$(${PKG_VERSION} lablgtk3-sourceview3) [ -n "${THREADS}" ] && echo "let threads = T_thread.main" @@ -26,6 +27,7 @@ let build_arch = "${OCAML_ARCH}" let build_ocaml = "${OCAML_VERSION}" let build_lablgtk = "${BUILD_LABLGTK}" -let _ = Res.sys_data_dir := "${SYSDATADIR}" -let _ = Res.sys_tmp_dir := "${SYSTMPDIR}" +let build_lablgtk_sourceview = "${BUILD_LABLGTKSV}" +let _ = Res.sys_data_dir := "${DATADIR}" +let _ = Res.sys_tmp_dir := "${TMPDIR}" EOF diff -Nru laby-0.6.4/src/dtools/conf.ml laby-0.7.0/src/dtools/conf.ml --- laby-0.6.4/src/dtools/conf.ml 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/src/dtools/conf.ml 2020-05-13 11:15:09.000000000 +0000 @@ -318,7 +318,7 @@ let i = int_of_string val2 in let k = as_int st in fun () -> k#set i with - | Failure "int_of_string" -> value_error val0 + | Failure _ -> value_error val0 | Mismatch _ -> type_error st#kind end | "float" -> @@ -326,7 +326,7 @@ let f = float_of_string val2 in let k = as_float st in fun () -> k#set f with - | Failure "float_of_string" -> value_error val0 + | Failure _ -> value_error val0 | Mismatch _ -> type_error st#kind end | "bool" -> @@ -334,7 +334,7 @@ let b = bool_of_string val2 in let k = as_bool st in fun () -> k#set b with - | Invalid_argument "bool_of_string" -> value_error val0 + | Invalid_argument _ -> value_error val0 | Mismatch _ -> type_error st#kind end | "string" -> diff -Nru laby-0.6.4/src/dtools/log.ml laby-0.7.0/src/dtools/log.ml --- laby-0.6.4/src/dtools/log.ml 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/src/dtools/log.ml 2020-05-13 11:15:09.000000000 +0000 @@ -29,7 +29,7 @@ int_of_string (Sys.getenv "DEBUG") with | Not_found -> 0 - | Failure "int_of_float" -> 0 + | Failure _ -> 0 end diff -Nru laby-0.6.4/src/dtools/opt.ml laby-0.7.0/src/dtools/opt.ml --- laby-0.6.4/src/dtools/opt.ml 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/src/dtools/opt.ml 2020-05-13 11:15:09.000000000 +0000 @@ -166,7 +166,7 @@ let i = int_of_string s in Do (fun () -> f i) with - | Failure "int_of_string" -> wrong_value "int" + | Failure _ -> wrong_value "int" end end | `Excl_int f -> @@ -177,7 +177,7 @@ let i = int_of_string s in Excl (fun () -> f i) with - | Failure "int_of_string" -> wrong_value "int" + | Failure _ -> wrong_value "int" end end | `Do_optint f -> @@ -188,7 +188,7 @@ let i = int_of_string s in Do (fun () -> f (Some i)) with - | Failure "int_of_string" -> wrong_value "int" + | Failure _ -> wrong_value "int" end end | `Excl_optint f -> @@ -199,7 +199,7 @@ let i = int_of_string s in Excl (fun () -> f (Some i)) with - | Failure "int_of_string" -> wrong_value "int" + | Failure _ -> wrong_value "int" end end end @@ -296,7 +296,7 @@ let i = int_of_string s in Do (fun () -> conf#set i) with - | Failure "int_of_string" -> wrong_value "int" + | Failure _ -> wrong_value "int" end in make ?short ?long (`Arg action) conf#descr @@ -307,7 +307,7 @@ let f = float_of_string s in Do (fun () -> conf#set f) with - | Failure "float_of_string" -> wrong_value "float" + | Failure _ -> wrong_value "float" end in make ?short ?long (`Arg action) conf#descr diff -Nru laby-0.6.4/src/gfx.ml laby-0.7.0/src/gfx.ml --- laby-0.6.4/src/gfx.ml 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/src/gfx.ml 2020-05-13 11:15:09.000000000 +0000 @@ -1,6 +1,6 @@ (* - * Copyright (C) 2007-2014 The laby team + * Copyright (C) 2007-2020 The laby team * You have permission to copy, modify, and redistribute under the * terms of the GPL-3.0. For full license terms, see gpl-3.0.txt. *) @@ -32,11 +32,11 @@ (F.x "initial window geometry" []) let conf_window_width = - Conf.int ~p:(conf_window#plug "width") ~d:1000 + Conf.int ~p:(conf_window#plug "width") ~d:800 (F.x "width of window" []) let conf_window_height = - Conf.int ~p:(conf_window#plug "height") ~d:750 + Conf.int ~p:(conf_window#plug "height") ~d:600 (F.x "height of window" []) exception Error of F.t @@ -63,9 +63,9 @@ start_vbox: GPack.box; start_image: GMisc.image; main_hpaned: GPack.paned; - menu_quit: GMenu.image_menu_item; - menu_home: GMenu.image_menu_item; - menu_level: GMenu.image_menu_item; + menu_quit: GMenu.menu_item; + menu_home: GMenu.menu_item; + menu_level: GMenu.menu_item; menu_levels: GMenu.menu; button_start: GButton.button; button_prev: GButton.tool_button; @@ -75,9 +75,9 @@ button_forward: GButton.toggle_tool_button; button_execute: GButton.button; map_image: GMisc.image; - interprets: GEdit.combo; - view_prog: GSourceView2.source_view; - view_help: GSourceView2.source_view; + interprets: GEdit.combo_box; + view_prog: GSourceView3.source_view; + view_help: GSourceView3.source_view; box_help: GPack.box; view_mesg: GText.view; view_title: GMisc.label; @@ -145,11 +145,15 @@ ant_w_p = pix "ant-w"; } -let draw_state state ressources (pixmap : GDraw.pixmap) = +let draw_state state ressources (pixbuf : GdkPixbuf.pixbuf) = let size = ressources.size in let tile i j p = - pixmap#put_pixbuf - ~x:(size / 2 + i * size) ~y:(size / 2 + j * size) p + let px = size / 2 + i * size in + let py = size / 2 + j * size in + (* GdkPixbuf.copy_area ~dest:pixbuf ~dest_x:px ~dest_y:py p *) + GdkPixbuf.composite ~dest:pixbuf ~alpha:255 + ~dest_x:px ~dest_y:py ~width:size ~height:size + ~ofs_x:(float px) ~ofs_y:(float py) ~scale_x:1.0 ~scale_y:1.0 p in let i0, j0 = State.pos state in let disp_tile i j t = @@ -175,10 +179,10 @@ | `None -> () end -let labeled_combo text packing = +let labeled_combo text packing strings = let box = GPack.hbox ~packing () in let _ = GMisc.label ~text ~xpad:5 ~ypad:8 ~packing:box#pack () in - GEdit.combo ~packing:box#add () + fst (GEdit.combo_box_text ~strings ~packing:box#add ()) let label packing = GMisc.label ~ypad:5 ~line_wrap:true ~packing () @@ -195,11 +199,11 @@ let label_help = F.x "Help:" [] let label_start = F.x "Start" [] -let layout () = +let layout languages = let scrolled ?(vpolicy=`ALWAYS) packing = GBin.scrolled_window ~packing ~hpolicy:`AUTOMATIC ~vpolicy () in - let monofont = Pango.Font.from_string "monospace" in + let monofont = GPango.font_description_from_string "monospace" in let window = GWindow.window ~resizable:true () in let windowbox = GPack.vbox ~packing:window#add () in let menu_bar = GMenu.menu_bar ~packing:windowbox#pack () in @@ -207,15 +211,15 @@ let sub_main = GMenu.menu () in let menu_main = GMenu.menu_item ~label:(Fd.render_raw label_menu) ~packing:menu_bar#append () in - let menu_level = GMenu.image_menu_item + let menu_level = GMenu.menu_item ~label:(Fd.render_raw label_level) ~packing:menu_bar#append () in - let menu_fullscreen = GMenu.image_menu_item ~stock:`FULLSCREEN + let menu_fullscreen = GMenu.menu_item ~label:"Fullscreen" ~packing:sub_main#append () in - let menu_unfullscreen = GMenu.image_menu_item ~stock:`LEAVE_FULLSCREEN + let menu_unfullscreen = GMenu.menu_item ~label:"Leave Fullscreen" ~packing:sub_main#append ~show:false () in - let menu_quit = GMenu.image_menu_item ~stock:`QUIT + let menu_quit = GMenu.menu_item ~label:"Quit" ~packing:sub_main#append () in - let menu_home = GMenu.image_menu_item ~stock:`HOME + let menu_home = GMenu.menu_item ~label:"Home" ~packing:sub_main#append () in let fullscreen () = menu_fullscreen#misc#hide (); @@ -241,17 +245,18 @@ let _ = GMisc.label ~markup:(Fd.render_raw label_welcome) ~justify:`CENTER ~packing:mstart_vbox#pack () in let interprets = - labeled_combo (Fd.render_raw label_language) mstart_vbox#pack + labeled_combo (Fd.render_raw label_language) mstart_vbox#pack languages in let button_start = GButton.button ~packing:mstart_vbox#pack ~label:(Fd.render_raw label_start) () in (* Game screen *) let hpaned = GPack.paned `HORIZONTAL ~packing:main_vbox#add () in - hpaned#set_position 620; + let tile_size = max 5 conf_tilesize#get in + hpaned#set_position (80 + 550 * tile_size / 40); let lvbox = GPack.vbox ~packing:hpaned#add1 () in let vpaned = GPack.paned `VERTICAL ~packing:hpaned#add () in - vpaned#set_position 450; + vpaned#set_position 400; let view_title = label lvbox#pack in let view_comment = label lvbox#pack in let sw_laby = scrolled ~vpolicy:`AUTOMATIC lvbox#add in @@ -259,7 +264,7 @@ label_txt (Fd.render_raw label_help) box_help#pack; let sw_help = scrolled box_help#pack in let view_help = - GSourceView2.source_view ~editable:false ~packing:sw_help#add () + GSourceView3.source_view ~height:100 ~editable:false ~packing:sw_help#add () in view_help#set_indent 1; view_help#misc#modify_font monofont; @@ -267,24 +272,24 @@ label_txt (Fd.render_raw label_prog) rtvbox#pack; let sw_prog = scrolled rtvbox#add in let view_prog = - GSourceView2.source_view + GSourceView3.source_view ~auto_indent:true ~indent_width:2 ~insert_spaces_instead_of_tabs:true ~show_line_numbers:true ~packing:sw_prog#add () in view_prog#set_indent 1; view_prog#misc#modify_font monofont; + let bbox = GPack.hbox ~packing:rtvbox#pack () in + let button_execute = GButton.button ~packing:bbox#pack ~stock:`EXECUTE () in let rbvbox = GPack.vbox ~packing:vpaned#add2 () in - let toolbar = GButton.toolbar ~packing:rbvbox#pack ~style:`BOTH () in + let toolbar = GButton.toolbar ~packing:bbox#pack () in let button stock = GButton.tool_button ~packing:toolbar#insert ~stock () in let tbutton stock = GButton.toggle_tool_button ~packing:toolbar#insert ~stock () in - let sti = GButton.separator_tool_item in - let button_prev = button `GO_BACK in - let button_next = button `GO_FORWARD in - let _ = sti ~expand:true ~draw:false ~packing:toolbar#insert () in let button_backward = tbutton `MEDIA_REWIND in + let button_prev = button `GO_BACK in let button_play = tbutton `MEDIA_PLAY in + let button_next = button `GO_FORWARD in let button_forward = tbutton `MEDIA_FORWARD in view_prog#misc#grab_focus (); label_txt (Fd.render_raw label_mesg) rbvbox#pack; @@ -292,8 +297,6 @@ let view_mesg = GText.view ~editable:false ~packing:sw_mesg#add () in view_mesg#misc#modify_font monofont; let map_image = GMisc.image ~packing:sw_laby#add_with_viewport () in - let bbox = GPack.hbox ~packing:rtvbox#pack ~homogeneous:true () in - let button_execute = GButton.button ~packing:bbox#pack ~stock:`EXECUTE () in button_execute#set_focus_on_click false; { window = window; @@ -315,10 +318,10 @@ view_title = view_title; view_comment = view_comment; } -let make_pixmap tile_size level = +let make_pixbuf tile_size level = let sizex, sizey = Level.size level in let width, height = tile_size * (1 + sizex), tile_size * (1 + sizey) in - GDraw.pixmap ~width ~height () + GdkPixbuf.create ~width ~height ~has_alpha:true () let display_gtk ressources = @@ -337,20 +340,19 @@ ] ); - let bg = ref `WHITE in - let c = layout () in + let c = layout language_list in let level_load name = let l = Level.load (Res.get ["levels"; name]) in - c.map_image#set_pixmap (make_pixmap ressources.size l); l + c.map_image#set_pixbuf (make_pixbuf ressources.size l); l in let syntaxd = Res.get ["syntax"] in let add_search_path m l = m#set_search_path (l @ m#search_path) in - let ssm = GSourceView2.source_style_scheme_manager true in + let ssm = GSourceView3.source_style_scheme_manager true in add_search_path ssm [syntaxd; Res.path [syntaxd; "styles"]]; let style = ssm#style_scheme conf_source_style#get in c.view_prog#source_buffer#set_style_scheme style; c.view_help#source_buffer#set_style_scheme style; - let slm = GSourceView2.source_language_manager false in + let slm = GSourceView3.source_language_manager false in add_search_path slm [syntaxd; Res.path [syntaxd; "language-specs"]]; (* gui outputs *) @@ -369,12 +371,10 @@ end in let draw image state = - let p : GDraw.pixmap = image#pixmap in - p#set_foreground !bg; - let width, height = p#size in - p#rectangle ~x:0 ~y:0 ~width ~height ~filled:true (); + let p : GdkPixbuf.pixbuf = image#pixbuf in + GdkPixbuf.fill p 0l; draw_state state ressources p; - image#set_pixmap p + image#set_pixbuf p in (* game creation *) @@ -432,21 +432,23 @@ play_inactive (); in let setupmod () = - let name = c.interprets#entry#text in - begin match List.mem name language_list with - | true -> - let lmod = List.find (fun x -> x#name = name) mods in - c.view_prog#buffer#set_text (command#chg_mod lmod); - let l = slm#language name in - if l = None then - log#warning ( + begin match + try Some (List.nth language_list c.interprets#active) + with _ -> None + with + | Some name -> + let lmod = List.find (fun x -> x#name = name) mods in + c.view_prog#buffer#set_text (command#chg_mod lmod); + let l = slm#language name in + if l = None then + log#warning ( F.x "cannot load syntax for mod" [ "name", F.string name; ] ); - c.view_prog#source_buffer#set_language l; - c.view_help#source_buffer#set_language l; - | false -> () + c.view_prog#source_buffer#set_language l; + c.view_help#source_buffer#set_language l; + | None -> () end in let newmod () = @@ -505,10 +507,9 @@ GMain.Main.quit () in let altdestroy _ = destroy (); true in - c.interprets#set_popdown_strings language_list; let smod = Mod.conf_selected#get in - if List.mem smod language_list - then c.interprets#entry#set_text smod; + let select i m = if m = smod then c.interprets#set_active i in + List.iteri select language_list; let group = ref None in let add_language l = @@ -532,7 +533,7 @@ ignore (c.button_backward#connect#toggled ~callback:backward_cb); ignore (c.button_forward#connect#toggled ~callback:forward_cb); ignore (c.button_execute#connect#clicked ~callback:execute); - ignore (c.interprets#entry#connect#changed ~callback:newmod); + ignore (c.interprets#connect#changed ~callback:newmod); ignore (c.view_prog#buffer#connect#changed ~callback:show_execute); ignore (c.menu_quit#connect#activate ~callback:destroy); ignore (c.menu_home#connect#activate ~callback:exit_play); @@ -541,12 +542,10 @@ exit_play (); c.window#set_default_size conf_window_width#get conf_window_height#get; c.window#show (); - (* bg color has to be retrieved after c.window#show *) - bg := `COLOR (c.window#misc#style#light `NORMAL); if List.mem "0.laby" levels_list then newlevel "0.laby" else if levels_list <> [] then newlevel (List.hd levels_list); - c.start_image#set_pixmap (make_pixmap ressources.size Level.dummy); + c.start_image#set_pixbuf (make_pixbuf ressources.size Level.dummy); draw c.start_image (!start_animation); ignore (GMain.Main.main ()) diff -Nru laby-0.6.4/src/level.ml laby-0.7.0/src/level.ml --- laby-0.6.4/src/level.ml 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/src/level.ml 2020-05-13 11:15:09.000000000 +0000 @@ -24,11 +24,11 @@ [| [| `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall |]; [| `Wall; `Void; `Wall; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Wall; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Wall |]; - [| `Wall; `Void; `Wall; `Void; `Void; `Void; `Wall; `Wall; `Wall; `Void; `Void; `Wall; `Void; `Void; `Void; `Void; `Wall; `Void; `Void; `Wall; `Void; `Wall |]; + [| `Wall; `Void; `Wall; `Void; `Void; `Void; `Void; `Wall; `Wall; `Void; `Void; `Wall; `Void; `Void; `Void; `Void; `Wall; `Void; `Void; `Wall; `Void; `Wall |]; [| `Wall; `Void; `Wall; `Void; `Void; `Void; `Void; `Void; `Web ; `Wall; `Void; `Wall; `Wall; `Wall; `Void; `Void; `Wall; `Void; `Void; `Wall; `Void; `Wall |]; [| `Wall; `Void; `Wall; `Void; `Void; `Void; `Wall; `Wall; `Wall; `Wall; `Void; `Wall; `Void; `Void; `Wall; `Void; `Wall; `Void; `Void; `Wall; `Void; `Wall |]; [| `Wall; `Void; `Wall; `Void; `Void; `Void; `Wall; `Void; `Void; `Wall; `Void; `Wall; `Void; `Void; `Wall; `Void; `Void; `Wall; `Web ; `Wall; `Void; `Wall |]; - [| `Wall; `Void; `Wall; `Wall; `Wall; `Void; `Void; `Wall; `Wall; `Void; `Void; `Wall; `Wall; `Wall; `Void; `Void; `Void; `Void; `Wall; `Void; `Void; `Wall |]; + [| `Wall; `Void; `Wall; `Wall; `Wall; `Void; `Void; `Wall; `Wall; `Wall; `Void; `Wall; `Wall; `Wall; `Void; `Void; `Void; `Void; `Wall; `Void; `Void; `Wall |]; [| `Wall; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Void; `Wall; `Void; `Void; `Void; `Wall |]; [| `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall; `Wall |]; |]; diff -Nru laby-0.6.4/src/mod.ml laby-0.7.0/src/mod.ml --- laby-0.6.4/src/mod.ml 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/src/mod.ml 2020-05-13 11:15:09.000000000 +0000 @@ -94,17 +94,17 @@ Str.global_substitute ln_regexp repl let bufsize = 16384 -let buffer = String.create bufsize +let buffer = Bytes.create bufsize let buf_read fd f = begin match Unix.read fd buffer 0 bufsize with | 0 -> false - | i -> f (String.sub buffer 0 i); true + | i -> f (Bytes.to_string (Bytes.sub buffer 0 i)); true end let output fd s = - let str = s ^ "\n" in - let len = String.length str in - ignore (Unix.write fd str 0 len) + let bytes = Bytes.of_string (s ^ "\n") in + let len = Bytes.length bytes in + ignore (Unix.write fd bytes 0 len) let input ?(timeout=0.5) err h = let collect s = diff -Nru laby-0.6.4/src/say.ml laby-0.7.0/src/say.ml --- laby-0.6.4/src/say.ml 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/src/say.ml 2020-05-13 11:15:09.000000000 +0000 @@ -26,7 +26,7 @@ let web_out = F.x "I can't move anymore." [] -let exit = +let do_exit = F.x "Wohoo, the exit!" [] let no_exit = @@ -38,7 +38,7 @@ let take_nothing = F.x "There's no rock to take here." [] -let take_no_space = +let take_no_space = F.x "I'm already carrying a rock." [] let drop_nothing = @@ -57,7 +57,7 @@ | `Exit_In -> f exit_in | `Web_In -> f web_in | `Web_Out -> f web_out - | `Exit -> f exit + | `Exit -> f do_exit | `No_Exit -> f no_exit | `Carry_Exit -> f carry_exit | `Take_Nothing -> f take_nothing diff -Nru laby-0.6.4/src/version.ml laby-0.7.0/src/version.ml --- laby-0.6.4/src/version.ml 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/src/version.ml 2020-05-13 11:15:09.000000000 +0000 @@ -37,7 +37,8 @@ [F.s "system "; F.s Config.build_system]; [F.s "architecture "; F.s Config.build_arch]; [F.s "ocaml "; F.s Config.build_ocaml]; - [F.s "ocaml-lablgtk "; F.s Config.build_lablgtk]; + [F.s "lablgtk "; F.s Config.build_lablgtk]; + [F.s "lablgtksourceview "; F.s Config.build_lablgtk_sourceview]; ] let run () = diff -Nru laby-0.6.4/TRANSLATION laby-0.7.0/TRANSLATION --- laby-0.6.4/TRANSLATION 2014-10-27 09:17:45.000000000 +0000 +++ laby-0.7.0/TRANSLATION 2020-05-13 11:15:09.000000000 +0000 @@ -9,8 +9,8 @@ en_US.UTF-8 option requires an argument fr_FR.UTF-8 l'option nécessite un argument - The first line gives the text as written in the program source code, - following lines are translations of this text in various locales. + The first line gives the text as written in the program source code. + Following lines are translations of this text in various locales. You may use a modified version of this file, laby will look for it at the following locations (in this order): @@ -23,7 +23,6 @@ Contributions: If you wish to contribute new translations or improve existing ones, - you are welcome to send them by email to: + please post them on github: https://github.com/sgimenez/laby/issues - Stéphane Gimenez