Open UnitedMarsupials-zz opened 6 years ago
Well, the python install section was contributed by several users, so a lot of room to improve (like avoid copy the JS files in icon folders).
The other point: maybe the proper way to handle BSD and non BSD environment is check if DATADIR_REL
is defined and use it in positive case. Use the current folders if not defined.
Oh, something like this is needed too, if the scudcloud.png
is to live only in share/pixmaps/
:
--- scudcloud/resources.py 2017-09-12 12:02:28.000000000 +0000
+++ scudcloud/resources.py 2017-09-28 16:16:16.490033000 +0000
@@ -14,4 +14,5 @@
SPELL_LIMIT = 6
+ INSTALL_PREFIX = '/usr'
SPELL_DICT_PATH = '/usr/share/hunspell'
DEFAULT_CONFDIR = '~/.config/scudcloud'
@@ -22,3 +23,6 @@
def get_path(filename):
- return os.path.join(Resources.INSTALL_DIR, 'resources', filename)
+ if filename.endswith('.png'):
+ return os.path.join(Resources.INSTALL_PREFIX, 'share', 'pixmaps', filename)
+ else:
+ return os.path.join(Resources.INSTALL_DIR, 'resources', filename)
Regarding the hardcoding of /usr
as the prefix -- the FreeBSD port will simply replace /usr
with $PREFIX
during port-building. But you may wish to do this in setup.py
, when files are "installed" into build_lib
.
While preparing the FreeBSD port of scudcloud, I found it necessary to patch
setup.py
as follows addressing several packaging-problems:autoplist
feature for Python-ports looks at thedata_files
to enumerate the files installed by the packages. Since the minimization of .js files was added, the resulting .js files disappeared from that listshare/pixmaps/
was odd, even if its icon could go therescudcloud.png
-- was installed into two places, it really does not need to be underresources/
scudcloud.desktop
file hardcodes the icon's location -- the port will fix that, but you may forsetup.py
to do it automaticallyDATADIR_REL
in particular tells the package, where it should install its data-file relative to the prefix (such asshare/scudcloud/
)Some of the below changes may be considered FreeBSD-specific, but you may wish to consider addressing the first four items...
Updated version of the patch: