Gentoo Archives: gentoo-commits

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/unrpyc/
Date: Sun, 10 May 2020 11:10:44
Message-Id: 1589108896.670b891301ee8eccbce7d5f3307b1bf7bf444911.bircoph@gentoo
1 commit: 670b891301ee8eccbce7d5f3307b1bf7bf444911
2 Author: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 10 11:04:16 2020 +0000
4 Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
5 CommitDate: Sun May 10 11:08:16 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=670b8913
7
8 dev-util/unrpyc: initial version
9
10 This is a very effecient rpyc decompiler for RenPy games.
11
12 Package-Manager: Portage-2.3.82, Repoman-2.3.20
13 Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>
14
15 dev-util/unrpyc/Manifest | 1 +
16 dev-util/unrpyc/metadata.xml | 22 +++++++++++++++++
17 dev-util/unrpyc/unrpyc-1.1.3.ebuild | 49 +++++++++++++++++++++++++++++++++++++
18 3 files changed, 72 insertions(+)
19
20 diff --git a/dev-util/unrpyc/Manifest b/dev-util/unrpyc/Manifest
21 new file mode 100644
22 index 00000000000..137c525b911
23 --- /dev/null
24 +++ b/dev-util/unrpyc/Manifest
25 @@ -0,0 +1 @@
26 +DIST unrpyc-1.1.3.tar.gz 77662 BLAKE2B e2fdf9015e67ee389ff84c49bd89c64d65178a26aaa7b8600202f491291e03a568bec2d8d09e47c407a9bcd025dab3b84e5167f07c9673d19bdb5bf7846c1eed SHA512 5883d58e11b2f52cffdeae744e17bf6bf2039340e53365f8ce58f716b991011bbca71c6473395a9d70c32bc77529eea3e7a9e3b8da7dc3cc8362cc0fdcbe5cf0
27
28 diff --git a/dev-util/unrpyc/metadata.xml b/dev-util/unrpyc/metadata.xml
29 new file mode 100644
30 index 00000000000..69df492b06a
31 --- /dev/null
32 +++ b/dev-util/unrpyc/metadata.xml
33 @@ -0,0 +1,22 @@
34 +<?xml version="1.0" encoding="UTF-8"?>
35 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
36 +<pkgmetadata>
37 + <maintainer type="person">
38 + <email>bircoph@g.o</email>
39 + <name>Andrew Savchenko</name>
40 + </maintainer>
41 + <longdescription>
42 + Unrpyc is a script to decompile Ren'Py (http://www.renpy.org/) compiled
43 + .rpyc script files. It will not extract files from .rpa archives.
44 + For that, use <pkg>app-arch/unrpa</pkg>.
45 + </longdescription>
46 + <upstream>
47 + <remote-id type="github">CensoredUsername/unrpyc</remote-id>
48 + </upstream>
49 + <use>
50 + <flag name="module">Build un.rpyc module for run-time decompiling</flag>
51 + <flag name="proto0">Use pickle protocol 0 for un-rpyc module. May be usefule for very old games</flag>
52 + <flag name="proto1">Use pickle protocol 1 for un-rpyc module. Default if no protocol is selected</flag>
53 + <flag name="proto2">Use pickle protocol 2 for un-rpyc module</flag>
54 + </use>
55 +</pkgmetadata>
56
57 diff --git a/dev-util/unrpyc/unrpyc-1.1.3.ebuild b/dev-util/unrpyc/unrpyc-1.1.3.ebuild
58 new file mode 100644
59 index 00000000000..e754cac60c4
60 --- /dev/null
61 +++ b/dev-util/unrpyc/unrpyc-1.1.3.ebuild
62 @@ -0,0 +1,49 @@
63 +# Copyright 1999-2020 Gentoo Authors
64 +# Distributed under the terms of the GNU General Public License v2
65 +
66 +EAPI=7
67 +
68 +PYTHON_COMPAT=( python2_7 )
69 +inherit distutils-r1
70 +
71 +SRC_URI="https://github.com/CensoredUsername/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
72 +KEYWORDS="~amd64 ~x86"
73 +DESCRIPTION="Ren'Py's rpyc scripts decompiler"
74 +HOMEPAGE="https://github.com/CensoredUsername/unrpyc"
75 +LICENSE="BSD-1 BSD"
76 +SLOT="0"
77 +
78 +IUSE="+module proto0 proto1 proto2"
79 +
80 +DEPEND="module? ( dev-python/picklemagic[${PYTHON_USEDEP}] )"
81 +
82 +src_prepare() {
83 + sed -i 's/unrpyc.py/unrpyc/g' README.md setup.py || die
84 + mv unrpyc.py unrpyc || die
85 + distutils-r1_src_prepare
86 +}
87 +
88 +src_compile() {
89 + distutils-r1_src_compile
90 +
91 + if use module; then
92 + local proto=1
93 + use proto0 && proto=0
94 + use proto1 && proto=1
95 + use proto2 && proto=2
96 +
97 + cd un.rpyc || die
98 + python_setup 'python2*'
99 + ./compile.py -p${proto} || die
100 + fi
101 +}
102 +
103 +src_install() {
104 + distutils-r1_src_install
105 +
106 + if use module; then
107 + install -Dpm 0644 -t "${ED}/usr/share/${PN}" un.rpyc/un.rpyc || die
108 + einfo "For run-time rpyc decompiling copy ${EPREFIX}/usr/share/${PN}/un.rpyc to your game dir."
109 + newdoc un.rpyc/README.md README-un.rpyc.md
110 + fi
111 +}