summaryrefslogtreecommitdiff
path: root/games-puzzle/magiccube4d
diff options
context:
space:
mode:
Diffstat (limited to 'games-puzzle/magiccube4d')
-rw-r--r--games-puzzle/magiccube4d/Manifest12
-rw-r--r--games-puzzle/magiccube4d/files/magiccube4d-2.2-64bit-ptr.patch53
-rw-r--r--games-puzzle/magiccube4d/files/magiccube4d-2.2-gcc41.patch22
-rw-r--r--games-puzzle/magiccube4d/files/magiccube4d-2.2-ldflags.patch15
-rw-r--r--games-puzzle/magiccube4d/files/magiccube4d-EventHandler.patch11
-rw-r--r--games-puzzle/magiccube4d/files/magiccube4d-xdg-config.patch64
-rw-r--r--games-puzzle/magiccube4d/magiccube4d-2.2-r1.ebuild44
-rw-r--r--games-puzzle/magiccube4d/magiccube4d-4.3.343.ebuild39
-rw-r--r--games-puzzle/magiccube4d/metadata.xml11
9 files changed, 114 insertions, 157 deletions
diff --git a/games-puzzle/magiccube4d/Manifest b/games-puzzle/magiccube4d/Manifest
index a39eac0d1ac7..b4a3cba6a1b6 100644
--- a/games-puzzle/magiccube4d/Manifest
+++ b/games-puzzle/magiccube4d/Manifest
@@ -1,8 +1,4 @@
-AUX magiccube4d-2.2-64bit-ptr.patch 1406 BLAKE2B 7741efef6045568adfb19b9cf64191ff682969dbcc4b12fdbbe62c55a9f4a4ae87a1208ad56fbd9ae8c331a33a79cde2ad28296da2a72d0c54810d1e183334ed SHA512 eb684cca4f6f02903c71e970146f6c110d9634ce2f1416e64bdf258b85264c79eaaa9b869f05ddb116373d908f4d0d2675c87d275ab79f76b21f77c5ce1c1563
-AUX magiccube4d-2.2-gcc41.patch 885 BLAKE2B 42990103d195d793e1b10efa573179373202de3d798168b309c14e96a868a80171501d63993e0adff569c8f5a072c55f312431b2eb0deab9f0f9dbb88fef7489 SHA512 2ac9eed48b4598b006ce866c319075eb6b06e8119890db28a0a88d6c680949606d89f5aa113a946c565a4abae529d07d22c7def72dd17beb810ea2f555833d69
-AUX magiccube4d-2.2-ldflags.patch 501 BLAKE2B 2abc1cf4e4b9d210634fae3da618848d21b818d006d30d67a316e750f4e9c77bb2ab8097fc07a1a34aace7efb64f5b3845d8975aa65e7ed83de662eb2dff7968 SHA512 76183b674fa09d330edb82e3c72b605b992a6fe24273c55a45d819ad08854869a7a73ae2ab0d03c14cd872fb13fc0836b75c8d17e3828559bb49d0064caa41b6
-AUX magiccube4d-EventHandler.patch 429 BLAKE2B 7572ff178552f47fe12012f6d6a822a2e2d2d63115eb14fce6ecc8bf489a7ab3c04a7f028d7a514d8de9adca27e6032051b0930386e7d40db08378ad16690a4c SHA512 e11bc6d31a41dca68b450773f575ff1708426daf1f8750117de81592f7050cebe9ea61385e24bd09186d166d764b2d00351b203552eb9d1c2a10be03b3be4f03
-DIST magiccube4d.gif 20739 BLAKE2B feaf1911e483bff7244476000c75b34794911fe279772b8f5d46ee8bd4125881fb71aaab0ebac891fd0a5db38b746c940991bf5fe9e1ad8a678240b2d6cddf82 SHA512 7a8902710eaa78a6580f024a86bfa1828870dc873a4fef30a7d4fa197a67cd1dde162d6d1d1ba0bea4307c13198d52505fb1a1fa3f6d10b3914af42d7c0ebd49
-DIST mc4d-src-2_2.tgz 144645 BLAKE2B 5b29963d056961ce425f7644b14c35e44ce94bc7be6ea5f3fbbb4048478366951005eb8e91fe7cb12e6f1424ad55add31493e0ad3a4ab18eea9e747f940c35f3 SHA512 19491460bada93b4ee2010004128279cb88ab866a5a8c791080d59fa86e5bacf966d7dab0c9b3074e94b77611ae341480d19b384079e83df549ef25e592b12a6
-EBUILD magiccube4d-2.2-r1.ebuild 1028 BLAKE2B 786b6648d5c99055d96cf8685300efb764ba8efd6500d9ebb6acd7a823025bb53dfe176eaac6f1733415a95e1ea5df1858151bcd7bf5258ffe1badcbc6bfa37b SHA512 e79d8a38e58a47cdc9f08e46f80c4e4b37004fdc9e06911d7677bae18508c72d49730d2c7ade92e5d93831852ab846740d77e35ed7fa8925a16c6f36ceceae71
-MISC metadata.xml 250 BLAKE2B 8d44bd4c6e7d6491273e2015e36ddac74af7b94a124fd240ff030e16430f5c85e53ab812f0e3e94bb2e6d138f39b512bbe01ff98b0081cacc21a02d648ec7643 SHA512 80ac07a3cac10ad2e72e9989a130b7d2073934fe92914a9db2af4d0e769d4bf537770f8faba0654bbd64a7e85ee38cf1f9d03b4b9cd322864b1b2bb35087d610
+AUX magiccube4d-xdg-config.patch 2850 BLAKE2B 2103a1c2bdba567f02b95f2bc1f98e19fc870057e2019f975f8f692ad29b23dcfb8ba25ef64b0b85184a6297623faa46ac600326809148172ca2b3edb7b4844c SHA512 1d4e7007501333ea2b54ad21d4bc685ae1d36b25541256c81c81544e5b72a0ba02c104c5b714f023f8cdbc2c72d8da54608c1d1ac388cd58a4e5f8a334dbf4fa
+DIST magiccube4d-4.3.343.tar.gz 871676 BLAKE2B a023ef1c84546e32f0de032f3c8515fca8568fa8e22869446a480e878574064b8e5572d2a0e76ae88af06de4f18a911f36e478e9f3c3dc1979915c0aa58d64a3 SHA512 f9fc93d54d850495e9216aa0bbf8beffa662032921e9fef54de9940fc07ad03e9af52d9a488445e4985ec2369abe90494657e6f5e199ebc2070c707dd95cc486
+EBUILD magiccube4d-4.3.343.ebuild 895 BLAKE2B 06e82e29bdd466d23da18bf1d48bdae49fc3301459afdcfef0895fd0fd1b90fcc21882ac3db760c7e513bc39d77cc7566d1e9b571d7727be2ae663b8efbb1d39 SHA512 73266c880520e5993971e154f6b458329ffa35eca3f064813cdbf57a8bc44aa40923aa186b3a22cd0e7d5f79c30d2e1365f4e73d2ec061cdb447c9a7fd95e674
+MISC metadata.xml 342 BLAKE2B 7dc88ce989ca7ea07a5385b968a58db0b55dc574ab2d00b5d51cf97eec310d078813861a4fc7f056d68fb728d8e9132f8229bb2b1d887c5a4bef5ec53ecedfe1 SHA512 775b5f545a278e5528a5b9086cc55482f7acd2e82a599caaa77570c67b09cd2bfe7b8632f76d972e523ddacff0fb8135cdd79cfe8d7f4172f7206753483438f0
diff --git a/games-puzzle/magiccube4d/files/magiccube4d-2.2-64bit-ptr.patch b/games-puzzle/magiccube4d/files/magiccube4d-2.2-64bit-ptr.patch
deleted file mode 100644
index 7fbd52871887..000000000000
--- a/games-puzzle/magiccube4d/files/magiccube4d-2.2-64bit-ptr.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-diff -Nru magiccube4d-src-2_2.orig/EventHandler.cpp magiccube4d-src-2_2/EventHandler.cpp
---- magiccube4d-src-2_2.orig/EventHandler.cpp 2007-09-30 12:01:46.503967712 +0200
-+++ magiccube4d-src-2_2/EventHandler.cpp 2007-09-30 12:03:23.489172011 +0200
-@@ -20,6 +20,7 @@
- #include <iostream>
- #include <unistd.h>
- #include <stdio.h>
-+#include <stdint.h>
-
- #include "MagicCube.h"
- #include "Puzzlest.h"
-@@ -415,7 +416,7 @@
- void
- EventHandler::undo_cb(void* argp)
- {
-- int arg = (int) argp;
-+ int arg = (intptr_t) argp;
- struct stickerspec grip;
- int dir;
- int slicesmask;
-@@ -461,7 +462,7 @@
- void
- EventHandler::redo_cb(void* argp)
- {
-- int arg = (int) argp;
-+ int arg = (intptr_t) argp;
- struct stickerspec grip;
- int dir;
- int slicesmask;
-@@ -507,7 +508,7 @@
- void
- EventHandler::scramble_cb(void *arg = NULL)
- {
-- int n = (int)arg;
-+ int n = (intptr_t)arg;
- struct stickerspec grip;
- int i, previous_face = -1;
- int ngrips = NFACES * 3 * 3 * 3;
-@@ -855,12 +856,12 @@
- void
- EventHandler::newPuzzle_cb(void* arg)
- {
-- if ((int)arg == preferences.getLength())
-+ if ((intptr_t)arg == preferences.getLength())
- {
- reset_cb(0);
- return;
- }
-- preferences.setLength((int)arg);
-+ preferences.setLength((intptr_t)arg);
- int length = preferences.getLength();
-
- polymgr->reset(length);
diff --git a/games-puzzle/magiccube4d/files/magiccube4d-2.2-gcc41.patch b/games-puzzle/magiccube4d/files/magiccube4d-2.2-gcc41.patch
deleted file mode 100644
index 8e2aaf2b5fcd..000000000000
--- a/games-puzzle/magiccube4d/files/magiccube4d-2.2-gcc41.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/EventHandler.h.old 2006-05-19 22:11:48.000000000 +0200
-+++ b/EventHandler.h 2006-05-19 22:11:58.000000000 +0200
-@@ -165,7 +165,7 @@
-
- int number_of_reference_stickers_needed;
- int (*reference_stickers_needed)[4];
-- void (EventHandler::*what_to_do_after_got_reference_stickers) (void *arg = NULL);
-+ void (EventHandler::*what_to_do_after_got_reference_stickers) (void *arg);
- void* cur_ui_data;
-
- bool quick_mode;
---- a/Machine.h.old 2006-05-19 22:12:17.000000000 +0200
-+++ b/Machine.h 2006-05-19 22:12:29.000000000 +0200
-@@ -31,7 +31,7 @@
- {
- public:
- typedef void (EventHandler::*event_handler)(EventHandler::Event*,
-- void *arg = 0);
-+ void *arg);
- virtual ~Machine() {};
-
- static Machine* createMachine(EventHandler*, int& argc, char *argv[],
diff --git a/games-puzzle/magiccube4d/files/magiccube4d-2.2-ldflags.patch b/games-puzzle/magiccube4d/files/magiccube4d-2.2-ldflags.patch
deleted file mode 100644
index 73d1b4a59dca..000000000000
--- a/games-puzzle/magiccube4d/files/magiccube4d-2.2-ldflags.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/Makefile.in.old 2010-10-15 10:38:48.000000000 +0200
-+++ b/Makefile.in 2010-10-15 10:39:07.000000000 +0200
-@@ -72,10 +72,10 @@
- $(CXX) -c $(CXXFLAGS) $<
-
- $(TARGET): $(OBJS)
-- $(CXX) -o $(TARGET) $(OBJS) $(LIBDIRS) $(LIBS)
-+ $(CXX) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBDIRS) $(LIBS)
-
- $(TARGET).static: $(OBJS)
-- $(CXX) -static -o $(TARGET).static $(OBJS) $(LIBDIRS) $(LIBS)
-+ $(CXX) $(LDFLAGS) -static -o $(TARGET).static $(OBJS) $(LIBDIRS) $(LIBS)
-
- Vec.h: vec_h.c
- $(CC) -o vec_h vec_h.c
diff --git a/games-puzzle/magiccube4d/files/magiccube4d-EventHandler.patch b/games-puzzle/magiccube4d/files/magiccube4d-EventHandler.patch
deleted file mode 100644
index d242438d8d05..000000000000
--- a/games-puzzle/magiccube4d/files/magiccube4d-EventHandler.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/EventHandler.cpp.old 2004-11-04 22:58:13.735812448 +1100
-+++ b/EventHandler.cpp 2004-11-04 22:57:03.176539088 +1100
-@@ -326,7 +326,7 @@
- number_of_reference_stickers_needed--;
- reference_stickers_needed++;
- if (number_of_reference_stickers_needed == 0)
-- (this->*what_to_do_after_got_reference_stickers)();
-+ (this->*what_to_do_after_got_reference_stickers)(NULL);
- }
- }
-
diff --git a/games-puzzle/magiccube4d/files/magiccube4d-xdg-config.patch b/games-puzzle/magiccube4d/files/magiccube4d-xdg-config.patch
new file mode 100644
index 000000000000..e60ec6125c1c
--- /dev/null
+++ b/games-puzzle/magiccube4d/files/magiccube4d-xdg-config.patch
@@ -0,0 +1,64 @@
+From 7430d876b0efdb3f828a92df60a9e2d4d7ebc113 Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@gentoo.org>
+Date: Sat, 17 Aug 2024 23:31:43 +0100
+Subject: [PATCH] Write config to XDG_CONFIG_HOME or ~/.config unless old
+ config exists or on Win
+
+Storing configuration outside a standard user configuration directory is bad
+practise and very unhelpful for distributions wanting to package this software.
+
+This respects the old configuation location for compatibility.
+
+XDG_CONFIG_HOME or ~/.config should make sense on just about any non-Windows OS.
+---
+ src/com/superliminal/util/PropertyManager.java | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/src/com/superliminal/util/PropertyManager.java b/src/com/superliminal/util/PropertyManager.java
+index 80567fc..2a6de12 100644
+--- a/src/com/superliminal/util/PropertyManager.java
++++ b/src/com/superliminal/util/PropertyManager.java
+@@ -4,6 +4,8 @@ import java.util.*;
+ import java.io.*;
+ import java.awt.*;
+ import java.net.*;
++import java.nio.file.InvalidPathException;
++import java.nio.file.Paths;
+
+ /**
+ * Title: PropertyManager
+@@ -101,8 +103,19 @@ public class PropertyManager extends Properties {
+ * Applications should load any user-specific property overrides directly into this object
+ * and then call setProperty whenever a user action needs to change one.
+ */
+- public final static PropertyManager userprefs = new LocalProps(new File(StaticUtils.getBinDir(), PRODUCT_NAME + ".props"));
++ public final static PropertyManager userprefs;
+ static {
++ File propsFile = Paths.get(StaticUtils.getBinDir(), PRODUCT_NAME + ".props").toFile();
++
++ if (!propsFile.canWrite() && !System.getProperty("os.name").startsWith("Windows")) {
++ try {
++ propsFile = Paths.get(System.getenv("XDG_CONFIG_HOME"), PRODUCT_NAME + ".props").toFile();
++ } catch (NullPointerException | InvalidPathException e) {
++ propsFile = Paths.get(System.getProperty("user.home"), ".config", PRODUCT_NAME + ".props").toFile();
++ }
++ }
++
++ userprefs = new LocalProps(propsFile);
+ System.out.println("Launch dir: " + StaticUtils.getBinDir());
+ }
+
+@@ -256,8 +269,9 @@ public class PropertyManager extends Properties {
+ if(localPropFile == null || storeFailed)
+ return;
+ try {
++ localPropFile.getParentFile().mkdirs();
+ this.store(new FileOutputStream(localPropFile), PRODUCT_NAME + " User Preferences");
+- } catch(IOException e) {
++ } catch(IOException | SecurityException e) {
+ storeFailed = true; // so as to only give fail msg once
+ if(!localPropFile.canWrite())
+ System.err.println("Can't write");
+--
+2.45.2
+
diff --git a/games-puzzle/magiccube4d/magiccube4d-2.2-r1.ebuild b/games-puzzle/magiccube4d/magiccube4d-2.2-r1.ebuild
deleted file mode 100644
index 1c45efaeaffc..000000000000
--- a/games-puzzle/magiccube4d/magiccube4d-2.2-r1.ebuild
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit desktop
-
-MY_PV="${PV/./_}"
-DESCRIPTION="Four-dimensional analog of Rubik's cube"
-HOMEPAGE="https://www.superliminal.com/cube/cube.htm"
-SRC_URI="https://www.superliminal.com/cube/mc4d-src-${MY_PV}.tgz
- https://superliminal.com/cube/cube_transp.gif -> ${PN}.gif"
-
-LICENSE="free-noncomm"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-DEPEND="x11-libs/libXaw"
-RDEPEND="${DEPEND}"
-
-S="${WORKDIR}/${PN}-src-${MY_PV}"
-
-src_prepare() {
- default
- eapply "${FILESDIR}"/${PN}-EventHandler.patch \
- "${FILESDIR}/${P}"-gcc41.patch \
- "${FILESDIR}/${P}"-64bit-ptr.patch \
- "${FILESDIR}"/${P}-ldflags.patch
- sed -i \
- -e "s:-Werror::" \
- configure \
- || die "sed failed"
-}
-
-src_compile() {
- emake DFLAGS="${CFLAGS}"
-}
-
-src_install() {
- dobin magiccube4d
- dodoc ChangeLog MagicCube4D-unix.txt readme-unix.txt Intro.txt
- doicon "${DISTDIR}"/${PN}.gif
- make_desktop_entry ${PN} "Magic Cube 4D" /usr/share/pixmaps/${PN}.gif
-}
diff --git a/games-puzzle/magiccube4d/magiccube4d-4.3.343.ebuild b/games-puzzle/magiccube4d/magiccube4d-4.3.343.ebuild
new file mode 100644
index 000000000000..99641bd510a5
--- /dev/null
+++ b/games-puzzle/magiccube4d/magiccube4d-4.3.343.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit desktop java-pkg-2 java-pkg-simple xdg
+
+DESCRIPTION="Four-dimensional analog of Rubik's cube"
+HOMEPAGE="https://www.superliminal.com/cube/cube.htm"
+SRC_URI="https://github.com/cutelyaware/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${P}"
+LICENSE="free-noncomm"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND=">=virtual/jre-1.8:*"
+DEPEND=">=virtual/jdk-1.8:*"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-xdg-config.patch
+)
+
+JAVA_SRC_DIR="src"
+JAVA_RESOURCE_DIRS=( src )
+
+src_prepare() {
+ default
+ java-pkg-2_src_prepare
+}
+
+src_install() {
+ java-pkg-simple_src_install
+ java-pkg_dolauncher ${PN} --main com.superliminal.magiccube4d.MC4DSwing --java_args "-Xms128m -Xmx512m"
+
+ newicon -s 32 src/mc4d.png ${PN}.png
+ make_desktop_entry ${PN} "Magic Cube 4D"
+
+ dodoc README.md
+}
diff --git a/games-puzzle/magiccube4d/metadata.xml b/games-puzzle/magiccube4d/metadata.xml
index 1c3ba213c494..e105507f248f 100644
--- a/games-puzzle/magiccube4d/metadata.xml
+++ b/games-puzzle/magiccube4d/metadata.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
-<maintainer type="project">
- <email>games@gentoo.org</email>
- <name>Gentoo Games Project</name>
-</maintainer>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">cutelyaware/magiccube4d</remote-id>
+ </upstream>
</pkgmetadata>