From b0eea10e8eb4f6533d15e986178b9566683c5b5e Mon Sep 17 00:00:00 2001 From: Jean-Marie Verdun Date: Wed, 1 Jun 2016 21:16:12 +0200 Subject: [PATCH] Add basic vagrant compilation capability Add FREECAD_USER_DATA environment variable required to support snap on ubuntu which is using Apparmor to limit application access to filesystem. Add automatic snap build on Xenial (ubuntu 16.04) within Vagrant build Info Build results are into /home/vagrant/Results (deb + snap --- src/App/Application.cpp | 7 +- vagrant/FreeCAD.sh | 261 ++++++++++++++++++++++++++++++++ vagrant/README | 2 + vagrant/Vagrantfile.trusty | 76 ++++++++++ vagrant/Vagrantfile.xenial | 76 ++++++++++ vagrant/Xenial/bin/freecad.png | Bin 0 -> 7143 bytes vagrant/Xenial/bin/launcher | 15 ++ vagrant/Xenial/bin/license.txt | 67 ++++++++ vagrant/Xenial/generate_yaml.sh | 105 +++++++++++++ vagrant/Xenial/launcher | 33 ++++ vagrant/Xenial/reset | 88 +++++++++++ vagrant/generate_yaml.sh | 106 +++++++++++++ 12 files changed, 835 insertions(+), 1 deletion(-) create mode 100644 vagrant/FreeCAD.sh create mode 100644 vagrant/README create mode 100644 vagrant/Vagrantfile.trusty create mode 100644 vagrant/Vagrantfile.xenial create mode 100644 vagrant/Xenial/bin/freecad.png create mode 100755 vagrant/Xenial/bin/launcher create mode 100644 vagrant/Xenial/bin/license.txt create mode 100755 vagrant/Xenial/generate_yaml.sh create mode 100755 vagrant/Xenial/launcher create mode 100755 vagrant/Xenial/reset create mode 100755 vagrant/generate_yaml.sh diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 79ee1f321..701f58619 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -1909,7 +1909,12 @@ void Application::ExtractUserPath() if (pwd == NULL) throw Base::Exception("Getting HOME path from system failed!"); mConfig["UserHomePath"] = pwd->pw_dir; - std::string appData = pwd->pw_dir; + char *path="/tmp"; + if ( FCUserData=getenv("FREECAD_USER_DATA") ) + path=FCUserData; + else + path= pwd->pw_dir; + std::string appData(path); Base::FileInfo fi(appData.c_str()); if (!fi.exists()) { // This should never ever happen diff --git a/vagrant/FreeCAD.sh b/vagrant/FreeCAD.sh new file mode 100644 index 000000000..3f45ccc05 --- /dev/null +++ b/vagrant/FreeCAD.sh @@ -0,0 +1,261 @@ +#!/bin/bash +# Vagrant provisioning script to build up FreeCAD based on OCCT 7 and Salome 7.7.1 on Linux Ubuntu +# (c) 2016 Jean-Marie Verdun / vejmarie (vejmarie@ruggedpod.qyshare.com) +# Released under GPL v2.0 +# Provided without any warranty +# Warning: compilation time is long quite long +# Must add the autlogin script +# Must add a lightdm start / reboot ? +FREECAD_GIT_BRANCH="https://github.com/vejmarie/FreeCAD" + +function create_deb { +rm -rf /tmp/$1-$2 +mkdir /tmp/$1-$2 +mkdir /tmp/$1-$2/DEBIAN +echo "Package:$1" >> /tmp/$1-$2/DEBIAN/control +echo "Version:$2" >> /tmp/$1-$2/DEBIAN/control +echo "Section:base" >> /tmp/$1-$2/DEBIAN/control +echo "Priority:optional" >> /tmp/$1-$2/DEBIAN/control +echo "Architecture:amd64" >> /tmp/$1-$2/DEBIAN/control +echo "Depends:"$3 >> /tmp/$1-$2/DEBIAN/control +echo "Maintainer:vejmarie@ruggedpod.qyshare.com" >> /tmp/$1-$2/DEBIAN/control +echo "Homepage:http://ruggedpod.qyshare.com" >> /tmp/$1-$2/DEBIAN/control +echo "Description:TEST PACKAGE" >> /tmp/$1-$2/DEBIAN/control +file_list=`ls -ltd $(find /opt/local/FreeCAD-0.17) | awk '{ print $9}'` +for file in $file_list +do + is_done=`cat /tmp/stage | grep $file` +if [ "$is_done" == "" ] +then +# The file must be integrated into the new deb + cp --parents $file /tmp/$1-$2 + echo $file >> /tmp/stage +fi +done +current_dir=`pwd` +cd /tmp +dpkg-deb --build $1-$2 +mv $1-$2.deb $1-$2_trusty-amd64.deb +cd $current_dir +} + +# If we are running ubuntu we must know if we are under Xenial (latest release) or Trusty which +# doesn't support the same package name + +is_ubuntu=`lsb_release -a | grep -i Distributor | awk '{ print $3}'` +if [ "$is_ubuntu" == "Ubuntu" ] +then + ubuntu_version=`lsb_release -a | grep -i codename | awk '{ print $2 }'` + if [ "$ubuntu_version" == "xenial" ] + then + package_list=" doxygen \ + libboost1.58-dev \ + libboost-filesystem1.58-dev \ + libboost-program-options1.58-dev \ + libboost-python1.58-dev \ + libboost-regex1.58-dev \ + libboost-signals1.58-dev \ + libboost-system1.58-dev \ + libboost-thread1.58-dev \ + libcoin80v5 \ + libcoin80-dev \ + libeigen3-dev \ + libpyside-dev \ + libqtcore4 \ + libshiboken-dev \ + libxerces-c-dev \ + libxmu-dev \ + libxmu-headers \ + libxmu6 \ + libxmuu-dev \ + libxmuu1 \ + pyside-tools \ + python-dev \ + python-pyside \ + python-matplotlib \ + qt4-dev-tools \ + qt4-qmake \ + libqtwebkit-dev \ + shiboken \ + swig" + else + ubuntu_version="unknown" + package_list=" doxygen \ + libboost1.55-dev \ + libboost-filesystem1.55-dev \ + libboost-program-options1.55-dev \ + libboost-python1.55-dev \ + libboost-regex1.55-dev \ + libboost-signals1.55-dev \ + libboost-system1.55-dev \ + libboost-thread1.55-dev \ + libcoin80 \ + libcoin80-dev \ + libeigen3-dev \ + libpyside-dev \ + libqtcore4 \ + libshiboken-dev \ + libxerces-c-dev \ + libxmu-dev \ + libxmu-headers \ + libxmu6 \ + libxmuu-dev \ + libxmuu1 \ + pyside-tools \ + python-dev \ + python-pyside \ + python-matplotlib \ + qt4-dev-tools \ + qt4-qmake \ + shiboken \ + swig" + fi +fi +sudo apt-get update +sudo apt-get install -y dictionaries-common +sudo apt-get install -y $package_list +sudo apt-get install -y python-pivy +sudo apt-get install -y git +sudo apt-get install -y cmake +sudo apt-get install -y g++ +sudo apt-get install -y libfreetype6-dev +sudo apt-get install -y tcl8.5-dev tk8.5-dev +sudo apt-get install -y libtogl-dev +sudo apt-get install -y libhdf5-dev +sudo apt-get install -y xfce4 xfce4-goodies +sudo apt-get install -y xubuntu-default-settings +sudo apt-get install -y lightdm +sudo apt-get install -y automake +sudo apt-get install -y libcanberra-gtk-module +sudo apt-get install -y libcanberra-gtk3-module overlay-scrollbar-gtk2 unity-gtk-module-common libatk-bridge2.0-0 unity-gtk2-module libatk-adaptor +myversion=`lsb_release -a | grep -i Distributor | awk '{ print $3}'` +if [ "$myversion" != "Ubuntu" ] +then +sudo cat /etc/lightdm/lightdm.conf | sed 's/\#autologin-user=/autologin-user=vagrant/' > /tmp/lightdm.conf +sudo cp /tmp/lightdm.conf /etc/lightdm/lightdm.conf +sudo /etc/init.d/lightdm start +sudo apt-get install libmed +sudo apt-get install libmedc +sudo apt-get install -y libmed-dev +sudo apt-get install -y libmedc-dev +else +cat <& /tmp/lightdm.conf +[SeatDefaults] +user-session=xfce +autologin-session=xfce +autologin-user=ubuntu +autologin-user-timeout=0 +greeter-session=xfce +pam-service=lightdm-autologin +EOF +sudo cp /tmp/lightdm.conf /etc/lightdm/ +sudo rm /etc/lightdm/lightdm-gtk-greeter.conf +sudo /etc/init.d/lightdm start & + +# Building MED + +git clone https://github.com/vejmarie/libMED.git +cd libMED +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/local/FreeCAD-0.17 .. +make -j 2 +sudo make install +cd ../.. +fi + +# I must create the package + +create_deb MED 3.10 "" + +# Building VTK + +wget http://www.vtk.org/files/release/7.0/VTK-7.0.0.tar.gz +gunzip VTK-7.0.0.tar.gz +tar xf VTK-7.0.0.tar +rm VTK-7.0.0.tar +cd VTK-7.0.0 +mkdir build +cd build +# cmake .. -DVTK_RENDERING_BACKEND=OpenGL +cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/opt/local/FreeCAD-0.17 -DVTK_Group_Rendering:BOOL=OFF -DVTK_Group_StandAlone:BOOL=ON -DVTK_RENDERING_BACKEND=None +make -j 2 +sudo make install + +create_deb VTK 7.0 "" + +# Building OCCT + +cd ../.. +wget "http://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=b00770133187b83761e651df50051b2fa3433858;sf=tgz" +mv "index.html?p=occt.git;a=snapshot;h=b00770133187b83761e651df50051b2fa3433858;sf=tgz" occt.tgz +gunzip occt.tgz +tar xf occt.tar +rm occt.tar +cd occt-b007701 +grep -v vtkRenderingFreeTypeOpenGL src/TKIVtk/EXTERNLIB >& /tmp/EXTERNLIB +\cp /tmp/EXTERNLIB src/TKIVtk/EXTERNLIB +grep -v vtkRenderingFreeTypeOpenGL src/TKIVtkDraw/EXTERNLIB >& /tmp/EXTERNLIB +\cp /tmp/EXTERNLIB src/TKIVtkDraw/EXTERNLIB +mkdir build +cd build +# cmake .. -DUSE_VTK:BOOL=ON +cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/opt/local/FreeCAD-0.17 -DUSE_VTK:BOOL=OFF +sudo make -j 2 +sudo make install + +create_deb OCCT 7.0 "vtk (>= 7.0), med (>= 3.10)" + +# Building Netgen + +cd ../.. +git clone https://github.com/vejmarie/Netgen +cd Netgen/netgen-5.3.1 +./configure --prefix=/opt/local/FreeCAD-0.17 --with-tcl=/usr/lib/tcl8.5 --with-tk=/usr/lib/tk8.5 --enable-occ --with-occ=/opt/local/FreeCAD-0.17 --enable-shared --enable-nglib CXXFLAGS="-DNGLIB_EXPORTS -std=gnu++11" +make -j 2 +sudo make install +cd ../.. +sudo cp -rf Netgen/netgen-5.3.1 /usr/share/netgen + +create_deb Netgen 5.3.1 "occt (>= 7.0)" + +#building FreeCAD + +git clone $FREECAD_GIT_BRANCH +cd FreeCAD +git checkout occt7 +cat cMake/FindOpenCasCade.cmake | sed 's/\/usr\/local\/share\/cmake\//\/opt\/local\/FreeCAD-0.17\/lib\/cmake/' > /tmp/FindOpenCasCade.cmake +cp /tmp/FindOpenCasCade.cmake cMake/FindOpenCasCade.cmake +cp cMake/FindOpenCasCade.cmake cMake/FindOPENCASCADE.cmake +cd .. +mkdir build +cd build +cmake ../FreeCAD -DCMAKE_INSTALL_PREFIX:PATH=/opt/local/FreeCAD-0.17 -DBUILD_FEM=1 -DBUILD_FEM_NETGEN=1 -DCMAKE_CXX_FLAGS="-DNETGEN_V5" +make -j 2 +make install +create_deb FreeCAD 0.17 "netgen (>= 5.3.1), occt (>= 7.0), med (>= 3.10)" +source_dir=`pwd` +cd /tmp +mkdir deb +mv *.deb deb +cd deb +dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz + +if [ "$ubuntu_version" == "xenial" ] +then +#Let's build the snap + mkdir snap + cd snap + cp -Rf $source_dir/FreeCAD/vagrant/Xenial . + cd Xenial + apt-get install -y snapcraft + ./generate_yaml.sh + snapcraft + mv freecad_0.17_amd64.snap /tmp +fi +mkdir $source_dir/Results +mv /tmp/*.deb $source_dir/Results +if [ -f "/tmp/freecad_0.17_amd64.snap" ] +then + mv /tmp/freecad_0.17_amd64.snap $source_dir/Results +fi diff --git a/vagrant/README b/vagrant/README new file mode 100644 index 000000000..80e18fbda --- /dev/null +++ b/vagrant/README @@ -0,0 +1,2 @@ +To build FreeCAD on trusty/xenial using vagrant please copy either Vagrantfile.trusty/Vagrantfile.xenial to Vagrantfile then kick from this directory vagrant up. Go have a drink compilation can be very long +Build results are kept into the vm, use vagrant ssh to connect to it and go into Results directory where you will get your deb and snap files diff --git a/vagrant/Vagrantfile.trusty b/vagrant/Vagrantfile.trusty new file mode 100644 index 000000000..0d37eb548 --- /dev/null +++ b/vagrant/Vagrantfile.trusty @@ -0,0 +1,76 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# All Vagrant configuration is done below. The "2" in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure(2) do |config| + # The most common configuration options are documented and commented below. + # For a complete reference, please see the online documentation at + # https://docs.vagrantup.com. + + # Every Vagrant development environment requires a box. You can search for + # boxes at https://atlas.hashicorp.com/search. + # config.vm.box = "debian/jessie64" + # config.vm.box = "ubuntu/xenial64" + config.vm.box = "ubuntu/trusty64" + + # Disable automatic box update checking. If you disable this, then + # boxes will only be checked for updates when the user runs + # `vagrant box outdated`. This is not recommended. + # config.vm.box_check_update = false + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8080" will access port 80 on the guest machine. + # config.vm.network "forwarded_port", guest: 80, host: 8080 + + # Create a private network, which allows host-only access to the machine + # using a specific IP. + # config.vm.network "private_network", ip: "192.168.33.10" + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + # config.vm.network "public_network" + + # Share an additional folder to the guest VM. The first argument is + # the path on the host to the actual folder. The second argument is + # the path on the guest to mount the folder. And the optional third + # argument is a set of non-required options. + # config.vm.synced_folder "./source" + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + config.vm.provider "virtualbox" do |vb| + # # Display the VirtualBox GUI when booting the machine + vb.gui = true + # # Customize the amount of memory on the VM: + vb.memory = "4096" + vb.cpus = 2 + end + + config.vm.provision :shell, path: "FreeCAD.sh" + + # + # View the documentation for the provider you are using for more + # information on available options. + + # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies + # such as FTP and Heroku are also available. See the documentation at + # https://docs.vagrantup.com/v2/push/atlas.html for more information. + # config.push.define "atlas" do |push| + # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" + # end + + # Enable provisioning with a shell script. Additional provisioners such as + # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the + # documentation for more information about their specific syntax and use. + # config.vm.provision "shell", inline: <<-SHELL + # sudo apt-get update + # sudo apt-get install -y apache2 + # SHELL +end diff --git a/vagrant/Vagrantfile.xenial b/vagrant/Vagrantfile.xenial new file mode 100644 index 000000000..df6ea31ea --- /dev/null +++ b/vagrant/Vagrantfile.xenial @@ -0,0 +1,76 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# All Vagrant configuration is done below. The "2" in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure(2) do |config| + # The most common configuration options are documented and commented below. + # For a complete reference, please see the online documentation at + # https://docs.vagrantup.com. + + # Every Vagrant development environment requires a box. You can search for + # boxes at https://atlas.hashicorp.com/search. + # config.vm.box = "debian/jessie64" + config.vm.box = "ubuntu/xenial64" + # config.vm.box = "ubuntu/trusty64" + + # Disable automatic box update checking. If you disable this, then + # boxes will only be checked for updates when the user runs + # `vagrant box outdated`. This is not recommended. + # config.vm.box_check_update = false + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine. In the example below, + # accessing "localhost:8080" will access port 80 on the guest machine. + # config.vm.network "forwarded_port", guest: 80, host: 8080 + + # Create a private network, which allows host-only access to the machine + # using a specific IP. + # config.vm.network "private_network", ip: "192.168.33.10" + + # Create a public network, which generally matched to bridged network. + # Bridged networks make the machine appear as another physical device on + # your network. + # config.vm.network "public_network" + + # Share an additional folder to the guest VM. The first argument is + # the path on the host to the actual folder. The second argument is + # the path on the guest to mount the folder. And the optional third + # argument is a set of non-required options. + # config.vm.synced_folder "./source" + + # Provider-specific configuration so you can fine-tune various + # backing providers for Vagrant. These expose provider-specific options. + # Example for VirtualBox: + # + config.vm.provider "virtualbox" do |vb| + # # Display the VirtualBox GUI when booting the machine + vb.gui = true + # # Customize the amount of memory on the VM: + vb.memory = "4096" + vb.cpus = 1 + end + + config.vm.provision :shell, path: "FreeCAD.sh" + + # + # View the documentation for the provider you are using for more + # information on available options. + + # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies + # such as FTP and Heroku are also available. See the documentation at + # https://docs.vagrantup.com/v2/push/atlas.html for more information. + # config.push.define "atlas" do |push| + # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" + # end + + # Enable provisioning with a shell script. Additional provisioners such as + # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the + # documentation for more information about their specific syntax and use. + # config.vm.provision "shell", inline: <<-SHELL + # sudo apt-get update + # sudo apt-get install -y apache2 + # SHELL +end diff --git a/vagrant/Xenial/bin/freecad.png b/vagrant/Xenial/bin/freecad.png new file mode 100644 index 0000000000000000000000000000000000000000..0ff01c31c959ab641c3ac21fa2055fa09ccee0e7 GIT binary patch literal 7143 zcmY*;byyTm*Y<*d3(_5eOG_>+AuQe9-7LLyEZrT_B_Q1h2olnzwpuGN` z=lP!RedoGn&dfdM-1nUMYpye~>Z)=$Sd>@*002ipURv|775}FLG5(Gp;BKpb4VtZl ziUa`gDe1){4E^sKWGSzy0s#0i0RSNp0KolUC}bZ1@Z8q%Nq+HysL42INoLqFGSRfEc*xkwoswpk|pYXpc5jr~r!W9YzdwY9x zdh>9)xZ8rc1qB7cTo5n>!tvLG!^77Z0rTN-_Mrba$^YY#w)U`ehr1%+F3zBTcwrVU zo(K^-x_^ZJ+x~q{1l;ETD>-}oC#}B;g8$h8b8~Wm|I7V1RQMkhs^$*2{;T{CzbLox zzdZjB_8%Q#@IT`J>oEV$^k3-TR7J6b!T-HBQ7q*?W&;3#5=TK=LfZ%B*bp>P!MmXV0F?Xc~(ajEAd0dH?P`g+a<>N z%$I4sJ)h9D1AT+ny&HEDuimFzHzReeWRy8**{ITK8`$ZmW_JHpI01o zorsJLvuq_@P8n^BtNf5(@jCteoLTVeddYO%vCv+(&MEz4QU>{?Dl=X*hTZAzEBx)M z5dplN6{(M=oAjoy4u)~Y#YoXYN7B?bN}qCcK>&yGB&f()|0cv|n^;p5d%#dpf~%T# zkJ9vQF;DMayOVVHYc2QBin-So!&*MR z*L!z$%lXOU3@OvniJb4AjdK#W7kXAVNS+{rBEy9vuHI&lT!SYcD{_CaLS{XFOcc5M zuLlm8#hiE5PI)q+TWJ!X^i)zag_uIo60q_fnQvAQ)qHx|XT>L8QLI>U2YX#~#P(7x z1^c9lk!`m`3O06Uh@+KuAMaX|aEqLZQA1q>oX1 zw#NwgQd|~IYctzi*AC?eTK2Y3n8J<-0qekn$RS5xMRGoV8=cIK6j#;-m%$>V*3=j2 zHCHzLkXx@%44?(N)adB7aB0aAPVBZS%oHdwLww$_u1ByWK_t+dnW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NZ!Df7ag6T;@QbfGTJi0c;hD1tdro zC7+?^YJP~BX5;F~qeVThWHkc+mf+lI5rxmjHt<{13=wDGn*u6ar|+2YjfjX?fQrj= z$3rmwYFl41s~&+;aG(ml*DMvq6y9Jb$YT3!)H+R#V#sNOY4PjT^leLT{_>Ys8BV?F z2NeOgo;=|0y9A(k!2TF77K@PO;OtnkJ)Pzw_QAdvliIN>SqGP&I zPBQ)MZ&C2+;l<0(v~P5AYTwEceO0W}dRn^ME4VGY#_b+$NlXx73biB@U + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. +0. Additional Definitions. + +As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. + +“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. + +An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. + +A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. + +The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. + +The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. +1. Exception to Section 3 of the GNU GPL. + +You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. +2. Conveying Modified Versions. + +If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: + + a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or + b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. + +3. Object Code Incorporating Material from Library Header Files. + +The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. + b) Accompany the object code with a copy of the GNU GPL and this license document. + +4. Combined Works. + +You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: + + a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. + b) Accompany the Combined Work with a copy of the GNU GPL and this license document. + c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. + d) Do one of the following: + 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. + 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. + e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) + +5. Combined Libraries. + +You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. + b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +6. Revised Versions of the GNU Lesser General Public License. + +The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. + diff --git a/vagrant/Xenial/generate_yaml.sh b/vagrant/Xenial/generate_yaml.sh new file mode 100755 index 000000000..37107c40b --- /dev/null +++ b/vagrant/Xenial/generate_yaml.sh @@ -0,0 +1,105 @@ +#!/bin/bash +# snapcraft yaml automatic generation tool for FreeCAD 0.17 +# (c) 2017 vejmarie +# Distributed under LGPL v2.0 +# Please report bugs at vejmarie@ruggedpod.qyshare.com + +rm snapcraft.yaml +lib_list=`ls /opt/local/FreeCAD-0.17/lib/*.so` +mod_list=`ls -ltd $(find /opt/local/FreeCAD-0.17/Mod) | awk '{ print $9}'` +bin_list=`ls -ltd $(find /opt/local/FreeCAD-0.17/bin) | awk '{ print $9}'` +data_list=`ls -ltd $(find /opt/local/FreeCAD-0.17/data) | awk '{ print $9}'` +python_list=`ls -ltd $(find /usr/lib/python2.7) | awk '{ print $9}'` +pyside_list=`ls -ltd $(find /usr/share/PySide/typesystems) | awk '{ print $9}'` +python_binary=`ls /usr/bin/python /usr/bin/py*2.7` +syslib=`ls -ltd $(find /usr/lib/x86_64-linux-gnu/dri) | awk '{ print $9}'` +syslib2=`ls -ltd $(find /usr/lib/x86_64-linux-gnu/gtk-2.0) | awk '{ print $9}'` +syslib3=`ls -ltd $(find /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0) | awk '{ print $9}'` +syslib4=`ls -ltd $(find /usr/lib/locale) | awk '{ print $9}'` +syslib5=`ls -ltd $(find /usr/share/X11/locale) | awk '{ print $9}'` +syslib6=`ls -ltd $(find /usr/lib/x86_64-linux-gnu/*gtk*) | awk '{ print $9}'` +syslib7=`ls -ltd $(find /usr/share/glib-2.0) | awk '{ print $9}'` +syslib8=`ls -ltd $(find /usr/share/i18n/locales) | awk '{ print $9}'` +echo " +name: freecad +version: 0.17 +summary: development version +description: development version This version is far from being bug free but integrates the latest FreeCAD technologies +parts: + example-part: + plugin: copy + files: + bin/launcher : bin/launcher" >> snapcraft.yaml +# bin/FreeCAD : opt/local/FreeCAD-0.17/bin/FreeCAD" >> snapcraft.yaml +for i in $bin_list +do + if [ ! -d "$i" ] + then + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml + fi +done +for i in $lib_list +do + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml +done +for i in $mod_list +do + if [ ! -d "$i" ] + then + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml + fi +done +for i in $data_list +do + if [ ! -d "$i" ] + then + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml + fi +done +for i in $python_list $pyside_list +do + if [ ! -d "$i" ] + then + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml + fi +done +for i in $python_binary +do + if [ ! -d "$i" ] + then + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml + fi +done +for i in $syslib $syslib2 $syslib3 $syslib4 $syslib5 $syslib6 $syslib7 $syslib8 +do + if [ ! -d "$i" ] + then + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml + fi +done +# python: +# plugin: python2 +echo " + snap: + - bin/launcher + - opt/local/FreeCAD-0.17/bin/FreeCAD + - opt + - usr" >> snapcraft.yaml +for i in $lib_list +do + second_name=`echo $i | sed 's/\///'` + echo " - $second_name" >> snapcraft.yaml +done +echo " +apps: + FreeCAD: + command: bin/launcher + plugs: [ locale-control,x11,opengl,network-bind,home,unity7 ] +" >> snapcraft.yaml diff --git a/vagrant/Xenial/launcher b/vagrant/Xenial/launcher new file mode 100755 index 000000000..32ada2fa1 --- /dev/null +++ b/vagrant/Xenial/launcher @@ -0,0 +1,33 @@ +#!/bin/bash +export I18NPATH=$SNAP/usr/share/i18n +export LOCPATH=$SNAP_USER_DATA + +LANG=en_US +ENC=UTF-8 +LOC="$LANG.$ENC" + +# generate a locale so we get properly working charsets and graphics +if [ ! -e $SNAP_USER_DATA/$LOC ]; then + $SNAP/usr/bin/localedef --prefix=$SNAP_USER_DATA -f $ENC -i $LANG $SNAP_USER_DATA/$LOC +fi + +export LC_ALL=$LOC +export LANG=$LOC +export LANGUAGE=${LANG%_*} +env >& $SNAP_USER_DATA/env + +export LIBGL_DRIVERS_PATH=$SNAP/usr/lib/x86_64-linux-gnu/dri +export GTK_PATH=$SNAP/usr/lib/x86_64-linux-gnu/gtk-2.0/modules +export LD_LIBRARY_PATH=$SNAP/usr/lib/x86_64-linux-gnu/gtk-2.0/modules:$LD_LIBRARY_PATH +export GTK_DATA_PREFIX=$SNAP_USER_DATA +export GTK_EXE_PREFIX=$SNAP/usr +export GDK_PIXBUF_MODULE_FILE=$SNAP/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache +export PYTHONHOME="$SNAP/usr" +export PYTHONPATH="$SNAP/usr" +export XDG_DATA_DIR="$SNAP/usr/share/glib-2.0/schemas" +export GSETTINGS_SCHEMA_DIR="$SNAP/usr/share/glib-2.0/schemas" +export LANG=en_US.UTF-8 +export FREECAD_USER_DATA="$SNAP_USER_DATA" +export XDG_CONFIG_HOME="$SNAP_USER_DATA" +exec "$SNAP/opt/local/FreeCAD-0.17/bin/FreeCAD" -u $SNAP_USER_DATA/user.cfg -s $SNAP_USER_DATA/system.cfg "$@" + diff --git a/vagrant/Xenial/reset b/vagrant/Xenial/reset new file mode 100755 index 000000000..959c88e4f --- /dev/null +++ b/vagrant/Xenial/reset @@ -0,0 +1,88 @@ +#!/bin/sh +# snapcraft reset script +# distributed under LGPL v2 + +if [ ! -e /var/lib/dpkg/status ]; then + echo "This script only works on Ubuntu Classic" + exit 1 +fi + +if [ "$(id -u)" != 0 ]; then + echo "This script needs to be run as root" + exit 1 +fi + +echo "This script will permanently destroy and reset all state in snapd" +echo "You will loose all of your installed snaps" +echo +echo "Type: DESTROY to remove all of your snap state" +echo +read consent + +if [ "$consent" != "DESTROY" ]; then + echo "No consent, aborting" + exit 0 +fi +echo +echo "ABOUT TO DESTROY ALL OF STATE OF SNAPD" +echo +echo "Interrupt the script in 10 seconds to abort" +sleep 10 || exit +echo +echo "DESTROYING ALL STATE OF SNAPD" + +if systemctl is-active --quiet snapd.service snapd.socket; then + snapd_was_active=yes + echo + echo "Stoping snapd..." + echo + ( + set -x + systemctl stop snapd.socket snapd.service + ) +else + echo "Skipping stopping snapd as systemctl reports it's inactive." +fi + +echo +echo "Unmounting all snaps..." +echo +( + set -x + umount /var/lib/snapd/snaps/*.snap +) + +echo +echo "Removing all support files and state..." +echo +( + set -x + rm -rvf /var/lib/snapd/* +) + +echo +echo "Removing generated systemd units..." +echo +( + set -x + rm -vf /etc/systemd/system/snap-*.mount + rm -vf /etc/systemd/system/snap-*.service + rm -vf /etc/systemd/system/multi-user.target.wants/snap-*.mount +) + +echo +echo "Removing generated executable wrappers..." +echo +( + set -x + rm -vrf /snap/* +) + +if [ "$snapd_was_active" = "yes" ]; then + echo + echo "Starting snapd" + ( + set -x + systemctl start snapd.socket + ) +fi diff --git a/vagrant/generate_yaml.sh b/vagrant/generate_yaml.sh new file mode 100755 index 000000000..6f20cc8c6 --- /dev/null +++ b/vagrant/generate_yaml.sh @@ -0,0 +1,106 @@ +#!/bin/bash +# snapcraft yaml automatic generation tool for FreeCAD 0.17 +# (c) 2017 vejmarie +# Distributed under LGPL v2.0 +# Please report bugs at vejmarie@ruggedpod.qyshare.com + +rm snapcraft.yaml +lib_list=`ls /opt/local/FreeCAD-0.17/lib/*.so` +mod_list=`ls -ltd $(find /opt/local/FreeCAD-0.17/Mod) | awk '{ print $9}'` +bin_list=`ls -ltd $(find /opt/local/FreeCAD-0.17/bin) | awk '{ print $9}'` +data_list=`ls -ltd $(find /opt/local/FreeCAD-0.17/data) | awk '{ print $9}'` +python_list=`ls -ltd $(find /usr/lib/python2.7) | awk '{ print $9}'` +pyside_list=`ls -ltd $(find /usr/share/PySide/typesystems) | awk '{ print $9}'` +python_binary=`ls /usr/bin/python /usr/bin/py*2.7` +syslib=`ls -ltd $(find /usr/lib/x86_64-linux-gnu/dri) | awk '{ print $9}'` +syslib2=`ls -ltd $(find /usr/lib/x86_64-linux-gnu/gtk-2.0) | awk '{ print $9}'` +syslib3=`ls -ltd $(find /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0) | awk '{ print $9}'` +syslib4=`ls -ltd $(find /usr/lib/locale) | awk '{ print $9}'` +syslib5=`ls -ltd $(find /usr/share/X11/locale) | awk '{ print $9}'` +syslib6=`ls -ltd $(find /usr/lib/x86_64-linux-gnu/*gtk*) | awk '{ print $9}'` +syslib7=`ls -ltd $(find /usr/share/glib-2.0) | awk '{ print $9}'` +syslib8=`ls -ltd $(find /usr/share/i18n/) | awk '{ print $9}'` +syslib9=`ls /usr/bin/locale*` +echo " +name: freecad +version: 0.17 +summary: development version +description: development version This version is far from being bug free but integrates the latest FreeCAD technologies +parts: + example-part: + plugin: copy + files: + bin/launcher : bin/launcher" >> snapcraft.yaml +# bin/FreeCAD : opt/local/FreeCAD-0.17/bin/FreeCAD" >> snapcraft.yaml +for i in $bin_list +do + if [ ! -d "$i" ] + then + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml + fi +done +for i in $lib_list +do + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml +done +for i in $mod_list +do + if [ ! -d "$i" ] + then + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml + fi +done +for i in $data_list +do + if [ ! -d "$i" ] + then + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml + fi +done +for i in $python_list $pyside_list +do + if [ ! -d "$i" ] + then + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml + fi +done +for i in $python_binary +do + if [ ! -d "$i" ] + then + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml + fi +done +for i in $syslib $syslib2 $syslib3 $syslib4 $syslib5 $syslib6 $syslib7 $syslib8 $syslib9 +do + if [ ! -d "$i" ] + then + second_name=`echo $i | sed 's/\///'` + echo " $i : $second_name" >> snapcraft.yaml + fi +done +# python: +# plugin: python2 +echo " + snap: + - bin/launcher + - opt/local/FreeCAD-0.17/bin/FreeCAD + - opt + - usr" >> snapcraft.yaml +for i in $lib_list +do + second_name=`echo $i | sed 's/\///'` + echo " - $second_name" >> snapcraft.yaml +done +echo " +apps: + FreeCAD: + command: bin/launcher + plugs: [ locale-control,x11,opengl,network-bind,home,unity7 ] +" >> snapcraft.yaml