Re: Building/Installing a GTK+ Application




--- getik too <getik2 inbox com> wrote:

> Ok I have compiled my GTK+ application and everything works.  Now I want to be
> able to install my application on other computers.  Assuming the other computers have GTK+
> installed and is unix/linux based, how do I go about installing my application from some storage
> media, eg. a cd.  
> What files and libraries would need to be included on the cd.  I am not trying
> to create a self installing cd just something that has whatever is necessary 
> to make my executable run.
> 
> If the unix/linux os does not have GTK+ installed what is needed then for my 
> program to run?
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
> 

As it has already been suggested, you can package your program with
buit by yourself version of gtk.

But remember, that gtk+ is not only gtk+, but also libraries it depends
on, and those libraries depend on other libraries.

So, it's up to you to decide what to be included in the package.

Here are gtk+ dependencies the way I know them:

      'gtk+' =>
        do{
          my $major_ver = '2';
          my $minor_ver = '8';
          #my $minor_ver = '10';

          $gtk_plus_hash_ref =
            {
            base_urls => &{$_gnome_c_urls_sub}
                           (
                           'gtk+',     # $target,
                           $major_ver, # $major_ver,
                           $minor_ver, # $minor_ver
                           ),

            major_ver => $major_ver,
            minor_ver => $minor_ver,
            micro_ver => '20',
            #micro_ver => '3',

            depends_on =>
              {
              targets =>
                {
                libjpeg => $libjpeg_hash_ref,
                libtiff => $libtiff_hash_ref,

                atk =>
                  do{
                    my $major_ver = '1';
                    my $minor_ver = '12';

                    $atk_hash_ref =
                      {
                      base_urls => &{$_gnome_c_urls_sub}
                                     (
                                     'atk',      # $target,
                                     $major_ver, # $major_ver,
                                     $minor_ver  # $minor_ver
                                     ),

                      major_ver => $major_ver,
                      minor_ver => $minor_ver,
                      micro_ver => '1',

                      depends_on =>
                        {
                        targets =>
                          {
                          glib =>
                            do{
                              my $major_ver = '2';
                              my $minor_ver = '12';

                              $glib_hash_ref =
                                {
                                base_urls => &{$_gnome_c_urls_sub}
                                               (
                                               'glib',     # $target,
                                               $major_ver, # $major_ver,
                                               $minor_ver  # $minor_ver
                                               ),

                                major_ver => $major_ver,
                                minor_ver => $minor_ver,
                                #micro_ver => '3'
                                micro_ver => '4'
                                };
                              } # do
                                # glib
                          } # targets
                        } # depends_on
                      }
                    }, # do
                       # atk

                cairo =>
                  do{
                    $cairo_hash_ref =
                      {
                      base_urls => ["http://cairographics.org/releases";],

                      major_ver => '1',
                      minor_ver => '2',
                      micro_ver => '4',

                      depends_on =>
                        {
                        targets =>
                          {
                          libpng => $libpng_hash_ref,
                          fontconfig => $fontconfig_hash_ref
                          } # targets
                        } # depends_on
                      }
                    }, # do
                       # cairo

                pango =>
                  do{
                    my $major_ver = '1';
                    my $minor_ver = '14';

                    $pango_hash_ref =
                      {
                      base_urls => &{$_gnome_c_urls_sub}
                                     (
                                     'pango',    # $target,
                                     $major_ver, # $major_ver,
                                     $minor_ver  # $minor_ver
                                     ),

                      major_ver => $major_ver,
                      minor_ver => $minor_ver,
                      micro_ver => '7',

                      pre_make_sub =>
                        sub
                          {
                          my %this_sub_args = @_;

                          ####################
                          foreach my $makefile
                          ####################
                            (
                            split
                              (
                              "\n",
                              `find $this_sub_args{target_build_dir} -name Makefile -type f`
                              )
                            )
                            {
                            my $result =
                            &{$_edit_file_sub}
                              (
                              $info_marker,        # $info_marker,
                              $error_marker,       # $error_marker,
                              $system_wrapper_sub, # $system_wrapper_sub
                              $makefile,           # $file,
                              sub
                                {
                                my ($line) = @_;
                                $line =~ s|^X_LIBS\s*=\s*(\-L/usr/X11R6/lib\s+)|X_LIBS =
-L/usr/lib $1|;
                                $line;
                                }                  # $line_editing_sub
                              );

                            return 1 if $result;
                            } # foreach my $makefile
                          0;
                          },

                      depends_on =>
                        {
                        targets =>
                          {
                          glib => $glib_hash_ref,
                          cairo => $cairo_hash_ref
                          }
                        } # depends_on
                      } # pango
                    } # do
                      # pango
                } # targets
              } # depends_on
            } # 'gtk+'
          }, # do
             # 'gtk+'
