File: 99-fix-shader-regen.diff

package info (click to toggle)
efl 1.21.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 261,264 kB
  • sloc: ansic: 1,026,744; cpp: 43,352; cs: 14,773; sh: 5,539; makefile: 3,347; objc: 1,518; pascal: 431; python: 322; xml: 182; sed: 16
file content (112 lines) | stat: -rw-r--r-- 3,509 bytes parent folder | download
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
Description: fix issues in shader code regeneration scripts
 The EFL tarballs ship some generated source code that the Debian
 package should re-generate on build.  This patch includes fixes to that
 process.
Author: Ross Vandegrift <ross@kallisti.us>
Origin: other
Forwarded: no
Last-Update: 2017-04-23
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/lib/ector/gl/shader/gen_shaders.sh
+++ b/src/lib/ector/gl/shader/gen_shaders.sh
@@ -7,16 +7,18 @@
 OUTPUT="$DIR/ector_gl_shaders.x"
 
 # Skip generation if there is no diff (or no git)
-if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
-if git diff --quiet --exit-code -- "$DIR"
-then
-  for f in gen_shaders.sh fragment.glsl vertex.glsl include.glsl; do
-    if [ "$DIR/$f" -nt "$OUTPUT" ]; then
-      touch "$OUTPUT"
-      break
-    fi
-  done
-  exit 0
+if [ "x$EFL_SHD_REGEN" != "x1" ]; then
+  if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
+  if git diff --quiet --exit-code -- "$DIR"
+  then
+    for f in gen_shaders.sh fragment.glsl vertex.glsl include.glsl; do
+      if [ "$DIR/$f" -nt "$OUTPUT" ]; then
+        touch "$OUTPUT"
+        break
+      fi
+    done
+    exit 0
+  fi
 fi
 
 # Write header
@@ -31,7 +33,8 @@
   m4 "$DIR/include.glsl" "$DIR/$SHD.glsl" > "$SHD.tmp"
 
   OIFS="$IFS"
-  IFS=$'\n'
+  IFS='
+'				# IFS must contain a single newline
   echo -n "static const char ${SHD}_glsl[] =" >> "$OUTPUT.tmp"
   for LINE in `cat "$SHD.tmp"` ; do
       printf "\n   \"$LINE\\\n\"" >> "$OUTPUT.tmp"
--- a/src/modules/evas/engines/gl_common/shader_3d/gen_shaders_3d.sh
+++ b/src/modules/evas/engines/gl_common/shader_3d/gen_shaders_3d.sh
@@ -14,11 +14,13 @@
 if [ -e ${OUTPUT} ] && [ ! -w ${OUTPUT} ] ; then exit 0; fi
 
 # Skip generation if there is no diff (or no git)
-if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
-if git diff --quiet --exit-code -- "$DIR"
-then
-  touch "$OUTPUT"
-  exit 0
+if [ "x$EFL_SHD_REGEN" != "x1" ]; then
+  if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
+  if git diff --quiet --exit-code -- "$DIR"
+  then
+    touch "$OUTPUT"
+    exit 0
+  fi
 fi
 
 exec 1<&-
--- a/src/modules/evas/engines/gl_common/shader/gen_shaders.sh
+++ b/src/modules/evas/engines/gl_common/shader/gen_shaders.sh
@@ -14,11 +14,13 @@
 if [ -e ${OUTPUT} ] && [ ! -w ${OUTPUT} ] ; then exit 0; fi
 
 # Skip generation if there is no diff (or no git)
-if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
-if git diff --quiet --exit-code -- "$DIR"
-then
-  touch "$OUTPUT"
-  exit 0
+if [ "x$EFL_SHD_REGEN" != "x1" ]; then
+  if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
+  if git diff --quiet --exit-code -- "$DIR"
+  then
+    touch "$OUTPUT"
+    exit 0
+  fi
 fi
 
 exec 1<&-
--- a/src/Makefile_Ector.am
+++ b/src/Makefile_Ector.am
@@ -144,9 +144,13 @@
 lib/ector/gl/shader/vertex.glsl \
 lib/ector/gl/shader/include.glsl
 
-lib/ector/gl/shader/ector_gl_shaders.x: $(ECTOR_GL_SHADERS_GEN)
-	@echo "  SHADERS  $@"
-	@sh $(srcdir)/lib/ector/gl/shader/gen_shaders.sh
+lib/ector/gl/shader/ector_gl_shaders.x: $(ECTOR_GL_SHADERS_GEN) $(top_srcdir)/src/lib/ector/gl/shader/gen_shaders.sh
+	@if [ "x$(EFL_SHD_REGEN)" = "x1" ]; then \
+	  echo "  SHADERS  $@" ; \
+	  sh $(srcdir)/lib/ector/gl/shader/gen_shaders.sh ; \
+	fi
+
+lib/ector/gl/ector_gl_shader.c: lib/ector/gl/shader/ector_gl_shaders.x
 
 lib_ector_libector_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
 -I$(top_builddir)/src/lib \