1. djbclark's Avatar
    I was wondering if anyone has looked into using pkgsrc to port a lot of software to BlackBerry 10. It looks like there is already a project that has done this for QNX 6 (Neutrino) with more than 6000 packages successfully compiled - see QNX Community: pkgsrc Project.

    With no work, some of the command-line applications might be useful. Writing simple front ends to other applications might make them useful.

    I'm just starting to look into BB10 development, so don't know how plausible this is - I just see that one can get a shell via the "BGShellPlus" (seems like the best option), "BG Shell", "Command shell" or "otgTerm" apps - and basic commands like "ls" and "ssh" work, so I assume there must be a way to compile other command-line software written in C and using the GNU Autotools / autoconf (e.g. ./configure; make; make install) or other cross-platform build systems, although I haven't found a good newbie guide to doing that yet (pointers appreciated).
    10-06-13 12:17 PM
  2. Bdot-1's Avatar
    Im posting to follow this
    10-06-13 05:03 PM
  3. BravoZuluDelta's Avatar
    Hmm, this is an interesting thought. So instead of trying to port Android and iOS apps over, embrace our POSIX compliance and fork over some Unix software that's available for Linux, OpenBSD, etc.

    I love it. This would definitely play into the "mobile computing" theme.

    Posted via CB10 on Q10
    10-06-13 05:09 PM
  4. djbclark's Avatar
    Yeah that'd be the idea. Some command line apps should be usable without modification; and I'm guessing others might be useful with GUI front ends, sort of like DDD (data display debugger).

    I've also queried foundry27 (the QNX equivalent to here) and found some guidance and interest. As a first step I'm going to try to port a compile toolchain to armv7 (QNX only supports cross compilation by default; I personally prefer waiting a long time to trying to figure out if compile problems are due to platform issues and whixh to cross compilation issues.) To do this I've gotten a beaglebone black, which is slow but super super cheap (like $45). If I can get a toolchain on that, but it's insane slow, for about $300 you can get a board with a cortex a15. Also will prob look in to running a distcc slave on a blackberry 10 device itself; I don't think that would need root.

    Assuming I actually find time to do this stuff, I'm planning on using the sort of moribund blackberrydev.org mediawiki (a counterpart to the #blackberrydev IRC channel on freenode) to keep doc and status. I'll post a link here when there is anything there.

    Posted via CB10
    BravoZuluDelta likes this.
    10-10-13 10:13 AM
  5. BravoZuluDelta's Avatar
    I'd love to see some interest and progress with this idea. Imagine LibreOffice, GIMP, VLC...all ported to BB10.
    10-11-13 09:34 AM
  6. Omnitech's Avatar
    Honestly I don't see the point.

    The VAST majority of POSIX apps were never designed to be used on a handheld device, and most of them are console apps. Typical smartphone users have zero interest in console apps.

    QNX is also a unique beast when it comes to userland executables, a lot of common tools you'd expect from your average BSD or Linux etc are either not there or completely different. (ie various common utilities like "ps" do not exist in QNX, though some have roughly similiar QNX equivalents.)

    While I'm sure there are tinkerers who might be interested in this sort of stuff, the already built-in and recently greatly improved Android runtime is a far FAR better mechanism to leverage a large existing software ecosystem to bring useful apps to BB10 than trying to port POSIX apps, in my view. (OS-X is POSIX compliant too - how many Mac users have you ever encountered that even know what POSIX is, or even know how to find the console app?)

    But even there, differences in the architecture prevent many of the more interesting geeky apps from fully working, ie "fing" is crippled running under the BB10 Android runtime. (Most likely because of the app firewalling, I would guess, or just network stack differences. I haven't investigated it much beyond "Hmm, half the functionality doesn't seem to work.")
    10-13-13 04:59 AM
  7. oddboy's Avatar
    I'd definitely be down with this. Anyone find out anymore on this? I imagine it might be possible to compile with the momentics ide..
    11-30-13 12:37 PM
  8. Omnitech's Avatar
    ...ie "fing" is crippled running under the BB10 Android runtime. (Most likely because of the app firewalling, I would guess, or just network stack differences. I haven't investigated it much beyond "Hmm, half the functionality doesn't seem to work.")

    The latest leaked OS 10.2.1.1055, with its greatly improved Android runtime, not only solves problems like the above (Fing now works great, yay), but installing Android apps directly from APK is now childsplay and there are at least a couple of apps that make obtaining those APK's very simple.
    11-30-13 07:16 PM
  9. oddboy's Avatar
    I don't want ports. I want native in the qnx shell.

    This looks promising: Composing Code: QNX, Native Binaries, and the BlackBerry PlayBook...
    gpl4all likes this.
    11-30-13 07:37 PM
  10. oddboy's Avatar
    http://forums.crackberry.com/showthread.php?t=881522

    Thought you guys might find this interesting.. a cron scheduler for BlackBerry 10.



    BRON: a cron-like scheduler for BlackBerry 10 : http://apps.oddelement.com
    12-07-13 01:11 PM
  11. gpl4all's Avatar
    I don't want ports. I want native in the qnx shell.

    This looks promising: Composing Code: QNX, Native Binaries, and the BlackBerry PlayBook...
    Yeah! Nothing is better than talk directly to OS, no player or whatever

    Posted via CB10 on Z10
    12-15-13 01:29 AM
  12. whatever-berry's Avatar
    Honestly I don't see the point.

    The VAST majority of POSIX apps were never designed to be used on a handheld device, and most of them are console apps. Typical smartphone users have zero interest in console apps.

    QNX is also a unique beast when it comes to userland executables, a lot of common tools you'd expect from your average BSD or Linux etc are either not there or completely different. (ie various common utilities like "ps" do not exist in QNX, though some have roughly similiar QNX equivalents.)

    While I'm sure there are tinkerers who might be interested in this sort of stuff, the already built-in and recently greatly improved Android runtime is a far FAR better mechanism to leverage a large existing software ecosystem to bring useful apps to BB10 than trying to port POSIX apps, in my view. (OS-X is POSIX compliant too - how many Mac users have you ever encountered that even know what POSIX is, or even know how to find the console app?)

    But even there, differences in the architecture prevent many of the more interesting geeky apps from fully working, ie "fing" is crippled running under the BB10 Android runtime. (Most likely because of the app firewalling, I would guess, or just network stack differences. I haven't investigated it much beyond "Hmm, half the functionality doesn't seem to work.")
    Hi Omnitech,
    that's more then clear, the main stream of users does not needs lot of open source sw, and they don't know, what could be some command-line tools good for, and how to use it. But still lot of people around need sometime a tool, which isn't available on appworld. And that is the main reason, where I can built very quickly my own script for something, and I can built it from another small tools. Let's have some example: What if I want to watch in active frames or full screen some values (temps, statuses, whatever), which these values could be anywhere in the network, internet... So I write simple script, which fetch my values into the file or local DB store together. The script can make some other calculating with values, etc... And now I need just another simple universal app, which shows the values from local store.
    So, I wanted to demonstrate just one case, where is very handy any open source tool. In this case would be nice to see maybe some python interpreter - cool.

    So, don't throw away the people, who cares the small useful tools. Is pretty nice, if some kids can sending msgs over the fb, viber, and other heavy applications. But let's create something real, what can be useful for all people universal way. Some interface, which can show output from script to active frame, notifications to hub (over the e-mail maybe), and so on.

    I'm looking forward to any good applications like this,

    WB
    05-01-14 03:54 AM
  13. oddboy's Avatar
    Here's one that executes system commands and displays the output on a screen:

    System Information - BlackBerry World

    It would be pretty trivial to make an app that watches a file and when your script pulls data from the network, writes it to that file. A Ui app could watch that file and display the contents any time the contents change.

    And I think bb10 has a python interpreter already, but not a lot of modules.
    05-01-14 07:55 AM
  14. dukzcry's Avatar
    Ok, i was able to bootstrap pkgsrc using these tools http://forums.crackberry.com/blackbe...kerers-961115/ [1] after applying a patch in attach [2].
    So to use pkgsrc on BB10 you need to:
    1) set the tools from [1]
    2) get the latest branch of pkgsrc qnx tree (not vendor one!) as described here: foundry27 : View Wiki Page: Bootstrap. If you have troubles getting it, here's the HEAD_660 branch, 458 revision (which may become too old at some point) https://docs.google.com/uc?id=0ByyEP...xport=download Includes .svn dir for later updating via svn
    3) apply a patch [2] like
    Code:
    $ ls
    pkgsrc
    $ patch < patch.txt
    4) extract the pkgsrc binary utilities from bootstrap.zip (in attach) to the documents folder (this path is a requirement).
    5) adjust the paths in pkg/env.sh and pkg/etc/mk.conf (which is the place for further workarounds and tweaks)
    6) if you're under the app user, you need to run fakeroot [1]
    7) do . /accounts/1000/shared/documents/pkg/env.sh
    Now follow an official guide on how to use pkgsrc Here's what was successfully built on QNX i386: ftp://ftp.netbsd.org/pub/pkgsrc/pack..._20110826/All/ and what failed: Index of pub/pkgsrc/reports/QNX/i386/6.5.0_head_20110826/20111203.2213/index.html Some of the failures can be fixed though.

    - in case you have several devices, you may go distributed way to speedup build process
    - if you wish to update pkgsrc tree right on the phone, read the guide at bottom: http://forums.crackberry.com/develop.../#post11155503
    - here's some prebuilt packages: https://drive.google.com/folderview?...UE&usp=sharing
    - to figure orphan/leaf packages (potential candidates for removal), use pkg_leaves command.
    Attached Files
    Last edited by dukzcry; 09-02-15 at 09:11 AM.
    djbclark and tollfeeder like this.
    10-01-14 06:12 AM
  15. djbclark's Avatar
    It was surprisingly annoying to get the svn packages tree to download completely - svn kept timing out.

    You can get it with much less trouble / faster in any case via the Sourceforge "QNX pkgsrc mirror" project.

    https://sourceforge.net/projects/qnxpkgsrcmirror/
    Last edited by djbclark; 01-04-15 at 05:07 PM. Reason: There is now the QNX pkgsrc mirror project on SourceForge.
    12-10-14 07:28 PM
  16. dukzcry's Avatar
    Their svn server requires a fast client machine with fast drives and a broadband internet channel, otherwise timeouts are common.

    Moreover, there are differences between a normal QNX and BB10, so some (or many?) packages will fail to build. However i've found that it's relatively easy to do hot patching and build further. I'm doing this locally for packages that i need right in the working directory, but if anyone is interested in doing a normal public ready work by forking and maintaining a separate pkgsrc tree for BB10, you're welcome. I don't have neither time nor interest to do this all by own. To that brave soul i suggest to find associates, as doing similar work alone is ungrateful.

    there are midnight commander and subversion all working with associated build utilities and libs. To be unpacked under /accounts/devuser/pkg folder: https://docs.google.com/uc?id=0ByyEP...xport=download

    This is the scheme with which I have no troubles and on-phone updates!
    1) do initial checkout of QNX pkgsrc tree on a fast machine
    2) transfer it to the BB10 device, including .svn directory
    3) use svn program from above binary pkgsrc prefix to do 'svn up' at wish.
    Last edited by dukzcry; 07-30-15 at 09:40 AM.
    12-12-14 01:31 AM
  17. djbclark's Avatar
    How did you get past "ERROR: subversion-1.8.0nb1 requires a native pthreads implementation." for subversion?



    I've also got a lot of stuff compiled, planning on putting up a pkg_add -able repo, probably next weekend.

    I'm using /accounts/1000/shared/misc/qnx instead of /accounts/devuser as the base, with the idea that that'll allow a non-dev-mode user to do stuff.
    12-15-14 07:18 AM
  18. dukzcry's Avatar
    Yes, it may break at first time, but surprisingly it get passed at second effort. Maybe some configure caching does nasty things.
    Can also suggest to bump svn version to 1.8.3 (via SVNVER mk variable, requires bmake makedistinfo in pkgsrc/devel/subversion-base to update hash). If fixes the r1503318 bug which you'll encounter on checkouts from community.qnx.com.
    Last edited by dukzcry; 04-27-15 at 11:49 AM.
    12-15-14 07:47 AM
  19. djbclark's Avatar
    Weird - I am using that mk.conf - I'll go look at the problem more; but knowing that variable is key is useful, thank you.

    Re: base path, idea is that for a random user there would be no need to ever connect to the phone with blackberry-connect and mess with permissions under /accounts/devuser; people could just plop down binary packages / eventually there could be a simple app that does basic pkg_add etc operations (or just use command-line utilities from a terminal app). If all you want to do is use some already-compiled software, getting blackberry-connect up and running seems like an unnecessary dependancy.

    Code:
    # Example /accounts/devuser/pkg/etc/mk.conf file produced by bootstrap-pkgsrc
    # Wed Oct  1 11:39:36 MSK 2014
    
    .ifdef BSD_PKG_MK       # begin pkgsrc settings
    
    
    UNPRIVILEGED=           yes
    PKG_DBDIR=              /accounts/devuser/pkg/var/db/pkg
    LOCALBASE=              /accounts/devuser/pkg
    VARBASE=                /accounts/devuser/pkg/var
    PKG_TOOLS_BIN=          /accounts/devuser/pkg/sbin
    PKGMANDIR=              man
    
    TOOLS_PLATFORM.install?=        /accounts/devuser/pkg/bin/install-sh
    TOOLS_PLATFORM.awk?=            /accounts/devuser/pkg/bin/nawk
    TOOLS_PLATFORM.sed?=            /accounts/devuser/pkg/bin/nbsed
    
    DISTDIR=                /sdcard/external_sd/downloads/distfiles
    PACKAGES=               /accounts/devuser/tmp/packages
    WRKOBJDIR=              /accounts/devuser/tmp/work
    #PKGSRCDIR=              /accounts/devuser/pkgsrc-qnx
    PKGSRC_COMPILER=        ccache gcc
    MAKE_JOBS=              4 # is number of CPUs*2
    #CFLAGS=                        -pipe
    #CXXFLAGS=              $CFLAGS
    
    FETCH_USING=                    fetch # tnftp is broken
    ALLOW_VULNERABLE_PACKAGES=      yes
    # workarounds
    USE_BUILTIN.termcap=            no
    USE_BUILTIN.dl=                 yes
    PTHREAD_OPTS=                  native
    #PKG_DEBUG_LEVEL=1
    
    .endif                  # end pkgsrc settings
    12-15-14 09:15 AM
  20. djbclark's Avatar
    Still playing with pkgsrc.

    Lots of things were dependent on s5ipc, an implementation of SysV IPC (which is included by default on most systems). It required much grotty ugliness to get it to build. I mentioned that over on the foundry27 QNX pkgsrc boards, and Sean from QNX dev, with impressive speed, cleaned it up a whole lot and pushed it out to SVN.

    Things I need to remember to package up: ldd work-alike script, syslog.h stub, usemsg stub, updated .profile, env.sh, make.mk

    Next big everything-depends-on-it blockage is perl. It looks like people have got it working in cross-compile; the qnxperl doc even has directions. Which didn't work for me; but probably just because I'm being dense. In any case the guy whose name is on the doc happens to work down the street from me; we're meeting up soon. He's actually not responsible for the BlackBerry bit of the doc, but he's been working with QNX for two decades, which I'm guessing means lots of grotty cross-compilation wisdom, so hopefully that'll be done soon.
    oddboy likes this.
    12-17-14 09:17 PM
  21. dukzcry's Avatar
    Lots of things were dependent on s5ipc, an implementation of SysV IPC (which is included by default on most systems). It required much grotty ugliness to get it to build.
    See: http://www.blackberrydev.net/wiki/S5ipc Fixed in tree a while ago.
    Things I need to remember to package up: ldd work-alike script, syslog.h stub, usemsg stub, updated .profile, env.sh, make.mk
    ldd now added, syslog facility should be provided in full, or workarounds for bb10 should be added in packages, for usemsg see above hack.
    Next big everything-depends-on-it blockage is perl
    Perl builds (since mc and svn which depend on it were built), but you need to know how: http://www.blackberrydev.net/wiki/Perl
    Last edited by dukzcry; 07-30-15 at 09:46 AM.
    moosbb likes this.
    12-18-14 12:15 AM
  22. djbclark's Avatar
    ldd

    Code:
    #!/bin/sh
    #
    #
    #	(requires objdump,awk)
    #	does NOT recurse into dependencies
    #
    #ifdef __USAGE
    #%C - display dynamic library dependency of the ELF executable
    #
    #%C [-v] a.out [a.out...]
    #	-v	Verbose
    #endif
    #
    
    verbose=
    
    unset IFS
    
    # get default lib search path
    CS_LIBPATH=`getconf CS_LIBPATH 2>/dev/null`
    if [ $? != 0 ]; then CS_LIBPATH="/lib:/usr/lib"; fi
    
    for bin do
    	if [ x$bin = x-v ]; then verbose=$bin; continue; fi
    
    	if [ $# -gt 1 ]; then
    		echo ${bin}:
    	fi
    
    	# LDLIBS="libc.so.2 libsocket.so";RPATH="/embedded/rpath:/path2"
    	eval `objdump -p -- $bin | awk '
    	    $1 == "NEEDED" { needs=needs $2 " "}
    	    $1 == "RPATH"  { rpath=rpath ":" $2}
    	    END {
    		## strip things after malicious chars
    		#sub("\`.*","",rpath)
    		if (p=match(needs,"[\`<>();&|$]")) needs=substr(needs,1,p-1);
    		if (p=match(rpath,"[\`<>();&|$]")) rpath=substr(rpath,1,p-1);
    		# strip first ":"
    		rpath=substr(rpath,2)
    		# result
    		print "LDLIBS=\"" needs "\";RPATH=\"" rpath "\""
    	    }'`
    
    	if [ x$verbose = x-v ]; then echo RPATH: $RPATH; fi
    
    
    	IFS=:
    	set -- $RPATH $LD_LIBRARY_PATH $CS_LIBPATH
    	case `uname -r` in
    	  6.1.*|6.0.*)
    	  	## 6.1.0 won't honor RPATH in the binary
    	  	## will search "" (current dir) if LD_LIBRARY_PATH undefined
    	  	set -- "$LD_LIBRARY_PATH" $CS_LIBPATH;;
    	  6.2.*)
    	  	## will search "" (current dir) if LD_LIBRARY_PATH undefined
    		set -- $RPATH "$LD_LIBRARY_PATH" $CS_LIBPATH;;
    	esac
    	if [ x$verbose = x-v ]; then echo Search Path: "$*"; fi
    	unset IFS
    
    	for i in $LDLIBS; do
    		case $i in
    		/*)
    			if [ -r $i ]; then
    				m="\011$i"
    				test ! -x $i && m=${m}"\011(not executable)"
    				i="found"
    			fi
    			;;
    		*)
    			for p do
    				test "$p" = "" && p="."
    				if [ -r $p/$i ]; then
    					m="\011$i =>\011$p/$i"
    					test ! -x $p/$i && m=${m}"\011(not executable)"
    					i="found"
    					break
    				fi
    			done
    			;;
    		esac
    		test "$i" != "found" && m="\011$i =>\011(file not found)"
    		echo "$m"
    	done
    done
    
    exit 0
    
    ## output format of SunOS ldd:
    #/bin/filename:
    #	libx.so =>	(file not found)
    #	libc.so.1 =>	/usr/lib/libc.so.1
    #	/usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1
    
    # Changelog:
    # 2002/09/02	use ":" for LDPATH separator, use IFS=: to split LDPATH
    #		properly search for "." when RPATH=:....
    # 2003/10/16	Switch between 6.1.0 and 6.2.0.
    #		Switch search "." when LD_LIBRARY_PATH undefined.
    12-18-14 05:04 AM
  23. dukzcry's Avatar
    Updates on this so far:
    1. Daniel now provides QNX pkgsrc mirror http://forums.crackberry.com/develop.../#post11152281 Thanks him for that!
    2. with current toolchain pkgsrc bootstraps just fine without any modifications done to pkgsrc tree (except of patch-pkgsrc660-444-tools.txt patch); also native termcap library is now provided by toolchain
    3. some prebuilt packages are available. See bootstrap post for a link.
    Last edited by dukzcry; 07-30-15 at 09:48 AM.
    moosbb and m3mb3rsh1p like this.
    04-27-15 08:08 AM

Similar Threads

  1. Replies: 20
    Last Post: 08-08-18, 08:30 PM
  2. Keyboard on screen app anywhere?
    By xenax in forum BlackBerry 10 Apps
    Replies: 20
    Last Post: 10-12-13, 09:41 AM
  3. What's that Android orb game called? Out for BB10?
    By xenax in forum BlackBerry 10 Games
    Replies: 4
    Last Post: 10-07-13, 08:49 AM
  4. Best link for sideloading?
    By Ryan Scott5 in forum BlackBerry Q10
    Replies: 3
    Last Post: 10-06-13, 04:12 PM
  5. Help with Q10 maps app?
    By ninauniverse in forum BlackBerry Q10
    Replies: 3
    Last Post: 10-06-13, 01:57 PM
LINK TO POST COPIED TO CLIPBOARD