Bug 190398 - Staged port finance/electrum
Summary: Staged port finance/electrum
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Guido Falsi
URL:
Keywords:
: 188682 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-05-30 01:40 UTC by kyuupichan
Modified: 2014-07-22 19:31 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (19.56 KB, patch)
2014-05-30 01:40 UTC, kyuupichan
no flags Details | Diff
Updated patch (19.11 KB, patch)
2014-06-02 21:38 UTC, Guido Falsi
no flags Details | Diff
New patch (19.04 KB, patch)
2014-06-03 09:43 UTC, Guido Falsi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kyuupichan 2014-05-30 01:40:00 UTC
Stage the port, and update to 1.9.8

Fix: See attached diff

Patch attached with submission follows:
Comment 1 Guido Falsi freebsd_committer freebsd_triage 2014-06-02 21:38:15 UTC
Created attachment 143300 [details]
Updated patch

Hi,

I have tested your patch and made a few changes. The patch is attached to the bug report.

In both patches I introduced again the %%PREFIX%% and the post-patch target. The prefix can be changed and shouldn't be hardcoded in the port. This is the correct way to handle this.

In lib/util.py I added a check for FreeBSD, the port was failing claiming "Unknown system".

Can you review and approve these changes?

Also, the port now only has an https master site. While this could do, not all peoople have unlimited connectivity, especially proxies sometimes filter https. Could you investigate if a plain http master site can be found and added to MASTER_SITES?

Thanks in advance.
Comment 2 kyuupichan 2014-06-02 21:54:36 UTC
Hi Guido.

The %%PREFIX%% thing is wrong and should be removed again to how I submitted the patch.  With PREFIX thing "make stage" fails.  It is not needed because the python installation wrapper system *already handles the prefix*, so it ends up being replaced twice.

I cannot test the FreeBSD thing but that's fine in principle of course.

Can you just remove the "s" in https from MASTER SITES?  Plain http works fine.
Comment 3 Guido Falsi freebsd_committer freebsd_triage 2014-06-03 09:43:23 UTC
I'm performing some tests, but it does not looks correct without the PREFIX thing.

First of all in your patches you're hardconfding /usr/local/share.

in setyp.py you're changing:



-usr_share = '/usr/share'
-if not os.access(usr_share, os.W_OK):
-    usr_share = os.getenv("XDG_DATA_HOME", os.path.join(os.getenv("HOME"), ".local", "share"))
+usr_share = '/usr/local/share'

if pythion was taking care of that it should work with /usr/share too.

You're also hardcoding it in util.py:

-        return "/Library/Application Support/Electrum"
+	return os.path.join('/usr/local', "share", "electrum")

You can test by putting a wrong path here and see the port fail.

These should really be dynamically changed in case a non standard prefix is used.

With this kind of patch the port isn't failing, a log for example:

http://www.madpilot.net/~mad/electrum-1.9.8.log

With python ports there is anyway a python caused problem because some python files will get installed anyway to LOCALBASE, so this port will not work correctly anyway when using PREFIX != LOCALBASE, but this is not a good reason to hardcode /usr/local a PREFIX.

I'm attaching a new patch to this bug since the previous one I sent actually contained a mistake. Please review and test this one.
Comment 4 Guido Falsi freebsd_committer freebsd_triage 2014-06-03 09:43:59 UTC
Created attachment 143323 [details]
New patch
Comment 5 kyuupichan 2014-06-03 10:44:02 UTC
Comment on attachment 143300 [details]
Updated patch

Hi Guido,

Yes this works fine for me to with and without staging.  It's odd because I'm sure the old one worked fine, and when I originally tried this myself I got doubled paths like 


/usr/obj/dports/finance/electrum/work/stage/usr/local/share/usr/obj/dports/finance/electrum/work/stage/usr/local/share/locale/vi_VN/LC_MESSAGES

But this isn't happening now so please go ahead and commit your change, it looks good to me.  Thanks for your help.
Comment 6 kyuupichan 2014-06-03 10:46:18 UTC
And remove the 's' of https if you don't want it; it still seems to be there.
Comment 7 Guido Falsi freebsd_committer freebsd_triage 2014-06-03 10:55:54 UTC
Committed, Thanks!
Comment 8 commit-hook freebsd_committer freebsd_triage 2014-06-03 10:55:57 UTC
A commit references this bug:

Author: madpilot
Date: Tue Jun  3 10:55:26 UTC 2014
New revision: 356326
URL: http://svnweb.freebsd.org/changeset/ports/356326

Log:
  - Update to 1.9.8
  - Stagify

  PR:		190398
  Submitted by:	kyuupichan@gmail.com (maintainer)

Changes:
  head/finance/electrum/Makefile
  head/finance/electrum/distinfo
  head/finance/electrum/files/patch-lib__util.py
  head/finance/electrum/files/patch-setup.py
  head/finance/electrum/pkg-plist
Comment 9 John Marino freebsd_committer freebsd_triage 2014-07-22 19:31:47 UTC
*** Bug 188682 has been marked as a duplicate of this bug. ***