Recent

Author Topic: How to build pas2js  (Read 6665 times)

jiutianfei

  • Newbie
  • Posts: 6
How to build pas2js
« on: January 17, 2018, 04:10:33 pm »
Hi all,

How to build pas2js? Using the installed fpcsrc-3.0.4 package, the compilation failed. On SVN, trunk looks like there are more files in the pas2js directory than in 3.0.4. So I svn co'ed trunk, make all, then tried to make pas2js. Still failed.

Hints appreciated.

Thaddy

  • Hero Member
  • *****
  • Posts: 14204
  • Probably until I exterminate Putin.
Re: How to build pas2js
« Reply #1 on: January 17, 2018, 05:11:45 pm »
make clean all install
It doesn't fail on my platforms.
Specialize a type, not a var.

jiutianfei

  • Newbie
  • Posts: 6
Re: How to build pas2js
« Reply #2 on: January 18, 2018, 02:22:39 pm »
Thanks for the hint. It wasn't that straightforward, but I got it built on
a fairly pristine Ubuntu 16.04. The trick seems to be to make sure ppcx64
used is the one from trunk, not from the fpc-3.0.4-2_amd64.deb package
which I used to bootstrap. So I "make clean all install" into ~/fpc, then:

  export PATH=~/fpc/bin:$PATH
  cd ~/fpc/bin
  ln ../lib/fpc/3.1.1/ppcx64
  hash -r
  cd ~/src/fpc-trunk/utils/pas2js
  fpcmake
  make



segfault

  • Full Member
  • ***
  • Posts: 107
Re: How to build pas2js
« Reply #3 on: February 16, 2018, 01:46:21 pm »
Sorry for the noob question but I have two folders which contain pas2js makefiles and I'm not sure which one I need to compile from:

/usr/share/fpcsrc/3.0.4/utils/pas2js

or

/usr/share/fpcsrc/3.0.4/packages/pastojs


segfault

  • Full Member
  • ***
  • Posts: 107
Re: How to build pas2js
« Reply #4 on: February 16, 2018, 05:09:05 pm »
Well, it makes no difference because when I try to compile from either I'm getting the dreaded "could not find unit. directory..."

