Linux Port :)

You have successfully tested a non-tested PIC model, programmer interface, created a new devices.ini paragraph, performed a new translation, don't hesitate to publish that information here.

Re: Linux Port :)

Postby admin » 12, 2010 Aug Thu 8:02 pm

I know that it is not necessary to allow reviewing the license at installation time and that it is not necessary to provide a translated license. But I choose to make the effort to have those possibilities (not so easy for the translation in the installer I must admit). While very few open source software provide a license translation, a lot show the license at installation time. In fact all the open source software with installer that I tried (and that did not start by saying that they are already installed) have shown the license in the installer.

And there is yet an additional usage of the license under text file format: the source package. It contains the license files that can be identified by its name. Its clearer than hidding the license text in the Aboutbox source file code.

If Linux installer does not allow to review the license at installation time that's not a problem. But I want to keep it in the Windows version.

It's true that in most of the files I created I did not add the copyright header because this is quite a small contribution and I did not feel the need to tag all my files. Though no information does not mean no copyright. It's just an unidentified copyright. By default you have no right to use anything except when explicitly granted. That's the role of the license (though it can be reasonably assumed that publishing a content implicitly gives the license to read it). But you are right, at the end nobody cares. In fact companies have to, when they use open source.

Philippe
admin
Site Admin
 
Posts: 153
Joined: 12, 2009 Jul Sun 7:20 pm

Re: Linux Port :)

Postby Death Knight » 14, 2010 Aug Sat 1:03 pm

Okey,I think it's enough to play with wxpic. I wanted to complete remaining works ASAP than will switch to work for other projects... There is no lots of job remains.

So needed to fix those license showing thing and version showing problem on about menu on linux version... Loading from txt is not problem, but if there no file, It's better to have english one hard coded to source. I place 4 comment lines that loads license dynamically. And If no license found, uses english one, that hard coded to code. But I think it doesn't load file and convert into string properly...
And also version problem in current devel branch. When you fix those two, I can start to generate packages for linux.

On some programs, linux packager show license (like loading flash player like closed source programs) but I don't know how to make it exactly... Also it's not guarantied to showing license (because package doesn't install itself but installer installs is thats different from distro to distro), some package installer will skip showing license... Since our source is open, I don't think it's required the show those license at installation. That will disturb linux users and might think your program as closed sourced (linux users commonly don't read licenses too, but they declines it instead of allowing :) ). Most of them wont install it the package and don't use the program...

I will try to generate debian package. But for that, I think I needed ubuntu installed on my Virtual machine. :)
Death Knight
 
Posts: 53
Joined: 30, 2010 May Sun 10:18 pm

Re: Linux Port :)

Postby Death Knight » 16, 2010 Aug Mon 1:32 am

Hellow.
I fixed serial ports on Linux. Now they works as it needed.
Before we cannot use USB to RS232 devices since their names are different in linux mounts.
I just add all devices /dev/ttyS* and /dev/ttyUSB* as a port. Serial devices showed as /dev/ttyS0 or /dev/ttyUSB0 in combobox also not as Com1,2,3...
I added new config variable sz40ComPortName to do it. I prefer to read selection directly from user interface but I can't. Actually don't try to understand how to do that or if it possible... Anyway,handled configuration save load options too. This variable is for just non windows systems...

But I cannot remove "Unknown" port setting from menu.
Can you move aInterfacePortChoice->Append(_("(unknown)")); code into #ifdef __WXMSW__ at InterfacePanel Line 360

Code: Select all
#ifdef __WXMSW__
        aInterfacePortChoice->Append(_("(unknown)"));
        for (i=1;i<=16;++i)
        {
            aInterfacePortChoice->Append(wxString::Format(_T("COM%d"),i));
        }
#else
...


I don't want to carry this to remove from linux because it's related with another settings.
After move something doesn't work. Ports are detected correctly but when I press initialize to test, it fails...
Also we don't need address thing in the linux since we are just using files as devices... You can disable (or hide ;) ) it.
Cheers.
Death Knight
 
