Skip to content

Commit

Permalink
snappy: Drop ccache from build
Browse files Browse the repository at this point in the history
Ccache is originally incorporated as a measure to speed up the rebuild
process(to determine whether the recipe works), as the packaging is nearly
completed it is no longer that useful but complicates the recipe.

This patch drops the ccache part and also changes the behavior of the
gcc-6 recipe to create the faked GCC commands symbolic links at stage
phase instead of build phase for MacOS filesystem compatibility.

Signed-off-by: 林博仁(Buo-ren Lin) <Buo.Ren.Lin@gmail.com>
  • Loading branch information
brlin-tw committed Aug 26, 2018
1 parent 982bbe1 commit 34a211d
Showing 1 changed file with 18 additions and 98 deletions.
116 changes: 18 additions & 98 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ parts:
poedit:
after:
- boostlib
- ccache
- gtkspell
- patches
- wxwidgets
Expand Down Expand Up @@ -158,9 +157,6 @@ parts:
override-build: |
set -eu
# Setup ccache + GCC-6
PATH="${SNAPCRAFT_STAGE}/bin:${PATH}"
./bootstrap
./configure \
--with-wx-prefix="$SNAPCRAFT_STAGE" \
Expand Down Expand Up @@ -239,9 +235,6 @@ parts:
- no-system-libraries

boostlib:
after:
- ccache

source: git://github.com/vslavik/poedit.git
source-type: git
source-depth: 1
Expand All @@ -262,9 +255,6 @@ parts:
override-build: |
set -eu
# Setup ccache + GCC-6
PATH="${SNAPCRAFT_STAGE}/bin:${PATH}"
cd deps/boost
./bootstrap.sh \
--prefix="${SNAPCRAFT_PART_INSTALL}" \
Expand All @@ -288,9 +278,6 @@ parts:
override-prime: 'true'

wxwidgets:
after:
- ccache

source: git://github.com/vslavik/wxWidgets.git
source-type: git
source-depth: 1
Expand Down Expand Up @@ -323,20 +310,14 @@ parts:
override-build: |
set -eu
# Setup ccache + GCC-6
PATH="${SNAPCRAFT_STAGE}/bin:${PATH}"
./autogen.sh
./configure \
--disable-shared \
--disable-sound \
--prefix="${SNAPCRAFT_STAGE}" \
--with-gtk=3 \
--without-opengl \
--without-sdl \
CC=gcc-6 \
CPP=cpp-6 \
CXX=g++-6
--without-sdl
make \
--jobs=$(nproc)
make \
Expand Down Expand Up @@ -386,63 +367,13 @@ parts:
- $localizations

desktop-gtk3:
after:
- ccache

override-build: |
set -eu
# Setup ccache + GCC-6
PATH="${SNAPCRAFT_STAGE}/bin:${PATH}"
snapcraftctl build
# This pseudo part setups Compiler cache(ccache) to the stage dir.
#
# To use it simply add a dependency to this part and prepend
# "$SNAPCRAFT_STAGE"/bin to the command search PATHs
ccache:
after:
- gcc-6
override-pull: 'true'
build-packages:
- ccache
plugin: nil
override-build: |
mkdir \
--parents \
"${SNAPCRAFT_PART_INSTALL}"/bin
ln \
--force \
--symbolic \
"$(which ccache)" \
"${SNAPCRAFT_PART_INSTALL}"/bin/gcc-6
ln \
--force \
--symbolic \
"$(which ccache)" \
"${SNAPCRAFT_PART_INSTALL}"/bin/g++-6
ln \
--force \
--symbolic \
./gcc-6 \
"${SNAPCRAFT_PART_INSTALL}"/bin/gcc
ln \
--force \
--symbolic \
./g++-6 \
"${SNAPCRAFT_PART_INSTALL}"/bin/g++
filesets:
executables:
- bin/*
stage:
- $executables
override-prime: 'true'

# This pseudo part setups version 6 of GCC, which is not available
# in Ubuntu 16.04 software source.
# To use it simply add a dependency to this part and prepend
# "$SNAPCRAFT_STAGE"/bin to the command search PATHs
gcc-6:
plugin: nil
# Poedit sources will be used when `source` is ommitted, avoid this
Expand All @@ -456,34 +387,31 @@ parts:
sudo apt update
sudo apt --yes install cpp-6 gcc-6 g++-6
override-stage: |
set -eu
# Make fake executable search path for build systems that don't
# respect CC and CXX environmental variables
# Snapcraft will give executable paths under SNAPCRAFT_STAGE priority
# in other parts' build step
mkdir \
--parents \
"${SNAPCRAFT_PART_INSTALL}"/bin
# DISABLED: Replaced by ccache-gcc-6
#ln \
#--force \
#--symbolic \
#"$(which gcc-6)" \
#"${SNAPCRAFT_PART_INSTALL}"/bin/gcc
#ln \
#--force \
#--symbolic \
#"$(which g++-6)" \
#"${SNAPCRAFT_PART_INSTALL}"/bin/g++
"${SNAPCRAFT_STAGE}"/bin
ln \
--force \
--symbolic \
"$(which gcc-6)" \
"${SNAPCRAFT_STAGE}"/bin/gcc
ln \
--force \
--symbolic \
"$(which g++-6)" \
"${SNAPCRAFT_STAGE}"/bin/g++
ln \
--force \
--symbolic \
"$(which cpp-6)" \
"${SNAPCRAFT_PART_INSTALL}"/bin/cpp
filesets:
executables:
- bin/*
stage:
- $executables
override-prime: 'true'
"${SNAPCRAFT_STAGE}"/bin/cpp
spellcheck-dictionaries:
plugin: nil
Expand Down Expand Up @@ -526,7 +454,6 @@ parts:
# to fix the non-relocatable iso-codes data path.
gtkspell:
after:
- ccache
- enchant
- iso-codes

Expand Down Expand Up @@ -556,9 +483,6 @@ parts:
override-build: |
set -eu
# Setup ccache + GCC-6
PATH="${SNAPCRAFT_STAGE}/bin:${PATH}"
# autogen.sh requires build directory to be created in advance
# https://sourceforge.net/p/gtkspell/gtkspell/merge-requests/1/
mkdir -p build
Expand Down Expand Up @@ -610,7 +534,6 @@ parts:
# patches/enchant-fix-build.patch for details
enchant:
after:
- ccache
- patches

source: https://github.com/AbiWord/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz
Expand All @@ -633,9 +556,6 @@ parts:
override-build: |
set -eu
# Setup ccache + GCC-6
PATH="${SNAPCRAFT_STAGE}/bin:${PATH}"
env NOCONFIGURE=yes ./autogen.sh
./configure \
--prefix=/snap/poedit/current \
Expand Down

0 comments on commit 34a211d

Please sign in to comment.