Commit cc17c93d authored by Maren Hachmann's avatar Maren Hachmann

Merge branch 'discrete_build_dirs' into 'master'

Update make_inkscape for using separate build directories per branch

See merge request !1
parents f724f580 6c41acb9
......@@ -82,6 +82,8 @@ cd /directory/where/script/is_saved
./make_inkscape cool_branch_name -f
```
(this will rebuild the Inkscape branch 'cool_branch_name' from scratch)
The script will take some time to execute, and it will also use a lot of your CPU power.
Near the end of the process, it will ask you to enter your password once, to be allowed to install the freshly created package.
......
......@@ -14,6 +14,11 @@ DOCUMENTS_DIR=$(xdg-user-dir DOCUMENTS)
# files for the Inkscape source code and the .git directory in it:
SOURCE_DIR="$DOCUMENTS_DIR/inkscape"
# Path to directory that will hold one build folder for each branch.
# The build folder is where the compiled code is stored until it is
# packaged for installation.
BUILDS_DIR="$DOCUMENTS_DIR/inkscape_builds"
# Directory where the builds shall be installed to (it is suggested to leave this unchanged):
INSTALL_TO="/opt"
......
......@@ -41,6 +41,7 @@ DATE=$(date +%Y.%m.%d.%H.%M.%S)
MARKER="-->"
# Do we want to do a full rebuild? This also allows to build Inkscape if the branch has not changed.
FORCE=0
# Get into correct directory
......@@ -80,7 +81,7 @@ echo "$MARKER Branch $BRANCH selected."
# git submodule deinit --all
# yeah...this is what git suggests to get rid of the submodule:
rm -r -f share/extensions
rm -rf share/extensions
# cleanup, so there won't be anything to commit, causing git to refuse switching branches
git checkout -- .
......@@ -98,7 +99,7 @@ REVISION=$(git log -1 --format="%h")
INSTALL_DIR=$INSTALL_TO/inkscape_$BRANCH
if [ ! -f "$INSTALL_DIR/bin/inkscape" ] || [ ! -f "$SOURCE_DIR/build/bin/inkscape" ] || [ ! "$REVISION" == "$REVISION_OLD" ] || [ $FORCE = 1 ]; then
if [ ! -f "$INSTALL_DIR/bin/inkscape" ] || [ ! -f "$BUILDS_DIR/build_$BRANCH/bin/inkscape" ] || [ ! "$REVISION" == "$REVISION_OLD" ] || [ $FORCE = 1 ]; then
echo "$MARKER Update in progress..."
else
echo "$MARKER No update needed! Your installation is already up-to-date."
......@@ -109,15 +110,20 @@ fi
REMOTE=$(git remote get-url origin)
# Delete any previous builds, if they exist
echo "$MARKER Removing old build directory..."
rm -rf build
mkdir build
cd build
# remove build directory if we want to force a full rebuild
if [ $FORCE = 1 ]
then
# Delete any previous builds, if they exist
echo "$MARKER Removing old build directory (build_$BRANCH) ..."
rm -rf $BUILDS_DIR/build_$BRANCH
fi
mkdir -p $BUILDS_DIR/build_$BRANCH
cd $BUILDS_DIR/build_$BRANCH
# Build
echo "$MARKER Configuring and compiling..."
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR ..
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR $SOURCE_DIR
make -j3
# Create description file
......@@ -129,7 +135,7 @@ mkdir -p $PACKAGE_DIR
# Build the .deb package
echo "$MARKER Building Debian package..."
checkinstall -y -D --fstrans=yes --install=no --pkgname inkscape-$BRANCH --pkgversion $DATE$REVISION --nodoc --maintainer "$USER" --arch amd64 --pakdir $PACKAGE_DIR --pkgsource "$REMOTE" --exclude="$SOURCE_DIR/.git"
checkinstall -y -D --fstrans=yes --install=no --pkgname inkscape-$BRANCH --pkgversion $DATE$REVISION --nodoc --pkglicense "GPL" --maintainer "$USER" --arch amd64 --pakdir $PACKAGE_DIR --pkgsource "$REMOTE" --exclude="$SOURCE_DIR/.git"
# Create user configuration directory, if doesn't exist
PROFILE_DIR=$SAVE_PROFILES_TO/inkscape_$BRANCH
......@@ -199,6 +205,6 @@ $STARTER_FILE (or $STARTER_FILE_DEBUG)
The .deb package that has been built is available in
$SAVE_DEBS_TO"
$SAVE_DEB_TO"
notify-send 'Package installed!' 'Enjoy running your new Inkscape build!' --icon=dialog-information
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment