Bug 205053

Summary: [NEW PORT] print/sharelatex: Online collaborative LaTeX editor
Product: Ports & Packages Reporter: Yuri Victorovich <yuri>
Component: Individual Port(s)Assignee: Yuri Victorovich <yuri>
Status: New ---    
Severity: Affects Only Me CC: nico512, rodomar705, ruben_verhoef, w.schwarzenfeld
Priority: --- Keywords: feature, patch
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on: 204577, 204932, 204547, 204772, 205032    
Bug Blocks:    
Description Flags
shar archive (compressed bz2)
patch adding UID/GID
shar archive (compressed bz2)
shar archive (compressed bz2)
shar archive (compressed bz2)
shar archive (compressed bz2)
Compile log error none

Description Yuri Victorovich freebsd_committer 2015-12-06 10:05:37 UTC
Comment 1 Yuri Victorovich freebsd_committer 2015-12-06 10:07:01 UTC
Created attachment 163885 [details]
shar archive (compressed bz2)
Comment 2 Yuri Victorovich freebsd_committer 2015-12-06 10:08:16 UTC
This port is fully functional and passes the poudriere build.
Comment 3 Yuri Victorovich freebsd_committer 2015-12-06 10:21:06 UTC
Created attachment 163888 [details]
patch adding UID/GID
Comment 4 Yuri Victorovich freebsd_committer 2015-12-06 11:06:06 UTC
Before the first use one must add the admin account with this command:
> sharelatex-create-admin-user your@email.com
Comment 5 Yuri Victorovich freebsd_committer 2015-12-10 11:21:51 UTC
Created attachment 164043 [details]
shar archive (compressed bz2)
Comment 6 Yuri Victorovich freebsd_committer 2015-12-11 09:46:07 UTC
Created attachment 164110 [details]
shar archive (compressed bz2)
Comment 7 Yuri Victorovich freebsd_committer 2015-12-27 14:19:55 UTC
Created attachment 164726 [details]
shar archive (compressed bz2)
Comment 8 Yuri Victorovich freebsd_committer 2015-12-28 06:43:35 UTC
Created attachment 164750 [details]
shar archive (compressed bz2)
Comment 9 rubenverhoef 2016-04-01 18:20:02 UTC
I really like sharelatex and don't get it working on FreeBSD. when i install your port it says: 
"/usr/ports/Mk/bsd.port.mk", line 1433: Could not find /usr/ports/Mk/Uses/nodejs.mk

