Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas On Android #1756

Open
berkfelix opened this issue Mar 3, 2021 · 7 comments
Open

Canvas On Android #1756

berkfelix opened this issue Mar 3, 2021 · 7 comments
Labels

Comments

@berkfelix
Copy link

Hello,how can i recompile canvas to use on android termux(arm)?

nodejs v14

@zbjornson
Copy link
Collaborator

#1609 has a suggestion for how to build on termux that worked for one person. Can you try that?

PR welcome if you figure out the build changes needed.

@4aiman
Copy link

4aiman commented Jan 27, 2023

I'm sorry for bumping this old issue, but it wasn't easy to find an answer for #Android-specific deps for #Termux.

So, this is for anyone searching:

  1. *-dev packages in Termux are built into the main packages
  2. If at some point you'll run in xproto not being available, try "xorgproto"
  3. Rather controversial thing to say: use sudo - some devices won't allow you to create symlinks or even explore your sd card (even after termux-setup-storage)

@EntropicBlackhole
Copy link

@4aiman Thank you very much, currently I'm just trying to use my phone as a temporary server until I have wifi again back at home, for my actual home server, and I do keep getting symlinks error and like permission errors once I keep trying to install canvas, I'll try these things in a bit and I'll let you know the result

@EntropicBlackhole
Copy link

@4aiman By the way, question, how exactly do i use sudo? I'm somewhat familiar with the bash terminal but not too much, how exactly to activate it to be on root? (probably getting the terminology wrong)

@4aiman
Copy link

4aiman commented Feb 3, 2023

@EntropicBlackhole I think I just did something like apt install sudo or pkg install sudo
In my experience some packages come from apt, some from pkg, and some from both.
Pretty sure that's not healthy, but I'm using what I have to use.

Once installed, just prepend your commands with sudo, like sudo npm start.

In all honesty, the biggest hurdle was realizing the ability of packages to be installed via sudo and not via "normal user" is tied not with privileges, but the file system.

There's a reason your internal SD card is called "emulated/0". It's not a real file system, and it cannot be used to mount things or create symlinks.

In the end I've created a folder in /data and placed all my node-related stuff there.
I still have to use sudo, even after changing permissions to 777 (which is yet another bad idea), but I can finally install any package and build it if necessary, canvas included.

Hope that helps

@EntropicBlackhole
Copy link

EntropicBlackhole commented Feb 3, 2023

@4aiman Termux actually asked me to do pkg install tsu (for sudo to work), which I did, but I still get symlink errors, I'm trying to install canvas on a folder that's inside the shared directory, however when it said that my GitHub ownership was dubious, the little command it gives you to type out afterwards actually went to the emulated path instead, which had me confused, but might be a reason as to why I keep getting symlink errors, also my phone is not rooted and a friend of mine pointed out it has to be for sudo work

In this case, would it be better if I tried having the cloned repo in another folder, that's personal to the phone only? This would avoid the emulated folder as you mentioned I believe

@4aiman
Copy link

4aiman commented Feb 6, 2023

@EntropicBlackhole
Not sure what you're asking, sorry.

I've flashed a different ROM since (a modified crDroid12.1) and used a more frequent version of Termux (fDroid).
Everything built even from the emulated FS flawlessly, even w/o sudo.
(I still have a rooted Android and gave Termux root access)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants