How to create Viktor Harbour 3.40 .deb package on Raspbian ?

317 views
Skip to first unread message

fvit

unread,
Mar 10, 2017, 12:34:26 PM3/10/17
to Harbour Users
Hello,
I have a problem on creating a .deb package from Viktor Harbour 3.40

After building on a Raspberry Pi (1) Model B flawlessly...

...almost flawlessly but for me is ok ;)

Harbour Compatibility and Regression Test Suite
Copyright (c) 1999-2017, Viktor Szakats
---------------------------------------------------------------------------
     
Version: Harbour 3.4.0dev () (2017-03-09 19:43)
     
Compiler: GNU C 4.9.2 (32-bit)
           OS
: Linux 4.4.50+ armv6l
   
Date, Time: 2017-03-10 18:16:37
Shortcut opt.: On
     
Switches:
===========================================================================
R
No.  Line            TestCall()                               -> Result                                                                                | Expected
---------------------------------------------------------------------------
! 1358 MAIN_STR(179)   Chr( -10000000.0 )
       
Result: "" + Chr( 0 ) + ""
     
Expected: "¦"
===========================================================================
Test calls passed:       5034 (  99.98 % )
Test calls failed:          1 (   0.02 % )
                   
----------
           
Total:       5035 ( Time elapsed: 2.46 seconds )

WARNING
: Failures detected

Then i tried to build a .deb package to install Harbour on my other two Pis but i get this error message:

root@raspberrypi:/home/pi/harbour-core-master# sudo fakeroot debian/rules binary
dh_testdir
make
: dh_testdir: Command not found
debian
/rules:39: recipe for target 'build-stamp' failed
make
: *** [build-stamp] Error 127


If someone know the solution please let me know.

Thank you for reading :)

Teo Fonrouge

unread,
Mar 10, 2017, 12:47:38 PM3/10/17
to Harbour Users
Hi,

You haven't installed dh_testdir which is part of debhelper

Install debhelper package:

$ sudo apt install debhelper


best regards,

Teo

fvit

unread,
Mar 10, 2017, 3:41:05 PM3/10/17
to Harbour Users
Thank you for your help, you are obviously right,

This line is in the "build section" on the GitHub page of Viktor...

You will need these base packages to build/package/test/use Harbour:

 bash git gcc binutils fakeroot debhelper valgrind upx uncrustify p7zip
-full



I'm very sorry for the silly question...

Thank you again for your help

fvit

unread,
Mar 10, 2017, 7:08:11 PM3/10/17
to Harbour Users
I'm still here... :)

I have followed the guide for building the .deb file but i got this error:

        ...
        find debian
/harbour ! -type l  -print0 2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s
        find debian
/harbour/usr/share/doc -type f  ! -regex 'debian/harbour/usr/share/doc/[^/]*/examples/.*' -print0 2>/dev/null | xargs -0r chmod 0644
        find debian
/harbour/usr/share/doc -type d  -print0 2>/dev/null | xargs -0r chmod 0755
        find debian
/harbour/usr/share/man -type f  -print0 2>/dev/null | xargs -0r chmod 0644
        find debian
/harbour/usr/include -type f  -print0 2>/dev/null | xargs -0r chmod 0644
        find debian
/harbour/usr/share/applications -type f  -print0 2>/dev/null | xargs -0r chmod 0644
        find debian
/harbour/usr/lib/arm-linux-gnueabihf/perl5/5.20 debian/harbour/usr/share/perl5 -type f -perm -5 -name '*.pm'  -print0 2>/dev/null | xargs -0r chmod a-X
        find debian
/harbour -perm -5 -type f \( -name '*.so.*' -o -name '*.so' -o -name '*.la' -o -name '*.a' -o -name '*.js' -o -name '*.css' -o -name '*.jpeg' -o -name '*.jpg' -o -name '*.png' -o -name '*.gif' -o -name '*.cmxs' \)  -print0 2>/dev/null | xargs -0r chmod 0644
        find debian