Could be my fault. Can somebody help me? (ruben_verhoef@hotmail.com)
Comment 10 Yuri Victorovich freebsd_committer 2016-04-01 23:03:02 UTC
Please note the dependencies - one of them isn't installed.
Comment 11 rubenverhoef 2016-04-02 21:46:56 UTC
(In reply to yuri from comment #10)

I have node010 npm010 and grunt installed but same error
Comment 12 Yuri Victorovich freebsd_committer 2016-04-02 22:29:53 UTC
/usr/ports/Mk/Uses/nodejs.mk comes from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204577
Comment 13 rubenverhoef 2016-04-02 23:18:04 UTC
(In reply to yuri from comment #12)

now i get an other error :(

_MASTER_SITES_real-time=https://codeload.github.com/sharelatex/real-time-sharelatex/tar.gz/35d9afe?dummy=/: not found
*** [do-fetch] Error code 127

Stop in /usr/ports/print/sharelatex.
*** [install] Error code 1
Comment 14 rubenverhoef 2016-04-03 09:13:29 UTC
(In reply to rubenverhoef from comment #13)
I see a conversation at: https://reviews.freebsd.org/D4603
I'm using freebsd 9.3 and you said "This patch (bug#205032) also breaks on 9.X, so you need to use 10.X for now." so I can't use your port right now?
Comment 15 Yuri Victorovich freebsd_committer 2016-04-03 15:27:08 UTC
Sorry, it currently won't work on 9.X.
One of the patches isn't compatible with 9.X because 9.X has a different make.
One of the two things should happen:
* Patch should be fixed for 9.X
* Wait until 9.X goes out of support.
I am not sure when 9.X goes out of support, I meant to ask but didn't ask yet.
This is what stopped me.
Comment 16 rubenverhoef 2016-04-03 16:21:24 UTC
(In reply to yuri from comment #15)

No problem, i'm using FreeNAS so that's the reason i'm on 9.3

Now i'm trying to build sharelatex on my own but have one problem left :( https://github.com/sharelatex/sharelatex/issues/409

Thanks for your help.
Comment 17 Rodomar705 2016-04-04 18:09:09 UTC
And here i am. I hope that this port will make in the port tree, sooner or later. Works wonderfully here on 10.3. The only problem for now is managing and upgrading the port itself, unfortunately. Having to patch the ports tree each time the tree is upgraded it's quite annoying. What's stopping the merge of the package itself? Just the patches? Maybe back porting the changes to let it work correctly with the current port tree would speedup the merge itself? Or it is just too hard/long to do it?
Comment 18 Yuri Victorovich freebsd_committer 2016-04-04 18:46:07 UTC
The drag is 9.X incompatibility of one of the patches.

Does anybody know when 9.X is going out of support?
Comment 19 Rodomar705 2016-04-04 18:52:03 UTC
(In reply to yuri from comment #18)
According to the official site, the EOL for 9.3 is expected to be December 31, 2016.
Comment 20 Yuri Victorovich freebsd_committer 2016-04-04 19:42:45 UTC
The patch in question is in bug#205032. The feature it adds is the ability to have hyphens and other special characters in github URLs. Going forward, with an increasing number of github dependencies it is essential to be able to handle any kinds of characters in URLs.

I couldn't figure out why the old make fails with this patch. If you are good at make and have time for this you are welcome to figure this out. 9.X support is currently a requirement for ports. This is the status of this issue.
Comment 21 Rodomar705 2016-04-14 07:21:20 UTC
After changing literally only the version number for tap, grunt seems to be installed just fine. Ugly hack, but it works. Now the problem is that when is trying to fetch, fails with
npm ERR! git submodule -q update --init --recursive: nodejs-fetch: ERROR: Unknown command: submodule
npm ERR! git submodule -q update --init --recursive:
npm ERR! FreeBSD 10.3-STABLE
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--loglevel" "warn" "--ignore-scripts"
npm ERR! node v5.10.1
npm ERR! npm  v3.8.6
npm ERR! code 1

npm ERR! Command failed: /var/ports/distfiles/sharelatex-0.151204.tmpdirs/.tmp/fake-git submodule -q update --init --recursive
npm ERR! nodejs-fetch: ERROR: Unknown command: submodule
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /var/ports/distfiles/sharelatex-0.151204/npm-debug.log
===>  Fetch failed for sharelatex-0.151204

Why fake-git? That's the reason? But i've installed git, and it keep spitting this error out to me. Had unfortunately to recover from a filesystem change, and i need to reinstall the package. Any help is appreciated.
Comment 22 Yuri Victorovich freebsd_committer 2016-04-14 08:09:32 UTC
npm isn't supposed to ever call git in this framework. I am not sure what is wrong. fake-git is a script that mimics git but retrieves the pre-downloaded copy of the same requested tarball.
Comment 23 Rodomar705 2016-04-14 08:15:52 UTC
Created attachment 169308 [details]
Compile log error
Comment 24 Rodomar705 2016-04-14 08:17:21 UTC
This is done during the fetch phase. I've attached the log file and if you can identify the source, i would be grateful. Can it be caused by my small modification on Grunt to install it?

Comment 25 Yuri Victorovich freebsd_committer 2016-04-14 10:39:36 UTC
I think this is due to the new npm version 3.8.6. node.mk was developed with npm-2.14.7. I need to update node.mk to be compatible with the new npm. In the mean time you can downgrade www/npm to 2.14.7 and it should build.

fake-git script emulates certain commands for the real git, but it looks like the new npm calls some not-yet-supported variation.
Comment 26 Rodomar705 2016-04-14 15:43:17 UTC
(In reply to yuri from comment #25)
YES! That was the problem! Thanks a million times, it was driving me crazy, i was literally taking the Mongo DB dump to pieces to get back my university notes. Thanks a ton again :)

This was a hard lesson for forcing me to remember to backup before doing modifications, but i think that was useful :P

Have a wonderful day :)
Comment 27 Yuri Victorovich freebsd_committer 2016-04-14 18:17:35 UTC
You're welcome!(In reply to Rodomar705 from comment #26)
Comment 28 Nico 2016-06-06 07:46:47 UTC
===>   sharelatex-0.151204 depends on package: mongodb>=0 - found
===>   Returning to build of sharelatex-0.151204
===>   sharelatex-0.151204 depends on file: /usr/local/share/texmf-var/web2c/tex/tex.fmt - found
===>   sharelatex-0.151204 depends on package: texlive-base>=20150521_5 - found
===>   sharelatex-0.151204 depends on package: texlive-texmf>=20150523_3 - found
===>   sharelatex-0.151204 depends on executable: node - found
===>   Generating temporary packing list
===> Creating groups.
** Cannot find any information about group `sharelatex' in /usr/ports/GIDs.
*** Error code 1

make[1]: stopped in /root/sharelatex/print/sharelatex
*** Error code 1

make: stopped in /root/sharelatex/print/sharelatex
Comment 29 Yuri Victorovich freebsd_committer 2016-06-06 07:52:04 UTC

You need UID and GID added, similar to what the first patch does.

Comment 30 Walter Schwarzenfeld freebsd_triage 2018-02-03 08:58:49 UTC
Any news here?
Comment 31 Yuri Victorovich freebsd_committer 2018-02-03 09:09:07 UTC
(In reply to w.schwarzenfeld from comment #30)

This is based on noejs.mk, that needs to be continued.