From 60a584f91a4c3eeea1bfb79e480fcafab36b061b Mon Sep 17 00:00:00 2001 From: bootchk Date: Tue, 23 Apr 2024 13:47:13 -0400 Subject: [PATCH] ScriptFu: move test plugins and install more in unstable build Move test plugins from /scripts to /scripts/test. POTFILES.skip that directory. Add a readme to scripts dir. Revise readme in scripts/test Rename test9.scm which tests the new byte type support in Scheme. Install it in unstable build, it is an important test, long and sophisticated. Install contactsheet.scm as a test plugin in unstable build. See test/meson.build for comments about its issue. --- plug-ins/script-fu/scripts/README | 30 +++++++++++++ plug-ins/script-fu/scripts/meson.build | 10 +---- .../scripts/{ => test}/clothify-v3.scm | 0 .../scripts/{ => test}/contactsheet.scm | 5 ++- plug-ins/script-fu/scripts/test/meson.build | 42 +++++++++++++++++++ .../test/{test9/test9.scm => test-bytes.scm} | 2 +- .../scripts/{ => test}/test-sphere.scm | 0 .../script-fu/scripts/{ => test}/test-v3.scm | 0 po-script-fu/POTFILES.skip | 4 +- 9 files changed, 79 insertions(+), 14 deletions(-) create mode 100644 plug-ins/script-fu/scripts/README rename plug-ins/script-fu/scripts/{ => test}/clothify-v3.scm (100%) rename plug-ins/script-fu/scripts/{ => test}/contactsheet.scm (98%) create mode 100644 plug-ins/script-fu/scripts/test/meson.build rename plug-ins/script-fu/scripts/test/{test9/test9.scm => test-bytes.scm} (99%) rename plug-ins/script-fu/scripts/{ => test}/test-sphere.scm (100%) rename plug-ins/script-fu/scripts/{ => test}/test-v3.scm (100%) diff --git a/plug-ins/script-fu/scripts/README b/plug-ins/script-fu/scripts/README new file mode 100644 index 0000000000..0f53ceb731 --- /dev/null +++ b/plug-ins/script-fu/scripts/README @@ -0,0 +1,30 @@ +The files in this directory are: + - production plugins + - demo plugins + - initialization scripts for ScriptFu + +Don't put test plugins in this directory, but in subdirectory test. + +Production plugins: + - installed in a release. + - appear in diverse menus, not just Filters. + - should be marked for translation, and not in potfiles.skip + +Demo plugins: + - installed in a release (with goat exercise plugins) + - appear in Filters>Development>Demos + - FUTURE: marked for translation, and not in potfiles.skip + +Initialization scripts + - loaded by the TinyScheme interpreter + - have suffix .init or .scm + - are not plugins +FUTURE: +The initialization scripts should all should have suffix .scm +(like the rest of the Scheme world.) +They should be in a separate directory +so advanced users can load library scripts. + +The files script-fu-util.scm and script-fu-util-setpt.scm +are also initialization scripts but loaded differently from .init files. +FUTURE: unify loading of initialization scripts. diff --git a/plug-ins/script-fu/scripts/meson.build b/plug-ins/script-fu/scripts/meson.build index 8ea128feef..4151c9f2cd 100644 --- a/plug-ins/script-fu/scripts/meson.build +++ b/plug-ins/script-fu/scripts/meson.build @@ -1,4 +1,5 @@ subdir('images') +subdir('test') # scripts interpreted by extension-script-fu, installed to /scripts scripts = [ @@ -48,15 +49,6 @@ scripts = [ 'xach-effect.scm', ] -if not stable - scripts += [ - 'contactsheet.scm', - 'clothify-v3.scm', - 'test-sphere.scm', - 'test-v3.scm', - ] -endif - install_data( scripts, install_dir: gimpdatadir / 'scripts', diff --git a/plug-ins/script-fu/scripts/clothify-v3.scm b/plug-ins/script-fu/scripts/test/clothify-v3.scm similarity index 100% rename from plug-ins/script-fu/scripts/clothify-v3.scm rename to plug-ins/script-fu/scripts/test/clothify-v3.scm diff --git a/plug-ins/script-fu/scripts/contactsheet.scm b/plug-ins/script-fu/scripts/test/contactsheet.scm similarity index 98% rename from plug-ins/script-fu/scripts/contactsheet.scm rename to plug-ins/script-fu/scripts/test/contactsheet.scm index f05f000a09..8f017b78a9 100644 --- a/plug-ins/script-fu/scripts/contactsheet.scm +++ b/plug-ins/script-fu/scripts/test/contactsheet.scm @@ -333,4 +333,7 @@ SF-COLOR _"Background color" "black" ) -(script-fu-menu-register "script-fu-contactsheet" "/Filters/Combine") +; Originally installed w release in "/Filters/Combine" +; Now installed in unstable as a test plugin because +; it has an open issue: dirstream fails on Windows. +(script-fu-menu-register "script-fu-contactsheet" "/Filters/Development/Demos") diff --git a/plug-ins/script-fu/scripts/test/meson.build b/plug-ins/script-fu/scripts/test/meson.build new file mode 100644 index 0000000000..49b7d8b702 --- /dev/null +++ b/plug-ins/script-fu/scripts/test/meson.build @@ -0,0 +1,42 @@ +# test plugins + +# Some, but not all, plugins in this directory are installed in unstable build. +# None should be installed in a release. +# None should be translated: not marked or marked but in potfiles.skip. + +# scripts interpreted by extension-script-fu, installed to /scripts +if not stable + scripts = [ + 'contactsheet.scm', + 'clothify-v3.scm', + 'test-sphere.scm', + 'test-v3.scm', + ] +endif + +install_data( + scripts, + install_dir: gimpdatadir / 'scripts', +) + + +# scripts interpreted by gimp-script-fu-interpreter +# Each installed in subdirectory of /plug-in +# Each have a shebang and executable permission. +# Like other interpreted plugins. +# Lacking a shebang, a .interp file is needed to associate .scm suffix + +if not stable + scripts_independent = [ + { 'name': 'test-bytes' }, + ] +endif + +foreach plugin : scripts_independent + name = plugin.get('name') + srcs = plugin.get('srcs', name + '.scm') + + install_data(srcs, + install_dir: gimpplugindir / 'plug-ins' / name, + install_mode: 'rwxr-xr-x') +endforeach diff --git a/plug-ins/script-fu/scripts/test/test9/test9.scm b/plug-ins/script-fu/scripts/test/test-bytes.scm similarity index 99% rename from plug-ins/script-fu/scripts/test/test9/test9.scm rename to plug-ins/script-fu/scripts/test/test-bytes.scm index 49c591d204..ab9aed06df 100755 --- a/plug-ins/script-fu/scripts/test/test9/test9.scm +++ b/plug-ins/script-fu/scripts/test/test-bytes.scm @@ -584,4 +584,4 @@ SF-STRING "Test name (optional)" "" ) -(script-fu-menu-register "script-fu-test9" "/Test") +(script-fu-menu-register "script-fu-test9" "/Filters/Development/Demos") diff --git a/plug-ins/script-fu/scripts/test-sphere.scm b/plug-ins/script-fu/scripts/test/test-sphere.scm similarity index 100% rename from plug-ins/script-fu/scripts/test-sphere.scm rename to plug-ins/script-fu/scripts/test/test-sphere.scm diff --git a/plug-ins/script-fu/scripts/test-v3.scm b/plug-ins/script-fu/scripts/test/test-v3.scm similarity index 100% rename from plug-ins/script-fu/scripts/test-v3.scm rename to plug-ins/script-fu/scripts/test/test-v3.scm diff --git a/po-script-fu/POTFILES.skip b/po-script-fu/POTFILES.skip index 88370e1bca..f878f15bce 100644 --- a/po-script-fu/POTFILES.skip +++ b/po-script-fu/POTFILES.skip @@ -50,9 +50,7 @@ plug-ins/print plug-ins/python plug-ins/screenshot plug-ins/script-fu/script-fu-refresh.c -plug-ins/script-fu/scripts/contactsheet.scm -plug-ins/script-fu/scripts/clothify-v3.scm -plug-ins/script-fu/scripts/test-v3.scm +plug-ins/script-fu/scripts/test plug-ins/selection-to-path plug-ins/twain plug-ins/ui