Quote
The installer encountered the following error:
Could not find unit directory for dependency package "fcl-js"

 :(

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: How to build pas2js
« Reply #5 on: February 16, 2018, 07:26:39 pm »
I've also tryed but it fails.  >:(

Anyway, you can download precompiled snapshots from here.  It seems to work nicely on my Linux Mint.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

segfault

  • Full Member
  • ***
  • Posts: 107
Re: How to build pas2js
« Reply #6 on: February 16, 2018, 07:51:32 pm »
Thanks, but I'm using 32 bit Debian and get an error running the binary, so I guess it must be 64 bit.

ftp://ftpmaster.freepascal.org/fpc/contrib/pas2js/0.9.5/
« Last Edit: February 16, 2018, 07:53:16 pm by segfault »

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: How to build pas2js
« Reply #7 on: February 17, 2018, 11:24:23 am »
May be. Mine is 64 bit.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

segfault

  • Full Member
  • ***
  • Posts: 107
Re: How to build pas2js
« Reply #8 on: February 17, 2018, 12:27:17 pm »
Shouldn't the pas2js package be available for installation in Lazarus? I'm using 1.8 and it isn't in the list of packages available for installation.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: How to build pas2js
« Reply #9 on: February 17, 2018, 06:33:31 pm »
Sorry for the noob question but I have two folders which contain pas2js makefiles and I'm not sure which one I need to compile from:

/usr/share/fpcsrc/3.0.4/utils/pas2js

or

/usr/share/fpcsrc/3.0.4/packages/pastojs



You need both. The latter is the heart of the transpiler while the former is the command line utility providing the transpiler.

Well, it makes no difference because when I try to compile from either I'm getting the dreaded "could not find unit. directory..."

Quote
The installer encountered the following error:
Could not find unit directory for dependency package "fcl-js"

 :(

You need to use make clean all at the top level directory of the trunk checkout plus a make install (probably as root). Anything else requires experience to do.

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: How to build pas2js
« Reply #10 on: February 17, 2018, 06:44:44 pm »
Seems I  can't find jilts for files here with my install, oh well
The only true wisdom is knowing you know nothing

segfault

  • Full Member
  • ***
  • Posts: 107
Re: How to build pas2js
« Reply #11 on: February 18, 2018, 05:38:17 pm »
You need to use make clean all at the top level directory of the trunk checkout plus a make install (probably as root). Anything else requires experience to do.

Thanks, but what is the "trunk checkout"? Here's what comes up when I do "locate pas2js" on my system:

/usr/share/fpcsrc/3.0.4/packages/pastojs/src/fppas2js.pp
/usr/share/fpcsrc/3.0.4/packages/pastojs/tests/testpas2js.lpi
/usr/share/fpcsrc/3.0.4/packages/pastojs/tests/testpas2js.pp
/usr/share/fpcsrc/3.0.4/utils/pas2js
/usr/share/fpcsrc/3.0.4/utils/pas2js/Makefile
/usr/share/fpcsrc/3.0.4/utils/pas2js/Makefile.fpc
/usr/share/fpcsrc/3.0.4/utils/pas2js/dist
/usr/share/fpcsrc/3.0.4/utils/pas2js/fpmake
/usr/share/fpcsrc/3.0.4/utils/pas2js/fpmake.o
/usr/share/fpcsrc/3.0.4/utils/pas2js/fpmake.pp
/usr/share/fpcsrc/3.0.4/utils/pas2js/pas2js.lpi
/usr/share/fpcsrc/3.0.4/utils/pas2js/pas2js.pp
/usr/share/fpcsrc/3.0.4/utils/pas2js/samples
/usr/share/fpcsrc/3.0.4/utils/pas2js/dist/rtl.js
/usr/share/fpcsrc/3.0.4/utils/pas2js/samples/arraydemo.pp
/usr/share/fpcsrc/3.0.4/utils/pas2js/samples/fordemo.pp
/usr/share/fpcsrc/3.0.4/utils/pas2js/samples/fordowndemo.pp
/usr/share/fpcsrc/3.0.4/utils/pas2js/samples/hello.pas
/usr/share/fpcsrc/3.0.4/utils/pas2js/samples/ifdemo.pp
/usr/share/fpcsrc/3.0.4/utils/pas2js/samples/repeatdemo.pp
/usr/share/fpcsrc/3.0.4/utils/pas2js/samples/whiledemo.pp

So which directory do I "make clean install" from?

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: How to build pas2js
« Reply #12 on: February 18, 2018, 06:09:29 pm »
Thanks, but what is the "trunk checkout"?
Trunk is located here. for checkout, see wikipedia version control common vocabulary.

In short using version control tool to 'download' the most up to date sources from trunk (version 3.1.1 atm)

Quote
Here's what comes up when I do "locate pas2js" on my system:
Those are not up to date sources from trunk, rather those from FPC 3.0.4 release.

See also here in FPC/Lazarus wiki.

segfault

  • Full Member
  • ***
  • Posts: 107
Re: How to build pas2js
« Reply #13 on: February 19, 2018, 09:43:27 am »
Hi molly,

Thanks for the info, it will be useful for future reference, but I'd prefer to first fix the problem I have getting pas2js to compile on 3.04. If pas2js isn't ready for "prime time" yet then why is it included in 3.04? I've looked at the Wiki page on How to find units but I can't see anything wrong on my system. Maybe it's a problem with the makefile.

Maybe it's better if I wait until the next Lazarus release, as apparently pas2js will be better integrated with it.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: How to build pas2js
« Reply #14 on: February 19, 2018, 09:49:37 am »
@sefault:
afaik (but i can be wrong, so better verify) it does not compile out of the box with fpc 3.0.4. It is also not included by default in fpc 3.0.4 distribution. There have been many changes/improvement made lately and is a work in progress (even the link i gave yesterday showed that 7 hours before there were new commits).

 

TinyPortal © 2005-2018