X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=build%2Fscripts%2Fdali_env;h=3a952dd7676191e546fede9f538f9472da3bc51e;hb=7c79599a8fac6c5f51b89391d0da9b7dbabd8568;hp=eaa46773f70f10268e278b22b1ad88562099394c;hpb=b36992cc4c7b8bc84b48adfd24ce76e6e5f16a28;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/build/scripts/dali_env b/build/scripts/dali_env index eaa4677..3a952dd 100755 --- a/build/scripts/dali_env +++ b/build/scripts/dali_env @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Copyright (c) 2016 Samsung Electronics Co., Ltd. +# Copyright (c) 2021 Samsung Electronics Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -37,30 +37,40 @@ my @system_packages = ( "pkg-config", "libtool", "ccache", - "libelementary-dev", "libexif-dev", "libgles2-mesa-dev", "libdrm-dev", "libgif-dev", "libturbojpeg", + "libturbojpeg0-dev", "libfribidi-dev", "libharfbuzz-dev", + "libhyphen-dev", "doxygen", "lcov", "libcurl4-gnutls-dev", -); - -my @emscripten_system_packages = ( - "gnome-common", "curl", - "tar", - "build-essential", - "cmake", - "nodejs", - "default-jre", - "python2.7" + "libssl-dev", + "cifs-utils", + "libgtest-dev", + "libcairo2-dev", + "libopencv-dev", + "gettext", + "libwebp-dev", ); +my $ubuntu_version = (split(/\s+/, `lsb_release -d`))[2]; +if (${ubuntu_version} > 20) +{ + # Add unique packages for 20.04 and above + push @system_packages, "libefl-all-dev"; +} +else +{ + # Add unique packages for Ubuntu releases before 20.04 + push @system_packages, "libelementary-dev"; +} + # Some packages like require building from source # v8 is currently disabled until we can get it working without a http proxy being setup my @source_pkgs = ( @@ -74,10 +84,7 @@ my @source_pkgs = ( # original version used with DALi is 3.25.19. 3.32.7 is the latest we can use before # upgrading DALi to use c++0x or c++11 "version" => " 3.32.7", "make" => "make -j8 library=shared", "build-mode" =>"debug" }, - - {"name" => "emscripten", - "portable" => "https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz" - } + {"name" => "gtest" }, ); ### Detect any http proxy, part of v8 installation requires this information @@ -147,17 +154,14 @@ else my $src_path = "$root_path/src-packages"; my $sbs_path = "$root_path/target"; my $install_path = "$root_path/opt"; -my $emscripten_path = "$root_path/emsdk_portable"; my $opt_create=0; my $opt_setenv=0; my $opt_help=0; my $opt_man=0; -my $opt_emscripten=0; GetOptions("create" => \$opt_create, "setenv" => \$opt_setenv, - "emscripten" => \$opt_emscripten, "help" => \$opt_help, "man" => \$opt_man) or pod2usage(2); @@ -193,23 +197,6 @@ sub in_dali_env sub create_setenv { - if( ( -d $emscripten_path ) || $opt_emscripten ) - { - print <<"EOF"; -# -# Emscripten environment -# - which brazenly overwrites PATH so we set this first -# - NB: If you change the tools within emsdk then you'll need to recreate this file -# - -EOF - my $emsdk_env_file = $emscripten_path . '/emsdk_set_env.sh'; - open(FILE, $emsdk_env_file) or die "Can't read file enscripten env file" . $emsdk_env_file; - my @emsdk_env = ; - close (FILE); - print @emsdk_env; - } - print <<"EOF"; # # To use the desktop libraries, please add the following lines to your .bashrc or @@ -219,15 +206,17 @@ EOF # You can then source this script by using # \$ . setenv # -# Use DESKTOP_PREFIX when running configure in dali/build/tizen: +# Use DESKTOP_PREFIX when running configure or cmake in dali/build/tizen: # \$ CXXFLAGS="-g -O0" ./configure --prefix=\$DESKTOP_PREFIX +# _OR_ +# \$ CXXFLAGS="-g -O0" cmake -DCMAKE_INSTALL_PREFIX=\$DESKTOP_PREFIX export DESKTOP_PREFIX=$install_path export PATH=$install_path/bin:\$PATH export LD_LIBRARY_PATH=$install_path/lib:\$LD_LIBRARY_PATH export INCLUDEDIR=$install_path/include export PKG_CONFIG_PATH=$install_path/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig - +export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DALI_WINDOW_WIDTH=480 export DALI_WINDOW_HEIGHT=800 @@ -241,11 +230,15 @@ sub check_system_package my $package; foreach $package (@_) { - my @x=split(/\s+/, `dpkg -l $package|grep $package`); + my @x=split(/\s+/, `dpkg -l $package 2> /dev/null|grep $package`); if($x[0] ne "ii") { - print "Attempting to install $package\n"; - system("sudo apt-get -y --force-yes install $package"); + # Check if the package is available to install, exit-code is 0 if the package is found. + if(system("apt-cache show $package > /dev/null 2>&1") == 0) + { + print "Attempting to install $package\n"; + system("sudo apt-get -y --force-yes install $package"); + } } } } @@ -256,11 +249,6 @@ sub check_system_packages check_system_package(@system_packages); - if($opt_emscripten) - { - check_system_package(@emscripten_system_packages); - } - my $gnome_v =`dpkg -l gnome-common| tail -1| sed "s/ \\+/ /g" | cut -d' ' -f 3`; my @am = split(/\./, `automake --version | head -1 | cut -f4 -d' '`); if($gnome_v =~ /$2.24/ && $am[1]>10) @@ -290,9 +278,14 @@ sub check_source_packages { install_v8( $pkgref ); } - elsif($pkg eq "emscripten" && $opt_emscripten) + elsif ($pkg eq "gtest") { - install_emscripten( $pkgref ); + if(! -e "/usr/lib/libgtest.a") + { + print "Attempting to build $pkg\n"; + # from https://www.eriksmistad.no/getting-started-with-google-test-on-ubuntu/ + run_command("cd /usr/src/gtest; sudo cmake CMakeLists.txt; sudo make; sudo cp *.a /usr/lib; cd -;"); + } } } } @@ -577,62 +570,6 @@ END } ################################################################################ -# -# install the latest emscripten in a portable directory -# -################################################################################ -sub install_emscripten -{ - my $info = $_[0]; - my $ret; - print( "Checking if Emscripten is up to date\n"); - - my $portable = $info->{"portable"}; - - my $current_dir = getcwd(); - - print( "\n"); - print( "Installing or updating Emscripten.\n"); - print( ".....You may need a cup of tea.\n"); - print( ".......... In fact, take the afternoon off.\n"); - print( "\n"); - - if(-e $emscripten_path) - { - chdir( $emscripten_path ); - } - else - { - chdir( $root_path ); - - system("curl -O " . $portable) == 0 - or die "curl failed with error $?. :" . $portable; - - my($filename, $dirs, $suffix) = fileparse($portable); - - system("tar -xvf " . $filename . $suffix) == 0 - or die "tar unpack failed (nb tar.gz is the presumed downloaded format):" . $filename . $suffix; - - system("rm " . $filename . $suffix) == 0 - or die "Cannot remove emsdk portable tar file:" . $filename . $suffix; - - chdir( $emscripten_path ); - } - - system("./emsdk update") == 0 - or die "Cannot run emsdk? Did the install fail?"; - - system("./emsdk install latest"); - system("./emsdk activate latest"); - system("bash -c \"source ./emsdk_env.sh\""); # emsdk uses popd ie expects bash - - system("emsdk list"); - - chdir($current_dir); -} - - -################################################################################ # MAIN ################################################################################ @@ -705,10 +642,6 @@ Create a DALi environment directory in the current directory. Display environment variables to setup. -=item B<-e|--emscripten> - -Include emscripten (use with -c to install with emscripten or -s to setup env vars with emscripten). - =item B<-h|--help> Display this help