summaryrefslogtreecommitdiff
path: root/games-util
diff options
context:
space:
mode:
authoreroen2014-08-08 23:13:31 +0200
committereroen2014-08-11 02:03:46 +0200
commit1f4acdfef2a686ebd371b8218adcd21293705c0c (patch)
tree782fc2609f32dbee9faed50043de9e2743db4fe2 /games-util
parent0320b350a30e96dcd7e8703cb8b5ae9d5de50fb4 (diff)
downloaderoen-overlay-1f4acdfef2a686ebd371b8218adcd21293705c0c.tar.gz
eroen-overlay-1f4acdfef2a686ebd371b8218adcd21293705c0c.tar.bz2
eroen-overlay-1f4acdfef2a686ebd371b8218adcd21293705c0c.tar.xz
dfhack-9999 - updatings
Diffstat (limited to 'games-util')
-rw-r--r--games-util/dfhack/Manifest58
-rw-r--r--games-util/dfhack/dfhack-0.40.06.9999.ebuild275
l---------games-util/dfhack/files/dfhack-0.40.06.9999/01-compile-static-libraries-as.patch1
-rw-r--r--games-util/dfhack/files/dfhack-0.40.06.9999/02-drop-strange-build-options.patch52
l---------games-util/dfhack/files/dfhack-0.40.06.9999/03-configurable-install-paths.patch1
l---------games-util/dfhack/files/dfhack-0.40.06.9999/04-compile-time-configurable.patch1
-rw-r--r--games-util/dfhack/files/dfhack-0.40.06.9999/05-compile-time-configurable-0.patch66
-rw-r--r--games-util/dfhack/files/dfhack-0.40.06.9999/06-compile-time-configurable-1.patch104
-rw-r--r--games-util/dfhack/files/dfhack-0.40.06.9999/07-startup-scripts-configurable.patch292
-rw-r--r--games-util/dfhack/files/dfhack-0.40.06.9999/08-ruby-plugin-configurable-paths.patch541
-rw-r--r--games-util/dfhack/files/dfhack-0.40.06.9999/09-getpath-configurable-path.patch46
-rw-r--r--games-util/dfhack/files/dfhack-0.40.06.9999/10-eggy-remove-annoying-banner.patch22
-rw-r--r--games-util/dfhack/files/dfhack-0.40.06.9999/11-debugging.patch22
-rw-r--r--games-util/dfhack/files/dfhack-0.40.06.9999/12-unbreak-egg.patch24
-rw-r--r--games-util/dfhack/files/dfhack-0.40.06.9999/series13
-rw-r--r--games-util/dfhack/metadata.xml1
-rw-r--r--games-util/dfhack/notes.mkd2
17 files changed, 1464 insertions, 57 deletions
diff --git a/games-util/dfhack/Manifest b/games-util/dfhack/Manifest
index 99edeafa..845de3bc 100644
--- a/games-util/dfhack/Manifest
+++ b/games-util/dfhack/Manifest
@@ -1,57 +1 @@
-AUX clsocket/0001-Compile-static-library-as-PIC.patch 960 SHA256 cb06cba3d104096302ec094e340bb5d99e82b68bce30bd094d0fef54bf33f4c3 SHA512 d09d18647c8db7c9a98f28ac73f5a1a2e7921b631e8f2f59fe6a704b949698eb860d786fd8e17cb495946e261966d6fdadd501bdf1b05abf55f0a89b228e0104 WHIRLPOOL 7f891ef012c6cb16d596cb32dba78543a7327a706bada24f0de660777815f242d977468b22847df5e92d976a5a91147fcf758fdb687e464b8f18d2a38aa321bd
-AUX dfhack-0.34.11-r2/0001-Compile-static-dependency-libraries-as-PIC.patch 2560 SHA256 af6e1ff8d7ddf05c201eef9df795ee8c4c7ae1a7e4d07a2a3b2dd6d05bb270ab SHA512 ddd9fd5849725abd169bad3c85d6fcb98d92a210dfe8ac737c07655c50b59e8c6b457fe86aa0c467a5dcaa4ba20528c71971278eea7c5b7a5d5e20810fe18852 WHIRLPOOL b1f4d6763a88a8f34e1654b2b93c5948c9c90544b97f8cdc6aa2747e6db1a0a34610693796e01d36f9dfaf8798717d4768600077e667ca196e78cf2fb54a18c6
-AUX dfhack-0.34.11-r2/0002-removed-magic-flags-and-paths-from-build-system.patch 7972 SHA256 159d19c627482f293cca4f281c42b2fe4f25d0fe708f1efff533cd28f4742d3a SHA512 4f68ec733f09093a079810b026b63e5b9694583188e335ce57949f64a5ca4689fe02819370088fb5c9de82e3386dd2fadd4556e87eaa205cd36d9c6d9fe08cc9 WHIRLPOOL 547563a0682529410e557d4372d580478db3bc642242170d2462331b8b786747f2a2f5021a832011185bfbf34d3d2fa1b9c023386034b4f8d70f7908a645fd98
-AUX dfhack-0.34.11-r2/0003-tell-various-components-about-non-magic-paths.patch 5346 SHA256 9b50aee749944915594f4a5034a33198d00a0a3ac0e17e5c099edf01537154a5 SHA512 0587fcda003a1c6212751761f04b059399d4ff045b3c4d15c7fb9203dcf59e87d96fef996762078ee4de1e00c9d135bb914887e3fec81cfb7e0f3add8e2362d9 WHIRLPOOL 1462a7b93cdb16a87eca89fbbfe02f9e3cd48287b89cd46449a4cee02c09b33366e8eb4f294c7b439382ff5ad9539f6c8ecb030da9cbe82aa1ba59c785f8bcf0
-AUX dfhack-0.34.11-r2/0004-compile-time-configurable-statedir.patch 3337 SHA256 8d4a1a67e6a2c1e6a311ea17e099e8c60c93b911d6ab46399ab31b30eb01cf0f SHA512 1a03b601f16846a0394476df09de5d3c456837dc8cfe6e021204b2fc145bb8a52c9aa0647799c5cb886209ce87b1120f2eeea3477189e7ba8666f71e5cc53ee5 WHIRLPOOL 77b17bc66f365f5b9829df44327ffc269f350b01709f72ba3c5345da534deea0915f58a7a3257844048b13eba5bf4f56941455a359f6966d19e9121182f335d8
-AUX dfhack-0.34.11-r2/0005-remove-annoying-banner.patch 1394 SHA256 7db8259c2e6d473db0f1af3ad98f0b55272f2fdab3c56e9a1198a6cb0848c58f SHA512 d4b5e801deb04f11080cda61b4da80192172e75548978272976c23d9168d443bd274ccb53c39f701df45f73032ee126d04aa2fb8a86816c2003d8635afdf7857 WHIRLPOOL 9dc6fb52b3f65f5696470d2a8482e693702f72382cf1d71d22f053a536d20b438a1b2a584249738f134bd4f9a08d67c7f19f4db2a909a3c929316a2f45e650b8
-AUX dfhack-0.34.11.3_p20130302/01-compile-static-libraries-as.patch 2418 SHA256 2d13b801026ed0484e9d8db7aa68ac7ee9be2009391a1ddbfff8824bad6cf38e SHA512 a52b49e0d479bddb89d4cc49f9de24c0caa5f5ff3bea9cf6dffed12311adbc4414296eccb92f693af38694ed06eca117ef043947ccb1cc6fa6aaadf83fd21e63 WHIRLPOOL c16d3e117a1ff2a7de53e36a9128329f7902dd6849dcf93f2a9e53890014512e4084cffe44b4d4fd39286061798b846276e99d0cac1d7f518ddc75cf4b375e65
-AUX dfhack-0.34.11.3_p20130302/02-drop-strange-build-options.patch 2038 SHA256 dd52200e6106b034ac22c308062dd2ef8de4c9a54ddd877e07737e4dbaeb59ee SHA512 fcd81edce8548cc1a830f92c97dc35a33f0a52cf778c6d50f55249696d90adcfa27ac08a9dca0913d671c09829e6e289361770f1fc5648a74367fa4a3509281f WHIRLPOOL 1b139665f085e8e99c5535c063348cd6dab28936a10d72892e898e463c17fd40824194df155855859142ef4092deb096ae004bedd9608b8712c339fbcbc0375a
-AUX dfhack-0.34.11.3_p20130302/03-configurable-install-paths.patch 3975 SHA256 bdfd0d8285089a51043ea08e2db78ae47cf7e11235230b0b23760211afff86e4 SHA512 82a303a5392971010e0c80138c3a2ba178bbbd7a9d69f3dc90a87698e5f8b630014cfd867e1cfeefbf14ce73978f56f1068e9be88e0bdc9eba6b46748b2bceca WHIRLPOOL 0b0d92af256cd88c6cec5ad1efb4951e48ec944aaf8882b4cac68d2059652080dd05137f537376844c2a5f066345f5b13711c5269d3dffa007601d14caeeb979
-AUX dfhack-0.34.11.3_p20130302/04-compile-time-configurable.patch 5252 SHA256 89f8396c8709a2d72f55f364b73d129e05f65caa32b8c145741d841281f7a71a SHA512 6a613fb00748f22938bf8fdbf55a1acfb141e48c85185c71fd08cc934ab9dd0089431f3942f2bce726d0e71cfd660ece4866026335ca03f75370565c190d330b WHIRLPOOL 7d3e6fe729f61ce5e61e6843c1219e19cba5b77d7558371044c2bb3e60c071d6a13af2e051d3978704b7ee43523ac029833d18e47830ab688ef8af7208bb7edb
-AUX dfhack-0.34.11.3_p20130302/05-compile-time-configurable-0.patch 1562 SHA256 16810214a14c585a7f99f3939f52c66aaab7d388f4854c1d684032df4e3ddf80 SHA512 a2797092215b61765cfee6654a45f0c1f890e6d537e370d038907e25e9e916d54e140635b57012b892039467027e62505045287f3d6a06a2f6d0e6dac83fe256 WHIRLPOOL 49c95f1adb62d1997adea7521e550ffb1bdf38b22e2ca699fd8314b0f96b32de6ee042218d0053f9da0827fecd81d923d078cb9f37447bc4c3211226d9ea0eff
-AUX dfhack-0.34.11.3_p20130302/06-compile-time-configurable-1.patch 3578 SHA256 ead1019a14dbdab2fb0ac097073c7f2a22fa24f426eb031615cd79a5a28b1a54 SHA512 fae5f28c20364a6032f329115a8d1630e17fb1e5e7888c058c94218824616f1b807e7471330fdb7e6d1f29d3960a85f1469edbf1d270cc44ed9a707295bf8c90 WHIRLPOOL 5c8e9a113fc0a4972e54df0871fa6cce4074ef0b4cca33cf2d26cffab3d75863d8aace3423d14d2110a00a5ba79ca39b680e1838889e9ac390f4ea95d06c6784
-AUX dfhack-0.34.11.3_p20130302/07-startup-scripts-configurable.patch 9738 SHA256 a107a4693ed5c8f156c2dd9718c3c83b6c6802bd39d8a41fb15b604bdd2d7908 SHA512 c833b81a0bf7be6d15bc6149e43ae4bcd37bdbe42890ea73ebe950bef416732d9c807c9268031568e08c3f3de9130fc6759d32dd236c830abfa0c3dfddc0f73f WHIRLPOOL 58c7e9891f72819782be79eb9388bd7650a18df2816f4d75f4708fcbdc72d882b0aa18f30af0a91f052cc83f8bf972a6e6df6a64845dbf4521689ba95f8094e4
-AUX dfhack-0.34.11.3_p20130302/08-ruby-plugin-configurable-paths.patch 19636 SHA256 2a24c35f5e4b1cf060fd6f11a5ff4b438b1fafea6a7ece9b5e0f018d1dfcad46 SHA512 00130cc96695e40e47763e858dd73b739d083808b7f0bb1a097a8120c0b7c8d10306a3da0700aa42b69422a32b7814d40290228f26da4e486c5cbb507bdf139d WHIRLPOOL 80aaf69a4c4139096c120f837bcf25a37076269f0f0d3a6ae272fd95124a59c163595827ddb22361f37b79f15d0a3853601dd2c3fdc9682826679aea9fdf3098
-AUX dfhack-0.34.11.3_p20130302/09-eggy-remove-annoying-banner.patch 662 SHA256 a139e7d33d1e6d708955572cae529dd2a56be4500ced49ae417c2f30808a3e14 SHA512 b77cf87d4d232779dd3f171364e6660af5a8e69889ca3b4d9b33ac0db4bde37a3851f23315f19b9bac4577050181f54222b57b0b78c8746407e69e7265d1b8b9 WHIRLPOOL 85728501157dcce4fa4a1b4da81ad8ff74ad7d701ed170ae5fa420977ebd4f1992b015f6d19a1ebfff14de90f43764e1521d3188db569b9a71427e966c2d40f2
-AUX dfhack-0.34.11.3_p20130302/series 410 SHA256 666ee96606c1b8ff23bff91d5ad6d6f788427ba0ff4affd4e0d4b34e9a22f391 SHA512 852b5ba7928d3040f90f5c8ddafcd9a8f86ad7409d4d8e91303083a4da2e3450fbca6f4cec84612a0b9f134cf20cd7e767d9f98836c122380ec84c608f053bc4 WHIRLPOOL bc0d13a22c98d2754795758b44280039b6789e0100f94cceffa50082966c16b41895bebdd35223dde1644ea7ad8116039158675b2ff1b64e9883c4a2e47750f8
-AUX dfhack-9999/01-compile-static-libraries-as.patch 2418 SHA256 2d13b801026ed0484e9d8db7aa68ac7ee9be2009391a1ddbfff8824bad6cf38e SHA512 a52b49e0d479bddb89d4cc49f9de24c0caa5f5ff3bea9cf6dffed12311adbc4414296eccb92f693af38694ed06eca117ef043947ccb1cc6fa6aaadf83fd21e63 WHIRLPOOL c16d3e117a1ff2a7de53e36a9128329f7902dd6849dcf93f2a9e53890014512e4084cffe44b4d4fd39286061798b846276e99d0cac1d7f518ddc75cf4b375e65
-AUX dfhack-9999/02-drop-strange-build-options.patch 2038 SHA256 dd52200e6106b034ac22c308062dd2ef8de4c9a54ddd877e07737e4dbaeb59ee SHA512 fcd81edce8548cc1a830f92c97dc35a33f0a52cf778c6d50f55249696d90adcfa27ac08a9dca0913d671c09829e6e289361770f1fc5648a74367fa4a3509281f WHIRLPOOL 1b139665f085e8e99c5535c063348cd6dab28936a10d72892e898e463c17fd40824194df155855859142ef4092deb096ae004bedd9608b8712c339fbcbc0375a
-AUX dfhack-9999/03-configurable-install-paths.patch 3975 SHA256 bdfd0d8285089a51043ea08e2db78ae47cf7e11235230b0b23760211afff86e4 SHA512 82a303a5392971010e0c80138c3a2ba178bbbd7a9d69f3dc90a87698e5f8b630014cfd867e1cfeefbf14ce73978f56f1068e9be88e0bdc9eba6b46748b2bceca WHIRLPOOL 0b0d92af256cd88c6cec5ad1efb4951e48ec944aaf8882b4cac68d2059652080dd05137f537376844c2a5f066345f5b13711c5269d3dffa007601d14caeeb979
-AUX dfhack-9999/04-compile-time-configurable.patch 5252 SHA256 89f8396c8709a2d72f55f364b73d129e05f65caa32b8c145741d841281f7a71a SHA512 6a613fb00748f22938bf8fdbf55a1acfb141e48c85185c71fd08cc934ab9dd0089431f3942f2bce726d0e71cfd660ece4866026335ca03f75370565c190d330b WHIRLPOOL 7d3e6fe729f61ce5e61e6843c1219e19cba5b77d7558371044c2bb3e60c071d6a13af2e051d3978704b7ee43523ac029833d18e47830ab688ef8af7208bb7edb
-AUX dfhack-9999/05-compile-time-configurable-0.patch 1562 SHA256 16810214a14c585a7f99f3939f52c66aaab7d388f4854c1d684032df4e3ddf80 SHA512 a2797092215b61765cfee6654a45f0c1f890e6d537e370d038907e25e9e916d54e140635b57012b892039467027e62505045287f3d6a06a2f6d0e6dac83fe256 WHIRLPOOL 49c95f1adb62d1997adea7521e550ffb1bdf38b22e2ca699fd8314b0f96b32de6ee042218d0053f9da0827fecd81d923d078cb9f37447bc4c3211226d9ea0eff
-AUX dfhack-9999/06-compile-time-configurable-1.patch 3578 SHA256 ead1019a14dbdab2fb0ac097073c7f2a22fa24f426eb031615cd79a5a28b1a54 SHA512 fae5f28c20364a6032f329115a8d1630e17fb1e5e7888c058c94218824616f1b807e7471330fdb7e6d1f29d3960a85f1469edbf1d270cc44ed9a707295bf8c90 WHIRLPOOL 5c8e9a113fc0a4972e54df0871fa6cce4074ef0b4cca33cf2d26cffab3d75863d8aace3423d14d2110a00a5ba79ca39b680e1838889e9ac390f4ea95d06c6784
-AUX dfhack-9999/07-startup-scripts-configurable.patch 9738 SHA256 a107a4693ed5c8f156c2dd9718c3c83b6c6802bd39d8a41fb15b604bdd2d7908 SHA512 c833b81a0bf7be6d15bc6149e43ae4bcd37bdbe42890ea73ebe950bef416732d9c807c9268031568e08c3f3de9130fc6759d32dd236c830abfa0c3dfddc0f73f WHIRLPOOL 58c7e9891f72819782be79eb9388bd7650a18df2816f4d75f4708fcbdc72d882b0aa18f30af0a91f052cc83f8bf972a6e6df6a64845dbf4521689ba95f8094e4
-AUX dfhack-9999/08-ruby-plugin-configurable-paths.patch 19636 SHA256 2a24c35f5e4b1cf060fd6f11a5ff4b438b1fafea6a7ece9b5e0f018d1dfcad46 SHA512 00130cc96695e40e47763e858dd73b739d083808b7f0bb1a097a8120c0b7c8d10306a3da0700aa42b69422a32b7814d40290228f26da4e486c5cbb507bdf139d WHIRLPOOL 80aaf69a4c4139096c120f837bcf25a37076269f0f0d3a6ae272fd95124a59c163595827ddb22361f37b79f15d0a3853601dd2c3fdc9682826679aea9fdf3098
-AUX dfhack-9999/09-eggy-remove-annoying-banner.patch 662 SHA256 a139e7d33d1e6d708955572cae529dd2a56be4500ced49ae417c2f30808a3e14 SHA512 b77cf87d4d232779dd3f171364e6660af5a8e69889ca3b4d9b33ac0db4bde37a3851f23315f19b9bac4577050181f54222b57b0b78c8746407e69e7265d1b8b9 WHIRLPOOL 85728501157dcce4fa4a1b4da81ad8ff74ad7d701ed170ae5fa420977ebd4f1992b015f6d19a1ebfff14de90f43764e1521d3188db569b9a71427e966c2d40f2
-AUX dfhack-9999/series 410 SHA256 666ee96606c1b8ff23bff91d5ad6d6f788427ba0ff4affd4e0d4b34e9a22f391 SHA512 852b5ba7928d3040f90f5c8ddafcd9a8f86ad7409d4d8e91303083a4da2e3450fbca6f4cec84612a0b9f134cf20cd7e767d9f98836c122380ec84c608f053bc4 WHIRLPOOL bc0d13a22c98d2754795758b44280039b6789e0100f94cceffa50082966c16b41895bebdd35223dde1644ea7ad8116039158675b2ff1b64e9883c4a2e47750f8
-AUX isoworld-0.34.11.3_p20130302/01-missing-include-dir.patch 491 SHA256 00bfd01587e25eeb4c93c3100bbf6872517f214e75a2824c92690c7a3159735e SHA512 267614162fa3d92e6e49783d11c211f55f2d235212fd2538421093f5f59c37509938833e5475a53cd1dc9f96435609f96865834871b373f04e84f7504f7018df WHIRLPOOL bf6c572b9f9db9900196d55fcf2dc26be165cc696dc5cd73454846fcfa6919259c3f71e06dba692addcd517cdebb6e9ee91e48992bc74c8f1fdc0d199f293978
-AUX isoworld-0.34.11.3_p20130302/series 106 SHA256 6c265ab0eac63e1b43b9bb9f698ea0b2281db81ea0a67da8602810613b6c0f00 SHA512 22e5f26edb861019d6fb2fdd6959d3efc3fc8687dc545256c34fe2f16e790ca51cdc3d10476f8d4e9ee6a755ed49414abe1c1fb633fca71aee5928cc2b617989 WHIRLPOOL e54a2c64a845f3a643a9f7cfc4fc447986aa83e502ec229c7a9866f9dc2cbe33548cbb9eb8f5dd2167606637230187e9e2a5955427a59e5a52de8994f16498f4
-AUX isoworld-9999/01-missing-include-dir.patch 491 SHA256 00bfd01587e25eeb4c93c3100bbf6872517f214e75a2824c92690c7a3159735e SHA512 267614162fa3d92e6e49783d11c211f55f2d235212fd2538421093f5f59c37509938833e5475a53cd1dc9f96435609f96865834871b373f04e84f7504f7018df WHIRLPOOL bf6c572b9f9db9900196d55fcf2dc26be165cc696dc5cd73454846fcfa6919259c3f71e06dba692addcd517cdebb6e9ee91e48992bc74c8f1fdc0d199f293978
-AUX isoworld-9999/series 106 SHA256 6c265ab0eac63e1b43b9bb9f698ea0b2281db81ea0a67da8602810613b6c0f00 SHA512 22e5f26edb861019d6fb2fdd6959d3efc3fc8687dc545256c34fe2f16e790ca51cdc3d10476f8d4e9ee6a755ed49414abe1c1fb633fca71aee5928cc2b617989 WHIRLPOOL e54a2c64a845f3a643a9f7cfc4fc447986aa83e502ec229c7a9866f9dc2cbe33548cbb9eb8f5dd2167606637230187e9e2a5955427a59e5a52de8994f16498f4
-AUX stonesense-0.34.11.3_p20130302/01-null-isn-t-an-int32.patch 2293 SHA256 c140f17f9ad485b43ab2b6de8e1ab88ff8e3f6748a233d7d34d63e79a9f8074e SHA512 84ab7ebd25505515085c3c6c2c903d4aa51d8432b8c750a4f66d436426ad9963c07fa5019e24f0ca6d5618be329b35673a819443d092460e55bb6bb829dd4760 WHIRLPOOL 3beb7cc546b1f5eba970628e3a263e2536f881ae1e21115df19c4979b9c267d66ba060bf16f78a46675fe96b2f18fb7281ba1a9dd1695e3e5f0df4147bcb78b7
-AUX stonesense-0.34.11.3_p20130302/02-configurable-install-paths.patch 1388 SHA256 03ac914c0fbee6d27b68c075d91b8b315179d9cb91944da731006241e0589dbb SHA512 b7b75f33b9aefe91081f4cede21b79b7583374ea5f5608cd4982a6ba5ad35006986ede06985bac70f5260610f2b32ac05cc06e90a983dbc6e85e7346da084d96 WHIRLPOOL 677942b840640ce40a3e93d28265a5f39c778fe369c4de27eee382d8a83e063a775477f5434f754173de88c2a0bf46750006ca11294b244fffe4f3ec5ba80d5f
-AUX stonesense-0.34.11.3_p20130302/03-don-t-segfault-if-logfile-is.patch 817 SHA256 7fd33d13206ef38bca971856d9cfff0fbef88f1e7685111e00fa13b780cc9ecb SHA512 2ff023f34a1cf8718a3954e3a7584d07a1716b67756473d0852863f182c55bcde209921a9e26e1efeffde17ae42ab87c322915d74f2661b79ec49dd158df7cd1 WHIRLPOOL 1c88b645f01d651896b951acbc97d610d986a7d756cb0d58cc9c3c9caaa3873c18d191c46238ad13e050047476cc2589ae7f40614f0b8d3a52bb24fa58325976
-AUX stonesense-0.34.11.3_p20130302/04-compile-time-configuration-of.patch 7408 SHA256 2a5cada5aaffa02feb7344646d7d781a02efd48814dc9bd49804bfd604794a7c SHA512 2158737598af4faac3ae3680f0c41206150e57164b3313af492e7848414774768131acae4afc3093fea6361c3acfb4ad52f841d420fac92ff7b98049c89f7219 WHIRLPOOL 94ee56857a2558b1cb669cca632b79d6cd1cb51735e3a356253f5229118f527a6108d9d1a26340aac0fecc0a67d8cd5e9fe23e9ef7355c3b1b5b66454007ca47
-AUX stonesense-0.34.11.3_p20130302/05-compile-time-configurable-log.patch 1000 SHA256 48994c657edeaa5d29f2ef6e016503bfddf980bfe924ec847994f44a86a5b35d SHA512 579c28c907a490de5cf8fad5ed6b0b74abf51c967994b0888af8dab432157f1bc4ba20a73bb03f59b3cc3736c69079a9efb2c3d203eeecdcc33e9a44b4bda6bd WHIRLPOOL 08899e1bf50d7a621b56683519577d53ebb8b59d08273af7124a86fe6e1fca2338afd654e93477a6ca58b9482e78ac00e2a39e997586e78d6f67649bd6fc14dc
-AUX stonesense-0.34.11.3_p20130302/06-fix-b0rked-xml-file.patch 1079 SHA256 d45d2e9f4c4707afdb5de1f9bded8a6bfebd4e9a530f7f50fae0d17fba1175ec SHA512 eca7dea452208b457730432f11d3206bd3cd7d440a7d1407d30381298621ac795ac7329a43b56d7d9b3a38ff8b0fb724d2a7f3469db4f5754fcc432e8f444dd6 WHIRLPOOL 28303997fe25b1fc7f1c7c0a2405c03ca053263d85d2cb4343e7d53d783de15132b1e400d2b920a71f9731b9da13cebc8480f15f9f2ebaf94c93ff6b33601de2
-AUX stonesense-0.34.11.3_p20130302/07-compile-time-configurable-dump.patch 4364 SHA256 c4b6e94399afd07aac3595c6dc2865b9e8965faae68a7e445d89371fdbe2e69e SHA512 27b86a0530be876d5d8712cef89786b5d35c1fe7d441155fcd804d71ac797fc8cb2d76688f4c0b7fe2341a2f0b1085ec0a035acfe7cb3e3879b614f8e2bf5c9d WHIRLPOOL be375a3af6e4c427a1f0b1c5fa9c15a837849422c0b3a9ab6048a6bad189771a75cf9ae25e5da9f3dff4fc988c61ba497070d406d70fd5e342685da8e2f18b91
-AUX stonesense-0.34.11.3_p20130302/08-compile-time-configurable.patch 517 SHA256 ae777e95df2a6222cc5b5b011a2be2d4377b658bafc67818cd45fa2f440b19d6 SHA512 59b60293c7db910cbe32aff5850b1bb2deb8eea40f543806033ca35d357f1b42ed2ac955106c24ac8a787cd6a88992647228becbc143a544ec55a3613f47aa3e WHIRLPOOL d9a61b9897b405b9a9dc9026fd5d29cc2502b9378ecb24fa7a220ce95c01666925b91165eba6d393bc5975624a6703a205b750d5641ddd7a8f5fb7d1c7576f8d
-AUX stonesense-0.34.11.3_p20130302/series 362 SHA256 46867ba655615440c4a1c04a1022033df110d134e11afff3ca59e5f5355aabc2 SHA512 4c791888240e965c86dd5899870b10ac0e16fdd19fb79ce4a4bd8a4e531c5a866553d568578a723b2856767cecf30e5400fb5fb99f926f00119f37621108770c WHIRLPOOL ec5b6ee427e9851abca3aa6b0142fdd8f27a2543c13d0645cb6e2ede1eba6386616533ee11ce3a83d541b48236cdc6ba80555549625d17319278d7f58d1f190a
-AUX stonesense-9999/01-null-isn-t-an-int32.patch 2293 SHA256 c140f17f9ad485b43ab2b6de8e1ab88ff8e3f6748a233d7d34d63e79a9f8074e SHA512 84ab7ebd25505515085c3c6c2c903d4aa51d8432b8c750a4f66d436426ad9963c07fa5019e24f0ca6d5618be329b35673a819443d092460e55bb6bb829dd4760 WHIRLPOOL 3beb7cc546b1f5eba970628e3a263e2536f881ae1e21115df19c4979b9c267d66ba060bf16f78a46675fe96b2f18fb7281ba1a9dd1695e3e5f0df4147bcb78b7
-AUX stonesense-9999/02-configurable-install-paths.patch 1388 SHA256 03ac914c0fbee6d27b68c075d91b8b315179d9cb91944da731006241e0589dbb SHA512 b7b75f33b9aefe91081f4cede21b79b7583374ea5f5608cd4982a6ba5ad35006986ede06985bac70f5260610f2b32ac05cc06e90a983dbc6e85e7346da084d96 WHIRLPOOL 677942b840640ce40a3e93d28265a5f39c778fe369c4de27eee382d8a83e063a775477f5434f754173de88c2a0bf46750006ca11294b244fffe4f3ec5ba80d5f
-AUX stonesense-9999/03-don-t-segfault-if-logfile-is.patch 817 SHA256 7fd33d13206ef38bca971856d9cfff0fbef88f1e7685111e00fa13b780cc9ecb SHA512 2ff023f34a1cf8718a3954e3a7584d07a1716b67756473d0852863f182c55bcde209921a9e26e1efeffde17ae42ab87c322915d74f2661b79ec49dd158df7cd1 WHIRLPOOL 1c88b645f01d651896b951acbc97d610d986a7d756cb0d58cc9c3c9caaa3873c18d191c46238ad13e050047476cc2589ae7f40614f0b8d3a52bb24fa58325976
-AUX stonesense-9999/04-compile-time-configuration-of.patch 7408 SHA256 2a5cada5aaffa02feb7344646d7d781a02efd48814dc9bd49804bfd604794a7c SHA512 2158737598af4faac3ae3680f0c41206150e57164b3313af492e7848414774768131acae4afc3093fea6361c3acfb4ad52f841d420fac92ff7b98049c89f7219 WHIRLPOOL 94ee56857a2558b1cb669cca632b79d6cd1cb51735e3a356253f5229118f527a6108d9d1a26340aac0fecc0a67d8cd5e9fe23e9ef7355c3b1b5b66454007ca47
-AUX stonesense-9999/05-compile-time-configurable-log.patch 1000 SHA256 48994c657edeaa5d29f2ef6e016503bfddf980bfe924ec847994f44a86a5b35d SHA512 579c28c907a490de5cf8fad5ed6b0b74abf51c967994b0888af8dab432157f1bc4ba20a73bb03f59b3cc3736c69079a9efb2c3d203eeecdcc33e9a44b4bda6bd WHIRLPOOL 08899e1bf50d7a621b56683519577d53ebb8b59d08273af7124a86fe6e1fca2338afd654e93477a6ca58b9482e78ac00e2a39e997586e78d6f67649bd6fc14dc
-AUX stonesense-9999/06-fix-b0rked-xml-file.patch 1079 SHA256 d45d2e9f4c4707afdb5de1f9bded8a6bfebd4e9a530f7f50fae0d17fba1175ec SHA512 eca7dea452208b457730432f11d3206bd3cd7d440a7d1407d30381298621ac795ac7329a43b56d7d9b3a38ff8b0fb724d2a7f3469db4f5754fcc432e8f444dd6 WHIRLPOOL 28303997fe25b1fc7f1c7c0a2405c03ca053263d85d2cb4343e7d53d783de15132b1e400d2b920a71f9731b9da13cebc8480f15f9f2ebaf94c93ff6b33601de2
-AUX stonesense-9999/07-compile-time-configurable-dump.patch 4364 SHA256 c4b6e94399afd07aac3595c6dc2865b9e8965faae68a7e445d89371fdbe2e69e SHA512 27b86a0530be876d5d8712cef89786b5d35c1fe7d441155fcd804d71ac797fc8cb2d76688f4c0b7fe2341a2f0b1085ec0a035acfe7cb3e3879b614f8e2bf5c9d WHIRLPOOL be375a3af6e4c427a1f0b1c5fa9c15a837849422c0b3a9ab6048a6bad189771a75cf9ae25e5da9f3dff4fc988c61ba497070d406d70fd5e342685da8e2f18b91
-AUX stonesense-9999/08-compile-time-configurable.patch 517 SHA256 ae777e95df2a6222cc5b5b011a2be2d4377b658bafc67818cd45fa2f440b19d6 SHA512 59b60293c7db910cbe32aff5850b1bb2deb8eea40f543806033ca35d357f1b42ed2ac955106c24ac8a787cd6a88992647228becbc143a544ec55a3613f47aa3e WHIRLPOOL d9a61b9897b405b9a9dc9026fd5d29cc2502b9378ecb24fa7a220ce95c01666925b91165eba6d393bc5975624a6703a205b750d5641ddd7a8f5fb7d1c7576f8d
-AUX stonesense-9999/series 362 SHA256 46867ba655615440c4a1c04a1022033df110d134e11afff3ca59e5f5355aabc2 SHA512 4c791888240e965c86dd5899870b10ac0e16fdd19fb79ce4a4bd8a4e531c5a866553d568578a723b2856767cecf30e5400fb5fb99f926f00119f37621108770c WHIRLPOOL ec5b6ee427e9851abca3aa6b0142fdd8f27a2543c13d0645cb6e2ede1eba6386616533ee11ce3a83d541b48236cdc6ba80555549625d17319278d7f58d1f190a
-AUX stonesense/0001-dont-segfault-if-logfile-is-unwritable.patch 1064 SHA256 6e9fc52b4a7779c50332e98d3d0a5949197dea352639e6c0aa9f2c170d1558d7 SHA512 0a6e5113d7fcb8fe241e6cb2eb58b8428b871675fdcc3f7234c5fc953820eac3c7efa088eca5bfc1062c439577800a8b6c38b7d22e8ba34cfb00806bb285b783 WHIRLPOOL 73ab1749346ab2f889fb16c9ec91b96dcbecc1607ac8e42c586fa407a3186e042fa74c7086dd7f2b1fc0812c524e7c309fb0f16a2a35f7c782eb182bd2fe7ea3
-AUX stonesense/0002-compile-time-configuration-of-magic-cwd.patch 7753 SHA256 79e024cbcf34998866dee56b7e27b1cad3a8d3da152bbc43b329723109d58d51 SHA512 b892aa4a94eefefe63d52352f2f01a76327fdcdf99cce5c565738f82b7b45de8536128dc7529df52bb4a465d5e198e0c774d0690f5577e8533b8f08221b6e377 WHIRLPOOL ce9507bb7f67666f87a8463cab941ad2ba1b14e8ec3000d587855a2922ca5a186dffd062c752bb313ac111d9645c979421b0657082c44c3ac000c3e8c787b25e
-AUX stonesense/0003-screenshots-in-home-dir.patch 2578 SHA256 88bc1a28442dfe8e5ff08e27e82de6443a3c5bccf49d7bcb2a26637a71ae3e18 SHA512 988efaba82e96149641e8dd6d8769b3ac1d890ebaa35128507a8f0d633af947ad9d8090758e1734a2f9b118c5404e4d712e2abb9a4e971f980f4163c0b646f5b WHIRLPOOL f3f03c297fbd39f27b5957cca0073a3420a10ba0a1741cf73f210cf680c2083c761cb68a637663281e69d1fee9e7b5049c3074f18fed394f48888bc377f5bb70
-AUX stonesense/0004-create-various-output-files-in-HOME-not-cwd.patch 5217 SHA256 3ac09c948cc36b04058a82cb9f04e0ff26ffee765bf2300a46eac09cebc867de SHA512 9f0c2c5f4a2d15c99e06d30e1d3825527449f63de4d370533f07ce4324d0afbd1a2190dcf9589cbd326fd0f9705333bb436bed74e72ac4a7485f002fa3600639 WHIRLPOOL cbe81a086301a3dc218f31e3b1edb837bd81a25d151e5d46c0988d080165e95faac8ab14a97995a7092262542cbb8b29a2a540fe45a5c74b520e47ec5ab0f420
-EBUILD dfhack-0.34.11.2.ebuild 5733 SHA256 186d75f15d47f0f8bb28c778d843086b5ea527a812dc0aa6d69e428699eccbb6 SHA512 a045c7047c297a4111449c3668f0e9c4e33364919d503edcf56eb2e05055e0d2344652c93fd29ec04b6334db5c58d38a5621d58450d94a4cc8f20046cc01b16a WHIRLPOOL 1b36e094a16a39b9c4136101cdf264b708fa81d47a2056bd283bb4d5b61b4535f95d4f2fb0a320f210470f489fdab3deb1360181b152c7120a89d82013d35c57
-EBUILD dfhack-0.34.11.3_p20130302.ebuild 8800 SHA256 e26828353aba250765fe89f927e5cca79162698cf3c655935f236a9ec6c46137 SHA512 6a6cae1540613beb0db9fb96b589791e5caf07270ba83f6e0122f14648b6bfc78aa2e7c80846b47e0de7da409def7bf4815769fa0018b5099abaa762c4d03dce WHIRLPOOL 8a2e17adb837ca961cbf73b1e26f49e3b0ff077ffec8b883d5a72bc381338c5b90d85f21f43a84b767602c35af7fa0af7328069098aa99843c1aa948070c7f5e
-EBUILD dfhack-9999.ebuild 8498 SHA256 adfc7edc5173777b877f8aac8244b129d9b2864a7b08096985dfbfab7c9fd1a6 SHA512 ecb6e57b999a77d91967bfcc5688856d2ff90d067ab1d0afe2ded515e371b20dfbb806050d3273382b2b78d26386eb3fe5dcc5d8249b8ef5f454aacc28502715 WHIRLPOOL 8bf6497db4de25a61a333d3af1b16be470c3709bf8bde1f6d6e26e572bdfe25686785b74ac0cd998692fee1c7f7d08dd23f4403ccbfb4730b6dab8d9a3ad619e
-MISC metadata.xml 721 SHA256 92c6cfa56d7afc563cd87101664f1200e50d02fedd5a7a3d19b8a549f042e8bc SHA512 009c4d722c0515a03323e711440db763bb47697719017d0ea8aa2da396739e55a125fcebdd94a1103f48ddf79735523e39ca9edfba77d67ed77c735a62e83a1f WHIRLPOOL ca03b60ff2b56d2bffabfdd8c26f980e5fe6ee70fb50cf13399c1fed55f3a6e7ae28ec7b4290df41f6ae27473b8ef561fe2c82597ef4aca771893a7664786bbb
-MISC todo.txt 2592 SHA256 3653d4111e53ff212fa8ff2a6a9d30a8698008485defeb1c2cb4b02d5155ab52 SHA512 422bff731050f868a721547a430df896dcb5fbbba4b1552261fbbdc31643ea0faa58ba7f69d30409b3f33d9c3a12e268d39f46caa6196e1fbc9acaaa6176e740 WHIRLPOOL 86716dd744146fca20422d7d3906a4f4ff15a92f6bf935bfeeb6d397fc8a6ac3aa000054981f8d8f46bc23e1bb40a6ed136c03cfbbeda9ff0d316bcba813689f
+DIST libruby187.tar.gz 382504 SHA256 5b8c7ff0462e44fa39ce510084cd663443e05def63f33d3ecf5b4b3b80d112ad SHA512 dfaedd36c953a2cde6e1252ba9b91ba113523fc99faf47186aa02afe479d9f97d26abfa72e26d3aa32d26ae27f9c495c8888a355d86103571842acb32ae831a6 WHIRLPOOL a40ebd31907b13de1d054863e628320bf4bd2d175a5a3b5e5bb92bcb7d511f9dc9f240929c1de93356834ff60bb992b8782b88503e4b32077079d467b2742695
diff --git a/games-util/dfhack/dfhack-0.40.06.9999.ebuild b/games-util/dfhack/dfhack-0.40.06.9999.ebuild
new file mode 100644
index 00000000..a8ab14a9
--- /dev/null
+++ b/games-util/dfhack/dfhack-0.40.06.9999.ebuild
@@ -0,0 +1,275 @@
+# By eroen, 2012-2014
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# $Header: $
+
+EAPI=5
+inherit base eutils multilib git-r3 cmake-utils games
+
+df_PV=${PV#0.}
+[[ "${df_PV}" = *.*.* ]] && df_PV=${df_PV%.*}
+
+DESCRIPTION="Memory hacking library for Dwarf Fortress and a set of tools that
+use it"
+HOMEPAGE="http://github.com/DFHack/dfhack"
+#EGIT_REPO_URI="git://github.com/DFHack/dfhack.git"
+EGIT_REPO_URI="git://github.com/quietust/dfhack.git"
+EGIT_BRANCH=develop
+SRC_URI="http://cloud.github.com/downloads/jjyg/dfhack/libruby187.tar.gz"
+
+KEYWORDS="" # ~amd64 ~x86
+
+CMAKE_MIN_VERSION=2.8.9
+CMAKE_REMOVE_MODULES_LIST="FindCurses FindDoxygen CMakeVS10FindMake"
+
+LICENSE="ZLIB MIT BSD-2"
+SLOT=${df_PV}
+IUSE="api dfusion doc egg isoworld minimal stonesense"
+
+HDEPEND="
+ dev-perl/XML-LibXML
+ dev-perl/XML-LibXSLT
+ doc? ( app-doc/doxygen )
+ "
+LIBRARY_DEPEND="
+ sys-libs/zlib[abi_x86_32]
+ stonesense? ( media-libs/fontconfig[abi_x86_32]
+ app-emulation/emul-linux-x86-baselibs[development]
+ media-libs/freetype[abi_x86_32]
+ x11-libs/libICE[abi_x86_32]
+ x11-libs/libSM[abi_x86_32]
+ x11-libs/libX11[abi_x86_32]
+ x11-libs/libXcursor[abi_x86_32]
+ x11-libs/libXext[abi_x86_32]
+ x11-libs/libXinerama[abi_x86_32]
+ x11-libs/libXrandr[abi_x86_32]
+ )
+ "
+DEPEND="${LIBRARY_DEPEND}
+ ${HDEPEND}"
+RDEPEND="${LIBRARY_DEPEND}
+ !egg? ( ~games-simulation/dwarffortress-${df_PV} )
+ stonesense? ( app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ "
+
+## missing multilib
+#dev-lang/lua - binary bundled
+#dev-libs/protobuf - bundled
+## stonesense
+#allegro - binary bundled
+# dev-libs/atk (libatk-1.0.so.0) - gtklibs
+# dev-libs/glib (libgthread-2.0.so.0,libglib-2.0.so.0,libgobject-2.0.so.0,libgmodule-2.0.so.0,libgio-2.0.so.0) - baselibs
+# media-libs/fontconfig (libfontconfig.so.1)
+# media-libs/freetype (libfreetype.so.6)
+# media-libs/jpeg:62 (libjpeg.so.62) - baselibs
+# virtual/glu (libGLU.so.1) - opengl
+# media-libs/libpng:1.2 (libpng12.so.0) - baselibs
+# virtual/opengl (libGL.so.1)
+# sys-libs/zlib (libz.so.1) - baselibs
+# x11-libs/cairo (libcairo.so.2) - gtklibs
+# x11-libs/gdk-pixbuf (libgdk_pixbuf) - gtklibs
+# x11-libs/gtk+ (libgdk-x11-2.0.so.0,libgtk-x11-2.0.so.0) - gtklibs
+# x11-libs/libICE (libICE.so.6)
+# x11-libs/libSM (libSM.so.6)
+# x11-libs/libX11 (libX11.so.6)
+# x11-libs/libXcursor (libXcursor.so.1)
+# x11-libs/libXext (libXext.so.6)
+# x11-libs/libXinerama (libXinerama.so.1)
+# x11-libs/libXrandr (libXrandr.so.2)
+# x11-libs/pango (libpangocairo-1.0.so.0,libpango-1.0.so.0,libpangoft2-1.0.so.0) - gtklibs
+
+#QA_PREBUILT="$(games_get_libdir)/libruby.so"
+#QA_PREBUILT="$(games_get_libdir)/${P}/libruby.so"
+#QA_PREBUILT=usr/games/lib32/dfhack-0.40.06.9999/libruby.so
+#QA_PREBUILT=usr/games/lib32/dfhack-0.40.06.9999/libruby.so
+#echo ${QA_PREBUILT}
+#QA_PREBUILT=("${GAMES_PREFIX#/}"/"$(get_libdir)"/${P}/libruby.so)
+#echo ${QA_PREBUILT}
+
+pkg_setup() {
+ multilib_toolchain_setup x86
+
+ df_executable="dwarffortress-${df_PV}"
+ dfhack_datadir="${GAMES_DATADIR}/${P}"
+ dfhack_docdir="/usr/share/doc/${P}"
+ dfhack_statedir="${GAMES_STATEDIR}/${P}"
+
+ if use egg; then
+ dfhack_libdir="$(games_get_libdir)"
+ else
+ dfhack_libdir="$(games_get_libdir)/${P}"
+ fi
+
+ QA_FLAGS_IGNORED=("${dfhack_libdir}"/libruby.so)
+ QA_PRESTRIPPED=("${dfhack_libdir}"/libruby.so)
+}
+
+src_unpack() {
+ git-r3_src_unpack
+ unpack ${A}
+ mv "${WORKDIR}"/libruby1.8.so.1.8.7 "${WORKDIR}"/libruby.so || die
+}
+
+src_prepare() {
+ # rm -r patches-master-$(date -I)/
+ # stg export -n -d patches-master-$(date -I) -e patch
+ # rm /usr/local/portage/games-util/dfhack/files/dfhack-0.40.06.9999/*
+ # cp patches-master-$(date -I)/* /usr/local/portage/games-util/dfhack/files/dfhack-0.40.06.9999/
+ epatch "${FILESDIR}"/${P}/*.patch
+
+ pushd "${S}"/depends/clsocket
+ epatch "${FILESDIR}"/clsocket/0001-Compile-static-library-as-PIC.patch
+ popd
+
+ #if use stonesense; then
+ # pushd "${S}"/plugins/stonesense
+ # epatch "${FILESDIR}"/stonesense-${PV}/01-null-isn-t-an-int32.patch
+ # epatch "${FILESDIR}"/stonesense-${PV}/02-configurable-install-paths.patch
+ # epatch "${FILESDIR}"/stonesense-${PV}/03-don-t-segfault-if-logfile-is.patch
+ # epatch "${FILESDIR}"/stonesense-${PV}/04-compile-time-configuration-of.patch
+ # epatch "${FILESDIR}"/stonesense-${PV}/05-compile-time-configurable-log.patch
+ # epatch "${FILESDIR}"/stonesense-${PV}/06-fix-b0rked-xml-file.patch
+ # epatch "${FILESDIR}"/stonesense-${PV}/07-compile-time-configurable-dump.patch
+ # epatch "${FILESDIR}"/stonesense-${PV}/08-compile-time-configurable.patch
+ # # Patches that no longer fit upstream, not updated yet.
+ # #epatch "${FILESDIR}"/stonesense/0003-screenshots-in-home-dir.patch
+ # popd
+ #fi
+ #if use isoworld; then
+ # pushd "${S}"/plugins/isoworld
+ # epatch "${FILESDIR}"/isoworld-${PV}/01-missing-include-dir.patch
+ # popd
+ # ewarn "The isoworld plugin requires agui, and will probably fail to build"
+ #fi
+
+ # Fix other scripts
+# if use dfusion; then
+# sed -f - -i plugins/Dfusion/luafiles/{init.lua,friendship/{init.lua,plugin.lua,install.lua},triggers/{plugin.lua,functions_menu.lua},friendship_civ/init.lua,common.lua,embark/{init.lua,plugin.lua},migrants/{init.lua,plugin.lua},xml_struct.lua,xml_types.lua} <<- EOF || die
+# s:("dfusion/:("${datadir}/dfusion/:
+# s:('dfusion/:('${datadir}/dfusion/:
+# EOF
+# sed -i "s:libs/Dwarf_Fortress:Dwarf_Fortress:" plugins/Dfusion/luafiles/common.lua
+# fi
+
+ ##Issues:
+ # - dfusion is strange. It's always been that, though.
+ # - prebuilt ruby
+ # - bundled lua
+ # - isoworld requires agui
+ # - prebuilt allegro for stonesense.
+ # - stonesense conf file: /usr/share/games/dfhack-9999/stonesense/init.txt
+ # Set in ./Config.cpp, installed together with the rest of the directory.
+ # - output files
+ # - - Make symlinks to (unversioned) /var
+}
+
+src_configure() {
+ # cmake -Wno-dev -LA .. | grep -v '^--' | sed -e 's/:\S*=/=/' -e 's/.*/"-D&"/'
+ mycmakeargs=(
+ #"-DBUILD_DEVEL=OFF"
+ "$(cmake-utils_use_build api DEVEL)"
+ #"-DBUILD_DEV_PLUGINS=OFF"
+ #"$(cmake-utils_use_build !minimal DEV_PLUGINS)"
+ "-DBUILD_DEV_PLUGINS=OFF"
+ #"-DBUILD_DFUSION=ON"
+ "$(cmake-utils_use_build dfusion DFUSION)"
+ #"-DBUILD_DOXYGEN=OFF"
+ "$(cmake-utils_use_build doc DOXYGEN)"
+ #"-DBUILD_DWARFEXPORT=ON"
+ "$(cmake-utils_use_build !minimal DWARFEXPORT)"
+ #"-DBUILD_EGGY=OFF"
+ "$(cmake-utils_use_build egg EGGY)"
+ #"-DBUILD_ISOWORLD=OFF"
+ "$(cmake-utils_use_build isoworld ISOWORLD)"
+ "-DBUILD_LIBRARY=ON"
+ #"-DBUILD_MAPEXPORT=ON"
+ "$(cmake-utils_use_build !minimal MAPEXPORT)"
+ "-DBUILD_PLUGINS=ON"
+ "-DBUILD_RUBY=ON"
+ "-DBUILD_SKELETON=OFF"
+ #"-DBUILD_STONESENSE=OFF"
+ "$(cmake-utils_use_build stonesense STONESENSE)"
+ #"-DBUILD_SUPPORTED=ON"
+ "$(cmake-utils_use_build !minimal SUPPORTED)"
+ #"-DCMAKE_INSTALL_PREFIX=/usr/local"
+ "-DCMAKE_INSTALL_PREFIX=${GAMES_DATADIR}"
+ "-DCONSOLE_NO_CATCH=OFF"
+ #"-DDFHACK_BINARY_DESTINATION=."
+ "-DDFHACK_BINARY_DESTINATION=${GAMES_BINDIR}"
+ #"-DDFHACK_DATA_DESTINATION=hack"
+ "-DDFHACK_DATA_DESTINATION=${dfhack_datadir}"
+ #"-DDFHACK_DEVDOC_DESTINATION=hack"
+ "-DDFHACK_DEVDOC_DESTINATION=${dfhack_docdir}/dev"
+ #"-DDFHACK_EGGY_DESTINATION=libs"
+ "-DDFHACK_EGGY_DESTINATION=${dfhack_libdir}"
+ #"-DDFHACK_INCLUDES_DESTINATION=hack/include"
+ "-DDFHACK_INCLUDES_DESTINATION=${GAMES_PREFIX}/include"
+ #"-DDFHACK_LIBRARY_DESTINATION=hack"
+ "-DDFHACK_LIBRARY_DESTINATION=${dfhack_libdir}"
+ #"-DDFHACK_LUA_DESTINATION=hack/lua"
+ "-DDFHACK_LUA_DESTINATION=${dfhack_datadir}/lua"
+ #"-DDFHACK_PLUGIN_DESTINATION=hack/plugins"
+ "-DDFHACK_PLUGIN_DESTINATION=${dfhack_datadir}/plugins"
+ #"-DDFHACK_RUBY_DESTINATION=hack/ruby"
+ "-DDFHACK_RUBY_DESTINATION=${dfhack_datadir}/ruby"
+ #"-DDFHACK_STATEDIR=."
+ "-DDFHACK_STATEDIR=${GAMES_STATEDIR}/${P}"
+ #"-DDFHACK_USERDOC_DESTINATION=hack"
+ "-DDFHACK_USERDOC_DESTINATION=${dfhack_docdir}"
+ #"-DDF_EXECUTABLE=./libs/Dwarf_Fortress"
+ "-DDF_EXECUTABLE=${df_executable}"
+ "-DDL_RUBY=OFF"
+ "-DRUBYLIB=${WORKDIR}/libruby.so"
+ )
+ # "-DSSENSE_ALLEGRO_DESTINATION=${dfhack_libdir}"
+ # "-DSSENSE_RES_DESTINATION=${dfhack_datadir}/stonesense"
+ # "-DSSENSE_DOC_DESTINATION=${dfhack_docdir}/stonesense"
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ cmake-utils_src_install
+ mv "${D%/}/${GAMES_BINDIR}/dfhack" \
+ "${D%/}/${GAMES_BINDIR}/dfhack-${df_PV}" || die
+ mv "${D%/}/${GAMES_BINDIR}/dfhack-run" \
+ "${D%/}/${GAMES_BINDIR}/dfhack-run-${df_PV}" || die
+ rm -f "${D%/}/${dfhack_docdir}"/LICENSE || die
+ dodir "${dfhack_statedir}"
+ if use stonesense; then
+ dodir "${GAMES_SYSCONFDIR#/}/${P}/stonesense"
+ mv "${D%/}/${dfhack_datadir#/}/stonesense/init.txt" \
+ "${D%/}/${GAMES_SYSCONFDIR#/}/${P}/stonesense/init.txt" || die
+ dosym "${ROOT}${GAMES_SYSCONFDIR#/}/${P}/stonesense/init.txt" \
+ "${dfhack_datadir#/}/stonesense/init.txt"
+ elog
+ elog "The Stonesense configuration file can be found at"
+ elog "${GAMES_SYSCONFDIR#/}/${P}/stonesense/init.txt"
+ fi
+ prepgamesdirs
+ fperms g+w "${dfhack_statedir}" || die
+ # userpriv: portage user needs to be able to link:
+ ! use egg || fperms o+rx "$(games_get_libdir)"/libegg.so || die
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ elog
+ elog "Due to Dwarf Fortress' special needs regarding working directory,"
+ elog "specifying relative paths to DFHack plugins can give unintended results."
+ elog
+ elog "DFHack installs custom raw files for dwarffortress in"
+ elog " ${dfhack_datadir}/raw"
+ elog "To use them, copy them into your raw folder and apply the diffs."
+ elog
+ elog "To start DFHack, please run dfhack-${df_PV}"
+}
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/01-compile-static-libraries-as.patch b/games-util/dfhack/files/dfhack-0.40.06.9999/01-compile-static-libraries-as.patch
new file mode 120000
index 00000000..5efdd5d0
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/01-compile-static-libraries-as.patch
@@ -0,0 +1 @@
+../dfhack-9999/01-compile-static-libraries-as.patch \ No newline at end of file
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/02-drop-strange-build-options.patch b/games-util/dfhack/files/dfhack-0.40.06.9999/02-drop-strange-build-options.patch
new file mode 100644
index 00000000..f7ab4f8e
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/02-drop-strange-build-options.patch
@@ -0,0 +1,52 @@
+drop strange build options
+
+From: eroen <eroen@occam.eroen.eu>
+
+
+---
+ CMakeLists.txt | 4 ++--
+ depends/lua/CMakeLists.txt | 2 +-
+ library/CMakeLists.txt | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 43a93a9..56ca990 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -105,8 +105,8 @@ OPTION(BUILD_PLUGINS "Build the plugins." ON)
+ IF(UNIX)
+ add_definitions(-DLINUX_BUILD)
+ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -Wall -Wno-unused-variable")
+- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -m32 -march=i686 -mtune=generic -std=c++0x")
+- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -m32 -march=i686 -mtune=generic")
++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -std=c++0x")
++ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+ ELSEIF(MSVC)
+ # for msvc, tell it to always use 8-byte pointers to member functions to avoid confusion
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /vmg /vmm /MP")
+diff --git a/depends/lua/CMakeLists.txt b/depends/lua/CMakeLists.txt
+index b77bce6..e39eb04 100644
+--- a/depends/lua/CMakeLists.txt
++++ b/depends/lua/CMakeLists.txt
+@@ -12,7 +12,7 @@ ENDIF()
+
+ IF(UNIX)
+ add_definitions(-DLINUX_BUILD)
+- SET(CMAKE_C_FLAGS "-m32")
++ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+ ENDIF()
+
+ SET (HDR_LIBLUA
+diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
+index e0ad360..9317ac3 100644
+--- a/library/CMakeLists.txt
++++ b/library/CMakeLists.txt
+@@ -223,7 +223,7 @@ ADD_CUSTOM_TARGET(generate_headers DEPENDS ${dfapi_SOURCE_DIR}/include/df/codege
+ IF(UNIX)
+ # Don't produce debug info for generated stubs
+ SET_SOURCE_FILES_PROPERTIES(DataStatics.cpp DataStaticsCtor.cpp DataStaticsFields.cpp
+- PROPERTIES COMPILE_FLAGS "-g0 -O1")
++ PROPERTIES COMPILE_FLAGS "-g0")
+ ELSE(WIN32)
+ SET_SOURCE_FILES_PROPERTIES(DataStatics.cpp DataStaticsCtor.cpp DataStaticsFields.cpp
+ PROPERTIES COMPILE_FLAGS "/O1 /bigobj")
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/03-configurable-install-paths.patch b/games-util/dfhack/files/dfhack-0.40.06.9999/03-configurable-install-paths.patch
new file mode 120000
index 00000000..05196d30
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/03-configurable-install-paths.patch
@@ -0,0 +1 @@
+../dfhack-9999/03-configurable-install-paths.patch \ No newline at end of file
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/04-compile-time-configurable.patch b/games-util/dfhack/files/dfhack-0.40.06.9999/04-compile-time-configurable.patch
new file mode 120000
index 00000000..aba03a3b
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/04-compile-time-configurable.patch
@@ -0,0 +1 @@
+../dfhack-9999/04-compile-time-configurable.patch \ No newline at end of file
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/05-compile-time-configurable-0.patch b/games-util/dfhack/files/dfhack-0.40.06.9999/05-compile-time-configurable-0.patch
new file mode 100644
index 00000000..df26fcd5
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/05-compile-time-configurable-0.patch
@@ -0,0 +1,66 @@
+compile-time configurable paths
+
+From: eroen <eroen@occam.eroen.eu>
+
+hack/
+./
+---
+ library/Core.cpp | 12 ++++++++++++
+ plugins/zone.cpp | 2 ++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/library/Core.cpp b/library/Core.cpp
+index 617ea42..128fc46 100644
+--- a/library/Core.cpp
++++ b/library/Core.cpp
+@@ -322,7 +322,11 @@ static command_result runRubyScript(color_ostream &out, PluginManager *plug_mgr,
+ rbcmd += "'" + args[i] + "', ";
+ rbcmd += "]\n";
+
++#ifdef DFHACK_DATA_DESTINATION
++ rbcmd += "catch(:script_finished) { load '" DFHACK_DATA_DESTINATION "/scripts/" + name + ".rb' }";
++#else
+ rbcmd += "catch(:script_finished) { load './hack/scripts/" + name + ".rb' }";
++#endif
+
+ return plug_mgr->ruby->eval_ruby(out, rbcmd.c_str());
+ }
+@@ -410,7 +414,11 @@ string findScript(string path, string name) {
+ if (fileExists(file)) {
+ return file;
+ }
++ #ifdef DFHACK_DATA_DESTINATION
++ file = string(DFHACK_DATA_DESTINATION) + "/scripts/" + name;
++ #else
+ file = path + "/hack/scripts/" + name;
++ #endif
+ if (fileExists(file)) {
+ return file;
+ }
+@@ -971,7 +979,11 @@ void Core::fatal (std::string output, bool deactivate)
+ std::string Core::getHackPath()
+ {
+ #ifdef LINUX_BUILD
++ #ifdef DFHACK_DATA_DESTINATION
++ return DFHACK_DATA_DESTINATION "/";
++ #else
+ return p->getPath() + "/hack/";
++ #endif
+ #else
+ return p->getPath() + "\\hack\\";
+ #endif
+diff --git a/plugins/zone.cpp b/plugins/zone.cpp
+index 5690ec2..b10d9d8 100644
+--- a/plugins/zone.cpp
++++ b/plugins/zone.cpp
+@@ -3182,8 +3182,10 @@ command_result df_autobutcher(color_ostream &out, vector <string> & parameters)
+ {
+ string run = "dfhack-run autobutcher ";
+ #ifdef LINUX_BUILD
++#ifndef DFHACK_DATA_DESTINATION
+ run = "./dfhack-run autobutcher ";
+ #endif
++#endif
+ // force creation of config
+ out << run << "start" << endl;
+
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/06-compile-time-configurable-1.patch b/games-util/dfhack/files/dfhack-0.40.06.9999/06-compile-time-configurable-1.patch
new file mode 100644
index 00000000..3969e1b8
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/06-compile-time-configurable-1.patch
@@ -0,0 +1,104 @@
+compile-time configurable state directory
+
+From: eroen <eroen@occam.eroen.eu>
+
+It'd be nice to write stuff somewhere writeable.
+---
+ CMakeLists.txt | 4 ++++
+ library/Console-posix.cpp | 4 ++++
+ library/Core.cpp | 8 ++++++++
+ library/Hooks-egg.cpp | 4 ++++
+ library/Hooks-linux.cpp | 4 ++++
+ 5 files changed, 24 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2b3b444..4cf44fe 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -64,6 +64,10 @@ SET(DFHACK_RELEASE "r0" CACHE STRING "Current release revision.")
+ set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}")
+ add_definitions(-DDFHACK_VERSION="${DFHACK_VERSION}")
+
++## where persistent things are written (and read) at runtime
++SET(DFHACK_STATEDIR "." CACHE PATH "DFHACK_STATEDIR")
++ADD_DEFINITIONS(-DDFHACK_STATEDIR="${DFHACK_STATEDIR}")
++
+ ## where to install things (after the build is done, classic 'make install' or package structure)
+ # the dfhack libraries will be installed here:
+ IF(UNIX)
+diff --git a/library/Console-posix.cpp b/library/Console-posix.cpp
+index fcc56b2..afbcd41 100644
+--- a/library/Console-posix.cpp
++++ b/library/Console-posix.cpp
+@@ -744,7 +744,11 @@ bool Console::init(bool sharing)
+ inited = false;
+ return false;
+ }
++ #ifdef DFHACK_STATEDIR
++ if (!freopen(DFHACK_STATEDIR "/stdout.log", "w", stdout))
++ #else
+ if (!freopen("stdout.log", "w", stdout))
++ #endif
+ ;
+ d = new Private();
+ // make our own weird streams so our IO isn't redirected
+diff --git a/library/Core.cpp b/library/Core.cpp
+index 128fc46..94a290d 100644
+--- a/library/Core.cpp
++++ b/library/Core.cpp
+@@ -882,7 +882,11 @@ void fIOthread(void * iodata)
+ PluginManager * plug_mgr = ((IODATA*) iodata)->plug_mgr;
+
+ CommandHistory main_history;
++ #ifdef DFHACK_STATEDIR
++ main_history.load(DFHACK_STATEDIR "/dfhack.history");
++ #else
+ main_history.load("dfhack.history");
++ #endif
+
+ Console & con = core->getConsole();
+ if (plug_mgr == 0)
+@@ -915,7 +919,11 @@ void fIOthread(void * iodata)
+ {
+ // a proper, non-empty command was entered
+ main_history.add(command);
++ #ifdef DFHACK_STATEDIR
++ main_history.save(DFHACK_STATEDIR "/dfhack.history");
++ #else
+ main_history.save("dfhack.history");
++ #endif
+ }
+
+ auto rv = core->runCommand(con, command);
+diff --git a/library/Hooks-egg.cpp b/library/Hooks-egg.cpp
+index c98cf5d..90df6af 100644
+--- a/library/Hooks-egg.cpp
++++ b/library/Hooks-egg.cpp
+@@ -37,7 +37,11 @@ distribution.
+ DFhackCExport int egg_init(void)
+ {
+ // reroute stderr
++ #ifdef DFHACK_STATEDIR
++ freopen(DFHACK_STATEDIR "/stderr.log", "w", stderr);
++ #else
+ freopen("stderr.log", "w", stderr);
++ #endif
+ // we don't reroute stdout until we figure out if this should be done at all
+ // See: Console-linux.cpp
+ fprintf(stderr,"dfhack: hooking successful\n");
+diff --git a/library/Hooks-linux.cpp b/library/Hooks-linux.cpp
+index 31c0323..42d86f3 100644
+--- a/library/Hooks-linux.cpp
++++ b/library/Hooks-linux.cpp
+@@ -114,7 +114,11 @@ static int (*_SDL_Init)(uint32_t flags) = 0;
+ DFhackCExport int SDL_Init(uint32_t flags)
+ {
+ // reroute stderr
++ #ifdef DFHACK_STATEDIR
++ freopen(DFHACK_STATEDIR "/stderr.log", "w", stderr);
++ #else
+ freopen("stderr.log", "w", stderr);
++ #endif
+ // we don't reroute stdout until we figure out if this should be done at all
+ // See: Console-linux.cpp
+
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/07-startup-scripts-configurable.patch b/games-util/dfhack/files/dfhack-0.40.06.9999/07-startup-scripts-configurable.patch
new file mode 100644
index 00000000..fbd888aa
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/07-startup-scripts-configurable.patch
@@ -0,0 +1,292 @@
+startup scripts - configurable paths
+
+From: eroen <eroen@occam.eroen.eu>
+
+
+---
+ CMakeLists.txt | 3 ++
+ library/CMakeLists.txt | 13 +++++++
+ package/linux/dfhack | 81 -------------------------------------------
+ package/linux/dfhack-run | 8 ----
+ package/linux/dfhack-run.in | 8 ++++
+ package/linux/dfhack.in | 81 +++++++++++++++++++++++++++++++++++++++++++
+ package/linux/egghack | 7 ----
+ package/linux/egghack.in | 7 ++++
+ 8 files changed, 112 insertions(+), 96 deletions(-)
+ delete mode 100755 package/linux/dfhack
+ delete mode 100755 package/linux/dfhack-run
+ create mode 100755 package/linux/dfhack-run.in
+ create mode 100755 package/linux/dfhack.in
+ delete mode 100755 package/linux/egghack
+ create mode 100755 package/linux/egghack.in
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4cf44fe..8719b23 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -68,6 +68,9 @@ add_definitions(-DDFHACK_VERSION="${DFHACK_VERSION}")
+ SET(DFHACK_STATEDIR "." CACHE PATH "DFHACK_STATEDIR")
+ ADD_DEFINITIONS(-DDFHACK_STATEDIR="${DFHACK_STATEDIR}")
+
++## what to call to start DF, configured into startup scripts
++SET(DF_EXECUTABLE "./libs/Dwarf_Fortress" CACHE STRING "DF_EXECUTABLE")
++
+ ## where to install things (after the build is done, classic 'make install' or package structure)
+ # the dfhack libraries will be installed here:
+ IF(UNIX)
+diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
+index 20bb2f6..24149ec 100644
+--- a/library/CMakeLists.txt
++++ b/library/CMakeLists.txt
+@@ -308,10 +308,23 @@ IF(UNIX)
+ DESTINATION .)
+ else()
+ # On linux, copy our version of the df launch script which sets LD_PRELOAD
++ configure_file(${dfhack_SOURCE_DIR}/package/linux/dfhack.in
++ ${dfhack_SOURCE_DIR}/package/linux/dfhack
++ @ONLY)
++ configure_file(${dfhack_SOURCE_DIR}/package/linux/dfhack-run.in
++ ${dfhack_SOURCE_DIR}/package/linux/dfhack-run
++ @ONLY)
++ configure_file(${dfhack_SOURCE_DIR}/package/linux/egghack.in
++ ${dfhack_SOURCE_DIR}/package/linux/egghack
++ @ONLY)
+ install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/dfhack
+ DESTINATION ${DFHACK_BINARY_DESTINATION})
+ install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/dfhack-run
+ DESTINATION ${DFHACK_BINARY_DESTINATION})
++ if(BUILD_EGGY)
++ install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/egghack
++ DESTINATION ${DFHACK_BINARY_DESTINATION})
++ endif()
+ endif()
+ ELSE()
+ if(NOT BUILD_EGGY)
+diff --git a/package/linux/dfhack b/package/linux/dfhack
+deleted file mode 100755
+index bc8b6d2..0000000
+--- a/package/linux/dfhack
++++ /dev/null
+@@ -1,81 +0,0 @@
+-#!/bin/sh
+-
+-# NOTE: This is dfhack's modification of the normal invocation script,
+-# changed to properly set LD_PRELOAD so as to run DFHACK.
+-#
+-# You can run DF under gdb by passing -g or --gdb as the first argument.
+-#
+-# If the file ".dfhackrc" exists in the DF directory or your home directory
+-# it will be sourced by this script, to let you set environmental variables.
+-# If it exists in both places it will first source the one in your home
+-# directory, then the on in the game directory.
+-#
+-# Shell variables .dfhackrc can set to affect this script:
+-# DF_GDB_OPTS: Options to pass to gdb, if it's being run
+-# DF_VALGRIND_OPTS: Options to pass to valgrind, if it's being run
+-# DF_HELGRIND_OPTS: Options to pass to helgrind, if it's being run
+-# DF_POST_CMD: Shell command to be run at very end of script
+-
+-DF_DIR=$(dirname "$0")
+-cd "${DF_DIR}"
+-export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch.
+-#export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing.
+-
+-# User config files
+-RC=".dfhackrc"
+-
+-if [ -r "$HOME/$RC" ]; then
+- . $HOME/$RC
+-fi
+-if [ -r "./$RC" ]; then
+- . "./$RC"
+-fi
+-
+-# Save current terminal settings
+-old_tty_settings=$(stty -g)
+-
+-# Now run
+-
+-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"./hack/libs":"./hack"
+-
+-PRELOAD_LIB=./hack/libdfhack.so
+-
+-case "$1" in
+- -g | --gdb)
+- shift
+- echo "set environment LD_PRELOAD=$PRELOAD_LIB" > gdbcmd.tmp
+- echo "set environment MALLOC_PERTURB_=45" >> gdbcmd.tmp
+- gdb $DF_GDB_OPTS -x gdbcmd.tmp ./libs/Dwarf_Fortress "$@"
+- rm gdbcmd.tmp
+- ret=$?
+- ;;
+- -h | --helgrind)
+- shift
+- LD_PRELOAD=$PRELOAD_LIB setarch i386 -R valgrind $DF_HELGRIND_OPTS --tool=helgrind --log-file=helgrind.log ./libs/Dwarf_Fortress "$@"
+- ret=$?
+- ;;
+- -v | --valgrind)
+- shift
+- LD_PRELOAD=$PRELOAD_LIB setarch i386 -R valgrind $DF_VALGRIND_OPTS --log-file=valgrind.log ./libs/Dwarf_Fortress "$@"
+- ret=$?
+- ;;
+- -c | --callgrind)
+- shift
+- LD_PRELOAD=$PRELOAD_LIB setarch i386 -R valgrind $DF_CALLGRIND_OPTS --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log ./libs/Dwarf_Fortress "$@"
+- ret=$?
+- ;;
+- *)
+- setarch i386 -R env LD_PRELOAD=$PRELOAD_LIB ./libs/Dwarf_Fortress "$@"
+- ret=$?
+- ;;
+-esac
+-
+-# Restore previous terminal settings
+-stty "$old_tty_settings"
+-echo -e "\n"
+-
+-if [ -n "$DF_POST_CMD" ]; then
+- eval $DF_POST_CMD
+-fi
+-
+-exit $ret
+diff --git a/package/linux/dfhack-run b/package/linux/dfhack-run
+deleted file mode 100755
+index 55001cf..0000000
+--- a/package/linux/dfhack-run
++++ /dev/null
+@@ -1,8 +0,0 @@
+-#!/bin/sh
+-
+-DF_DIR=$(dirname "$0")
+-cd "${DF_DIR}"
+-
+-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"./hack/libs":"./hack"
+-
+-exec hack/dfhack-run "$@"
+diff --git a/package/linux/dfhack-run.in b/package/linux/dfhack-run.in
+new file mode 100755
+index 0000000..f013053
+--- /dev/null
++++ b/package/linux/dfhack-run.in
+@@ -0,0 +1,8 @@
++#!/bin/sh
++
++DF_DIR=$(dirname "$0")
++cd "${DF_DIR}"
++
++export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"@DFHACK_LIBRARY_DESTINATION@"/libs:"@DFHACK_LIBRARY_DESTINATION@"
++
++exec "@DFHACK_LIBRARY_DESTINATION@"/dfhack-run "${@}"
+diff --git a/package/linux/dfhack.in b/package/linux/dfhack.in
+new file mode 100755
+index 0000000..55dde73
+--- /dev/null
++++ b/package/linux/dfhack.in
+@@ -0,0 +1,81 @@
++#!/bin/sh
++
++# NOTE: This is dfhack's modification of the normal invocation script,
++# changed to properly set LD_PRELOAD so as to run DFHACK.
++#
++# You can run DF under gdb by passing -g or --gdb as the first argument.
++#
++# If the file ".dfhackrc" exists in the DF directory or your home directory
++# it will be sourced by this script, to let you set environmental variables.
++# If it exists in both places it will first source the one in your home
++# directory, then the on in the game directory.
++#
++# Shell variables .dfhackrc can set to affect this script:
++# DF_GDB_OPTS: Options to pass to gdb, if it's being run
++# DF_VALGRIND_OPTS: Options to pass to valgrind, if it's being run
++# DF_HELGRIND_OPTS: Options to pass to helgrind, if it's being run
++# DF_POST_CMD: Shell command to be run at very end of script
++
++DF_DIR=$(dirname "$0")
++cd "${DF_DIR}"
++export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch.
++#export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing.
++
++# User config files
++RC=".dfhackrc"
++
++if [ -r "$HOME/$RC" ]; then
++ . $HOME/$RC
++fi
++if [ -r "./$RC" ]; then
++ . "./$RC"
++fi
++
++# Save current terminal settings
++old_tty_settings=$(stty -g)
++
++# Now run
++
++export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"@DFHACK_LIBRARY_DESTINATION@"/libs:"@DFHACK_LIBRARY_DESTINATION@"
++
++PRELOAD_LIB=./hack/libdfhack.so
++
++case "$1" in
++ -g | --gdb)
++ shift
++ echo "set environment LD_PRELOAD=@DFHACK_LIBRARY_DESTINATION@/libdfhack.so" > gdbcmd.tmp
++ echo "set environment MALLOC_PERTURB_=45" >> gdbcmd.tmp
++ gdb ${DF_GDB_OPTS} -x gdbcmd.tmp "@DF_EXECUTABLE@" "${@}"
++ rm gdbcmd.tmp
++ ret=$?
++ ;;
++ -h | --helgrind)
++ shift
++ LD_PRELOAD="@DFHACK_LIBRARY_DESTINATION@"/libdfhack.so setarch i386 -R valgrind ${DF_HELGRIND_OPTS} --tool=helgrind --log-file=helgrind.log "@DF_EXECUTABLE@" "${@}"
++ ret=$?
++ ;;
++ -v | --valgrind)
++ shift
++ LD_PRELOAD="@DFHACK_LIBRARY_DESTINATION@"/libdfhack.so setarch i386 -R valgrind ${DF_VALGRIND_OPTS} --log-file=valgrind.log "@DF_EXECUTABLE@" "${@}"
++ ret=$?
++ ;;
++ -c | --callgrind)
++ shift
++ LD_PRELOAD="@DFHACK_LIBRARY_DESTINATION@"/libdfhack.so setarch i386 -R valgrind ${DF_CALLGRIND_OPTS} --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log "@DF_EXECUTABLE@" "${@}"
++ ret=$?
++ ;;
++ *)
++ setarch i386 -R env LD_PRELOAD="@DFHACK_LIBRARY_DESTINATION@"/libdfhack.so "@DF_EXECUTABLE@" "${@}"
++ ret=$?
++ ;;
++esac
++
++# Restore previous terminal settings
++stty "$old_tty_settings"
++echo -e "\n"
++
++if [ -n "$DF_POST_CMD" ]; then
++ eval $DF_POST_CMD
++fi
++
++exit $ret
+diff --git a/package/linux/egghack b/package/linux/egghack
+deleted file mode 100755
+index 5b3b03b..0000000
+--- a/package/linux/egghack
++++ /dev/null
+@@ -1,7 +0,0 @@
+-#!/bin/sh
+-DF_DIR=$(dirname "$0")
+-cd "${DF_DIR}"
+-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"./hack/libs":"./hack"
+-export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch.
+-#export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing.
+-./libs/Dwarf_Fortress $* # Go, go, go! :)
+diff --git a/package/linux/egghack.in b/package/linux/egghack.in
+new file mode 100755
+index 0000000..4bf4c9d
+--- /dev/null
++++ b/package/linux/egghack.in
+@@ -0,0 +1,7 @@
++#!/bin/sh
++DF_DIR=$(dirname "$0")
++cd "${DF_DIR}"
++export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"@DFHACK_LIBRARY_DESTINATION@"/libs:"@DFHACK_LIBRARY_DESTINATION@"
++export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch.
++#export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing.
++"@DF_EXECUTABLE@" ${*} # Go, go, go! :)
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/08-ruby-plugin-configurable-paths.patch b/games-util/dfhack/files/dfhack-0.40.06.9999/08-ruby-plugin-configurable-paths.patch
new file mode 100644
index 00000000..3fb1e8b2
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/08-ruby-plugin-configurable-paths.patch
@@ -0,0 +1,541 @@
+ruby plugin - configurable paths
+
+From: eroen <eroen@occam.eroen.eu>
+
+
+---
+ plugins/ruby/CMakeLists.txt | 4 +
+ plugins/ruby/ruby.rb | 247 -------------------------------------------
+ plugins/ruby/ruby.rb.in | 247 +++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 251 insertions(+), 247 deletions(-)
+ delete mode 100644 plugins/ruby/ruby.rb
+ create mode 100644 plugins/ruby/ruby.rb.in
+
+diff --git a/plugins/ruby/CMakeLists.txt b/plugins/ruby/CMakeLists.txt
+index e6d3eff..b282751 100644
+--- a/plugins/ruby/CMakeLists.txt
++++ b/plugins/ruby/CMakeLists.txt
+@@ -27,6 +27,8 @@ ADD_CUSTOM_COMMAND(
+ )
+ ADD_CUSTOM_TARGET(ruby-autogen-rb DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ruby-autogen.rb)
+
++CONFIGURE_FILE(ruby.rb.in ruby.rb @ONLY)
++
+ INCLUDE_DIRECTORIES("${dfhack_SOURCE_DIR}/depends/tthread")
+
+ DFHACK_PLUGIN(ruby ruby.cpp LINK_LIBRARIES dfhack-tinythread)
+@@ -34,6 +36,8 @@ ADD_DEPENDENCIES(ruby ruby-autogen-rb)
+
+ INSTALL(FILES ${RUBYLIB} DESTINATION ${DFHACK_LIBRARY_DESTINATION})
+
++INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ruby.rb DESTINATION ${DFHACK_RUBY_DESTINATION})
++
+ INSTALL(DIRECTORY .
+ DESTINATION ${DFHACK_RUBY_DESTINATION}
+ FILES_MATCHING PATTERN "*.rb")
+diff --git a/plugins/ruby/ruby.rb b/plugins/ruby/ruby.rb
+deleted file mode 100644
+index edce8ac..0000000
+--- a/plugins/ruby/ruby.rb
++++ /dev/null
+@@ -1,247 +0,0 @@
+-# redefine standard i/o methods to use the dfhack console
+-module Kernel
+- def puts(*a)
+- a.flatten.each { |l|
+- DFHack.print_str(l.to_s.chomp + "\n")
+- }
+- nil
+- end
+-
+- def puts_err(*a)
+- a.flatten.each { |l|
+- DFHack.print_err(l.to_s.chomp + "\n")
+- }
+- nil
+- end
+-
+- def p(*a)
+- a.each { |e|
+- puts_err e.inspect
+- }
+- nil
+- end
+-end
+-
+-module DFHack
+- VERSION = version
+-
+- class OnupdateCallback
+- attr_accessor :callback, :timelimit, :minyear, :minyeartick, :description
+- def initialize(descr, cb, tl, initdelay=0)
+- @description = descr
+- @callback = cb
+- @ticklimit = tl
+- @minyear = (tl ? df.cur_year : 0)
+- @minyeartick = (tl ? df.cur_year_tick+initdelay : 0)
+- end
+-
+- # run callback if timedout
+- def check_run(year, yeartick, yearlen)
+- if @ticklimit
+- return unless year > @minyear or (year == @minyear and yeartick >= @minyeartick)
+- @minyear = year
+- @minyeartick = yeartick + @ticklimit
+- if @minyeartick > yearlen
+- @minyear += 1
+- @minyeartick -= yearlen
+- end
+- end
+- # t0 = Time.now
+- @callback.call
+- # dt = Time.now - t0 ; puts "rb cb #@description took #{'%.02f' % dt}s" if dt > 0.1
+- rescue Exception
+- df.onupdate_unregister self
+- puts_err "onupdate #@description unregistered: #$!", $!.backtrace
+- end
+-
+- def <=>(o)
+- [@minyear, @minyeartick] <=> [o.minyear, o.minyeartick]
+- end
+- end
+-
+- class << self
+- attr_accessor :onupdate_list, :onstatechange_list
+-
+- # register a callback to be called every gframe or more
+- # ex: DFHack.onupdate_register('fastdwarf') { DFHack.world.units[0].counters.job_counter = 0 }
+- # if ticklimit is given, do not call unless this much game ticks have passed. Handles advmode time stretching.
+- def onupdate_register(descr, ticklimit=nil, initialtickdelay=0, &b)
+- raise ArgumentError, 'need a description as 1st arg' unless descr.kind_of?(::String)
+- @onupdate_list ||= []
+- @onupdate_list << OnupdateCallback.new(descr, b, ticklimit, initialtickdelay)
+- DFHack.onupdate_active = true
+- if onext = @onupdate_list.sort.first
+- DFHack.onupdate_minyear = onext.minyear
+- DFHack.onupdate_minyeartick = onext.minyeartick
+- end
+- @onupdate_list.last
+- end
+-
+- # delete the callback for onupdate ; use the value returned by onupdate_register or the description
+- def onupdate_unregister(b)
+- b = @onupdate_list.find { |bb| bb.description == b } if b.kind_of?(String)
+- @onupdate_list.delete b
+- if @onupdate_list.empty?
+- DFHack.onupdate_active = false
+- DFHack.onupdate_minyear = DFHack.onupdate_minyeartick = DFHack.onupdate_minyeartickadv = -1
+- end
+- end
+-
+- # same as onupdate_register, but remove the callback once it returns true
+- def onupdate_register_once(*a)
+- handle = onupdate_register(*a) {
+- onupdate_unregister(handle) if yield
+- }
+- end
+-
+- TICKS_PER_YEAR = 1200*28*12
+- # this method is called by ruby.cpp if df.onupdate_active is true
+- def onupdate
+- @onupdate_list ||= []
+-
+- y = cur_year
+- ytmax = TICKS_PER_YEAR
+- if df.gamemode == :ADVENTURE and df.respond_to?(:cur_year_tick_advmode)
+- yt = cur_year_tick_advmode
+- ytmax *= 144
+- else
+- yt = cur_year_tick
+- end
+-
+- @onupdate_list.each { |o|
+- o.check_run(y, yt, ytmax)
+- }
+-
+- if onext = @onupdate_list.sort.first
+- DFHack.onupdate_minyear = onext.minyear
+- if ytmax > TICKS_PER_YEAR
+- DFHack.onupdate_minyeartick = -1
+- DFHack.onupdate_minyeartickadv = onext.minyeartick
+- else
+- DFHack.onupdate_minyeartick = onext.minyeartick
+- DFHack.onupdate_minyeartickadv = -1
+- end
+- end
+- end
+-
+- # register a callback to be called every gframe or more
+- # ex: DFHack.onstatechange_register { |newstate| puts "state changed to #{newstate}" }
+- def onstatechange_register(&b)
+- @onstatechange_list ||= []
+- @onstatechange_list << b
+- @onstatechange_list.last
+- end
+-
+- # delete the callback for onstatechange ; use the value returned by onstatechange_register
+- def onstatechange_unregister(b)
+- @onstatechange_list.delete b
+- end
+-
+- # same as onstatechange_register, but auto-unregisters if the block returns true
+- def onstatechange_register_once
+- handle = onstatechange_register { |st|
+- onstatechange_unregister(handle) if yield(st)
+- }
+- end
+-
+-
+- # this method is called by dfhack every 'onstatechange'
+- def onstatechange(newstate)
+- @onstatechange_list ||= []
+- @onstatechange_list.each { |cb| cb.call(newstate) }
+- end
+-
+- # return true if the argument is under the cursor
+- def at_cursor?(obj)
+- same_pos?(obj, cursor)
+- end
+-
+- # returns true if both arguments are at the same x/y/z
+- def same_pos?(pos1, pos2)
+- pos1 = pos1.pos if pos1.respond_to?(:pos)
+- pos2 = pos2.pos if pos2.respond_to?(:pos)
+- pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z
+- end
+-
+- # try to match a user-specified name to one from the raws
+- # uses case-switching and substring matching
+- # eg match_rawname('coal', ['COAL_BITUMINOUS', 'BAUXITE']) => 'COAL_BITUMINOUS'
+- def match_rawname(name, rawlist)
+- rawlist.each { |r| return r if name == r }
+- rawlist.each { |r| return r if name.downcase == r.downcase }
+- may = rawlist.find_all { |r| r.downcase.index(name.downcase) }
+- may.first if may.length == 1
+- end
+-
+- def translate_name(name, english=true, onlylastpart=false)
+- out = []
+-
+- if not onlylastpart
+- out << name.first_name if name.first_name != ''
+- if name.nickname != ''
+- case respond_to?(:d_init) && d_init.nickname_dwarf
+- when :REPLACE_ALL; return "`#{name.nickname}'"
+- when :REPLACE_FIRST; out.pop
+- end
+- out << "`#{name.nickname}'"
+- end
+- end
+- return out.join(' ') unless name.words.find { |w| w >= 0 }
+-
+- if not english
+- tsl = world.raws.language.translations[name.language]
+- if name.words[0] >= 0 or name.words[1] >= 0
+- out << ''
+- out.last << tsl.words[name.words[0]] if name.words[0] >= 0
+- out.last << tsl.words[name.words[1]] if name.words[1] >= 0
+- end
+- if name.words[5] >= 0
+- out << ''
+- (2..5).each { |i| out.last << tsl.words[name.words[i]] if name.words[i] >= 0 }
+- end
+- if name.words[6] >= 0
+- out << tsl.words[name.words[6]]
+- end
+- else
+- wl = world.raws.language
+- if name.words[0] >= 0 or name.words[1] >= 0
+- out << ''
+- out.last << wl.words[name.words[0]].forms[name.parts_of_speech[0]] if name.words[0] >= 0
+- out.last << wl.words[name.words[1]].forms[name.parts_of_speech[1]] if name.words[1] >= 0
+- end
+- if name.words[5] >= 0
+- out << 'the'
+- out.last.capitalize! if out.length == 1
+- out << wl.words[name.words[2]].forms[name.parts_of_speech[2]] if name.words[2] >= 0
+- out << wl.words[name.words[3]].forms[name.parts_of_speech[3]] if name.words[3] >= 0
+- if name.words[4] >= 0
+- out << wl.words[name.words[4]].forms[name.parts_of_speech[4]]
+- out.last << '-'
+- else
+- out << ''
+- end
+- out.last << wl.words[name.words[5]].forms[name.parts_of_speech[5]]
+- end
+- if name.words[6] >= 0
+- out << 'of'
+- out.last.capitalize! if out.length == 1
+- out << wl.words[name.words[6]].forms[name.parts_of_speech[6]]
+- end
+- end
+-
+- out.join(' ')
+- end
+- end
+-end
+-
+-# global alias so we can write 'df.world.units.all[0]'
+-def df
+- DFHack
+-end
+-
+-# load autogenned file
+-require './hack/ruby/ruby-autogen-defs'
+-require './hack/ruby/ruby-autogen'
+-
+-# load all modules
+-Dir['./hack/ruby/*.rb'].each { |m| require m.chomp('.rb') }
+diff --git a/plugins/ruby/ruby.rb.in b/plugins/ruby/ruby.rb.in
+new file mode 100644
+index 0000000..d8edec8
+--- /dev/null
++++ b/plugins/ruby/ruby.rb.in
+@@ -0,0 +1,247 @@
++# redefine standard i/o methods to use the dfhack console
++module Kernel
++ def puts(*a)
++ a.flatten.each { |l|
++ DFHack.print_str(l.to_s.chomp + "\n")
++ }
++ nil
++ end
++
++ def puts_err(*a)
++ a.flatten.each { |l|
++ DFHack.print_err(l.to_s.chomp + "\n")
++ }
++ nil
++ end
++
++ def p(*a)
++ a.each { |e|
++ puts_err e.inspect
++ }
++ nil
++ end
++end
++
++module DFHack
++ VERSION = version
++
++ class OnupdateCallback
++ attr_accessor :callback, :timelimit, :minyear, :minyeartick, :description
++ def initialize(descr, cb, tl, initdelay=0)
++ @description = descr
++ @callback = cb
++ @ticklimit = tl
++ @minyear = (tl ? df.cur_year : 0)
++ @minyeartick = (tl ? df.cur_year_tick+initdelay : 0)
++ end
++
++ # run callback if timedout
++ def check_run(year, yeartick, yearlen)
++ if @ticklimit
++ return unless year > @minyear or (year == @minyear and yeartick >= @minyeartick)
++ @minyear = year
++ @minyeartick = yeartick + @ticklimit
++ if @minyeartick > yearlen
++ @minyear += 1
++ @minyeartick -= yearlen
++ end
++ end
++ # t0 = Time.now
++ @callback.call
++ # dt = Time.now - t0 ; puts "rb cb #@description took #{'%.02f' % dt}s" if dt > 0.1
++ rescue Exception
++ df.onupdate_unregister self
++ puts_err "onupdate #@description unregistered: #$!", $!.backtrace
++ end
++
++ def <=>(o)
++ [@minyear, @minyeartick] <=> [o.minyear, o.minyeartick]
++ end
++ end
++
++ class << self
++ attr_accessor :onupdate_list, :onstatechange_list
++
++ # register a callback to be called every gframe or more
++ # ex: DFHack.onupdate_register('fastdwarf') { DFHack.world.units[0].counters.job_counter = 0 }
++ # if ticklimit is given, do not call unless this much game ticks have passed. Handles advmode time stretching.
++ def onupdate_register(descr, ticklimit=nil, initialtickdelay=0, &b)
++ raise ArgumentError, 'need a description as 1st arg' unless descr.kind_of?(::String)
++ @onupdate_list ||= []
++ @onupdate_list << OnupdateCallback.new(descr, b, ticklimit, initialtickdelay)
++ DFHack.onupdate_active = true
++ if onext = @onupdate_list.sort.first
++ DFHack.onupdate_minyear = onext.minyear
++ DFHack.onupdate_minyeartick = onext.minyeartick
++ end
++ @onupdate_list.last
++ end
++
++ # delete the callback for onupdate ; use the value returned by onupdate_register or the description
++ def onupdate_unregister(b)
++ b = @onupdate_list.find { |bb| bb.description == b } if b.kind_of?(String)
++ @onupdate_list.delete b
++ if @onupdate_list.empty?
++ DFHack.onupdate_active = false
++ DFHack.onupdate_minyear = DFHack.onupdate_minyeartick = DFHack.onupdate_minyeartickadv = -1
++ end
++ end
++
++ # same as onupdate_register, but remove the callback once it returns true
++ def onupdate_register_once(*a)
++ handle = onupdate_register(*a) {
++ onupdate_unregister(handle) if yield
++ }
++ end
++
++ TICKS_PER_YEAR = 1200*28*12
++ # this method is called by ruby.cpp if df.onupdate_active is true
++ def onupdate
++ @onupdate_list ||= []
++
++ y = cur_year
++ ytmax = TICKS_PER_YEAR
++ if df.gamemode == :ADVENTURE and df.respond_to?(:cur_year_tick_advmode)
++ yt = cur_year_tick_advmode
++ ytmax *= 144
++ else
++ yt = cur_year_tick
++ end
++
++ @onupdate_list.each { |o|
++ o.check_run(y, yt, ytmax)
++ }
++
++ if onext = @onupdate_list.sort.first
++ DFHack.onupdate_minyear = onext.minyear
++ if ytmax > TICKS_PER_YEAR
++ DFHack.onupdate_minyeartick = -1
++ DFHack.onupdate_minyeartickadv = onext.minyeartick
++ else
++ DFHack.onupdate_minyeartick = onext.minyeartick
++ DFHack.onupdate_minyeartickadv = -1
++ end
++ end
++ end
++
++ # register a callback to be called every gframe or more
++ # ex: DFHack.onstatechange_register { |newstate| puts "state changed to #{newstate}" }
++ def onstatechange_register(&b)
++ @onstatechange_list ||= []
++ @onstatechange_list << b
++ @onstatechange_list.last
++ end
++
++ # delete the callback for onstatechange ; use the value returned by onstatechange_register
++ def onstatechange_unregister(b)
++ @onstatechange_list.delete b
++ end
++
++ # same as onstatechange_register, but auto-unregisters if the block returns true
++ def onstatechange_register_once
++ handle = onstatechange_register { |st|
++ onstatechange_unregister(handle) if yield(st)
++ }
++ end
++
++
++ # this method is called by dfhack every 'onstatechange'
++ def onstatechange(newstate)
++ @onstatechange_list ||= []
++ @onstatechange_list.each { |cb| cb.call(newstate) }
++ end
++
++ # return true if the argument is under the cursor
++ def at_cursor?(obj)
++ same_pos?(obj, cursor)
++ end
++
++ # returns true if both arguments are at the same x/y/z
++ def same_pos?(pos1, pos2)
++ pos1 = pos1.pos if pos1.respond_to?(:pos)
++ pos2 = pos2.pos if pos2.respond_to?(:pos)
++ pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z
++ end
++
++ # try to match a user-specified name to one from the raws
++ # uses case-switching and substring matching
++ # eg match_rawname('coal', ['COAL_BITUMINOUS', 'BAUXITE']) => 'COAL_BITUMINOUS'
++ def match_rawname(name, rawlist)
++ rawlist.each { |r| return r if name == r }
++ rawlist.each { |r| return r if name.downcase == r.downcase }
++ may = rawlist.find_all { |r| r.downcase.index(name.downcase) }
++ may.first if may.length == 1
++ end
++
++ def translate_name(name, english=true, onlylastpart=false)
++ out = []
++
++ if not onlylastpart
++ out << name.first_name if name.first_name != ''
++ if name.nickname != ''
++ case respond_to?(:d_init) && d_init.nickname_dwarf
++ when :REPLACE_ALL; return "`#{name.nickname}'"
++ when :REPLACE_FIRST; out.pop
++ end
++ out << "`#{name.nickname}'"
++ end
++ end
++ return out.join(' ') unless name.words.find { |w| w >= 0 }
++
++ if not english
++ tsl = world.raws.language.translations[name.language]
++ if name.words[0] >= 0 or name.words[1] >= 0
++ out << ''
++ out.last << tsl.words[name.words[0]] if name.words[0] >= 0
++ out.last << tsl.words[name.words[1]] if name.words[1] >= 0
++ end
++ if name.words[5] >= 0
++ out << ''
++ (2..5).each { |i| out.last << tsl.words[name.words[i]] if name.words[i] >= 0 }
++ end
++ if name.words[6] >= 0
++ out << tsl.words[name.words[6]]
++ end
++ else
++ wl = world.raws.language
++ if name.words[0] >= 0 or name.words[1] >= 0
++ out << ''
++ out.last << wl.words[name.words[0]].forms[name.parts_of_speech[0]] if name.words[0] >= 0
++ out.last << wl.words[name.words[1]].forms[name.parts_of_speech[1]] if name.words[1] >= 0
++ end
++ if name.words[5] >= 0
++ out << 'the'
++ out.last.capitalize! if out.length == 1
++ out << wl.words[name.words[2]].forms[name.parts_of_speech[2]] if name.words[2] >= 0
++ out << wl.words[name.words[3]].forms[name.parts_of_speech[3]] if name.words[3] >= 0
++ if name.words[4] >= 0
++ out << wl.words[name.words[4]].forms[name.parts_of_speech[4]]
++ out.last << '-'
++ else
++ out << ''
++ end
++ out.last << wl.words[name.words[5]].forms[name.parts_of_speech[5]]
++ end
++ if name.words[6] >= 0
++ out << 'of'
++ out.last.capitalize! if out.length == 1
++ out << wl.words[name.words[6]].forms[name.parts_of_speech[6]]
++ end
++ end
++
++ out.join(' ')
++ end
++ end
++end
++
++# global alias so we can write 'df.world.units.all[0]'
++def df
++ DFHack
++end
++
++# load autogenned file
++require '@DFHACK_RUBY_DESTINATION@/ruby-autogen-defs'
++require '@DFHACK_RUBY_DESTINATION@/ruby-autogen'
++
++# load all modules
++Dir['@DFHACK_RUBY_DESTINATION@/*.rb'].each { |m| require m.chomp('.rb') }
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/09-getpath-configurable-path.patch b/games-util/dfhack/files/dfhack-0.40.06.9999/09-getpath-configurable-path.patch
new file mode 100644
index 00000000..2f941b3d
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/09-getpath-configurable-path.patch
@@ -0,0 +1,46 @@
+getPath() - configurable path
+
+From: eroen <eroen@occam.eroen.eu>
+
+
+---
+ library/Core.cpp | 4 ++++
+ library/Process-linux.cpp | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/library/Core.cpp b/library/Core.cpp
+index 94a290d..386b89b 100644
+--- a/library/Core.cpp
++++ b/library/Core.cpp
+@@ -422,6 +422,10 @@ string findScript(string path, string name) {
+ if (fileExists(file)) {
+ return file;
+ }
++ file = path + "/scripts/" + name;
++ if (fileExists(file)) {
++ return file;
++ }
+ return "";
+ }
+
+diff --git a/library/Process-linux.cpp b/library/Process-linux.cpp
+index 1b430e5..210a625 100644
+--- a/library/Process-linux.cpp
++++ b/library/Process-linux.cpp
+@@ -190,12 +190,16 @@ uint32_t Process::getTickCount()
+
+ string Process::getPath()
+ {
++ #ifdef DFHACK_DATA_DESTINATION
++ return string(DFHACK_DATA_DESTINATION);
++ #else
+ const char * cwd_name = "/proc/self/cwd";
+ char target_name[1024];
+ int target_result;
+ target_result = readlink(cwd_name, target_name, sizeof(target_name));
+ target_name[target_result] = '\0';
+ return(string(target_name));
++ #endif
+ }
+
+ int Process::getPID()
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/10-eggy-remove-annoying-banner.patch b/games-util/dfhack/files/dfhack-0.40.06.9999/10-eggy-remove-annoying-banner.patch
new file mode 100644
index 00000000..c8fbdd15
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/10-eggy-remove-annoying-banner.patch
@@ -0,0 +1,22 @@
+eggy - remove annoying banner
+
+From: eroen <eroen@occam.eroen.eu>
+
+
+---
+ library/Core.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/library/Core.cpp b/library/Core.cpp
+index 386b89b..8906f85 100644
+--- a/library/Core.cpp
++++ b/library/Core.cpp
+@@ -1111,7 +1111,7 @@ bool Core::Init()
+ // set up hotkey capture
+ thread * HK = new thread(fHKthread, (void *) temp);
+ screen_window = new Windows::top_level_window();
+- screen_window->addChild(new Windows::dfhack_dummy(5,10));
++ //screen_window->addChild(new Windows::dfhack_dummy(5,10));
+ started = true;
+
+ cerr << "Starting the TCP listener.\n";
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/11-debugging.patch b/games-util/dfhack/files/dfhack-0.40.06.9999/11-debugging.patch
new file mode 100644
index 00000000..80848422
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/11-debugging.patch
@@ -0,0 +1,22 @@
+debugging
+
+From: eroen <eroen@occam.eroen.eu>
+
+
+---
+ library/Core.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/library/Core.cpp b/library/Core.cpp
+index 8906f85..dd5725d 100644
+--- a/library/Core.cpp
++++ b/library/Core.cpp
+@@ -400,6 +400,8 @@ static bool try_autocomplete(color_ostream &con, const std::string &first, std::
+ }
+
+ string findScript(string path, string name) {
++ cerr << "findScript(" << path << ", " << name << std::endl;
++
+ if (df::global::world) {
+ //first try the save folder if it exists
+ string save = World::ReadWorldFolder();
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/12-unbreak-egg.patch b/games-util/dfhack/files/dfhack-0.40.06.9999/12-unbreak-egg.patch
new file mode 100644
index 00000000..0d23872b
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/12-unbreak-egg.patch
@@ -0,0 +1,24 @@
+Unbreak egg
+
+From: eroen <eroen@occam.eroen.eu>
+
+See:
+ commit fc24d24ccc2147fff61e309bcb2167b9709249b6
+ Merge Console-linux and Console-darwin into Console-posix
+---
+ library/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
+index 24149ec..50ac9f2 100644
+--- a/library/CMakeLists.txt
++++ b/library/CMakeLists.txt
+@@ -99,7 +99,7 @@ Hooks-darwin.cpp
+ )
+
+ SET(MAIN_SOURCES_LINUX_EGGY
+-Console-linux.cpp
++Console-posix.cpp
+ Hooks-egg.cpp
+ PlugLoad-linux.cpp
+ Process-linux.cpp
diff --git a/games-util/dfhack/files/dfhack-0.40.06.9999/series b/games-util/dfhack/files/dfhack-0.40.06.9999/series
new file mode 100644
index 00000000..11b86fb6
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.40.06.9999/series
@@ -0,0 +1,13 @@
+# This series applies on GIT commit 0983728e1493d490ddf85c8bf20c3a10b987b08d
+01-compile-static-libraries-as.patch
+02-drop-strange-build-options.patch
+03-configurable-install-paths.patch
+04-compile-time-configurable.patch
+05-compile-time-configurable-0.patch
+06-compile-time-configurable-1.patch
+07-startup-scripts-configurable.patch
+08-ruby-plugin-configurable-paths.patch
+09-getpath-configurable-path.patch
+10-eggy-remove-annoying-banner.patch
+11-debugging.patch
+12-unbreak-egg.patch
diff --git a/games-util/dfhack/metadata.xml b/games-util/dfhack/metadata.xml
index 0fd4842f..46303153 100644
--- a/games-util/dfhack/metadata.xml
+++ b/games-util/dfhack/metadata.xml
@@ -9,5 +9,6 @@
<flag name="egg">Build libegg in stead of the libsdl overriding library for interfacing with <pkg>games-simulation/dwarffortress</pkg>. Requires a patched <pkg>dev-libs/libgraphics</pkg>.</flag>
<flag name="isoworld">Build the isoworld plugin.</flag>
<flag name="ssense">Build the Stonesense plugin. This installs pre-built allegro libraries.</flag>
+ <flag name="stonesense">Build the Stonesense plugin. This installs pre-built allegro libraries.</flag>
</use>
</pkgmetadata>
diff --git a/games-util/dfhack/notes.mkd b/games-util/dfhack/notes.mkd
new file mode 100644
index 00000000..2629f89f
--- /dev/null
+++ b/games-util/dfhack/notes.mkd
@@ -0,0 +1,2 @@
+## Snapshots
+20140620 - f5de76e2cce0dd1dd266ed1d6ac79d711bf37c29