/harbour/usr/bin -type f  -print0 2>/dev/null | xargs -0r chmod a+x
        find debian
/harbour/usr/lib -type f -name '*.ali'  -print0 2>/dev/null | xargs -0r chmod uga-w
        find debian
/harbour-dbg  -print0 2>/dev/null | xargs -0r chown --no-dereference 0:0
        find debian
/harbour-dbg ! -type l  -print0 2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s
        find debian
/harbour-dbg/usr/share/doc -type f  ! -regex 'debian/harbour-dbg/usr/share/doc/[^/]*/examples/.*' -print0 2>/dev/null | xargs -0r chmod 0644
        find debian
/harbour-dbg/usr/share/doc -type d  -print0 2>/dev/null | xargs -0r chmod 0755
        find debian
/harbour-dbg/usr/share/man -type f  -print0 2>/dev/null | xargs -0r chmod 0644
        find debian
/harbour-dbg/usr/include -type f  -print0 2>/dev/null | xargs -0r chmod 0644
        find debian
/harbour-dbg/usr/share/applications -type f  -print0 2>/dev/null | xargs -0r chmod 0644
        find debian
/harbour-dbg/usr/lib/arm-linux-gnueabihf/perl5/5.20 debian/harbour-dbg/usr/share/perl5 -type f -perm -5 -name '*.pm'  -print0 2>/dev/null | xargs -0r chmod a-X
        find debian
/harbour-dbg -perm -5 -type f \( -name '*.so.*' -o -name '*.so' -o -name '*.la' -o -name '*.a' -o -name '*.js' -o -name '*.css' -o -name '*.jpeg' -o -name '*.jpg' -o -name '*.png' -o -name '*.gif' -o -name '*.cmxs' \)  -print0 2>/dev/null | xargs -0r chmod 0644
        find debian
/harbour-dbg/usr/lib -type f -name '*.ali'  -print0 2>/dev/null | xargs -0r chmod uga-w
dh_installdeb
        install
-d debian/harbour/DEBIAN
        sed s
/#DEBHELPER#// < debian/postinst > debian/harbour/DEBIAN/postinst
        chmod
0755 -- debian/harbour/DEBIAN/postinst
        chown
0:0 -- debian/harbour/DEBIAN/postinst
        sed s
/#DEBHELPER#// < debian/postrm > debian/harbour/DEBIAN/postrm
        chmod
0755 -- debian/harbour/DEBIAN/postrm
        chown
0:0 -- debian/harbour/DEBIAN/postrm
dh_installdeb
: Compatibility levels before 9 are deprecated (level 5 in use)
        find debian
/harbour/etc -type f -printf '/etc/%P
'
| LC_ALL=C sort >> debian/harbour/DEBIAN/conffiles
        chmod
0644 -- debian/harbour/DEBIAN/conffiles
        chown
0:0 -- debian/harbour/DEBIAN/conffiles
        install
-d debian/harbour-dbg/DEBIAN
dh_shlibdeps
        dpkg
-shlibdeps -Tdebian/harbour.substvars debian/harbour/usr/bin/harbour debian/harbour/usr/bin/hbnetio debian/harbour/usr/bin/hbrun debian/harbour/usr/bin/hbmk2 debian/harbour/usr/bin/hbformat debian/harbour/usr/bin/hbtest debian/harbour/usr/bin/hbi18n debian/harbour/usr/bin/hbdoc debian/harbour/usr/bin/hbpp debian/harbour/usr/bin/hbspeed debian/harbour/usr/lib/harbour/libharbour.so.3.4.0
dpkg
-shlibdeps: error: syntax error in debian/control at line 25: block lacks the 'Package' field
dh_shlibdeps
: dpkg-shlibdeps -Tdebian/harbour.substvars debian/harbour/usr/bin/harbour debian/harbour/usr/bin/hbnetio debian/harbour/usr/bin/hbrun debian/harbour/usr/bin/hbmk2 debian/harbour/usr/bin/hbformat debian/harbour/usr/bin/hbtest debian/harbour/usr/bin/hbi18n debian/harbour/usr/bin/hbdoc debian/harbour/usr/bin/hbpp debian/harbour/usr/bin/hbspeed debian/harbour/usr/lib/harbour/libharbour.so.3.4.0 returned exit code 25
debian
/rules:69: recipe for target 'binary-arch' failed
make
: *** [binary-arch] Error 25

