summaryrefslogtreecommitdiff
path: root/gimp-remove-lua.patch
blob: 9e8d71295dd0e963baa97e841b46dad9bcc1e31e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
diff -urNp a/extensions/goat-exercises/goat-exercise-lua.lua b/extensions/goat-exercises/goat-exercise-lua.lua
--- a/extensions/goat-exercises/goat-exercise-lua.lua	2022-03-09 09:39:44.007314944 +0100
+++ b/extensions/goat-exercises/goat-exercise-lua.lua	1970-01-01 01:00:00.000000000 +0100
@@ -1,184 +0,0 @@
-#!/usr/bin/env luajit
-
--- GIMP - The GNU Image Manipulation Program
--- Copyright (C) 1995 Spencer Kimball and Peter Mattis
---
--- goat-exercise-lua.lua
--- Copyright (C) Jehan
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation; either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program.  If not, see <https://www.gnu.org/licenses/>.
-
-local lgi = require 'lgi'
-
-local GLib    = lgi.GLib
-local GObject = lgi.GObject
-local Gio     = lgi.Gio
-local Gegl    = lgi.Gegl
-local Gimp    = lgi.Gimp
-local GimpUi  = lgi.GimpUi
-local Gtk     = lgi.Gtk
-local Gdk     = lgi.Gdk
-
-local Goat = lgi.package 'Goat'
-local Goat = lgi.Goat
-
-function run(procedure, run_mode, image, drawables, args, run_data)
-  -- procedure:new_return_values() crashes LGI so we construct the
-  -- GimpValueArray manually.
-  local retval = Gimp.ValueArray(1)
-
-  if table.getn(drawables) ~= 1 then
-    local calling_err = GObject.Value(Gimp.PDBStatusType, Gimp.PDBStatusType.CALLING_ERROR)
-    local msg         = "Procedure '%s' only works with one drawable."
-
-    msg = string.format(msg, procedure:get_name())
-
-    retval:append(calling_err)
-    retval:append(GObject.Value(GObject.Type.STRING, msg))
-    return retval
-  end
-
-  local drawable = drawables[1]
-
-  -- Not sure why run_mode has become a string instead of testing
-  -- against Gimp.RunMode.INTERACTIVE.
-  if run_mode == "INTERACTIVE" then
-    GimpUi.init("goat-exercise-lua");
-    local dialog = GimpUi.Dialog {
-      title          = "Exercise a goat (Lua)",
-      role           = "goat-exercise-Lua",
-      use_header_bar = 1
-    }
-    dialog:add_button("_Cancel", Gtk.ResponseType.CANCEL);
-    dialog:add_button("_Source", Gtk.ResponseType.APPLY);
-    dialog:add_button("_OK", Gtk.ResponseType.OK);
-
-    local geometry = Gdk.Geometry()
-    geometry.min_aspect = 0.5;
-    geometry.max_aspect = 1.0;
-    dialog:set_geometry_hints (nil, geometry, Gdk.WindowHints.ASPECT);
-
-    local box = Gtk.Box {
-      orientation = Gtk.Orientation.VERTICAL,
-      spacing     = 2
-    }
-    dialog:get_content_area():add(box)
-    box:show()
-
-    local lang = "Lua"
-    local head_text = "This plug-in is an exercise in '%s' to demo plug-in creation.\n" ..
-                      "Check out the last version of the source code online by clicking the \"Source\" button."
-
-    local label = Gtk.Label { label = string.format(head_text, lang) }
-    box:pack_start(label, false, false, 1)
-    label:show()
-
-    local contents = GLib.file_get_contents(arg[0])
-    if (contents) then
-      local scrolled = Gtk.ScrolledWindow()
-      scrolled:set_vexpand (true)
-      box:pack_start(scrolled, true, true, 1)
-      scrolled:show()
-
-      local view = Gtk.TextView()
-      view:set_wrap_mode(Gtk.WrapMode.WORD)
-      view:set_editable(false)
-      local buffer = view:get_buffer()
-      buffer:set_text(contents, -1)
-      scrolled:add(view)
-      view:show()
-    end
-
-    while (true) do
-      local response = dialog:run()
-      local url = 'https://gitlab.gnome.org/GNOME/gimp/blob/master/extensions/goat-exercises/goat-exercise-lua.lua'
-
-      if response == Gtk.ResponseType.OK then
-        dialog:destroy()
-        break
-      elseif (response == Gtk.ResponseType.APPLY)  then
-        Gio.app_info_launch_default_for_uri(url, nil);
-      else -- CANCEL, CLOSE, DELETE_EVENT
-        dialog:destroy()
-        local cancel = GObject.Value(Gimp.PDBStatusType, Gimp.PDBStatusType.CANCEL)
-        retval:append(cancel)
-        return retval
-      end
-    end
-  end
-
-  local x, y, width, height = drawable:mask_intersect()
-  if width ~= nill and height ~= nil and width > 0 and height > 0 then
-    Gegl.init(nil)
-
-    local buffer = drawable:get_buffer()
-    local shadow_buffer = drawable:get_shadow_buffer()
-
-    local graph = Gegl.Node()
-    local input = graph:create_child("gegl:buffer-source")
-    input:set_property("buffer", GObject.Value(Gegl.Buffer, buffer))
-    local invert = graph:create_child("gegl:invert")
-    local output = graph:create_child("gegl:write-buffer")
-    output:set_property("buffer", GObject.Value(Gegl.Buffer, shadow_buffer))
-    input:link(invert)
-    invert:link(output)
-    output:process()
-
-    shadow_buffer:flush()
-
-    drawable:merge_shadow(true)
-    drawable:update(x, y, width, height)
-    Gimp.displays_flush()
-  end
-
-  local success = GObject.Value(Gimp.PDBStatusType, Gimp.PDBStatusType.SUCCESS)
-  retval:append(success)
-  return retval
-end
-
-Goat:class('Exercise', Gimp.PlugIn)
-
-function Goat.Exercise:do_query_procedures()
-  return { 'plug-in-goat-exercise-lua' }
-end
-
-function Goat.Exercise:do_create_procedure(name)
-  local procedure = Gimp.ImageProcedure.new(self, name,
-                                            Gimp.PDBProcType.PLUGIN,
-                                            run, nil)
-
-  procedure:set_image_types("*");
-  procedure:set_sensitivity_mask(Gimp.ProcedureSensitivityMask.DRAWABLE);
-
-  procedure:set_menu_label("Exercise a Lua goat");
-  procedure:set_icon_name(GimpUi.ICON_GEGL);
-  procedure:add_menu_path('<Image>/Filters/Development/Goat exercises/');
-
-  procedure:set_documentation("Exercise a goat in the Lua language",
-                              "Takes a goat for a walk in Lua",
-                              name);
-  procedure:set_attribution("Jehan", "Jehan", "2019");
-
-  return procedure
-end
-
--- 'arg' is a Lua table. When automatically converted to an array, the
--- value 0 is deleted (because Lua arrays start at 1!), which breaks
--- Gimp.main() call. So let's create our own array starting at 1.
-argv = {}
-for k, v in pairs(arg) do
-  argv[k+1] = v
-end
-
-Gimp.main(GObject.Type.name(Goat.Exercise), argv)
diff -urNp a/extensions/goat-exercises/Makefile.am b/extensions/goat-exercises/Makefile.am
--- a/extensions/goat-exercises/Makefile.am	2022-03-09 09:39:44.007314944 +0100
+++ b/extensions/goat-exercises/Makefile.am	2022-03-09 10:27:14.623108639 +0100
@@ -72,10 +72,10 @@ endif
 
 # Lua (lua-jit + LGI) version.
 