Posts: 53
Joined: 30, 2010 May Sun 10:18 pm

Re: Linux Port :)

Postby admin » 19, 2010 Aug Thu 3:36 pm

Hi Erdem,

I have fixed all that by aligning the Windows way for managing Serial ports on the Linux way. There was a lot of unused code in this area so I made also a big Cleanup. Unfortunately my laptop has no serial port nor parallel. So testing is limited!
Then I tried to regenerate the language files and discovered that a renaming has completely broken my language file makefile. It is much more complex than yours as it starts from the project file and the source files to go up to the .mo. And it is generic (it does not depend on the project and automatically adapts to any list of languages found in the project). But it does not accept that the .po files has a different case than the remaining files in the project.

So I started to revert the names to their original case (I also modified your makefile so it stays in line with the original names). Though changing case is really problematic under Windows as this is still the same file while not being the same. This required to do some SVN Copy operations. Unfortunately the Copy operation seems not compatible with the proxy of my Wifi Hot Spot (I get a 502 Bad Gateway error). So I have not been able to complete the operation. I will try to find a compatible Wifi hot spot but that will take longer...

It took me a long time to understand why my makefile no longer generated the language files (this makefile is very complex to be fully generic - it includes 3 other makefile that it generates itself - so debugging it is a nightmare). And then it took me a long review time of the generated language files to cope with the re-organization of the source files brought by suppression of wx directory (so the source file order has been modified and the .po is completely changed). I know that removing wx what a good thing because it was a really big naming mistake. But please in the future no more renaming, file moving or such cosmetic change! I am sure that Linux knows what is upper case and I doubt that some one has prevented the use of upper case in filenames.

When I will have solved the SVN issue I will look at the consequence of renaming on the Window installer...

Philippe
admin
Site Admin
 
Posts: 153
Joined: 12, 2009 Jul Sun 7:20 pm

Re: Linux Port :)

Postby admin » 20, 2010 Aug Fri 2:34 pm

OK I solved my problem but that was not a proxy issue. I realize that my Wifi Ethernet card had received the same IP address than my IP on the web.
The problem was that I used http: in my repository address. I lost the s in the copy to my laptop.
It works well for usual requests but fails with copy. The reason is tricky: when performing usual operations to http://domain/filepathname, the request is sent to http://domain and contains a reference to filepathname. The Apache server sends the http://domain request at the same service as if the request is received for https://domain
But in case of a copy operation the request copies http://domain/filepathname1 to http://domain/filepathname2 the request contains filepathname1 and http://domain/filepathname2. The server has been configured to be at domain https://domain so it does not understand http://domain/filepathname2 is referring at his own repository! You can't copy outside your own repository...

So all is fixed now. I made a brand new working copy using https and all works well. I have committed all the changes, including the fixes for the installer. By the way I had to make again more complex my makefile to manage the doc directory in addition of the Lang directory. Fortunately the new directory pattern is identical to the Lang directory so I just had to copy all the lines for the Lang directory to process the doc directory. I have now 5 included auto-generated makefiles!
admin
Site Admin
 
Posts: 153
Joined: 12, 2009 Jul Sun 7:20 pm

Re: Linux Port :)

Postby Death Knight » 23, 2010 Aug Mon 4:31 pm

Hi Philippe, I assume you will not work for 2 weeks. I looked now and finds big changes on svn.
I see some glitches like linux build is broken for forgotten ')' but fixed.

I don't understand that why language build system broken for windows. It doesn't look for letters capitals. Lower names is good thing in posix systems. For example I see some people that "I installed DivFix++ but cannot run it..." like comments because my executable is "DivFix++" not divfix++. Also my package names start with capitals. Linux world is changes distro to distro. You can use it on some distros. But in ubuntu (which is most used linux distro), it's forbidden. You cannot use big capitals. So my package at ubuntu distro uses (and has to use) small letters...

So having big name on program name definitely generates problems sooner or later. It's not just cosmetic issue for posix. It might be better on capital starting on letters or writings but the rules are different for the posix rules. It's better to have small ones. We needed to choose between cosmetic (Wx) vs compatibility(wx). I used cosmetic way before on my program without knowing the compatibility issues also don't understand why all people uses small letters meaninglessly on linux and than experienced that having capitals on name is wrong way. Your program name could be start with capitals on program title or about dialog, web page...etc but keeping capital for program executable is a mistake. How about If you are needed to write "Firefox" command for run it instead of "firefox"? Since linux users wanted to make it easy, they use lower letters on all programs.

And make files that you are mentioned. I don't know about them. Does they generated via Code::Blocks?
I also noticed that your program doesn't have language selection function. So I don't test it. I guess you select language via system variables but I think it's better to have a selection menu.

Erdem
Death Knight
 
Posts: 53
Joined: 30, 2010 May Sun 10:18 pm

Re: Linux Port :)

Postby admin » 24, 2010 Aug Tue 2:10 pm

Hi,

I still have my laptop so I am still able to do some work ;)
But the test possibilities are limited (hence the regression :( )

So I understand that ubuntu is a sort of cancer that forces you to use only lower case so that you arrive to be obliged to use lower letters everywhere. This reminds me the Internet Explorer cancer that does not follow the norm and forces the web pages to include IE variant to stay compatible with it.
Wouldn't it be better to isolate that cancer by forcing them to lower case at the last stage when building the package so that the constraint is embed in the ubuntu package generator and not on every OS for every projects.

Imagine that another Linux variant imposes that they want all their names in upper case because they prefer them like it! How would you do? As a general rule, the constraints, when they are not common sense, should not be propagated.


My generic makefile is not provided with wxPic as it requires a lot of stuff to work (a lot of gnu tools such as sed, diff,... a PHP interpreter, and a Saxon xslt 2 parser with its JVM, as well as a some environment variables). And it mainly allows me to simplify the language files maintenance and make systematic the test environment creation (it does a sort of install in the debug and release - or other - branches found in the bin subdirectory). And it does all that with no parameter. It just have to be run in the project home directory.

The language choice is provided in the Option panel. It is based on the list of languages files found in the Lang subdirectory (one of the role of my makefile is to copy the language files there). If you have no language file you get only the build-in language. At first run when language is undefined, it tries to find a match for the locale in the language files and if found, use it as first language.

Philippe
admin
Site Admin
 
Posts: 153
Joined: 12, 2009 Jul Sun 7:20 pm

Re: Linux Port :)

Postby admin » 19, 2010 Sep Sun 5:22 pm

Hello Erdem,

After reviewing your makefile I have understood the difficulty to configure WxPic for its data files under Linux. As under windows all files are installed in the executable directory, the code was referring to ExecutablePath everywhere a path was necessary. With Linux each file is in its own location. I saw that wxWidgets helps to solve this problem by providing access to standard locations. So I change all the occurrence of ExecutablePath by retrieval of the right directory (data directory or localized resource directory).

In addition I returned the .mo files to their standard location under Windows too. In fact I had specified a non-standard location because the standard one did not work. This time I debugged wxWidgets to understand why the standard path did not work. And I found that when the application is installed in a directory whose name starts with "debug" the localized file standard directory is modified by wxWidgets. This code can be deactivated when not compiling in debug mode. But I wanted to keep the possibility to compile in debug! So I renamed the debug directory so that the program is never installed in a directory starting with debug.

I have updated your makefile to install all the data files. And I make use of Code::Blocks to build the executable instead of the compiler. This allows to have a fine dependency management on .h files and avoids to place the binary and the objects in different location than Code::Blocks does. I have also added in the makefile the function to copy the datafile in the Release and Debug test directories. So that it is possible to test the executable with all its data files directly from Code::Blocks. In fact now if you run the executable and it cannot find its data files it will stop immediately with an error message listing the missing files.

