From eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 Mon Sep 17 00:00:00 2001 From: Dave Cobbley Date: Tue, 14 Aug 2018 10:05:37 -0700 Subject: [Subtree] Removing import-layers directory As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley Signed-off-by: Brad Bishop --- ...or-format-overflow-if-the-compiler-suppor.patch | 32 +++++++++ .../files/0001-Use-labs-instead-of-abs.patch | 46 +++++++++++++ ...1-palisade-Fix-warnings-with-clang-on-arm.patch | 72 ++++++++++++++++++++ .../fix-compiling-failure-with-option-g-O.patch | 43 ++++++++++++ poky/meta/recipes-sato/puzzles/puzzles_git.bb | 76 ++++++++++++++++++++++ 5 files changed, 269 insertions(+) create mode 100644 poky/meta/recipes-sato/puzzles/files/0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch create mode 100644 poky/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch create mode 100644 poky/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch create mode 100644 poky/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch create mode 100644 poky/meta/recipes-sato/puzzles/puzzles_git.bb (limited to 'poky/meta/recipes-sato/puzzles') diff --git a/poky/meta/recipes-sato/puzzles/files/0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch b/poky/meta/recipes-sato/puzzles/files/0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch new file mode 100644 index 000000000..d40a3b1ef --- /dev/null +++ b/poky/meta/recipes-sato/puzzles/files/0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch @@ -0,0 +1,32 @@ +From 337799e40350b3db2441cc98f65ec36a74dfb356 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 21 Apr 2017 12:18:08 -0700 +Subject: [PATCH] Use -Wno-error=format-overflow= if the compiler supports it + +we need this warning to be suppressed with gcc7+ +however older compilers dont support it so we need +a way to disble it only if compiler supports it + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 3a38c95..bb9035e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -42,7 +42,7 @@ fi + if test "x$GCC" = "xyes"; then + AC_MSG_CHECKING([for usable gcc warning flags]) + gccwarningflags= +- for flag in -Wall -Werror -std=c89 -pedantic; do ++ for flag in -Wall -Werror -std=c89 -pedantic -Wno-error=format-overflow=; do + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS$gccwarningflags $flag $GTK_CFLAGS" +-- +2.12.2 + diff --git a/poky/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch b/poky/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch new file mode 100644 index 000000000..f43d1df6c --- /dev/null +++ b/poky/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch @@ -0,0 +1,46 @@ +From 9808dc09e08937c9bffd858d3ded428225a4312a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 7 Sep 2015 09:02:38 +0000 +Subject: [PATCH] Use labs instead of abs + +cluevals is array of longs so we have to use labs() instead of abs() +since abs() returns int + +Fixes + +keen.c:1458:17: error: absolute value function 'abs' given an argument +of type 'long' but has parameter of type 'int' which may cause +truncation of value + +Signed-off-by: Khem Raj +--- +Upstream-Status: Pending + + keen.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/keen.c b/keen.c +index a6a7238..1631992 100644 +--- a/keen.c ++++ b/keen.c +@@ -1043,7 +1043,7 @@ done + cluevals[j] *= grid[i]; + break; + case C_SUB: +- cluevals[j] = abs(cluevals[j] - grid[i]); ++ cluevals[j] = labs(cluevals[j] - grid[i]); + break; + case C_DIV: + { +@@ -1455,7 +1455,7 @@ static int check_errors(const game_state *state, long *errors) + cluevals[j] *= state->grid[i]; + break; + case C_SUB: +- cluevals[j] = abs(cluevals[j] - state->grid[i]); ++ cluevals[j] = labs(cluevals[j] - state->grid[i]); + break; + case C_DIV: + { +-- +2.5.1 + diff --git a/poky/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch b/poky/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch new file mode 100644 index 000000000..5351f8eb4 --- /dev/null +++ b/poky/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch @@ -0,0 +1,72 @@ +From 6d8326275802a2e6e61d3e99460af6891ae8362f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 13 Jan 2016 23:10:19 -0800 +Subject: [puzzles][PATCH] palisade: Fix warnings with clang on arm + +ARM treats 'char' as unsigned char when 'char' is not qualified with +'signed' or 'unsigned' explicitly. + +This results in warnings e.g. + +palisade.c:531:22: error: comparison of constant -1 with expression of +type 'clue' (aka 'char') is always false +[-Werror,-Wtautological-constant-out-of-range-compare] + if (clues[i] == EMPTY) continue; + +Therefore, typcast the contant to char in such places to be explicit + +Signed-off-by: Khem Raj +--- +Upstream-Status: Submitted + + palisade.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/palisade.c b/palisade.c +index 984e616..2b9c25c 100644 +--- a/palisade.c ++++ b/palisade.c +@@ -295,11 +295,11 @@ static void solver_connected_clues_versus_region_size(solver_ctx *ctx) + * If p = q = 3 then the region has size exactly 2. */ + + for (i = 0; i < wh; ++i) { +- if (ctx->clues[i] == EMPTY) continue; ++ if (ctx->clues[i] == (char)EMPTY) continue; + for (dir = 0; dir < 4; ++dir) { + int j = i + dx[dir] + w*dy[dir]; + if (disconnected(ctx, i, j, dir)) continue; +- if (ctx->clues[j] == EMPTY) continue; ++ if (ctx->clues[j] == (char)EMPTY) continue; + if ((8 - ctx->clues[i] - ctx->clues[j] > ctx->params->k) || + (ctx->clues[i] == 3 && ctx->clues[j] == 3 && + ctx->params->k != 2)) +@@ -317,7 +317,7 @@ static int solver_number_exhausted(solver_ctx *ctx) + int changed = FALSE; + + for (i = 0; i < wh; ++i) { +- if (ctx->clues[i] == EMPTY) continue; ++ if (ctx->clues[i] == (char)EMPTY) continue; + + if (bitcount[(ctx->borders[i] & BORDER_MASK)] == ctx->clues[i]) { + for (dir = 0; dir < 4; ++dir) { +@@ -528,7 +528,7 @@ static int is_solved(const game_params *params, clue *clues, + for (i = 0; i < wh; ++i) { + if (dsf[i] == UNVISITED) dfs_dsf(i, params->w, border, dsf, TRUE); + if (dsf_size(dsf, i) != k) goto error; +- if (clues[i] == EMPTY) continue; ++ if (clues[i] == (char)EMPTY) continue; + if (clues[i] != bitcount[border[i] & BORDER_MASK]) goto error; + } + +@@ -674,7 +674,7 @@ static char *new_game_desc(const game_params *params, random_state *rs, + p = numbers; + r = 0; + for (i = 0; i < wh; ++i) { +- if (numbers[i] != EMPTY) { ++ if (numbers[i] != (char)EMPTY) { + while (r) { + while (r > 26) { + *p++ = 'z'; +-- +2.7.0 + diff --git a/poky/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch b/poky/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch new file mode 100644 index 000000000..c134acde2 --- /dev/null +++ b/poky/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch @@ -0,0 +1,43 @@ +gtk.c: fix compiling failure with option -g -O + +There were compiling failure with option -g -O +... +././gtk.c: In function 'configure_area': +././gtk.c:397:2: error: 'cr' may be used uninitialized in this function [-Werror=maybe-uninitialized] + cairo_set_source_rgb(cr, + ^ +././gtk.c:384:14: note: 'cr' was declared here + cairo_t *cr; + ^ +././gtk.c: In function 'main': +././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized] + fprintf(stderr, "%s: %s\n", pname, error); + ^ +cc1: all warnings being treated as errors +... + +Initialized pointer 'cr' and 'error' with NULL + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia +--- + gtk.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gtk.c b/gtk.c +index a2eba2c..c54bf63 100644 +--- a/gtk.c ++++ b/gtk.c +@@ -2481,7 +2481,7 @@ char *fgetline(FILE *fp) + int main(int argc, char **argv) + { + char *pname = argv[0]; +- char *error; ++ char *error = NULL; + int ngenerate = 0, print = FALSE, px = 1, py = 1; + int time_generation = FALSE, test_solve = FALSE, list_presets = FALSE; + int soln = FALSE, colour = FALSE; +-- +1.9.1 + diff --git a/poky/meta/recipes-sato/puzzles/puzzles_git.bb b/poky/meta/recipes-sato/puzzles/puzzles_git.bb new file mode 100644 index 000000000..bfd817719 --- /dev/null +++ b/poky/meta/recipes-sato/puzzles/puzzles_git.bb @@ -0,0 +1,76 @@ +SUMMARY = "Simon Tatham's Portable Puzzle Collection" +HOMEPAGE = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/" + +DEPENDS = "libxt" + +# The libxt requires x11 in DISTRO_FEATURES +REQUIRED_DISTRO_FEATURES = "x11" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENCE;md5=da6110d4ed1225a287eab2bf0ac0193b" + +SRC_URI = "git://git.tartarus.org/simon/puzzles.git \ + file://fix-compiling-failure-with-option-g-O.patch \ + file://0001-Use-labs-instead-of-abs.patch \ + file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \ + file://0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch \ + " +UPSTREAM_CHECK_COMMITS = "1" +SRCREV = "2adf0052d66eae88c7a5e55e67fe16e13f7018b5" +PE = "2" +PV = "0.0+git${SRCPV}" + +S = "${WORKDIR}/git" + +inherit autotools distro_features_check pkgconfig + +CFLAGS_append = " -Wno-deprecated-declarations" + +PACKAGECONFIG ??= "gtk3" +PACKAGECONFIG[gtk2] = "--with-gtk=2,,gtk+," +PACKAGECONFIG[gtk3] = "--with-gtk=3,,gtk+3," + +PACKAGES += "${PN}-extra" +FILES_${PN} = "" +FILES_${PN}-extra = "${prefix}/bin ${datadir}/applications" + +python __anonymous () { + var = d.expand("FILES_${PN}") + data = d.getVar(var, False) + for name in ("bridges", "fifteen", "inertia", "map", "samegame", "slant"): + data = data + " ${bindir}/%s" % name + data = data + " ${datadir}/applications/%s.desktop" % name + d.setVar(var, data) +} + +do_configure_prepend () { + cd ${S} + ./mkfiles.pl + cd ${B} +} + +do_install_append () { + # net conflicts with Samba, so rename it + mv ${D}${bindir}/net ${D}${bindir}/puzzles-net + + # Create desktop shortcuts + install -d ${D}/${datadir}/applications/ + cd ${D}/${prefix}/bin + for prog in *; do + if [ -x $prog ]; then + # Convert prog to Title Case + title=$(echo $prog | sed 's/puzzles-//' | sed 's/\(^\| \)./\U&/g') + echo "making ${D}/${datadir}/applications/$prog.desktop" + cat < ${D}/${datadir}/applications/$prog.desktop +[Desktop Entry] +Name=$title +Exec=${bindir}/$prog +Icon=applications-games +Terminal=false +Type=Application +Categories=Game; +StartupNotify=true +STOP + fi + done +} -- cgit v1.2.3