palapeli: make puzzles as part of build

View: New views
6 Messages — Rating Filter:   Alert me  

palapeli: make puzzles as part of build

by Bugzilla from mw_triad@users.sourceforge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

As previously mentioned, I don't think there should be an extra step to
create the "built in" puzzles, and I'm not confident this is acceptable
if palapeli is going to ship. I also don't see any particular reason to
do it. Therefore I have prepared this patch to generate the "built in"
puzzles as part of the normal build process.

This theoretically removes the necessity of the second half of Step 3 of
the official build instructions, at least assuming the slicers can be
found. (So this might fail to bootstrap. But I'm also not convinced
something isn't broken that kbuildsycoca must be run manually. And even
if it does, it's not impossible to make that part of the build process
also.)

Obviously this is meant mainly for Stefan, but I'm posting here and to
-buildsystem in case anyone else has comments.

Only downside is... I'm not sure if it works. The .puzzles from what I
can tell built and installed okay, but when I try to start one, I'm
getting an excessively zoomed background with no puzzle. However I'm
getting that on other puzzles that I know were working, so I am thinking
I might have a bad build.

(Oddly enough, 'delete' seems to work as expected now. Maybe it is only
broken if the "built in" puzzles don't exist?)

--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
So, an astrophysicist, a quantum physicist, and an astrologer walk into
a bar...

From 8c046a3efe00b3a4d87f07cff4363b30aa417db0 Mon Sep 17 00:00:00 2001
From: Matthew Woehlke <mw_triad@...>
Date: Tue, 20 Oct 2009 19:18:15 -0500
Subject: [PATCH] Make puzzles as part of build.

---
 puzzles/CMakeLists.txt  |   46 +++++++++++++++++++++++++++++++---------------
 puzzles/make-puzzles.sh |    8 --------
 2 files changed, 31 insertions(+), 23 deletions(-)
 delete mode 100644 puzzles/make-puzzles.sh

diff --git a/puzzles/CMakeLists.txt b/puzzles/CMakeLists.txt
index 1a7be5c..1526f40 100644
--- a/puzzles/CMakeLists.txt
+++ b/puzzles/CMakeLists.txt
@@ -1,15 +1,31 @@
-if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/castle-maintenon.puzzle)
- install(FILES
- castle-maintenon.puzzle
- cincinnati-bridge.puzzle
- citrus-fruits.puzzle
- european-honey-bee.puzzle
- panther-chameleon-female.puzzle
- DESTINATION ${DATA_INSTALL_DIR}/palapeli/puzzlelibrary
- PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
- install(FILES
- default-collection.conf
- DESTINATION ${CONFIG_INSTALL_DIR}
- PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
- RENAME palapeli-libraryrc)
-endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/castle-maintenon.puzzle)
+macro(make_puzzle NAME)
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.puzzle
+                   COMMAND ${palapeli_BINARY_DIR}/tools/libpala-puzzlebuilder
+                           ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.conf
+                           ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.puzzle
+                   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.conf
+                           libpala-puzzlebuilder)
+ list(APPEND puzzle_outputs ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.puzzle)
+endmacro()
+
+set(PUZZLES
+    castle-maintenon cincinnati-bridge citrus-fruits european-honey-bee
+    panther-chameleon-female
+)
+set(puzzle_outputs)
+
+foreach(PUZZLE ${PUZZLES})
+ make_puzzle(${PUZZLE})
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PUZZLE}.puzzle
+        DESTINATION ${DATA_INSTALL_DIR}/palapeli/puzzlelibrary
+        PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
+ )
+endforeach()
+install(FILES default-collection.conf
+        DESTINATION ${CONFIG_INSTALL_DIR}
+        PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
+        RENAME palapeli-libraryrc
+)
+
+add_custom_target(puzzles ALL DEPENDS ${puzzle_outputs})
diff --git a/puzzles/make-puzzles.sh b/puzzles/make-puzzles.sh
deleted file mode 100644
index 092a032..0000000
--- a/puzzles/make-puzzles.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-for MANIFEST in *.conf; do
- [ "$MANIFEST" = "default-collection.conf" ] && continue
- TARGET=$(basename $MANIFEST .conf).puzzle
- echo "Creating $TARGET"
- libpala-puzzlebuilder $MANIFEST $TARGET
-done
--
1.6.0.6


_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: palapeli: make puzzles as part of build