I am doing something wrong ?

Sorry to bother again...  :)

vszakats

unread,
Mar 10, 2017, 10:20:38 PM3/10/17
to Harbour Users

fvit

unread,
Mar 11, 2017, 8:12:55 PM3/11/17
to Harbour Users
Wow, the Author Himself :) 

Thank you so much for your quick reply, but unfortunately, after (too) many hours of building (now I use git to get the source... the time before I used the "zip"ball on your GitHub page) I have this error:

...
hbmk2: Target up to date: ../lib/linux/gcc/libhbhpdf.a
/home/pi/harbour-core/bin/linux/gcc/hbmk2 -lang=en -quiet -width=0 -autohbm- @../config/hbpre -inc ./sddfb/sddfb.hbp @../config/hbpost
hbmk2: Processing: ../contrib/rddsql/rddsql.hbc
hbmk2: Compilation threads: 1
hbmk2 [sddfb]: Error: Missing dependency: firebird
hbmk2 [sddfb]: Hint: Install deb package: firebird2.5-dev
hbmk2 [sddfb]: Exit code: 10: dependency missing or disabled
/home/pi/harbour-core/bin/linux/gcc/hbmk2 -lang=en -quiet -width=0 -autohbm- @../config/hbpre -inc ./hbrun/hbrun.hbp @../config/hbpost
hbmk2: Processing: ../package/harbour.hbc
hbmk2: Processing: ../contrib/hbcrypto/hbcrypto.hbc
hbmk2: Processing: ../contrib/hbcrypto/3rd/ed25519/ed25519.hbc
hbmk2: Processing: ../contrib/hbcrypto/3rd/scrypt/scrypt.hbc
hbmk2: Processing: ../contrib/hbct/hbct.hbc
hbmk2: Processing: ../contrib/hbexpat/hbexpat.hbc
hbmk2: Processing: ../contrib/hbexpat/3rd/expat/expat.hbc
hbmk2: Processing: ../contrib/hbmzip/hbmzip.hbc
hbmk2: Processing: ../contrib/hbmzip/3rd/minizip/minizip.hbc
hbmk2: Processing: ../contrib/hbtip/hbtip.hbc
hbmk2: Processing: ../contrib/hbbz2io/hbbz2io.hbc
hbmk2: Processing: ../contrib/hbbz2/hbbz2.hbc
hbmk2: Processing: ../contrib/hbbz2/3rd/bz2/bz2.hbc
hbmk2: Processing: ../contrib/hbcomio/hbcomio.hbc
hbmk2: Processing: ../contrib/hbgzio/hbgzio.hbc
hbmk2: Processing: ../contrib/hbmemio/hbmemio.hbc
hbmk2: Processing: ../contrib/hbnetio/hbnetio.hbc
hbmk2: Processing: ../contrib/hbpipeio/hbpipeio.hbc
hbmk2: Processing: ../contrib/hbtcpio/hbtcpio.hbc
hbmk2: Processing: ../contrib/hbunix/hbunix.hbc
hbmk2: Compilation threads: 1
hbmk2: Linking... ../bin/linux/gcc/hbrun
hbmk2: Linker command:
gcc ../bin/linux/gcc/.hbmk/hbrun/hbmk2.o '../bin/linux/gcc/.hbmk/hbrun/_hbmkaut_hbmk2.o'   -Wl,-z,relro,-z,now -Wl,--start-group -lhbcrypto -led25519 -lscrypt -lhbct -lhbexpat -lexpat -lhbmzip -lminizip -lhbtip -lhbbz2io -lhbbz2 -lbz2 -lhbcomio -lhbgzio -lhbmemio -lhbnetio -lhbpipeio -lhbtcpio -lhbunix -lhbcplr -lhbdebug -lharbour   -Wl,--end-group -o../bin/linux/gcc/hbrun -L../lib/linux/gcc
/usr/bin/ld: ../lib/linux/gcc/libminizip.a(unzip.o): undefined reference to symbol 'inflateInit2_'
//lib/arm-linux-gnueabihf/libz.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
hbmk2 [hbrun]: Error: Running linker. 1
gcc ../bin/linux/gcc/.hbmk/hbrun/hbmk2.o '../bin/linux/gcc/.hbmk/hbrun/_hbmkaut_hbmk2.o'   -Wl,-z,relro,-z,now -Wl,--start-group -lhbcrypto -led25519 -lscrypt -lhbct -lhbexpat -lexpat -lhbmzip -lminizip -lhbtip -lhbbz2io -lhbbz2 -lbz2 -lhbcomio -lhbgzio -lhbmemio -lhbnetio -lhbpipeio -lhbtcpio -lhbunix -lhbcplr -lhbdebug -lharbour   -Wl,--end-group -o../bin/linux/gcc/hbrun -L../lib/linux/gcc
hbmk2 [hbrun]: Exit code: 7: failed in final assembly (linker or library manager)
! Finished build...
Makefile:8: recipe for target 'first' failed
make[2]: *** [first] Error 7
make[2]: Leaving directory '/home/pi/harbour-core/contrib'
config/dir.mk:71: recipe for target 'contrib' failed
make[1]: *** [contrib] Error 2
make[1]: Leaving directory '/home/pi/harbour-core'
debian/rules:39: recipe for target 'build-stamp' failed
make: *** [build-stamp] Error 2


The command I issue to make the .deb package is:

fakeroot debian/rules binary

Maybe is my fault. I have never used "sudo" to git or fakeroot...

I have tried again a few minutes ago after a "git pull" but I have the same error.

Thank you again for your help here, and for your work in general.

I work daily with your compiler for my freelance job and just for fun on my Raspberry Pi(s) :)

vszakats

unread,
Mar 12, 2017, 6:31:01 AM3/12/17
to Harbour Users
Hi fvit,

I don't use .deb (or .rpm) build methods (nor would I ever
recommend to install a non-stable Harbour in such way),
but doing a plain standalone build using `make` finishes
without any problem for me on the Raspberry Pi.

[ `Error: Missing dependency:` messages are expected and
can be safely ignored if those dependencies are indeed
missing.]

If you suspect any bug, please open an Issue here:

-Viktor

fvit

unread,
Mar 12, 2017, 11:11:12 AM3/12/17
to Harbour Users
Thanks Viktor, i don't suspect any bug, is (much) more probable that i'm doing something wrong :)

I build daily your compiler on windows 10 64bit with MinGW64 without an issue whatsover, is more than two years now.

My last attempt to build on the RPi is to NOT upgrade the firmware to the latest version but to keep the old one.
If I'm successfull i will post it here.
I have started the build process an hour ago, I expect to finish tonight.. :)

I will not bother you again, I promise :)
 Tnx again, bye!

vszakats

unread,
Mar 12, 2017, 11:40:13 AM3/12/17
to Harbour Users


On Sunday, March 12, 2017 at 4:11:12 PM UTC+1, fvit wrote:
Thanks Viktor, i don't suspect any bug, is (much) more probable that i'm doing something wrong :)

It's possible something goes differently when the deb toolchain
is controlling the build, but I'm not familiar with .deb creation.

Good news is that Harbour can be used just fine after a plain
build, it's enough to run the tools inside bin/linux/gcc/ directly.
(or can be added to PATH, too.). Well let's hope it builds with
your current OS state.

-Viktor

fvit