-if BUILD_LUA
-goat_exercise_luadir = $(goat_exercise_c_libexecdir)
-goat_exercise_lua_SCRIPTS = goat-exercise-lua.lua
-endif
+#if BUILD_LUA
+#goat_exercise_luadir = $(goat_exercise_c_libexecdir)
+#goat_exercise_lua_SCRIPTS = goat-exercise-lua.lua
+#endif
 
 # Python 3 (pygobject) version.
 
@@ -135,7 +135,6 @@ org.gimp.extension.goat-exercises.metain
 
 EXTRA_DIST = \
 	goat-exercise-gjs.js	\
-	goat-exercise-lua.lua	\
 	goat-exercise-py3.py	\
 	$(appstream_in_files)
 
diff -urNp a/extensions/goat-exercises/Makefile.in b/extensions/goat-exercises/Makefile.in
--- a/extensions/goat-exercises/Makefile.in	2022-03-09 09:39:44.006314936 +0100
+++ b/extensions/goat-exercises/Makefile.in	2022-03-09 10:28:59.224986448 +0100
@@ -118,7 +118,6 @@ CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(goat_exercise_c_libexecdir)" \
 	"$(DESTDIR)$(goat_exercise_vala_libexecdir)" \
 	"$(DESTDIR)$(goat_exercise_gjsdir)" \
-	"$(DESTDIR)$(goat_exercise_luadir)" \
 	"$(DESTDIR)$(goat_exercise_py3dir)" "$(DESTDIR)$(appdatadir)" \
 	"$(DESTDIR)$(goat_exercise_c_libexecdir)" \
 	"$(DESTDIR)$(goat_exercise_vala_libexecdir)"