...

      libjpeg =>
        do{
          my $target_basename = 'jpegsrc.v6b';

          $libjpeg_hash_ref =
            {
            base_urls => ['ftp://ftp.uu.net/graphics/jpeg'],

            target_basename => $target_basename,

            configure_args => '--enable-shared',

            pre_configure_sub =>
              sub
                {
                my %this_sub_args = @_;

                my $info_marker = $this_sub_args{info_marker};
                my $error_marker = $this_sub_args{error_marker};
                my $cmdline_args_hash_ref = $this_sub_args{cmdline_args_hash_ref};
                my $system_wrapper_sub = $this_sub_args{system_wrapper_sub};

                my $wrong_dir = "${$cmdline_args_hash_ref}{build_prefix}/jpeg-6b";

                unless(rename($wrong_dir => $this_sub_args{target_build_dir}))
                  {
                  warn "$error_marker could not rename $wrong_dir =>
$this_sub_args{target_build_dir}\n";
                  return 1;
                  }

                0; # the returned value
                }, # sub
                   # pre_configure_sub

            pre_make_sub =>
              sub
                {
                my %this_sub_args = @_;

                my $info_marker = $this_sub_args{info_marker};
                my $error_marker = $this_sub_args{error_marker};
                my $system_wrapper_sub = $this_sub_args{system_wrapper_sub};
                my $target_build_dir = $this_sub_args{target_build_dir};

                my $makefile = "$target_build_dir/Makefile";
                my $original_makefile = "$makefile.original";

                if(
                  &{$system_wrapper_sub}
                    (
                    $info_marker,
                    "\\cp -p $makefile $original_makefile"
                    ) != 0
                  )
                  {
                  warn "$error_marker could not back up Makefile\n";
                  return 1;
                  }

                open(my $rfh, $makefile) or
                do{
                  warn "$error_marker cannot open '$makefile' file for reading\n";
                  return 1;
                  };

                my @buffer = <$rfh>;

                close($rfh);

                #########################
                foreach my $line(@buffer)
                #########################
                  {
                  $line =~ s|(/install\s+)|$1 -D |;
                  } # foreach my $line(@buffer)

                open(my $wfh, '>', $makefile) or
                do{
                  warn "$error_marker could not open '$makefile' foe writing\n";
                  return 1;
                  };

                print $wfh @buffer;

                close($wfh);

                0; # the returned value
                } # sub
                  # pre_make_sub 
            }
          }, # do
             # libjpeg

      libtiff =>
        do{
          $libtiff_hash_ref =
            {
            base_urls => ['ftp://ftp.remotesensing.org/pub/libtiff'],

            target_basename => 'tiff',

            major_ver => '3',
            minor_ver => '8',
            micro_ver => '2',

            depends_on =>
              {
              targets =>
                {
                zlib => $zlib_hash_ref
                } # targets
              } # depends_on
            }
          }, # do
             # libtiff
...

      zlib =>
        do{
          $zlib_hash_ref =
            {
            base_urls => \ _sf_zlib_mirrors,

            major_ver => '1',
            minor_ver => '2',
            micro_ver => '3',

            configure_args => '--shared'
            }
          }, # do
             # zlib
...

      libpng =>
        do{
          $libpng_hash_ref =
            {
            base_urls => \ _sf_libpng_mirrors,

            major_ver => '1',
            minor_ver => '2',
            micro_ver => '12',

            depends_on =>
              {
              targets =>
                {
                zlib => $zlib_hash_ref
                } # targets
              } # depends_on
            }
          }, # do
             # libpng
...

      fontconfig =>
        do{
          $fontconfig_hash_ref =
            {
            base_urls => ['http://fontconfig.org/release'],

            major_ver => '2',
            minor_ver => '4',
            micro_ver => '1',

            depends_on =>
              {
              targets =>
                {
                freetype => $freetype_hash_ref
                }
              } # depends_on
            }
          }, # do
             # fontconfig
...

      freetype =>
        do{
          $freetype_hash_ref =
            {
            base_urls => \ _sf_freetype_mirrors,

            major_ver => '2',
            minor_ver => '2',
            micro_ver => '1',

            depends_on =>
              {
              targets =>
                {
                zlib => $zlib_hash_ref
                } # targets
              } # depends_on
            }
          }, # do
             # freetype
.

If you have root access on the computers you need to install your app on,
you can use existing packaging solutions.

If you don't, you'll have to compile stuff yourself and distribute it
with your application.

--Sergei.

Applications From Scratch: http://appsfromscratch.berlios.de/


 
____________________________________________________________________________________
Get your email and see which of your friends are online - Right on the New Yahoo.com 
(http://www.yahoo.com/preview) 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]