LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Why are Linux programs available only in source? (https://www.linuxquestions.org/questions/linux-newbie-8/why-are-linux-programs-available-only-in-source-819107/)

QueenZ 07-10-2010 12:42 PM

Why are Linux programs available only in source?
 
When I go to sites like kde-apps.org or gtk-apps.org i often times find that lots of programs there are available only in source code? Why? Why is it so hard for the developer to compile the package or to make that .deb or .rpm package? I'm sure it's easier for the developer to compile his own program than for a linux user... i don't get this.. why does everything come in source code?

sycamorex 07-10-2010 12:49 PM

First of all, not everyone uses deb or rpm package systems and source code is universal can usually be compiled on almost any (supported) platform.

Secondly, by compiling from source, the packages is tailored to your system/hardware, etc.

thirdly, providing binary packages (deb/rpm) takes away your freedom to enable/disable some functions of the program.
By default the most common functions are enabled, however, depending on your system/needs you may slim it down disabling some functionalities or add some additional ones.
You can see the list of available options by issuing ./configure --help

Compiling is not that difficult. If you don't want to customise your package, in most cases the following will suffice:

Quote:

./configure
make
make install

frieza 07-10-2010 12:50 PM

yes and no, there are so many distributions out there with their own package format as well as so many versions of those distributions still in operation that it would be quite a bit of work to compile them for all of them, even for just the most common ones, it is much simpler to simply create a configure script and a makefile and let the person installing it do the compiling themselves to ensure the greatest compatibility, not to mention, provided the necessary libraries and header files are present on the machine the source code can be compiled on almost any *nix like operating system, including bsd, OSX, other UNIXes etc.. in short a source release is more flexible.

knudfl 07-10-2010 01:15 PM

Say, you have Ubuntu 10.04 Lucid.
Available packages = about 30,000.

Not often any reason to compile anything.

..

QueenZ 07-10-2010 01:15 PM

sycamorex, that almost never works.. it didn't for this wordplay game...

Quote:

queenz@martin-lucid:~/Downloads/wordplay-0.3$ ./configure
bash: ./configure: No such file or directory
Quote:

$ make
wordplay.c:2048: error: ‘struct <anonymous>’ has no member named ‘mouse_off_y’
wordplay.c:2049: error: ‘struct <anonymous>’ has no member named ‘drag_y’
wordplay.c:2050: error: ‘struct <anonymous>’ has no member named ‘drag_y’
wordplay.c:2051: error: ‘struct <anonymous>’ has no member named ‘drag_y’
wordplay.c:2051: error: ‘struct <anonymous>’ has no member named ‘tile_height’
wordplay.c:2052: error: ‘struct <anonymous>’ has no member named ‘drag_y’
wordplay.c:2052: error: ‘struct <anonymous>’ has no member named ‘tile_height’
wordplay.c:2056: error: ‘struct <anonymous>’ has no member named ‘drag_x’
wordplay.c:2056: error: ‘struct <anonymous>’ has no member named ‘drag_y’
wordplay.c:2059: warning: implicit declaration of function ‘gtk_widget_queue_draw_area’
wordplay.c:2059: error: ‘struct <anonymous>’ has no member named ‘canvas’
wordplay.c:2060: error: ‘struct <anonymous>’ has no member named ‘tile_width’
wordplay.c:2060: error: ‘struct <anonymous>’ has no member named ‘tile_height’
wordplay.c:2061: error: ‘struct <anonymous>’ has no member named ‘canvas’
wordplay.c:2061: error: ‘struct <anonymous>’ has no member named ‘drag_x’
wordplay.c:2061: error: ‘struct <anonymous>’ has no member named ‘drag_y’
wordplay.c:2062: error: ‘struct <anonymous>’ has no member named ‘tile_width’
wordplay.c:2062: error: ‘struct <anonymous>’ has no member named ‘tile_height’
wordplay.c: At top level:
wordplay.c:2069: error: expected ‘)’ before ‘*’ token
wordplay.c:2087: error: expected ‘)’ before ‘*’ token
wordplay.c:2105: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘handle_hook_key_press’
wordplay.c:2122: error: expected ‘)’ before ‘*’ token
wordplay.c:2161: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘handle_defs_mouse_wheel’
wordplay.c:2180: error: expected ‘)’ before ‘*’ token
wordplay.c:2187: error: expected ‘)’ before ‘*’ token
wordplay.c:2196: error: expected ‘)’ before ‘*’ token
wordplay.c:2210: error: expected ‘)’ before ‘*’ token
wordplay.c:2238: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘complete_tile_drop’
wordplay.c: In function ‘cancel_tile_drop’:
wordplay.c:2251: error: ‘struct <anonymous>’ has no member named ‘drop_timeout_id’
wordplay.c:2252: error: ‘struct <anonymous>’ has no member named ‘drop_timeout_id’
wordplay.c:2253: error: ‘struct <anonymous>’ has no member named ‘drop_timeout_id’
wordplay.c: At top level:
wordplay.c:2260: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘restore_message_text’
make: *** [wordplay.o] Error 1

sycamorex 07-10-2010 01:24 PM

Probably the reason that it never works for you is that you never read the INSTALL/README files included with the sources. Is this the case?:)
Wordplay compiles nicely on my system. The INSTALL file says:

Quote:

