Solved Steps from source code to tar.gz

Fbsdnew

Active Member

Reaction score: 5
Messages: 134


I want to know what to do from having a program (all of the file)on GitHub to building and compiling with cc on FreeBSD. What is source code? And how do I get from that to an executable and start a program?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,711
Messages: 39,306

I want to know what to do from having a program (all of the file)on GitHub to building and compiling with cc on FreeBSD.
There is no "one-size-fits-all" tutorial for this.

What is source code? And how do I get from that to an executable and start a program?
Perhaps learn the basics first? Get a book that teaches C programming. That should get you started.
 
OP
F

Fbsdnew

Active Member

Reaction score: 5
Messages: 134

There is no "one-size-fits-all" tutorial for this.


Perhaps learn the basics first? Get a book that teaches C programming. That should get you started.
I've already gotten the speech about learning c. Thought I would ask about what to do since I have no idea how to connect the dots or where any supporting documentation for porting would be. I didn't see any good examples. But maybe there wouldn't be any since like you said there's no one size fits all tutorial?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,711
Messages: 39,306

Thought I would ask about what to do since I have no idea how to connect the dots
The dots will connect once you learned how to code yourself. Then the process will be a lot clearer.

where any supporting documentation for porting would be.
There is a Porter's handbook but the information in it will be totally useless if you don't know what any of it means.

But maybe there wouldn't be any since like you said there's no one size fits all tutorial?
There is no single way to do this. It all depends on the actual code you're dealing with. Sometimes it's easy, sometimes it's difficult and other's are close to impossible.
 
OP
F

Fbsdnew

Active Member

Reaction score: 5
Messages: 134

The dots will connect once you learned how to code yourself. Then the process will be a lot clearer.


There is a Porter's handbook but the information in it will be totally useless if you don't know what any of it means.


There is no single way to do this. It all depends on the actual code you're dealing with. Sometimes it's easy, sometimes it's difficult and other's are close to impossible.

I saw that there is a URL for some of these programs on freebsd for a git or svn download. What would a good first step be from there? It looks like there is more I can do.
 

vigole

Daemon

Reaction score: 1,557
Messages: 1,391

  1. Read the FreeBSD Handbook, to know the OS daily operations
  2. Learn to work with shell: Sh - the POSIX Shell
  3. You have to know some basics about FreeBSD architecture
  4. Study a C programming language book, cover to cover, preferably The C Programming Language. 2nd Edition by Brian Kernighan and Dennis Ritchie
  5. Adopt your C knowledge to FreeBSD architecture: FreeBSD Developers' Handbook
  6. If you want to provide a port of a 3rd-party software, study the FreeBSD Porter's Handbook
  7. Best manual/guide for programming is the source code:
    1. Download the FreeBSD source code, and study some portion of it according to your needs.
    2. Download the FreeBSD port tree and study the structure of some ports (Makefile, ...)
  8. Use Debugger.
  9. Learn how to use DTrace
  10. Subscribe to some FreeBSD mailing lists
  11. Read some bug reports and learn from process
  12. Write program, run it, break and debug it.
  13. Take notes and archive your processes.
    1. Use bookmark or a HTML/<a> file to keep a list of important resources on the internet.
    2. Develop a systematically well-defined folder/text structure to organise your notes
    3. General contents are always available on different resources, e.g. web, but
    4. You have to keep tracks of your customised processes, e.g. configs, tricks, snippets, debug process, ...
    5. Use serial number, date suffix or timestamp, to have a clue about changes over the time.
    6. Use a version-control system for tracking changes of source files, or even on some cases your personal notes.
 

Mjölnir

Daemon

Reaction score: 1,509
Messages: 2,114

And last not least: be patient. This is a lot of stuff & needs time to settle down. Take a break when you feel you're stuck. To support connecting synapses: eat healthy, natural food ;)
 

mark_j

Daemon

Reaction score: 737
Messages: 1,279


I want to know what to do from having a program (all of the file)on GitHub to building and compiling with cc on FreeBSD. What is source code? And how do I get from that to an executable and start a program?
Jeez, you haven't set yourself much of a goal here, have you?

Source code is exactly what it says, the source code. It's the language of the compiler you're using. So for C, C++, C#, Objective-C each has its own source code syntax and language. If you have no knowledge of programing in C, then I suggest it's a poor language to learn concepts on. That's better done with a higher level language.

If you want to take some code off github, you can clone it to your local machine. So, the first thing to do is install GIT.

Once GIT's installed, go to the github repository and look for install instructions, a README.md or something similar. Any code worth running will have install instructions. Then you just click the CODE button on github, copy the URL and paste it onto your FreeBSD terminal, such as:

git clone https://github.com/samplesoftware/

This will pull in everything and create a sub-directory of the work. You will then cd into it and perform a make or configure or cmake or whatever software compilation control software is used. Pray it doesn't use meson. :(
 
OP
F

Fbsdnew

Active Member

Reaction score: 5
Messages: 134

Jeez, you haven't set yourself much of a goal here, have you?

Source code is exactly what it says, the source code. It's the language of the compiler you're using. So for C, C++, C#, Objective-C each has its own source code syntax and language. If you have no knowledge of programing in C, then I suggest it's a poor language to learn concepts on. That's better done with a higher level language.

If you want to take some code off github, you can clone it to your local machine. So, the first thing to do is install GIT.

Once GIT's installed, go to the github repository and look for install instructions, a README.md or something similar. Any code worth running will have install instructions. Then you just click the CODE button on github, copy the URL and paste it onto your FreeBSD terminal, such as:

git clone https://github.com/samplesoftware/

This will pull in everything and create a sub-directory of the work. You will then cd into it and perform a make or configure or cmake or whatever software compilation control software is used. Pray it doesn't use meson. :(
Im trying doing this with a program called i2p bote and when I cd into the directory and use make configure this is what I get...

root@machine17:~/i2p.i2p-bote.git # make configure
make: don't know how to make configure. Stop

make: stopped in /root/i2p.i2p-bote.git
 

memreflect

Well-Known Member

Reaction score: 221
Messages: 257

Im trying doing this with a program called i2p bote
A post on Reddit suggests the original I2P-Bote project is abandonware, and it appears to be true.

The README.md file in the more up-to-date fork includes a Build process section that lists dependencies on JDK 1.7.0+ and Gradle 5.6.4+ (I think installing devel/gradle should be enough to also install a suitable version of OpenJDK). Once you have the necessary dependencies installed, continue reading that section and follow the steps you require to build I2P-Bote. Good luck getting it to build.

After you build it, how you install it is a mystery to me since I've never used I2P or Gradle, so hopefully you know how to do it.

and when I cd into the directory and use make configure this is what I get...

root@machine17:~/i2p.i2p-bote.git # make configure
make: don't know how to make configure. Stop

The reason make configure failed is because there is no Makefile with a configure target. In fact, there is no Makefile at all. You need to read the instructions.
 

mark_j

Daemon

Reaction score: 737
Messages: 1,279

Im trying doing this with a program called i2p bote and when I cd into the directory and use make configure this is what I get...

root@machine17:~/i2p.i2p-bote.git # make configure
make: don't know how to make configure. Stop

make: stopped in /root/i2p.i2p-bote.git

The key to ANY development is being able to follow instructions, whether you're developing for someone else or doing as you are and taking someone else's work and trying to build it.

If the project you described doesn't include build instructions and you're not capable of working it out yourself, then you're best to search for another project that is documented. I know nothing about i2p-bote and I don't have time to find out, sorry.
 
Top