unread,
Mar 13, 2017, 10:01:58 AM3/13/17
to Harbour Users
We can close here... :)
After a bunch of tests the build works pretty well after a simple:
"sudo make clean install"
I have abandoned the idea of using the deb toolchain, and now it works great.
With the lastest "git pull" i have a few more errors on "hbtest" but i know is transitory.
The project changes hour by hour...

Thank you Viktor!

Harbour Compatibility and Regression Test Suite
Copyright (c) 1999-2017, Viktor Szakats
---------------------------------------------------------------------------

     
Version: Harbour 3.4.0dev (aed913a) (2017-03-12 19:55)

     
Compiler: GNU C 4.9.2 (32-bit)

           OS
: Linux 4.9.13+ armv6l
   
Date, Time: 2017-03-13 14:59:28

Shortcut opt.: On
     
Switches:
===========================================================================
R
No.  Line            TestCall()                               -> Result                                                                                | Expected
---------------------------------------------------------------------------
!    2 MAIN_HVM(55)    Asc( Chr( -100000.0 ) )
       
Result: 0
     
Expected: 96
!    4 MAIN_HVM(57)    Asc( Chr( dNegHigh ) )
       
Result: 0
     
Expected: 96
!    6 MAIN_HVM(60)    Asc( hb_BChar( -100000.0 ) )
       
Result: 0
     
Expected: 96
!    8 MAIN_HVM(62)    Asc( hb_BChar( dNegHigh ) )
       
Result: 0
     
Expected: 96
!   10 MAIN_HVM(64)    hb_SToD( "20170310" ) - -100000.0
       
Result: hb_SToD("20170310")
     
Expected: hb_SToD("22901224")
!   12 MAIN_HVM(67)    hb_SToD( "20170310" ) + -100000.0
       
Result: hb_SToD("20170310")
     
Expected: hb_SToD("17430526")
!   14 MAIN_HVM(69)    -100000.0 + hb_SToD( "20170310" )
       
Result: hb_SToD("20170310")
     
Expected: hb_SToD("17430526")
!   16 MAIN_HVM(72)    hb_SToD( "20170310" ) - dNegHigh
       
Result: hb_SToD("20170310")
     
Expected: hb_SToD("22901224")
!   18 MAIN_HVM(75)    hb_SToD( "20170310" ) + dNegHigh
       
Result: hb_SToD("20170310")
     
Expected: hb_SToD("17430526")
!   20 MAIN_HVM(77)    dNegHigh + hb_SToD( "20170310" )
       
Result: hb_SToD("20170310")
     
Expected: hb_SToD("17430526")
! 1378 MAIN_STR(179)   Chr( -10000000.0 )

       
Result: "" + Chr( 0 ) + ""
     
Expected: "▒"
===========================================================================
Test calls passed:       5045 (  99.78 % )
Test calls failed:         11 (   0.22 % )
                   
----------
           
Total:       5056 ( Time elapsed: 1.49 seconds )


WARNING
: Failures detected



vszakats

unread,
Mar 13, 2017, 10:43:55 AM3/13/17
to Harbour Users
Hi fvit,


On Monday, March 13, 2017 at 3:01:58 PM UTC+1, fvit wrote:
We can close here... :)
After a bunch of tests the build works pretty well after a simple:
"sudo make clean install"
I have abandoned the idea of using the deb toolchain, and now it works great.

Thanks for your feedback. I'm glad it works now, so it's probably
the .deb build environment that messes up something. .deb is
meant for packagers and distro maintainers, so it's not a showstopper.

I'd reiterate that `install`-ing is unnecessary and speaking of non-stable
software, it's dangerous especially if combined with `sudo`. Simple
`make` should result in an equally usable binary, with the advantage
that you can just wipe the whole directory and start over anytime.
 
With the lastest "git pull" i have a few more errors on "hbtest" but i know is transitory.
The project changes hour by hour...

Yes, in fact your report unintentionally revealed a nasty flaw on ARM
Harbour builds (all versions/forks). I've committed the tests for these
already. Related bug report with a patch-proposal pending here:


-Viktor

Reply all
Reply to author
Forward
0 new messages