To compile, check the top of Makefile for configuration options (you may want
to change PREFIX and/or CFLAGS), then type "make". To install, type "make
install".

Gtk 1.2.x and Gdk-Pixbuf are required.
Check if you've got necessary dependencies Gtk/Gdk.

fbobraga 07-10-2010 01:27 PM

apt-get install wordplay ?

QueenZ 07-10-2010 01:28 PM

sycamorex, i do have GTK and also GDK i guess but there i just no such file configure there...

Quote:

-rw-r--r-- 1 queenz queenz 43 2006-08-23 23:45 AUTHORS
lrwxrwxrwx 1 queenz queenz 4 2010-07-10 21:09 ChangeLog -> NEWS
-rw-r--r-- 1 queenz queenz 18009 2006-08-23 23:45 COPYING
drwxr-xr-x 2 queenz queenz 4096 2007-08-19 01:14 data
-rw-r--r-- 1 queenz queenz 15505 2006-08-23 23:45 icons.c
-rw-r--r-- 1 queenz queenz 205 2006-08-23 23:45 icons.h
lrwxrwxrwx 1 queenz queenz 6 2010-07-10 21:09 INSTALL -> README
-rw-r--r-- 1 queenz queenz 831 2006-08-23 23:45 Makefile
-rw-r--r-- 1 queenz queenz 156 2007-08-14 10:42 NEWS
-rw-r--r-- 1 queenz queenz 1664 2007-08-14 14:08 README
-rwxr-xr-x 1 queenz queenz 14 2006-08-23 23:45 tags
-rw-r--r-- 1 queenz queenz 17494 2007-08-14 14:09 TAGS
drwxr-xr-x 3 queenz queenz 4096 2006-08-23 23:45 tilesets
-rw-r--r-- 1 queenz queenz 7663 2006-08-23 23:45 util.c
-rw-r--r-- 1 queenz queenz 2324 2006-08-23 23:45 util.h
-rw-r--r-- 1 queenz queenz 465 2006-08-23 23:45 wordplay_16x16.png
-rw-r--r-- 1 queenz queenz 650 2006-08-23 23:45 wordplay_32x32.png
-rw-r--r-- 1 queenz queenz 946 2006-08-23 23:45 wordplay_48x48.png
-rw-r--r-- 1 queenz queenz 82991 2007-08-14 10:48 wordplay.c
-rw-r--r-- 1 queenz queenz 8780 2007-08-14 08:20 wordplay.h

sycamorex 07-10-2010 01:34 PM

As the INSTALL file states, you don't need to issue ./configure in this case. The Make file is ready. You can just customise some flags by editing the Makefile file.
In this case however, there's not much to customise.

./configure
make && make install

They are just generic instructions. Always read the INSTALL / README files to follow the install instructions.

You say you guess that you've got gdk-pixbuf. You need to doublecheck it. Without all necessary dependencies, it won't compile.

QueenZ 07-10-2010 01:52 PM

ok i didn't have it but anyway..
Usually if you compile a program it will work on almost every distro out there... and most of the time it will be enough for the end user.. no?

sycamorex 07-10-2010 02:07 PM

Quote:

Originally Posted by QueenZ (Post 4029349)
ok i didn't have it but anyway..
Usually if you compile a program it will work on almost every distro out there... and most of the time it will be enough for the end user.. no?

I'm not sure I understand. What will be enough for the end user?

Generally, your first source of packages should be your distro's repository. You'll grab the source code only if:
1. It's not in the distro repository
2. You want to enable some extra functionality.

With the number of packages in Ubuntu repositories, an *average* Ubuntu user (from your bash prompt I assume you use Ubuntu) will rarely (if never) need to install anything from the source code.

knudfl 07-10-2010 02:33 PM

About wordplay :
http://archive.ubuntu.com/ubuntu/poo...22.orig.tar.gz

cd wordplay-7.22.orig/
patch -p1 < wordplay_7.22-1.diff

make CC=gcc-3.3
I.e. the file wordplay.c is from 1996.
You can get gcc-3.3 from e.g. Ubuntu Hardy.
http://packages.ubuntu.com/hardy-updates/gcc-3.3
..

rkelsen 07-10-2010 09:26 PM

Quote:

Originally Posted by QueenZ (Post 4029300)
Why is it so hard for the developer to compile the package or to make that .deb or .rpm package?

Releasing source code allows people to compile and package it however they please, even allowing different OSes to use the software. For example, you can compile KDE on the *BSDs.

I note that the distributions you're listed as using (Ubuntu and OpenSuse) are, by default, tailored towards not requiring the end user to compile their own software. As a couple of people have mentioned, with these two distros, it's probably best if you install the binary packages supplied by the distributor.

In order to be able to compile software, your OS has to have an environment designed with the goal of enabling the end user to do so. Slackware is one such distro. In fact, (and I might be going out on a limb here), I think that Slackware has the best "out-of-the-box" environment for compiling stuff. I've seen only a handful of failures over the 11 years I've been using Slackware, and none for at least 5 of those years. So far I've built 106 packages for Slackware 13.1 with no failures.

Ubuntu and OpenSuse can be customised to compile software as easily as Slackware, but you need to add some of the "*-devel" packages. I'm not sure which ones, because I haven't tested either of these distros over the past couple of years.

HTH


All times are GMT -5. The time now is 03:38 PM.