@@ -183,7 +182,7 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-SCRIPTS = $(goat_exercise_gjs_SCRIPTS) $(goat_exercise_lua_SCRIPTS) \
+SCRIPTS = $(goat_exercise_gjs_SCRIPTS) \
 	$(goat_exercise_py3_SCRIPTS)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -753,8 +752,8 @@ goat_exercise_c_LDADD = \
 @BUILD_JAVASCRIPT_TRUE@goat_exercise_gjs_SCRIPTS = goat-exercise-gjs.js
 
 # Lua (lua-jit + LGI) version.
-@BUILD_LUA_TRUE@goat_exercise_luadir = $(goat_exercise_c_libexecdir)
-@BUILD_LUA_TRUE@goat_exercise_lua_SCRIPTS = goat-exercise-lua.lua
+#@BUILD_LUA_TRUE@goat_exercise_luadir = $(goat_exercise_c_libexecdir)
+#@BUILD_LUA_TRUE@goat_exercise_lua_SCRIPTS = goat-exercise-lua.lua
 
 # Python 3 (pygobject) version.
 @BUILD_PYTHON_TRUE@goat_exercise_py3dir = $(goat_exercise_c_libexecdir)
@@ -795,7 +794,6 @@ appdatadir = $(goat_exercise_c_libexecdi
 appdata_DATA = $(appstream_files)
 EXTRA_DIST = \
 	goat-exercise-gjs.js	\
-	goat-exercise-lua.lua	\
 	goat-exercise-py3.py	\
 	$(appstream_in_files)
 
@@ -977,41 +975,41 @@ uninstall-goat_exercise_gjsSCRIPTS:
 	files=`for p in $$list; do echo "$$p"; done | \
 	       sed -e 's,.*/,,;$(transform)'`; \
 	dir='$(DESTDIR)$(goat_exercise_gjsdir)'; $(am__uninstall_files_from_dir)
-install-goat_exercise_luaSCRIPTS: $(goat_exercise_lua_SCRIPTS)
-	@$(NORMAL_INSTALL)
-	@list='$(goat_exercise_lua_SCRIPTS)'; test -n "$(goat_exercise_luadir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(goat_exercise_luadir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(goat_exercise_luadir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n' \
-	    -e 'h;s|.*|.|' \
-	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
-	      if (++n[d] == $(am__install_max)) { \
-		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
-	    else { print "f", d "/" $$4, $$1 } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	     test -z "$$files" || { \
-	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(goat_exercise_luadir)$$dir'"; \
-	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(goat_exercise_luadir)$$dir" || exit $$?; \
-	     } \
-	; done
-
-uninstall-goat_exercise_luaSCRIPTS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(goat_exercise_lua_SCRIPTS)'; test -n "$(goat_exercise_luadir)" || exit 0; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	       sed -e 's,.*/,,;$(transform)'`; \
-	dir='$(DESTDIR)$(goat_exercise_luadir)'; $(am__uninstall_files_from_dir)
+#install-goat_exercise_luaSCRIPTS: $(goat_exercise_lua_SCRIPTS)
+#	@$(NORMAL_INSTALL)
+#	@list='$(goat_exercise_lua_SCRIPTS)'; test -n "$(goat_exercise_luadir)" || list=; \
+#	if test -n "$$list"; then \
+#	  echo " $(MKDIR_P) '$(DESTDIR)$(goat_exercise_luadir)'"; \
+#	  $(MKDIR_P) "$(DESTDIR)$(goat_exercise_luadir)" || exit 1; \
+#	fi; \
+#	for p in $$list; do \
+#	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+#	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+#	done | \
+#	sed -e 'p;s,.*/,,;n' \
+#	    -e 'h;s|.*|.|' \
+#	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+#	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+#	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+#	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+#	      if (++n[d] == $(am__install_max)) { \
+#		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+#	    else { print "f", d "/" $$4, $$1 } } \
+#	  END { for (d in files) print "f", d, files[d] }' | \
+#	while read type dir files; do \
+#	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+#	     test -z "$$files" || { \
+#	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(goat_exercise_luadir)$$dir'"; \
+#	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(goat_exercise_luadir)$$dir" || exit $$?; \
+#	     } \
+#	; done
+
+#uninstall-goat_exercise_luaSCRIPTS:
+#	@$(NORMAL_UNINSTALL)
+#	@list='$(goat_exercise_lua_SCRIPTS)'; test -n "$(goat_exercise_luadir)" || exit 0; \
+#	files=`for p in $$list; do echo "$$p"; done | \
+#	       sed -e 's,.*/,,;$(transform)'`; \
+#	dir='$(DESTDIR)$(goat_exercise_luadir)'; $(am__uninstall_files_from_dir)
 install-goat_exercise_py3SCRIPTS: $(goat_exercise_py3_SCRIPTS)
 	@$(NORMAL_INSTALL)
 	@list='$(goat_exercise_py3_SCRIPTS)'; test -n "$(goat_exercise_py3dir)" || list=; \
@@ -1266,7 +1264,7 @@ check-am: all-am
 check: check-am
 all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA)
 installdirs:
-	for dir in "$(DESTDIR)$(goat_exercise_c_libexecdir)" "$(DESTDIR)$(goat_exercise_vala_libexecdir)" "$(DESTDIR)$(goat_exercise_gjsdir)" "$(DESTDIR)$(goat_exercise_luadir)" "$(DESTDIR)$(goat_exercise_py3dir)" "$(DESTDIR)$(appdatadir)" "$(DESTDIR)$(goat_exercise_c_libexecdir)" "$(DESTDIR)$(goat_exercise_vala_libexecdir)"; do \
+	for dir in "$(DESTDIR)$(goat_exercise_c_libexecdir)" "$(DESTDIR)$(goat_exercise_vala_libexecdir)" "$(DESTDIR)$(goat_exercise_gjsdir)" "$(DESTDIR)$(goat_exercise_py3dir)" "$(DESTDIR)$(appdatadir)" "$(DESTDIR)$(goat_exercise_c_libexecdir)" "$(DESTDIR)$(goat_exercise_vala_libexecdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -1330,7 +1328,6 @@ info: info-am
 info-am:
 
 install-data-am: install-appdataDATA install-goat_exercise_gjsSCRIPTS \
-	install-goat_exercise_luaSCRIPTS \
 	install-goat_exercise_py3SCRIPTS
 
 install-dvi: install-dvi-am
@@ -1385,7 +1382,6 @@ uninstall-am: uninstall-appdataDATA \
 	uninstall-goat_exercise_c_libexecDATA \
 	uninstall-goat_exercise_c_libexecPROGRAMS \
 	uninstall-goat_exercise_gjsSCRIPTS \
-	uninstall-goat_exercise_luaSCRIPTS \
 	uninstall-goat_exercise_py3SCRIPTS \
 	uninstall-goat_exercise_vala_libexecDATA \
 	uninstall-goat_exercise_vala_libexecPROGRAMS
@@ -1403,7 +1399,6 @@ uninstall-am: uninstall-appdataDATA \
 	install-goat_exercise_c_libexecDATA \
 	install-goat_exercise_c_libexecPROGRAMS \
 	install-goat_exercise_gjsSCRIPTS \
-	install-goat_exercise_luaSCRIPTS \
 	install-goat_exercise_py3SCRIPTS \
 	install-goat_exercise_vala_libexecDATA \
 	install-goat_exercise_vala_libexecPROGRAMS install-html \
@@ -1416,7 +1411,6 @@ uninstall-am: uninstall-appdataDATA \
 	uninstall-appdataDATA uninstall-goat_exercise_c_libexecDATA \
 	uninstall-goat_exercise_c_libexecPROGRAMS \
 	uninstall-goat_exercise_gjsSCRIPTS \
-	uninstall-goat_exercise_luaSCRIPTS \
 	uninstall-goat_exercise_py3SCRIPTS \
 	uninstall-goat_exercise_vala_libexecDATA \
 	uninstall-goat_exercise_vala_libexecPROGRAMS