diff --git a/misc/distrib.sh b/misc/distrib.sh index 9f3fe3bc..e3654426 100755 --- a/misc/distrib.sh +++ b/misc/distrib.sh @@ -18,7 +18,8 @@ mkdir dist/Linux mkdir dist/Linux/ISO mkdir dist/Linux/OUT -VERSION="1_0_0beta5" +VERSION="1_0_0beta7" #for files +VERSION_NAME="1.0b7" #for display declare -a langs=("en" "nl" "fy" "de" "fr" "no" "ru" "cs" "it" "hi" "pt_br" "uz" "pl" "id" "zh2" "fa" "es") for lang in "${langs[@]}" @@ -55,17 +56,20 @@ cp plugins/media/assets/picto.ico dist/Win64/ISO/$lang/pictogram.ico # Translate examples -./bin/Linux/ctren -t /tmp/dict_all.dict demo1.ctr > dist/Win64/ISO/$lang/demo1.ctr 2>/tmp/err1.log -./bin/Linux/ctren -t /tmp/dict_all.dict demo2.ctr > dist/Win64/ISO/$lang/demo2.ctr 2>/tmp/err2.log -./bin/Linux/ctren -t /tmp/dict_all.dict demo3.ctr > dist/Win64/ISO/$lang/demo3.ctr 2>/tmp/err3.log -./bin/Linux/ctren -t /tmp/dict_all.dict demo4.ctr > dist/Win64/ISO/$lang/demo4.ctr 2>/tmp/err4.log -./bin/Linux/ctren -t /tmp/dict_all.dict demo5.ctr > dist/Win64/ISO/$lang/demo5.ctr 2>/tmp/err5.log -./bin/Linux/ctren -t /tmp/dict_all.dict demo6.ctr > dist/Win64/ISO/$lang/demo6.ctr 2>/tmp/err6.log -./bin/Linux/ctren -t /tmp/dict_all.dict demo7.ctr > dist/Win64/ISO/$lang/demo7.ctr 2>/tmp/err7.log -./bin/Linux/ctren -t /tmp/dict_all.dict demo8.ctr > dist/Win64/ISO/$lang/demo8.ctr 2>/tmp/err8.log -./bin/Linux/ctren -t /tmp/dict_all.dict demo9.ctr > dist/Win64/ISO/$lang/demo9.ctr 2>/tmp/err9.log -./bin/Linux/ctren -t /tmp/dict_all.dict demo10.ctr > dist/Win64/ISO/$lang/demo10.ctr 2>/tmp/err10.log -./bin/Linux/ctren -t /tmp/dict_all.dict demo11.ctr > dist/Win64/ISO/$lang/demo11.ctr 2>/tmp/err11.log +./bin/Linux/ctren -t /tmp/dict_all.dict misc/distrib/assets/demo1.ctr > dist/Win64/ISO/$lang/demo1.ctr 2>/tmp/err1.log +./bin/Linux/ctren -t /tmp/dict_all.dict misc/distrib/assets/demo2.ctr > dist/Win64/ISO/$lang/demo2.ctr 2>/tmp/err2.log +./bin/Linux/ctren -t /tmp/dict_all.dict misc/distrib/assets/demo3.ctr > dist/Win64/ISO/$lang/demo3.ctr 2>/tmp/err3.log +./bin/Linux/ctren -t /tmp/dict_all.dict misc/distrib/assets/demo4.ctr > dist/Win64/ISO/$lang/demo4.ctr 2>/tmp/err4.log +./bin/Linux/ctren -t /tmp/dict_all.dict misc/distrib/assets/demo5.ctr > dist/Win64/ISO/$lang/demo5.ctr 2>/tmp/err5.log +./bin/Linux/ctren -t /tmp/dict_all.dict misc/distrib/assets/demo6.ctr > dist/Win64/ISO/$lang/demo6.ctr 2>/tmp/err6.log +./bin/Linux/ctren -t /tmp/dict_all.dict misc/distrib/assets/demo7.ctr > dist/Win64/ISO/$lang/demo7.ctr 2>/tmp/err7.log +./bin/Linux/ctren -t /tmp/dict_all.dict misc/distrib/assets/demo8.ctr > dist/Win64/ISO/$lang/demo8.ctr 2>/tmp/err8.log +./bin/Linux/ctren -t /tmp/dict_all.dict misc/distrib/assets/demo9.ctr > dist/Win64/ISO/$lang/demo9.ctr 2>/tmp/err9.log +./bin/Linux/ctren -t /tmp/dict_all.dict misc/distrib/assets/demo10.ctr > dist/Win64/ISO/$lang/demo10.ctr 2>/tmp/err10.log +./bin/Linux/ctren -t /tmp/dict_all.dict misc/distrib/assets/demo11.ctr > dist/Win64/ISO/$lang/demo11.ctr 2>/tmp/err11.log +./bin/Linux/ctren -t /tmp/dict_all.dict misc/distrib/assets/pak-o-mat.ctr > dist/Win64/ISO/$lang/pak-o-mat.ctr 2>/tmp/pak-o-mat.log +sed -e "s/ctrnl/ctr$lang/g" misc/distrib/assets/export.bat > dist/Win64/ISO/$lang/export.bat + # Copy assets to setup creator work dir @@ -78,13 +82,18 @@ cp -R dist/Win64/ISO/$lang ~/.wine/drive_c/InnoSetupSourceDir/dist # Copy setup-creator script to work dir suffix="$(echo "$lang" | tr 'a-z' 'A-Z')" -sed -e "s/096/$VERSION/g" -e "s/ctrnl/ctr$lang/g" -e "s/CitrineNL/Citrine$suffix/" plugins/media/citrine.iss > ~/.wine/drive_c/InnoSetupSourceDir/citrine.iss +sed -e "s/{VERSION}/$VERSION/g" \ + -e "s/{VERSION_NAME}/$VERSION_NAME/g" \ + -e "s/ctrnl/ctr$lang/g" \ + -e "s/CitrineNL/Citrine$suffix/" \ + plugins/media/citrine.iss > ~/.wine/drive_c/InnoSetupSourceDir/citrine.iss # Start setup-creator wine "C:\\Program Files (x86)\\Inno Setup 6\\ISCC.exe" "C:\\InnoSetupSourceDir\\citrine.iss" # Copy to output dir mkdir -p dist/Win64/OUT/$lang/ +rm dist/Win64/OUT/$lang/* # clean up cp ~/.wine/drive_c/InnoSetupSourceDir/Output/Citrine${VERSION}.exe dist/Win64/OUT/$lang/ # Zip it @@ -111,8 +120,10 @@ cp bin/Linux/ctr$lang dist/Linux/ISO/$lang/ cp plugins/media/libctrmedia.so dist/Linux/ISO/$lang/mods/media/ rm dist/Linux/ISO/$lang/*.dll rm dist/Linux/ISO/$lang/*.exe -sed -e "s/ctrnl/ctr$lang/g" plugins/media/assets/citrine.sh > dist/Linux/ISO/$lang/citrine.sh -chmod uog+x dist/Linux/ISO/$lang/citrine.sh +sed -e "s/ctrapp_nl/ctrapp_$lang/g" misc/distrib/assets/export.sh > dist/Linux/ISO/$lang/export.sh +cp misc/distrib/assets/export.desktop dist/Linux/ISO/$lang/export.desktop + + tar cvzf "dist/Linux/OUT/$lang/citrine${lang}${VERSION}.tar.gz" -C dist/Linux/ISO/ ${lang} @@ -125,6 +136,7 @@ cp -R dist/Linux/ISO/${lang}/mods /tmp/${lang}/Citrine.AppDir/ sed -e "s/ctrnl/ctr$lang/g" misc/Citrine.AppDir/AppRun > /tmp/${lang}/Citrine.AppDir/AppRun + ./appimagetool-x86_64.AppImage /tmp/${lang}/Citrine.AppDir citrine_app ; cp citrine_app dist/Linux/ISO/${lang}/ctrapp_${lang} chmod uog+x dist/Linux/ISO/${lang}/ctrapp_${lang} #sed -e "s/ctrnl/ctrapp_$lang/g" plugins/media/assets/citrine.sh > dist/Linux/ISO/$lang/citrine_app.sh diff --git a/misc/distrib/assets/demo1.ctr b/misc/distrib/assets/demo1.ctr new file mode 100644 index 00000000..47c668e0 --- /dev/null +++ b/misc/distrib/assets/demo1.ctr @@ -0,0 +1,12 @@ +>> m := Media new. + +m link: ( Package new: ['demodata'] ). + +>> mouse := Image new: ['mouse.png']. + +mouse + x: 0 y: 100, + speed: 5, + controllable: True. + +m screen: ['demo.png']. diff --git a/misc/distrib/assets/demo10.ctr b/misc/distrib/assets/demo10.ctr new file mode 100644 index 00000000..e33bd723 --- /dev/null +++ b/misc/distrib/assets/demo10.ctr @@ -0,0 +1,5 @@ +>> m := Media new. +>> html := Network send: None to: ['https://citrine-lang.org/']. +>> meta := html split: ['> m := Media new. +>> a := Blob new: 8. +a bytes: ( + Sequence <<: + 2, ; 0 ; 0 ; 0 ; + 1 ; 0 ; 0 ; 0 +). + +>> struct := Blob struct: (Sequence <<: ['int'], ; ['int']). + +m link: ( Sequence <<: ['@structtest'], ; + ['@structtest'] ; + (Sequence <<: struct) ; + ['int'] ; + ['ffitest'] ; + ['ffisum:'] +). + +m show: ['FFI:'] + (ffitest ffisum: a). + +struct structfree. +struct free. +a free. \ No newline at end of file diff --git a/misc/distrib/assets/demo2.ctr b/misc/distrib/assets/demo2.ctr new file mode 100644 index 00000000..700c3245 --- /dev/null +++ b/misc/distrib/assets/demo2.ctr @@ -0,0 +1,20 @@ +>> m := Media new. +m link: ( Package new: ['demodata'] ). + +>> fish := Image new: ['fish.png']. +>> quay := Image new: ['quay.png']. + +fish + x: 0 y: 100, + speed: 2, + gravity: 0.2, + friction: 0.01, + acceleration: 0.2, + controllable: True. + + +quay + x: 200 y: 100, + wall: True. + +m screen: ['demo.png']. \ No newline at end of file diff --git a/misc/distrib/assets/demo3.ctr b/misc/distrib/assets/demo3.ctr new file mode 100644 index 00000000..9baab719 --- /dev/null +++ b/misc/distrib/assets/demo3.ctr @@ -0,0 +1,18 @@ +>> m := Media new. +m link: ( Package new: ['demodata'] ). + +>> quay := Image new: ['quay.png']. +>> boat := Image new: ['boat.png']. + +boat + x: 100 y: 100, + speed: 2, + friction: 0.01, + acceleration: 0.2, + controllable: 4. + +quay + x: 200 y: 100, + wall: True. + +m screen: ['demo.png']. \ No newline at end of file diff --git a/misc/distrib/assets/demo4.ctr b/misc/distrib/assets/demo4.ctr new file mode 100644 index 00000000..c5cbe672 --- /dev/null +++ b/misc/distrib/assets/demo4.ctr @@ -0,0 +1,47 @@ +>> m := Media new. +m link: ( Package new: ['demodata'] ). + +m width: 350 height: 175. + +>> rock := Image new: ['rock.png']. +>> rock2 := Image new: ['rock.png']. +>> hiker := Image new: ['hiker.png']. + +hiker + x: 100 y: 100, + speed: 2, + reel: 2 speed: 10, + gravity: 1, + friction: 0.5, + controllable: True. + +rock + x: 150 y: 300, + wall: True. + +rock2 + x: 250 y:180, + wall: True. + +m on: ['start'] do: { + rock to-x: 150 y: 200. + rock2 to-x: 380 y: 180. +}. + +rock on: ['destination'] do: { + self y? <=: 200, true: { + self to-x: 150 y: 300. + }, else: { + self to-x: 150 y: 200. + }. +}. + +rock2 on: ['destination'] do: { + self x? >=: 380, true: { + self to-x: 250 y: 180. + }, else: { + self to-x: 380 y: 180. + }. +}. + +m screen: ['demo.png']. \ No newline at end of file diff --git a/misc/distrib/assets/demo5.ctr b/misc/distrib/assets/demo5.ctr new file mode 100644 index 00000000..aa813f2b --- /dev/null +++ b/misc/distrib/assets/demo5.ctr @@ -0,0 +1,28 @@ +>> m := Media new. +m link: ( Package new: ['demodata'] ). +>> balloon := Image new: ['balloon.png']. +>> bird := Image new: ['bird.png'], reel: 2 speed: 10. + +bird on: ['fly'] do: { + >> right := Number between: 0 and: 500. + >> height := Number between: 0 and: 100. + self to-x: right y: height. +}. + +bird on: ['destination'] do: { self fly. }. +balloon on: ['collision:'] do: { :other + (other = bird) true: { Program end. }. +}. +m on: ['start'] do: { + balloon + fixate: True, + active: True, + controllable: 1, + gravity: 0.2. + bird + x: 300 y: 10, + gravity: 0.01, + speed: 1, + fly. +}. +m screen: ['demo.png']. diff --git a/misc/distrib/assets/demo6.ctr b/misc/distrib/assets/demo6.ctr new file mode 100644 index 00000000..65b66289 --- /dev/null +++ b/misc/distrib/assets/demo6.ctr @@ -0,0 +1,33 @@ +>> m := Media new. +m link: ( Package new: ['demodata'] ). +>> ball := Image new: ['ball.png']. +>> bat := Image new: ['bat.png']. + +>> a := Image new: ['wall1.png']. +>> b := Image new: ['wall1.png']. +>> c := Image new: ['wall2.png']. +>> d := Image new: ['wall2.png']. + +a x: 0 y: 0, wall: True. +b x: 0 y: 350, wall: True. +c x: 0 y: 0, wall: True. +d x: 750 y: 0, wall: True. + +ball + x: 400 y: 100, + to-x: (Number between: 200 and: 800) y: 500, + gravity: 1, + bounce: True, + active: True. + +bat + x: 100 y: 300, + speed: 5, + friction: 0.01, + accelerate: 0.4, + controllable: 3, + wall: True. + +ball on: ['collision:'] do: { self speed: 7. }. + +m screen: ['demo.png']. \ No newline at end of file diff --git a/misc/distrib/assets/demo7.ctr b/misc/distrib/assets/demo7.ctr new file mode 100644 index 00000000..1e5f5957 --- /dev/null +++ b/misc/distrib/assets/demo7.ctr @@ -0,0 +1,29 @@ +>> m := Media new. +m link: ( Package new: ['demodata'] ). +>> o := Color new red: 0 green: 0 blue: 0. +>> a := Image new: ['demo.png']. +>> r := 80. +>> c := 200. + +m on: ['start'] do: { + { :j + >> p := Sequence new. + { :i + p append: ( + Point new + x: r * i cos + ( r * j cos + c ) + y: r * i sin + ( r * j sin + c ) + ). + } * 360. + + a draw: p color: ( + Color new + red: 0 + green: 255 - (j / 36) * 255 + blue: (j / 36) * 255 + ). + + } * 36. +}. + +m screen: ['demo.png']. \ No newline at end of file diff --git a/misc/distrib/assets/demo8.ctr b/misc/distrib/assets/demo8.ctr new file mode 100644 index 00000000..8f665f21 --- /dev/null +++ b/misc/distrib/assets/demo8.ctr @@ -0,0 +1,24 @@ +>> m := Media new. +m link: ( Package new: ['demodata'] ). +>> target := Image new: ['target.png']. +>> sfx := Sound new: ['sfx.ogg']. + +target on: ['click'] do: { + sfx play. + m show: ( + ['x,y'] x self x? y self y? + ). +}. + +m on: ['timer:'] do: { + target + x: (Number between: 50 and: 750) + y: (Number between: 50 and: 350). + m timer: 1 after: 2000. +}. + +m on: ['start'] do: { + m timer: 1 after: 1. +}. + +m screen: ['demo.png']. \ No newline at end of file diff --git a/misc/distrib/assets/demo9.ctr b/misc/distrib/assets/demo9.ctr new file mode 100644 index 00000000..00ba96b0 --- /dev/null +++ b/misc/distrib/assets/demo9.ctr @@ -0,0 +1,16 @@ +>> m := Media new. +m link: ( Package new: ['demodata'] ). +>> d := Image new: ['demo.png']. +>> f := Font new + source: ['DoubleStrike.ttf'] # public domain font + size: 40. + +d font: f, + align-x: 100 y: 100, + line-height: 40, + editable: True, + ink: (Color new red: 150 green: 150 blue: 0), + highlight: (Color new red: 50 green: 50 blue: 0), + write: ['Lorem Ipsum...']. + +m screen: ['demo.png']. \ No newline at end of file diff --git a/misc/distrib/assets/export.bat b/misc/distrib/assets/export.bat new file mode 100644 index 00000000..b986726b --- /dev/null +++ b/misc/distrib/assets/export.bat @@ -0,0 +1,23 @@ + + +setlocal enabledelayedexpansion + +rem Ensure at least one argument is provided +if "%~1"=="" ( + echo No arguments provided. + exit /b 1 +) + +rem Initialize an empty variable to hold the processed filenames +set "args=" + +rem Loop through all command-line arguments +for %%i in (%*) do ( + rem Extract the filename with extension + set "args=!args! %%~nxi" +) + +rem Call the other batch file with the filenames only +ctrnl.exe pak-o-mat.ctr %args% + + diff --git a/misc/distrib/assets/export.desktop b/misc/distrib/assets/export.desktop new file mode 100644 index 00000000..a54df2dc --- /dev/null +++ b/misc/distrib/assets/export.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=export +Comment= +Exec=bash export.sh %F +Icon= +Path= +Terminal=true +StartupNotify=false diff --git a/misc/distrib/assets/export.sh b/misc/distrib/assets/export.sh new file mode 100644 index 00000000..2c870edf --- /dev/null +++ b/misc/distrib/assets/export.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +args=() +for file in $@; do + fname=`basename $file` + args+=("$fname") +done; +./ctrapp_nl pak-o-mat.ctr "${args[@]}" diff --git a/misc/distrib/assets/pak-o-mat.ctr b/misc/distrib/assets/pak-o-mat.ctr new file mode 100644 index 00000000..fe4b92fc --- /dev/null +++ b/misc/distrib/assets/pak-o-mat.ctr @@ -0,0 +1,16 @@ +>> m := Media new. +>> r := Sequence new. +>> b := File new: + Path datpak. + +{ b delete. } +except: { <- None. }, start. + +>> d := Package new: b. +{ :i + + >> n := Program argument: i + 2. + d append: ( + File new: n + ). +} * (Program arguments - 2). \ No newline at end of file diff --git a/plugins/media/citrine.iss b/plugins/media/citrine.iss index e09ed387..5d91f9c3 100644 --- a/plugins/media/citrine.iss +++ b/plugins/media/citrine.iss @@ -5,9 +5,9 @@ DisableWelcomePage=no DisableDirPage=yes DisableProgramGroupPage=yes SourceDir=C:\InnoSetupSourceDir -OutputBaseFilename=Citrine1_0 +OutputBaseFilename=Citrine{VERSION} AppName=CitrineNL -AppVersion=1.0 +AppVersion={VERSION_NAME} AppCopyright=Copyright (C) 2009-2025 GaborSoftware WizardStyle=modern DefaultDirName={autopf}\CitrineNL