by Bugzilla from mw_triad@users.sourceforge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Matthew Woehlke wrote:
> Only downside is... I'm not sure if it works. The .puzzles from what I
> can tell built and installed okay, but when I try to start one, I'm
> getting an excessively zoomed background with no puzzle. However I'm
> getting that on other puzzles that I know were working, so I am thinking
> I might have a bad build.

Patch seems okay; stuff works after I revert svn r1038221. Stefan, any
ideas?

--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
So, an astrophysicist, a quantum physicist, and an astrologer walk into
a bar...

_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: palapeli: make puzzles as part of build

by Bugzilla from majewsky@gmx.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Mittwoch 21 Oktober 2009 03:15:30 schrieb Matthew Woehlke:
> Matthew Woehlke wrote:
> > Only downside is... I'm not sure if it works. The .puzzles from what I
> > can tell built and installed okay, but when I try to start one, I'm
> > getting an excessively zoomed background with no puzzle. However I'm
> > getting that on other puzzles that I know were working, so I am thinking
> > I might have a bad build.
>
> Patch seems okay; stuff works after I revert svn r1038221. Stefan, any
> ideas?

Please don't revert that, but open your palapelirc and delete the
"SceneSizeFactor" setting. It has changed its meaning in r1038221: It's not
measured in multiples of the image size, but in percents of the image size.
This might break stuff if you're using an old configuration value.

Greetings
Stefan

--
Die Zukunft wird nicht gemeistert von denen, die an der Vergangenheit kleben.


_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

signature.asc (204 bytes) Download Attachment

Re: palapeli: make puzzles as part of build

by Bugzilla from mw_triad@users.sourceforge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stefan Majewsky wrote:

> Am Mittwoch 21 Oktober 2009 03:15:30 schrieb Matthew Woehlke:
>> Matthew Woehlke wrote:
>>> Only downside is... I'm not sure if it works. The .puzzles from what I
>>> can tell built and installed okay, but when I try to start one, I'm
>>> getting an excessively zoomed background with no puzzle. However I'm
>>> getting that on other puzzles that I know were working, so I am thinking
>>> I might have a bad build.
>> Patch seems okay; stuff works after I revert svn r1038221. Stefan, any
>> ideas?
>
> Please don't revert that, but open your palapelirc and delete the
> "SceneSizeFactor" setting. It has changed its meaning in r1038221: It's not
> measured in multiples of the image size, but in percents of the image size.
> This might break stuff if you're using an old configuration value.

I just reverted it locally to see that was what was wrong; wasn't
necessarily suggesting that it /should/ be reverted. Anyway, deleting
that key fixes it; thanks. (Just note that you won't be able to make
such a change once you release ;-), you'd have to change the name of the
key or otherwise version the rc somehow...)

--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
"What, more work?" -- Peasants (Warcraft II)

_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: palapeli: make puzzles as part of build

by Parker Coates :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Oct 21, 2009 at 11:57, Matthew Woehlke wrote:

> Stefan Majewsky wrote:
>> Please don't revert that, but open your palapelirc and delete the
>> "SceneSizeFactor" setting. It has changed its meaning in r1038221: It's not
>> measured in multiples of the image size, but in percents of the image size.
>> This might break stuff if you're using an old configuration value.
>
> I just reverted it locally to see that was what was wrong; wasn't
> necessarily suggesting that it /should/ be reverted. Anyway, deleting
> that key fixes it; thanks. (Just note that you won't be able to make
> such a change once you release ;-), you'd have to change the name of the
> key or otherwise version the rc somehow...)

Actually you can change it later if you write a kconf_update script
[1] to change it. Of course, that's still a bit ugly and should be
avoided if at all possible, but still it is doable.

Parker

[1] http://techbase.kde.org/Development/Tools/Using_kconf_update
_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

Re: palapeli: make puzzles as part of build

by Bugzilla from majewsky@gmx.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Mittwoch 21 Oktober 2009 17:57:04 schrieb Matthew Woehlke:
> I just reverted it locally to see that was what was wrong; wasn't
> necessarily suggesting that it /should/ be reverted. Anyway, deleting
> that key fixes it; thanks. (Just note that you won't be able to make
> such a change once you release ;-), you'd have to change the name of the
> key or otherwise version the rc somehow...)

I'm well aware of kconf_update, and I'm also well aware when using it is utter
bloat. ;-)

Greetings
Stefan


_______________________________________________
kde-games-devel mailing list
kde-games-devel@...
https://mail.kde.org/mailman/listinfo/kde-games-devel

signature.asc (204 bytes) Download Attachment