diff --git a/stapel/Dockerfile b/stapel/Dockerfile index 3e2a23adeb..671f941aad 100644 --- a/stapel/Dockerfile +++ b/stapel/Dockerfile @@ -209,6 +209,16 @@ WORKDIR $LFS/sources/gcc/build RUN make RUN make DESTDIR=$LFS install RUN ln -sv gcc $TOOLS/bin/cc +RUN for tool in $(ls /.werf/stapel/bin/ | grep $LFS_TGT) ; do ln -fs /.werf/stapel/bin/$tool /.werf/stapel/bin/$(echo $tool | sed -e "s|$LFS_TGT-||") ; done + +# libffi +RUN echo "libffi" && cd $LFS/sources && \ +mkdir libffi && \ +tar xf libffi-*.tar.* -C libffi --strip-components 1 +WORKDIR $LFS/sources/libffi +RUN ./configure --prefix=$TOOLS --disable-static --with-gcc-arch=native +RUN make +RUN make install ENV PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin RUN apt install -y libssl-dev autoconf automake libffi-dev libgdbm-dev libncurses5-dev libsqlite3-dev libtool libyaml-dev pkg-config sqlite3 zlib1g-dev libreadline-dev libssl-dev @@ -222,7 +232,7 @@ WORKDIR /omnibus ENV BUNDLE_GEMFILE=/omnibus/Gemfile RUN source /etc/profile.d/rvm.sh && bundle install --without development -ENV PATH=$TOOLS/x86_64-lfs-linux-gnu/bin:$TOOLS/bin:$PATH +ENV PATH=$TOOLS/$LFS_TGT/bin:$TOOLS/bin:$PATH # Dpkg-architecture binary will make python-omnibus-package fail to build, # because of python setup.py, which hardcodes /usr/include/... into preceeding include paths, @@ -230,15 +240,15 @@ ENV PATH=$TOOLS/x86_64-lfs-linux-gnu/bin:$TOOLS/bin:$PATH # It is needed to remove that binary before omnibus-building. RUN mv $(which dpkg-architecture) /tmp/dpkg-architecture -RUN source /etc/profile.d/rvm.sh && bundle exec omnibus build -o append_timestamp:false werf-stapel - -ENV CC=$LFS_TGT-gcc -ENV CXX=$LFS_TGT-g++ -ENV AR=$LFS_TGT-ar -ENV RANLIB=$LFS_TGT-ranlib +#ENV CC=$LFS_TGT-gcc +#ENV CXX=$LFS_TGT-g++ +#ENV AR=$LFS_TGT-ar +#ENV RANLIB=$LFS_TGT-ranlib ENV CC_FOR_TARGET=$LFS_TGT-gcc ENV PKG_CONFIG_PATH="/.werf/stapel/lib/pkgconfig:/.werf/stapel/embedded/lib/pkgconfig" +RUN source /etc/profile.d/rvm.sh && bundle exec omnibus build -o append_timestamp:false werf-stapel + ADD stapel/wget-list-after-omnibus $LFS/sources/wget-list-after-omnibus ADD stapel/wget-list-after-omnibus.md5sums $LFS/sources/wget-list-after-omnibus.md5sums RUN wget --input-file=$LFS/sources/wget-list-after-omnibus --continue --directory-prefix=$LFS/sources || true @@ -342,15 +352,6 @@ RUN ./configure --prefix=$TOOLS --without-python --disable-makeinstall-chown --w RUN make RUN make install -# libffi -RUN echo "libffi" && cd $LFS/sources && \ -mkdir libffi && \ -tar xf libffi-*.tar.* -C libffi --strip-components 1 -WORKDIR $LFS/sources/libffi -RUN ./configure --prefix=$TOOLS --disable-static --with-gcc-arch=native -RUN make -RUN make install - # glib RUN PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin apt update RUN PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin apt install -y python3-pip xsltproc diff --git a/stapel/omnibus/config/software/diffutils.rb b/stapel/omnibus/config/software/diffutils.rb index fe02030f2f..3f79503d47 100644 --- a/stapel/omnibus/config/software/diffutils.rb +++ b/stapel/omnibus/config/software/diffutils.rb @@ -1,13 +1,15 @@ name 'diffutils' -default_version '3.6' +default_version '3.8' license 'GPL-3.0' license_file 'COPYING' +version('3.8') { source md5: '6a6b0fdc72acfe3f2829aab477876fbc' } version('3.5') { source md5: '569354697ff1cfc9a9de3781361015fa' } version('3.6') { source md5: '07cf286672ced26fba54cd0313bdc071' } -source url: "https://ftp.gnu.org/gnu/diffutils/diffutils-#{version}.tar.xz" +#source url: "https://ftp.gnu.org/gnu/diffutils/diffutils-#{version}.tar.xz" +source url: "https://mirror.tochlab.net/pub/gnu/diffutils/diffutils-#{version}.tar.xz" relative_path "diffutils-#{version}" diff --git a/stapel/omnibus/config/software/python.rb b/stapel/omnibus/config/software/python.rb new file mode 100644 index 0000000000..98923fb6f0 --- /dev/null +++ b/stapel/omnibus/config/software/python.rb @@ -0,0 +1,73 @@ +# +# Copyright 2013-2015 Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "python" +default_version "2.7.18" + +license "Python-2.0" +license_file "LICENSE" +skip_transitive_dependency_licensing true + +dependency "ncurses" +dependency "zlib" +dependency "openssl" +dependency "bzip2" + +# version_list: url=https://www.python.org/ftp/python/#{version}/ filter=*.tgz + +version("2.7.18") { source sha256: "da3080e3b488f648a3d7a4560ddee895284c3380b11d6de75edb986526b9a814" } +version("2.7.14") { source sha256: "304c9b202ea6fbd0a4a8e0ad3733715fbd4749f2204a9173a58ec53c32ea73e8" } +version("2.7.9") { source sha256: "c8bba33e66ac3201dabdc556f0ea7cfe6ac11946ec32d357c4c6f9b018c12c5b" } +version("2.7.5") { source sha256: "8e1b5fa87b91835afb376a9c0d319d41feca07ffebc0288d97ab08d64f48afbf" } + +source url: "https://python.org/ftp/python/#{version}/Python-#{version}.tgz" + +relative_path "Python-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + if mac_os_x? + os_x_release = ohai["platform_version"].match(/([0-9]+\.[0-9]+).*/).captures[0] + env["MACOSX_DEPLOYMENT_TARGET"] = os_x_release + end + + command "./configure" \ + " --prefix=#{install_dir}/embedded" \ + " --enable-shared" \ + " --with-dbmliborder=", env: env + + command "sed -i -e 's|os.unlink(tmpfile)|pass|' ./setup.py" + + make env: env + make "install", env: env + + # There exists no configure flag to tell Python to not compile readline + delete "#{install_dir}/embedded/lib/python2.7/lib-dynload/readline.*" + + # Ditto for sqlite3 + delete "#{install_dir}/embedded/lib/python2.7/lib-dynload/_sqlite3.*" + delete "#{install_dir}/embedded/lib/python2.7/sqlite3/" + + # Remove unused extension which is known to make healthchecks fail on CentOS 6 + delete "#{install_dir}/embedded/lib/python2.7/lib-dynload/_bsddb.*" + + # Remove sqlite3 libraries, if you want to include sqlite, create a new def + # in your software project and build it explicitly. This removes the adapter + # library from python, which links incorrectly to a system library. Adding + # your own sqlite definition will fix this. + delete "#{install_dir}/embedded/lib/python2.7/lib-dynload/_sqlite3.*" +end