I have also taken into account the need to have no upper case character in the filenames under Ubuntu without affecting the filenames elsewhere. It is the makefile that performs the renaming at installation time. In test directory the Upper case names are kept.
I have put in comment the installation of the .png and the .desktop files in the Makefile because I don't know what they are used for. So I was not able to know where I had to put these files nor how to test if they are at the right place.
For the same reason I did not update the wxpic.spec file

After doing all that I still don't understand why it was necessary to change the structure of the directories. I could have written the Makefile to work with the old structure. I am thinking to return to the old structure with a slight change: Rename the Web directory to Doc, move the content of Lang and doc directories in this new Doc directory that would contain all the text files. This should have only an impact on the Makefile and on the Windows installer (and probably on the Linux packager(s)).

I have also returned to my License.txt file for filling the About Dialog now that the data files are easy to reach under Windows and Linux. I even added more files to fill the Translators and the Doc Writers. I kept the standard About Dialog though it is really ugly under Windows (it does not even fit in the screen !!!). They really need to improve it.

Regards,
Philippe
admin
Site Admin
 
Posts: 153
Joined: 12, 2009 Jul Sun 7:20 pm

Re: Linux Port :)

Postby Death Knight » 17, 2010 Oct Sun 4:17 pm

Hi Philipe,
There is too much time I guess. I am working to build my UPS with ATmega, fighting with MOSFETS, Opamps etc... so I don't use PIC's much this days and forgot the packaging stage...
I look new make file. It looks good but there is some problems.

Adding Code::Blocks to makefile is not a good move. Because it makes the program "depended" to code::blocks. And Code::Blocks is not available in most repos. Even if it's available, there will rise problems due need ox X11 for build on CompileFarms... So I think it's better to revert back older makefile approach for compiling. You might thing this state of make file is more portable but it's not useable so it's not portable actually... This is biggest problem of make file...

.png and the .desktop files are required for a icon on like "startup menu" on windows but for Linux GTK. Users can easily find the program from gui.

Change of directory names are not required only if they installed to proper location with proper name on install time (If we can). But it's better and easier to keep this directory in linux format. Why do program/script needed to rename those files on installation? There is 3 different script needed on linux side(makefile, rpm spec and deb control) So on install time you can copy directory to linux targets easily, reduces complexity. That simplifies makefile. I don't mastered on Makefile structure. There is lots of documentation for it. Looks like bash but has some special abilities... So I cannot move files as I want (with using "install" command). Change of name required :) Specially for doc/language(?) directory that has some dir in dir. (FR dir in ENG root..) But if you can make the packaging scripts, it's okey. But there is also RPM spec and deb control files needed to changed. Those are not using make file (?)...

wxAbout will be changed on next wx version I guess. I don't know which version you talking about but I think they will fix if it looks uggly. :)

And I tried to build file, it gives error. I think you make some thing bad on submitting to svn...Please check SVN... Specially end of this file. End of file is absent!

Will back soon (I wish), cheers
Erdem
Death Knight
 
Posts: 53
Joined: 30, 2010 May Sun 10:18 pm

Re: Linux Port :)

Postby admin » 25, 2010 Oct Mon 8:59 am

Hi Erdem,

The corruption issue in MainFrame-2.cpp is fixed. I have no idea how it occurred. In fact all the CR and LF have been lost from the lines I had added in the new revision. This would have worked if these lines did not contain a comment starting with // :!:

The makefile no longer requires Code::Blocks, but I kept an option that allows to use it if you need to take into account the dependencies on .h
The install rules are improved too so that the files that are already up-to-date are not re-installed.

I don't understand your explanation about the directories. But I will see when I will see the packaging instructions.

Regards,
Philippe
admin
Site Admin
 
Posts: 153
Joined: 12, 2009 Jul Sun 7:20 pm

PreviousNext

Return to WxPic contributions

Who is online

Users browsing this forum: No registered users and 1 guest

cron